helma.filestorehelma.filestore is a simple, file based storage engine. It uses JSON as object serialization format and offers basic storage, retrieval and querying support for plain JavaScript objects. A simple demo app for helma.filestore is included in Helma NG. To use helma.filestore you need to import the module and create a Store instance, passing it the root directory of the data store:
Next you define a JavaScript constructor for your persistent model class. There are two extra methods need to call. One is the
Note that the persistent properties are kept in a separate object which is here called Of course you can add methods to your model object any way you like it, either in the constructor or through the constructor's prototype property. Thus, the full code now looks like this:
That's it, your first persistent JavaScript class. Store the code above to a file called book.js so we can play with it using the Helma NG shell:
Voila, your first persistent object. Let's store it and see how the data retrieval objects work:
One very powerful method is the
If you're done, use a book's |
navigation
Download
Community
Weblog
Mailing Lists
IRC Channel
Documentation
Introductions
Tools
Reference
Project
Roadmap
Bug Reporting
Source
Helma NG Wiki
Wiki
Tags
Updates
Related Projects
Sites using Helma
Shop
search
tags for this page
all tags
Tagsapps (1) bugs (2) class (1) community (2) compatibility (1) concurrency (1) continuations (2) Documentation (6) dogfood (1) formatting (1) functions (1) gobi (1) helma (7) helma 1.6 (17) helma 1.7 (8) helma 1.x (4) Helma 1x (0) helma 2 (11) helma ng (20) hopobject (1) howto sample code xml-rpc (1) html (1) inheritance (5) introspection (1) java (3) javascript (5) jetty (4) JSDoc (1) lazy (1) marius person (1) metaprogramming (3) modules (5) oop (1) organization (2) ORM (2) parsing (1) plugins (1) project (2) projects (1) prototype (2) prototype scope rhino functions this (0) Rabbit (2) Reference (1) REPL (1) rhino (5) roadmap (3) scope (1) shell (1) shop (0) Skin Rendering (5) Snippets (1) source svn (1) sugar (3) templates (13) testing (5) this (1) Tobi (10) web.xml (2) xml (1) Pages linking to this page: Wiki Overview Text Draft, wiki |