11.07.2015 Views

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

webMathematica™ Wolfram - Wolfram Research

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

webMathematica User Guide 53"Content.nb"}"Content.eps"}"Content.pdf"}]]]],"PostScript",{ExportString[nbobj, "EPS"], "application/eps",,"PDF",{ExportString[nbobj, "PDF"], "application/pdf",,"GIF",{ExportString[nbobj, "GIF"], "image/gif", "Content.gif"},_,"Unknown format"In this example, one evaluation tests the variable $$button. If it has a value from activatingone of the buttons in the form, this is used to specify a return format type and passed to afunction, GeneralContent. The Mathematica code for this function is placed into a separatepackage to be loaded when the variable is set. GeneralContent calls a function that creates avery simple notebook, MakeNotebook. MakeNotebook generates a notebook using the MathematicaNotebook API and the function Developer`UseFrontEnd. In a real life situation a moreinteresting notebook would probably be generated. MSPReturn returns the representation of thenotebook to the server with the content type. This is then returned to the browser, which, ifsuitably configured, will deploy the necessary helper application.In a more advanced example, the dynamically generated notebook would probably use informationsent with the request from the client.If you wish to return special content and also set a filename to be used with this content, thenyou may wish to use the three-argument form of MSPReturn.Another way to set the content returned from an MSP script is to use MSPPageOptions. Thetopic of returning general content is discussed later.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!