Thursday, 22 May 2008

Serving jnlp from PHP for WebStart applications

So... I had to incorporate the TriggerTool information in the runlist summary, but it is served as a jnlp with arguments in the jnlp format. My first attempts at generating the jnlp dynamically would work either in Safari or in Firefox, but not both until I renamed the web application to 'test.php.jnlp'.. this worked but is ugly. Finally I hit on the solution: not only making the http header into 'Content-Type: application/x-java-jnlp-file' but also adding '; name=smtp.jnlp' onto the end of that. Now the file comes back as a .jnlp which is recognised by both browsers.
This last week, meanwhile has been a hectic rush as I was initially blamed for submitting broken tags into Athena. It turned out it was a subtle bug in the pixel software which went something like this:
Gaudi has a templated stream insertion operator for all types.
A PixelDcsData class also had a stream insertion operator.
A PixelDcsData class also had a single argument constructor, that argument being 'Identifier'.
Now, when trying to output 'Identifier' with stream insertion, the compiler complained of an ambiguously overloaded '<<' because it couldn't decide whether to convert Identifier to a PixelDcsData class and then use the custom '<<' or use the intrinsic templated '<<'. Constructors with a single argument act as conversion operators. To avoid this, qualify the constructor with 'explicit'.

No comments: