Posted by kdg
on November 30, 2005 at 8:22 AM PST
I want my single document interface (SDI) app to start with a document depending from where it is started. It can be started from a web page, which will feed it a document reference through a parameter in the JNLP file. The document will be different each time the app is started. However, if the app is started using the desktop icon or menu, it should open without preloading a document. The user just manually selects the document of his choice on the file system.
I wonder how this can be done. If the parameter is passed through a generated JNLP file, then the desktop version will also use this JNLP file and open the same document.
I see these options:
1) provide the user a separate, document-parameter-free JNLP file to install the app on the desktop. The auto-load JNLP file will then have desktop integration disabled.
2) just let the desktop version try to open the document and silently fail
Both solutions are not very elegant.
1) Will make the web page much more complex, which I can't afford. It also requires additional initiative from the user to install the app.
2) Will slow down offline start-up, generate spurious errors in the webserver logs, and the desktop version might still load the document if it's still present from an earlier launch from the website.
Does anyone have a better idea? For example, is there a way to detect how the app was launched?