Valid XHTML 1.0 Transitional

DictionaryForMIDs WebApp: how to make dictionaries available for WebApps

Background

The WebApp uses the files that are contained in the dictionary JAR files, so say it more precisely, the files that are in the "dictionary" path of the JAR file. Those files need to be accessible from the Sourceforge web server. The WebApp uses the HTML5 "Application Cache" feature to download each of the dictionary files into the browser. When the user selects the URL for a dictionary, then the browser automatically downloads all the dictionary files and from that point on that dictionary is available for offline use. That means, also without an internet connection, when the user selects the URL for the dictionary, then the WebApp will start with the offline loaded dictionary.

 

WebApp dictionary directories

For each dictionary the dictionary JAR file is extracted (dictionary path only) and stored at /home/project-web/dictionarymid/htdocs/WebApp/dictionaries. The dictionary subdirectory is named as the corresponding directory in the File Release System. For example, the name for the CEDICT dictionary is /home/project-web/dictionarymid/htdocs/WebApp/dictionaries/dictionary EngChi (CEDICT).

 

Shell scripts

Extracting the files from the dictionary JAR plus establishing links for the WebApp, including application cache manifest files, PHP files and htaccess file is done by the shell script createWebAppFiles.sh. See here:
http://svn.code.sf.net/p/dictionarymid/code/trunk/WebApp/Tools/CreateWebAppFiles/createWebAppFiles.sh

The shell script createWebAppFiles.sh must be executed from the Sourceforge shell service. I.e. at the Linux command prompt available at shell.sourceforge.net.

createWebAppFiles.sh takes as argument the id of the dictionary:

createWebAppFiles.sh <dictionary_subdirectory>

<dictionary_subdirectory> is equal to the subdirectory name of the dictionary in the Sourceforge File Release System (FRS) at /home/frs/project/d/di/dictionarymid.

For example the subdirectory for CEDICT is "dictionary EngChi (CEDICT)". In order to create the WebApp files for CEDICT you enter the command

createWebAppFiles.sh "dictionary EngChi (CEDICT)"

Do not forget to set the quotation marks !

In the FRS each directory has one or more subdirectories with a version number, each with the dictionary ZIP file:

<dictionary name>/<dictionary version>/<dictionary>.zip

The script createWebAppFiles.sh picks the subdirectory with the latest modifcation date. The zip file in that directory is unzipped and the containing dictionary JAR is extracted (only the dictionary subpath).

That's all - the script will create all files for the <new_dictionary> WebApp. It will automatically be available to users at http://dictionarymid.sourceforge.net/WebApp/dictionaries/<new_dictionary>

 

Additionally there is the script createAllWebAppFiles.sh (no command line parameters). The script createAllWebAppFiles.sh does walk through each of the directories at /home/frs/project/d/di/dictionarymid. And for each dictionary directory there the script createAllWebAppFiles.sh is called. So createAllWebAppFiles.sh does create the WebApp files for all dictionaries.

The script createAllWebAppFiles.sh is located here: http://svn.code.sf.net/p/dictionarymid/code/trunk/WebApp/Tools/CreateWebAppFiles/createAllWebAppFiles.sh