Mathematica browser plugin question

Discussion in 'Physics & Math' started by AlphaNumeric, Mar 17, 2011.

  1. AlphaNumeric Fully ionized Registered Senior Member

    Messages:
    6,702
    Wolfram have various Mathematica related products, Mathematica 8, a web browser plugin, Wolfram Alpha and some kind of Java applet thing. The web browser plug in allows you to run, but not edit, Mathematica packages within a browser and they've got tons of demonstrations on the Wolfram website. However, I can't for the life of me find out how to implement such a hosting on a website. Looking at the HTML code for a Wolfram demonstration it just refers to a script, as if there's already a server-side program running.

    Does anyone know (or have superior Googling skills to me) how such a thing can be implemented? The Java based thing involves licenses but I think the browser plug in does not.
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. brightpurple Registered Senior Member

    Messages:
    4
    Hey AlphaNumeric

    Is this what you are after?

    www[dot]wolfram[dot]com/products/webmathematica/install/

    (Can't post link direct as have a low post count (I read mostly))

    Looks like you need to install something on a tomcat server.

    Tells us how your install goes, sounds like an interesting mini project
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. rpenner Fully Wired Valued Senior Member

    Messages:
    4,833
    WebMathematica is an add-on for the purchased Mathematica server. It allows you to use apache + tomcat + server java to let people run jobs on the server from their web browsers. A servlet is like a java-plugin for a web server as opposed to an applet which runs on the web browser.

    http://www.wolfram.com/products/webmathematica/technology/

    --

    One such applet for the web browser is LiveGraphics3D
    http://reference.wolfram.com/mathematica/webMathematica/tutorial/AppendixLiveGraphics.html
    http://wwwvis.informatik.uni-stuttgart.de/~kraus/LiveGraphics3D/
    http://www.vis.uni-stuttgart.de/~kraus/LiveGraphics3D/examples/parametrized/circumcircle.html (Requires Java)

    A Wolfram-created plugin for certain browsers and OS's is called CDF Player (application-only under Linux)
    http://www.wolfram.com/cdf-player/
    http://reference.wolfram.com/mathematica/ref/format/CDF.html
    http://reference.wolfram.com/mathematica/howto/CreateAComputableDocumentFormatFile.html

    So to host CDF files, presumably you would just have to host the files on a web site, inform the website that your *.cdf files have the Wolfram-dictated MIME-type (this may be optional), and include a *.html page (or php or jsp etc...) which has the proper html code to associate the files with the plugin.

    Code:
    
    <object classid="clsid:612AB921-E294-41AA-8E98-87E7E057EF33"
    width="500" height="300" type="application/vnd.wolfram.mathematica"
        ><param name="src" value="/cdfdirectory/demo.cdf"
            ><embed
                width="500"
                height="300"
                src="/cdfdirectory/demo.cdf"
                type="application/vnd.wolfram.mathematica"
    /></object>
    
    
    This embed-within-an-object is a technique to work with Microsoft's IE while still supporting the rest of the Browser/OS world.
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.
  7. AlphaNumeric Fully ionized Registered Senior Member

    Messages:
    6,702
    Looks like I was mistakenly thinking the CDF player and the browser plug in were different things.

    Rpenner, does the code you have given there basically make a 500x300 block on a webpage which opens up the Mathematica CDF player when clicked or does it autoload it within the browser so you can interact with the notebook loaded on the server at /cdfdirectory/demo.cdf inside a window, as you can on the Wolfram pages? I have close to zero HTML understanding so I'm not sure. Someone else will implement all of this and he's a whiz at Java etc but I'm tasked with finding out whether its possible without having to pay for some kind of Mathematica server.

    Thanks
     
  8. rpenner Fully Wired Valued Senior Member

    Messages:
    4,833
    If the html code above is inserted on a webpage anywhere on http://www.example.com/, then a web browser will reserve a 500-by-300 pixel area to host the plugin. If the plugin is installed, the plugin, in conjunction with the web server, will look for the CDF file at http://www.example.com/cdfdirectory/demo.cdf

    (Or so I am told. Stuck on a Linux box right now.)

    You might want to include separate links to the plugin download URL (in case the user doesn't have it) and to the CDF file (for users who want to load it into Mathematica or UNIX versions of the CDF player) and add note that the CDF player on UNIX doesn't work as a browser plugin.
     

Share This Page