DictionaryForMIDs publishing for WebApps

Started by Gert, 31. October 2013, 16:42:31

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



here is a description how the publishing of WebApps works currently.

First, for general information: 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.

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)".

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:
[note: at the time of writing this posting, that script is not functional; I will update it following the input of Stars Soft]

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 does walk through each of the directories at /home/frs/project/d/di/dictionarymid. Each directory has a subdirectory with a version number. The script createWebAppFiles.sh picks the subdirectory with the highest version number. The zip file in that directory is unzipped and the containing dictionary JAR is extracted (path dictionary).

Dear Stars Soft, I have a question, is this structure implemented for all dictionaries (the names in < and > are placeholders):
<dictionary name>/<dictionary version>/<dictionary>.zip

If yes, I think then we could keep the current script approach; I probably will update the script so that it takes a command line argument:
"-all": create WebApp files for all dictionaries at /home/frs/project/d/di/dictionarymid
"<dictionary name>": create WebApp files only for the dictionary with <dictionary name> at /home/frs/project/d/di/dictionarymid

Then, when <new_dictionary> it published and uploaded to the FRS the following command needs to be run:

createWebAppFiles.sh  <new_dictionary>

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>

Dear Stars Soft, what is your opinion on that ?

If that is ok, then I will update the script createWebAppFiles.sh so that it works and handles the command line parameter.

With best greetings,




QuoteDear Stars Soft, I have a question, is this structure implemented for all dictionaries (the names in < and > are placeholders):
<dictionary name>/<dictionary version>/<dictionary>.zip?

Yes, i do using this same folder architecture.

Best Wishes,

Stars Soft


The directory stucture is great !

I completed the scripts, see here: http://dictionarymid.sourceforge.net/WebApp/htdocs/WebAppCreateDictionaries.html

Deviating from my proposal above, createWebAppFiles.sh does not take an -all command line argument. Instead, in order to create all WebApp dictionaries, the script createAllWebAppFiles.sh is used.