Skip to content

How to make a CD ROM with JClic activities

Francesc Busquets edited this page Nov 11, 2015 · 1 revision

There are two ways to distribute JClic activities in CD-ROM, DVD or other off-line supports:

  • To embed applets in HTML pages, or...
  • To launch a stand-alone JClic player with a tailored library.
In both cases, the first step consists in to prepare a root folder with a copy of the JClic runtime files.

Table of Contents

Preparing the root folder

JClic is a Java application packaged and distributed with a special type of files that have the extension ".jar". Both the applet and the stand-alone variants of JClic must load a set of JAR files to start. Applets usually load this files from a web site, through a Internet connection. The stand-alone JClic player should load it from a local folder in the computer's hard disk. This standard behavior can be changed to force JClic to load the files from a directory in the removable media (CD-ROM, DVD, USB stick...). This will allow us to distribute runnable applications that will not require Internet access nor previous local installation of any file.

  • First, create a folder that will act as a root of the future CD-ROM or DVD. Let's call it "cdroot":
  • Then download the ZIP file with the latest release of JClic. This file has a name like jclic-0.1.2.2.zip (the version numbers can vary).
  • Unzip the contents of this file into the root folder created in step 1. This will create a new folder named jclic-0.1.2.2 or similar, containing the program files needed by JClic.
  • Rename this folder to jclic. We have now this tree:
http://clic.xtec.net/img/cdesquema01.png

Preparing folders for the activities

The second step will be to create a folder for each activity project of the CD-ROM, and place its jclic.zip file on it.

http://clic.xtec.net/img/cdesquema02.png

Now you must choose a method of presentation: HTML pages with applets, or the stand-alone JClic player.

Method one: JClic Applet

  • Launch JClic Author and open the first activity project. Then go to Tools - Create web page. Write this text into the the field On exit go to:
../index.htm
Fill in the remaining options of the dialog box and click on OK. This will create a file named index.htm. Repeat the operation with the remaining projects.
  • You have now an structure like this:
http://clic.xtec.net/img/cdesquema03.png
  • Then use a text editor (Notepad, Gedit...) to open the first index.htm file, and replace the text:
http://clic.xtec.net/dist/jclic
with this one:
../jclic
The text appears two times in each file: in the line that starts with <script>... and in another line starting by setJarBase(....
  • Repeat the previous step with all the remaining index.htm files.
  • Create a main index.htm file in the cdroot folder, with links to each index.htm project files.
  • Check the workings of the system. It must run fine, also if you are disconnected of the Internet.
Of course, you can give a specific look to the HTML pages, and provide links and menus to go in and out. It's also advisable to provide an autorun.inf script that automatically will launch a browser with the main page when the CD-ROM is inserted in the unit.

http://clic.xtec.net/img/cdesquema04.png

Method two: JClic Player

  • Launch JClic Player (not JClic Author!!) and go to Tools - Libraries - New - Create new project library.
  • Search and select the cdroot folder and give a name to the new library. For example, mainmenu.jclic.
  • Back to the Select library dialog, click on Edit.
  • Replace the generic name New project library by a more descriptive one. For example, My activities.
  • Click on the bracnh Main menu and add a shortcut for each JClic project. Shortcuts have four elements:
    • A link to a project file (for example, onejclicproject/onejclicproject.jclic.zip)
    • An icon. You can choose between standard JClic icons or any other custom small image.
    • A name
    • An optional description
  • Close all the dialog windows and exit JClic player.
  • Finally, you must provide a method to launch JClic from the cdroot folder. Using your preferred text editor, create this two files:
start.bat:
java -jar jclic\jclicplayer.jar library.jclic

start.sh:

java -jar jclic/jclicplayer.jar library.jclic

The first one will launch JClic player in Windows. The second one is for Linux. Of course, you can provide also an autorun.inf file to automatize the launching of the application when the disk is inserted.

http://clic.xtec.net/img/cdesquema05.png

Advanced features

  • In order to return to the main menu when an activity project is finished, edit it with JClic Author, go to the Sequences tab and place an "Exit" command at the end of the activity sequence. This will work both in JClic Applet and Player modes.
  • You can also use Flash animations or other embedded objects to launch the pages containing the applets.
Clone this wiki locally