JClic startup parameters - projectestac/jclic GitHub Wiki
JClic Player and JClic Applet can be started with specific parameters that allow to control several variables and settings.
The parameters currently recognized by JClic are:
activityPack | Absolute or relative file path or URL of the project that must be loaded when JClic starts. In JClicPlayer this is the default parameter. | |||||||||||||||
sequence | Works only in applets, to indicate the sequence label that will be used as a start point into the JClic project. | |||||||||||||||
language | Two-letter code (639-2) of the language to be used by JClic in system messages and menus. Ex.: "pt" to indicate Portuguese. | |||||||||||||||
country | Optional code specifying a local variant of the language. Ex.: "BR" to indicate Brazilian Portuguese. | |||||||||||||||
variant | Another optional variable that can be used in conjunction with the preceding two. | |||||||||||||||
skin | JClic skin that will be used at start. Ex.: "@orange.xml" | |||||||||||||||
cookie | Optional session cookie value. Currently not used. | |||||||||||||||
reporter | Name of the reports engine class. Ex.: "TCPReporter" | |||||||||||||||
reporterParams |
Parameters passed to the reports engine. This parameter can have multiple key-value pairs inside, separated by semi-colons. The parameters currently used are:
|
|||||||||||||||
exitUrl | Parameter used in applets to specify the URL where the browser should navigate to when JClic finds the exit command. | |||||||||||||||
infoUrlFrame | Optional parameter that indicates the name of the frame where the info documents will be displayed. Default is "_blank" | |||||||||||||||
systemSounds | This indicates if JClic must play or not system sounds. Possible values are "true" and "false". | |||||||||||||||
compressImages | This parameter decides if JClic will compress images in order to make it fit into the cells. Default is "true". | |||||||||||||||
lookAndFeel |
In JClic Player, settings must be appended to the command line, in the form -key=value. Multiple parameters can be written in the same line separated by spaces. Some special parameter values can have sub-parameters. This sub-parameters are separated by semi-colons (";").
This is an example of a command line invoking JClic and passing some parameters to it:
<pre>java -jar jclicplayer.jar myproject.jclic.zip -language=en -reporter=TCPReporter -reporterParams=path=myServer:9000/reports;user=johnsmith -systemSounds=false'''</pre>
This is the explanation of each fragment of this command line:
java -jar jclicplayer.jar | This command, if written from the directory where JClic is installed, starts the program. |
myproject.jclic.zip | This is the project file that will be automatically loaded when JClic starts. It is the default parameter, so no key is needed. |
-language=en | JClic will use the English language in system messages and menus. |
-reporter=TCPReporter | The class edu.xtec.jclic.report.TCPReporter will be used as a reporting engine |
-reporterParams=path=myServer:9000/reports;user=johnsmith | Two parameters will be passed to the reports engine: the path to the server and the user identifier. |
-systemSounds=false | JClic will not emit event and other system sounds. |
Applets can receive parameters in two ways:
Parameters are passed with tags of type <param key="value"> placed into the <applet> tag. In this example, generated by the JClicMoodle module, the applet will be 600 x 400 pixels, it will wear the "green" skin, an activity pack from the clicZone library will be automatically loaded, and results will ber reported every 5 seconds to a special moodle path in "myserver.com", with the user ID "10":
<pre>
<applet code="JClicApplet" codebase="http://clic.xtec.net/dist/jclic"
archive="jclic.jar"
width="600" height="400">
<param name="type" value="application/x-java-applet;version=1.4">
<param name="scriptable" value="false">
<param name="activityPack" value="http://clic.xtec.net/projects/bombers/jclic/bombers.jclic.zip">
<param name="skin" value="@green.xml">
<param name="reporter" value="TCPReporter">
<param name="reporterparams" value="path=myserver.com;service=/moodle18/mod/jclic/action/beans.php;user=10;key=1;lap=5">
</applet>
</pre>
The JavaScript file jclicplugin.js simplifies the scripting of JClic applets. Its functions have name similar to the parameters, preceded by "set" (Ex.: setSkin(value)). See the script for the list of all implemented functions.
This example embeds a JClic applet of 750 x 464 pixels in a web page, with the orange skin and settings for a reports system:
<pre>
<html>
<head>
...
<script language="JavaScript" src="http://clic.xtec.net/dist/jclic/jclicplugin.js" type="text/javascript"></script>
...
</head>
<body>
...
<script language="JavaScript" type="text/javascript">
setLanguage('en');
setExitUrl('http://www.yahoo.com');
setSkin('@orange.xml');
setReporter('TCPReporter','path=myserver.com:9000/reports;user=johnsmith;key=ABC567');
writePlugin('project=http://clic.xtec.net/projects/llums/jclic/llums.jclic.zip', '750', '464', '100%', '100%');
</script>
...
</html>
</pre>