Helma Logo
main list history
previous version  overview  next version

Version 2 by zumbrunn on 18. April 2006, 17:26

The following is a proposal for how the helmaLib should be  restructured and included in the release of Helma 1.5.

The goal of this proposal is to include a library in a format that is open (not zipped) and easily accessible/approachable/transparent for newbies. It should leverage the newly added repository capabilities in a way that is ideal for these kinds of libraries and should allow them to be used efficiently in current and future applications.

For Helma 1.5, the libraries would be spread over two sub-directories in ./helma/modules, so that extensions to the core javascript prototypes would be in ./modules/core/ and other prototypes such as Aspects, File, Ssh, Search, etc, in ./modules/helma/

Applications and modules that depend on any of these libraries would use app.addRepository() in the global scope of there code files (not inside of functions) to let Helma take care of these dependencies.

For example:

    // take care of any dependencies
    app.addRepository('modules/core/Array.js');
    app.addRepository('modules/core/String.js');
    app.addRepository('modules/helma/Search.js');
    app.addRepository('modules/helma/Zip.js');

Dependencies within the library are automatically taken care of using the same approach. In the above example, Zip.js requires File.js and Search.js requires lucene.jar. The code in the files Array.js and String.js would directly extend these core javascript prototypes.

The file structure would look as follows:

    modules
      core
        Array.js
        Date.js
        Number.js
        Object.js
        String.js
      helma
        Aspects.js
        Chart.js
        Color.js
        Database.js
        File.js
        Ftp.js
        Html.js
        Http.js
        Image.js
        Mail.js
        Search.js
        Skin.js
        Ssh.js
        Url.js
        Zip.js
        ganymed-ssh2.jar
        jxl.jar
        lucene.jar

In addition, the modules directory in Helma 1.5 would still also contain the helmaTools.zip repository.

I've attached a zip <a href="/static/helma.dev/Wiki/Helma%201.5%20Javascript%20Libraries/modules.zip">zip file of the modules directory directory</a> that basically implements this, but have not yet committed this to CVS. There it could either replace apps/helmaLib or get its own CVS module named apps/modules.


     removed
     added