GeoGebra

Unsigned GeoGebra Applets

Jump to: navigation, search

With GeoGebra 3.2.31.0 we have introduced unsigned applets and applet preloading to make GeoGebra applets start faster and more easily. Unsigned applets don't allow saving or printing but have otherwise the same features as signed GeoGebra applets. The main advantage is that users don't need to accept a security dialog window when they are using an unsigned GeoGebra applet for the first time.

Contents

Creating Unsigned GeoGebra Applets

All new applets created with GeoGebra 3.2.31.0 (or later) are unsigned by default. Just use File, Export Dynamic Worksheet to create an unsigned applet. In the Advanced tab you can see that "Save, Print" is unchecked by default (only signed applets allow saving and printing). Furthermore, you will notice that "ggb & jar Files" is also unchecked in the Advanced tab by default.

Thus, all you get when you export a Dynamic Worksheet from GeoGebra now is one single html file. It is now very easy to share this Dynamic Worksheet with anybody. Just put the html file on your webserver or send it to someone via email. That's it! No more ggb-files or jar-files to worry about.

Some Technical Details

A typical applet tag in the html file created for such an unsigned applet will look like this:

 <applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
         codebase="http://www.geogebra.org/webstart/4.0/unsigned/"
         width="714" height="447" MAYSCRIPT>
    <param name="ggbBase64" value=" ... ">
      ...
 </applet>

The "ggbBase64" parameter embeds your construction as text into the html file. Note that you can also open such an html file in GeoGebra to edit its construction.

Unsigned Applet Preloading

You have lots of GeoGebra applets on your website and want to make startup of your applets superfast? You can now take advantage of the fact that new users don't have to accept our security certificate anymore. Thus, you can preload our unsigned applet files in the background without the user even noticing it. Here's how to do it.

Let's say you have your own web site with lots of GeoGebra applets. Probably you have some kind of overview page from where you link to other pages with your GeoGebra applets. On this overview page, you can already preload the GeoGebra applet in the background. Just add the following lines towards the end of the HTML code of your overview page:

  <iframe frameborder="0" scrolling="no" 
     src="http://www.geogebra.org/webstart/4.0/unsigned/preload.html" 
     width="1" height="1">
  </iframe>

This preloader won't show on your page, but it will download all GeoGebra applet files in the background. So, when your visitors navigate to your first GeoGebra applet, it will start very fast because all the necessary files are already available. Note that the preloader will only download files when there is a newer version available on the GeoGebra server.

Having Unsigned Jar Files on Your Own Server

We recommend that you use the codebase on the GeoGebra server (e.g. codebase="http://www.geogebra.org/webstart/4.0/unsigned/") as our server is set up to provide highly compressed versions of the jar files with the latest bug fixes. However, if you prefer to have the jar files on your own server or offline, here's how to do it:

  • Download all unsigned jar files from http://www.geogebra.org/webstart/4.0/unsigned/unpacked/
  • Download all highly compressed unsigned jar.pack.gz files from http://www.geogebra.org/webstart/4.0/unsigned/packed/
  • Put all jar and jar.pack.gz files into one single folder (no subfolders) on your server or disk, e.g. http://www.yourserver.com/yourjarfolder/
  • Use your jar folder in the codebase attribute and add the Djnlp.packEnabled parameter to all applet tags of your applets. This parameter tells the Java plugin (version 6 update 10 or later) to look for the highly compressed .jar.pack.gz files first. If they are not available or the client has an older version of the Java plugin, the larger .jar files are downloaded. Thus, your applets will work with all Java plugins but download much faster on a newer plugin. Your applet tags should look like this:
 <applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
         codebase="http://www.yourserver.com/yourjarfolder/"  width="714" height="447" MAYSCRIPT>
       <param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/>
      ...
 </applet>

You can also preload the GeoGebra jar files from your server. Just insert the following preloader applet into the HTML code of your main page or overview page. Make sure that the same caching version numbers are used in the applet tags of the preloader and the actual applets.

  <applet code="geogebra.GeoGebraAppletPreloader" archive="geogebra.jar" width="1" height="1"
      codebase="http://www.yourserver.com/yourjarfolder/" >
      <param name="java_arguments" value="-Xmx512m -Djnlp.packEnabled=true"/>
          ...
  </applet>

Converting Old GeoGebra Applets

You can also use unsigned jar files for your old applets that are using ggb-files. This will work as long as the jar files, the html file, and the ggb file of your dynamic worksheet are on the same server. You will also need to change your applet tag slightly to look like the one shown above: always use archive="geogebra.jar" and specify the jar location in codebase. We strongly encourage you to use the same codebase for all your applets instead of putting jar files in many different locations. This will allow caching of the jar files and avoid lots of unnecessary downloads.

 <applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
         codebase="http://www.yourserver.com/yourjarfolder/"  width="714" height="447" MAYSCRIPT>
     <param name="filename" value="yourfile.ggb">      
          ...
 </applet>

For offline applets (on a disk or USB drive) where the jar files reside in the same folder together with the html file and the ggb file, use ./ as a codebase:

 <applet name="ggbApplet" code="geogebra.GeoGebraApplet" archive="geogebra.jar"
         codebase="./"  width="714" height="447" MAYSCRIPT>
     <param name="filename" value="yourfile.ggb">      
          ...
 </applet> 

For questions, please visit the Technology forum at http://www.geogebra.org/forum

Use With JavaScript

If you wish to use JavaScript with unsigned applets, you will need to host the jar files on the same server as the JavaScript code (see above)