3
I Use This!
Activity Not Available

News

Analyzed 2 months ago. based on code collected 4 months ago.
Posted over 15 years ago
Contents [hide]Current effortsQuery API designPreliminary DesignPrior ArtStore interface Current efforts Berkeley storable backend for the Helma NG Storable interface based on the Berkeley DBHibernate wrapper for Helma NG and demo app by Robert ... [More] ThurnherHelma NG filestore module and demo appGoogle App Engine datastore module and demo app (running on App Engine)padded-ng is a CouchDB client by Jan-Felix Wittmann.Liam Staskawicz is working on a Helma NG module for MongoDB. Query API design Preliminary Design The current Git snapshot implements preliminary query functionality for the googlestore, berkeleystore, filestore, memstore backends. Note that while googlestore and berkeleystore use indxing and query functionality provided by the underlying libraries and APIs, filestore and memstore use unindexed, brute force query implementations that require a full read of the queried objects. Type.query() Returns a query object for the Storable type represented by the given constructor. query.equals('propertyName', propertyValue) Returns a subquery with the added equality filter. query.less('propertyName', propertyValue) Returns a subquery with the added less-than filter. query.lessEquals('propertyName', propertyValue) Returns a subquery with the added less-than-or-equals filter. query.greater('propertyName', propertyValue) Returns a subquery with the added greater-than filter. query.greaterEquals('propertyName', propertyValue) Returns a subquery with the added greater-than-or-equals filter. query.select('propertyName') Returns an array containing the result of the query. If propertyName argument is defined, the result array only contains the given property of the selected objects. Otherwise, it contains the whole objects. Query example: var book = Book.query().equals("title", req.params.title).select(); Prior Art Collecting links of prior art and to collect more ideas on this. MongoDBA Developer's Tour - Advanced Queries Developers' Guide - Searching and Retrieving App Engine Datastore Low-level API - Query DataMapper - http://datamapper.org/doku.php?id=docsRuby-based ORM that provides nice modules that a variety of backends (rdbms and others) can mix in to provide common features like validation, lazy/eager loading, in addition to a nice query apiMozilla ServerJS Relational Database Interface Persevere JSONQuery Django's query interface http://docs.djangoproject.com/en/dev/topics/db/queries/#retrieving-specific-objects-with-filters (replaced named parameters with a JS object)only django's ORM part could be packaged as jar (jython2.5)enhanced googlestore query interface nearly identical to djangosLINQ ("language-integrated query" developed by MS for .NET), JS impl. available:jLinq JSLINQ Store interface A persistent class is created by calling the Storable.defineClass() method with a store implementation and a class name. // define Storable base class defineClass(org.helma.wrappers.Storable); // create a new store var store = new MyStore('/db'); // create a persistent Book object var Book = Storable.defineClass(store, "Book"); // Book objects can now be accessed via the // Storable data access methods and scripted // via Book.prototype Book.prototype.toString = function() this.title; var b = new Book({title: 'JS for dummies'}); b.save(); A store implementation can be any JavaScript object that implements the folloing functions: all(type) - get all objects of one typeget(type, id) - get a single object for its idquery() - get a query objectgetEntity(key|properties) - get an entity objectgetKey(entity) - get the key objectgetProps(entitiy) - get the properties objectequalKeys(key1, key2) - check if keys are equalsave(props, entitiy) - save object to dbremove(key) - remove object from dbgetId(key) - get the object id [Less]
Posted over 15 years ago
Contents [hide]Module Path SetupModule and Resource Loading Module Path Setup Helma NG loads JavaScript resources using a module loader that is compliant with the ServerJS Securable Modules proposal: ... [More] https://wiki.mozilla.org/ServerJS/Modules/SecurableModules Helma NG actually goes one step further and makes sure every module has its own top level scope, so modules are fully isolated from each other, providing a programming environment that resembles that of Python environment more than the one of ordinary client-side JavaScript runtime. Helma uses the concept of a module path to look up and load modules that is similar to the PATH environment variable used to find executables on most operating systems. By default, the module path consists of two entries: The application root, which is the parent directory of the command line script, or the current working directory if called without script argument. The system modules root, which corresponds to the modules directory in the Helma NG home directory. Helma NG provides several ways to access and set the module path. The simplest is to set the HELMA_MODULE_PATH environment variable, separating multiple entries with ':' or whatever character is used to separate PATH entries on your system: export HELMA_MODULE_PATH=../foo/lib:../my/lib Alternatively, you can define the module path using the helma.modulepath Java system property, and you can add entries to the module path using the addRepository() method in the helma/system module. Module and Resource Loading Helma NG provides three functions with different semantics to load modules: require(moduleName) The require function provides the functionality defined in the ServerJS Securable Modules proposal. It tries to locate a module in the module path, loads it and returns its exports object. import(moduleName) The import function builds on top of require, additionally setting a property in the calling module scope whose name is the name of the loaded module and whose value is the loaded module's exports object. include(moduleName) The include function builds on top of require, additionally copying all exported properties of the loaded module to the calling module scope. export(propertyName[, ...]) The export function provides an alternative method to the exports object to define exported properties in a module by passing the names of exported properties as arguments. addToClasspath(pathName) This function adds a jar file or directory to the classpath. By default, all jar files in the Helma NG lib directory are included in the classpath. getResource(pathName) This looks for a file with the given path name in the module path and returns a resource object. This can be used to load resources other than JavaScript files using the same lookup rules as the module loader. [Less]
Posted over 15 years ago
Contents [hide]Some example sites built using Helma:Organizations with projects based on Helma: Some example sites built using Helma: 247street.net - weblog communityalphazoo.at - weblog communityantville.org - weblog communityappjet.com - ... [More] in-browser IDE for building and hosting web apps with javascriptblogger.de - weblog communityblogmax.at - weblog communityblogr.com - your space for photos, videos, podcasts and your blogblogs.macbay.de - weblog communityblogs.uni-erlangen.de - university weblogsblogverzeichnis.krone.at - weblog directoryclub3k.at - webchat community and social media sitecollabor.f4.fhtw-berlin.de - education weblog communityderwesten.de - media and community sitedubistnews.at - weblog communityevolver.at - webzinefm4.orf.at - public broadcast media sitefritz.salzburg.com - entertainment community sitefuturezone.orf.at - public broadcast media sitehausverein.ch - corporate/association sitehektor.ch - project site for Hektor, the spray-paint output devicehelma.org - project site, wiki, bloghenso.com - personal site, bloghyype.net - sports forum micro-blogideenbüro.org - corporate site, wiki, blogjobulous.com - site with job reviews of people who've worked themkakanien.ac.at - platform for interdisciplinary research in the field of Central and Southeast European studiesknallgrau.at - corporate sitekontakt.erstebankgroup.net - corporate sitekontakt-collection.net - corporate sitelineto.com - corporate site and web shop for original digital typefacesmeinekleine.at - media community sitemetropolism.com - contemporary art magazine sitemumundo.net - project sitemywoman.at - weblog communitymyworld.bluewin.ch - weblog community and social media siteoe3.orf.at - public broadcast media siteoesterreich.orf.at - public broadcast media sitep3k.org - personal site/blogabi nachholen - personal siteparq.at - corporate siteiphone.boozle.de - ORF.at for iPhoneplastikmaedchen.net - personal sitepolitikblogs.at - weblog directorypolylog.tv - social media sitepreachingtheword.net - audio sermon archiveradiograz.at - media and community siteshnitzl.org - add, share, organize and discover great eventsscience.orf.at - public broadcast media sitescratchdisk.com personal portfolio sitescriptographer.com - project site for a JavaScript scripting plugin for Adobe Illustratorshapeshifters.net - community site for creativessosmitmensch.at - human rights pressure groupspinnenwerk.de - weblog communitytonight.rp-online.de - party portal and communitytwoday.net - weblog communitytwoday.tuwien.ac.at - university weblogstypolis.net - weblog communitytz-online.de - media and community sitevistablog.at - corporate blogwebmark.eu - Managementinformationssystemweblife.at - community and social media siteweblogs.brandnews.at - weblog communitywestropolis.de - culture community sitewg-spion.de/in/hamburg - flat share communityzumbrunn.com - corporate/personal site Organizations with projects based on Helma: Alliance for Nonprofit Management, Washington DCAOL, New YorkBauhaus-University of Weimar, GermanyBauMax, AustriaBerliner Jugendserver Spinnenwerk, GermanyBrandenburg University of Applied Sciences, GermanyCanton of Berne, SwitzerlandCasa Consult, SwitzerlandChris Zumbrunn Ventures, Switzerlandcollettiva design, AustriaDr. Sauer Group, Washington DCElectricité Plainpalais, SwitzerlandGreen Party Berne, SwitzerlandFHTW University for Applied Sciences Berlin, GermanyForum for Direct Democracy, SwitzerlandHarvard University, Center for Hellenic Studies, Washington DC Hausverein Schweiz, SwitzerlandIdeenbüro, SwitzerlandIQ-plus Medien, AustriaK12, VirginiaKleine Zeitung, AustriaKnallgrau New Media Solutions, AustriaLakeland Catholic Schools, Alberta, CanadaLineto, SwitzerlandMANOVA NetBusiness Solutions GmbH, AustriaMicrosoft, AustriaMunich Online, GermanyNAFSA Association of International Educators, Washington DCNational Gallery of Victoria, AustraliaNational Geographic, IowaNetural Communication, AustriaNuclear Energy Institute, Washington DCORF, AustriaParq, AustriaRheinische Post Online, GermanyRingier, SwitzerlandRundfunk Berlin-Brandenburg, GermanySalzburger Nachrichten, AustriaShapeshifters information management, AustriaSiteworx, VirginiaSOS Mitmensch, AustriaSumaato, Ubilabs, GermanySwiss Army, AFD, SwitzerlandSwiss Red Cross, SwitzerlandSwisscom, SwitzerlandSwisspost, SwitzerlandSysEleven, GermanySystem One, AustriaTechnical University of Vienna, AustriaTelecom Austria, AustriaUnilever, AustriaUnited Press International, Washington DCUniversity College of Falmouth, United KingdomUniversity of Berne, SwitzerlandUniversity of Erlangen, GermanyUniversity of Vienna, AustriaVerlagsgruppe NEWS, AustriaWAZ NewMedia, GermanyZLB Bioplasma, Switzerland [Less]
Posted over 15 years ago
OpenJDK, which is the default Java implementation on various Linux distributions, has a long-standing bug that makes it difficult to run other versions of Mozilla Rhino than the one shipped with the distribution. Helma NG relies on a more recent ... [More] version of Rhino including, among other things, features of JavaScript 1.8 and EcmaScript 5. Although recent snapshots of Helma NG include workarounds for this bug, it is still possible you may encounter problems when running Helma NG with OpenJDK. In this case, you may consider switching to a different Java implementation. For example, to install Sun's version of Java and make it the default on Ubunutu 9.04 (Jaunty Jackalope), use the following commands: sudo aptitude install sun-java6-jdk sudo update-java-alternatives -s java-6-sun You should now have the official Sun JDK installed as default Java implementation. [Less]
Posted over 15 years ago
This page documents new features in Helma 1.7. As Helma 1.7 hasn't been released yet, this page is incomplete and work-in-progress. Contents [hide]Case sensitive HopObject property namesProgrammatically generated collectionsProgrammatically defined ... [More] HopObject mappingsApache Commons Daemon supportLazy collection loadingQuery parameter argument to HopObject.href()Profiler Case sensitive HopObject property names Property names in HopObjects are now case sensitive. This means that obj.foo, obj.Foo and obj.FOO no longer point to the same property. This feature should help to enforce good programming habits and speed up property access. Programmatically generated collections Helma 1.7 defines a new static method on HopObject constructors that allows to generate HopObject collections via JavaScript. The method is called HopObject.getCollection() and takes a single JavaScript object as argument. It returns a HopObject that is equivalent to the one you would get by defining it as a collection in a type.properties file. Programmatically defined HopObject mappings There is a new and experimental definePrototype function that allows to define prototype mappings via JavaScript. In its current implementation, there is a global function called definePrototype() that takes two arguments: The prototype name, and a JavaScript object describing the type mapping. Apache Commons Daemon support Helma 1.7 introduces Apache Commons Daemon support, making it possible to run the embedded Jetty server on port 80 for ordinary users on Unix and running Helma as service on Unix and Windows systems. There also is a Debian/Ubuntu package that indorses Commons Daemon jsvc utility to install Helma as service. Lazy collection loading HopObject.list(), when called without arguments, no longer fetches all contained objects. HopObject.list(start, length) (when called with start and length arguments) prefetches the requested object range. Large object collections with more than 1000 elements divide their list of child ids into multiple segments where each segment is loaded individually. Query parameter argument to HopObject.href() HopObject.href() now takes a JavaScript object as optional second argument after the action name. The argument's properties will be encoded to a query string and added to the returned URL. The object may also contain nested objects, which will be encoded using the outer[inner] format. For example, the following call: root.href('', {foo: 'bar', nested: {x: 1}}); returns /?foo=bar&nested[x]=1, which is parsed back to the original object structure when received by Helma. Profiler Helma 1.7 features a profiler for measuring function runtime and invocation frequency. Profiling data is written to the event log and the response's debug area. To enable the profiler set the the rhino.profile app property to true. More information can be found on the Profiler page. [Less]
Posted over 15 years ago
Helma NG stands for Helma Next Generation and is a version of Helma built from the ground up. The main differences between Helma 1 and Helma NG are that Helma NG has a much smaller and leaner Java core (mostly just runtime, shell, and the module and ... [More] resource loader), and that Helma NG aims to provide full CommonJS interoperability. This is a wiki space dedicated to Helma NG. Feel free to create new pages or edit existing ones. Contents [hide]OverviewGetting StartedResourcesRecently Edited Pages Overview Helma NG consists of several components that can be used together or alone: A compact JavaScript runtime environment based on Mozilla Rhino. It adds to Rhino a reloading module system that is compatible to the CommonJS Securable Module proposal. An interactive shell with support for autocompletion and history. A module library implemented in JavaScript, covering basic functionality such as extensions to the built-in objects, file I/O, logging, persistence, unit testing, client and server side HTTP support and web framework. Getting Started Some links that may help you getting acquainted with Helma NG: README Getting Started Demo apps JavaScript Runtime Modules Web Framework and Middleware Persistence API Resources Mailing list Roadmap Download (Github) Source Code (Github) Issues (Github) IRC: #helma on irc.freenode.net Recently Edited Pages namemodified bylast modifiedProfilerhannes2009/09/29 20:30Web Frameworkhannes2009/09/28 17:14JavaScript Runtimehannes2009/09/28 16:51Module Loaderhannes2009/09/28 16:48READMEhannes2009/09/28 16:35Running Rhino and Helma NG on Google App Engineearl2009/09/27 22:54helma.logginghannes2009/09/25 18:23Roadmaphannes2009/09/21 16:16Getting Startedhannes2009/09/21 15:46moduleshannes2009/09/17 18:32Persistence APIhannes2009/09/04 17:47Middlewarehannes2009/06/18 20:20Toolshannes2009/05/20 00:59Demo appshannes2009/05/19 15:34Shellhannes2009/05/19 14:11Modules and Scopeshannes2009/05/13 12:53jsdoc-toolkit_for_ngmarius2009/05/08 14:57helma.skinhannes2009/04/30 15:20Modules Discussionhannes2009/04/30 11:34Sandboxeshannes2009/04/03 18:19 [Less]
Posted over 15 years ago
Helma 1.7 and Helma NG feature a profiler for measuring function runtime and invocation frequency. This page describes the Helma 1 profiler. For information on the NG profiler view the dedicated page. To enable the profiler, add the following line ... [More] to the app.properties or server.properties file: rhino.profile = true Note that for the profiler to work, the application has to run in interpreted mode (rhino optimization level set to -1). If the rhino.profile property is set, this is taken care of automatically, but you have to start (or restart) the application with this setting - enabling the profiler at runtime will not work. By default, the profiler will be used for all requests and internal invocations. The output is written to the application's event log and, if available, to the response's debug area. It looks like this: total average calls path -------------------------------------------------------------------------------- 234 ms 234 ms 1 gobi-dev/code/Page/PageActions.js #220: create_action 205 ms 205 ms 1 gobi-dev/code/HopObject/macros.js #8: skin_macro 169 ms 169 ms 1 gobi-dev/code/Global/Global.js #495: include_macro 166 ms 166 ms 1 gobi-dev/code/Page/PageMacros.js #8: body_macro 166 ms 166 ms 1 gobi-dev/code/Global/WikiMarkup.js #29 166 ms 166 ms 1 gobi-dev/code/Page/PageMacros.js #330: list_macro 165 ms 165 ms 1 gobi-dev/code/Global/PageList.js #76 98 ms 0 ms 1562 gobi-dev/code/Global/PageList.js #8 92 ms 0 ms 105 gobi-dev/code/Page/Permissions.js #152: checkAccess 58 ms 0 ms 578 gobi-dev/code/Page/PageCore.js #343: getLink 48 ms 0 ms 104 gobi-dev/code/Page/Permissions.js #173: getPermission 46 ms 0 ms 103 gobi-dev/code/Page/Permissions.js #169: getPermissions 45 ms 0 ms 103 gobi-dev/code/Global/Permissions.js #8 <truncated> In order to only apply the profiler to requests for one particular user, set the rhino.profile.session property to the user's session id (the value of the user's HopSession cookie). rhino.profile = true rhino.profile.session = 127.0.0.1n5guagu2sdl2jslf This allows you to use the debugger in production environments and only profile your own requests. Note that the application still needs to run in interpreted mode for everybody, though, but this usually won't have a huge impact on performance. It's also possible to set the rhino.profile.session property so that it matches a substring of the session id. Since Helma session ids are prefixed with the user's IP address by default, this can be useful to only profile requests from a specific IP address or subnet. For example, the following setting will will cause only requests from the 192.168.0.0/255.255.255.0 subnet to be profiled. rhino.profile = true rhino.profile.session = 192.168.0 Be careful when running Helma in a local reverse proxy setup, though, as all sessions may be prefixed with 127.0.0.1 or an address from your LAN. [Less]
Posted over 15 years ago
TODO - see helma 1 profiler and profiler demo page.
Posted over 15 years ago
Helma NG Helma NG is a general purpose Javascript runtime and web application framework. "NG" stands for "next generation", meaning that it is more of a rewrite of Helma 1 than simply a new version. Helma NG consists of several components that can ... [More] be used together or alone: A compact JavaScript runtime environment based on Mozilla Rhino. It adds to Rhino a reloading module system that is compatible to the ServerJS Securable Module proposal. An interactive shell with support for autocompletion and history. A module library implemented in JavaScript, covering basic functionality such as extensions to the built-in objects, file I/O, logging, persistence, client and server side HTTP support and more. For more information, check out the Helma NG homepage and wiki at http://helma.org/wiki/Helma+NG/ Building Helma Helma requires Java 1.5 and uses Apache Ant as its build environment. If you have these installed, building Helma NG is straightforward: Check out Helma NG from Git: git clone git://github.com/hns/helma-ng.git Change to the helma-ng directory and run ant to compile: ant jar If this succeeds you should now have a file called run.jar and be ready to go. JavaScript Runtime and Shell The Helma JavaScript runtime is based on Mozilla Rhino and supports JavaScript 1.7 with partial support for JavaScript 1.8 features. To run Helma NG, add the helma-ng/bin directory to your PATH environment variable: export PATH=$PATH:/path/to/helma-ng/bin To start a shell session, just run the helma command without any arguments: helma To run a script simply pass it to helma on the command line: helma apps/demo/main.js If you run a script that is contained in Helma's module path you can also use the simpler abstract module name instead of the file name. For example, to run the helma test suite: helma test/all To create a new web application, use the admin/create script. This will copy an simple skeleton app to the location you define. You can pass the application directory as command line argument, or the script will prompt you for it. helma admin/create [appdir] Run helma with the -h or --help switch to get more information about available command line options. For example, the -i or --interactive option allows you to run an application and use the shell at the same time, which can be really handy. Module Path Setup Helma NG loads JavaScript resources using a module loader that is compliant with the ServerJS Securable Modules proposal: https://wiki.mozilla.org/ServerJS/Modules/SecurableModules Helma NG actually goes one step further and makes sure every module has its own top level scope, so modules are fully isolated from each other, providing a programming environment that resembles that of Python environment more than the one of ordinary client-side JavaScript runtime. Helma uses the concept of a module path to look up and load modules that is similar to the PATH environment variable used to find executables on most operating systems. By default, the module path consists of two entries: The application root, which is the parent directory of the command line script, or the current working directory if called without script argument. The system modules root, which corresponds to the modules directory in the Helma NG home directory. Helma NG provides several ways to access and set the module path. The simplest is to set the HELMAMODULEPATH environment variable, separating multiple entries with ':' or whatever character is used to separate PATH entries on your system: export HELMA_MODULE_PATH=../foo/lib:../my/lib Alternatively, you can define the module path using the helma.modulepath Java system property, and you can add entries to the module path using the addRepository() method in the helma/system module. Module and Resource Loading Helma NG provides three functions with different semantics to load modules: require(moduleName) The require function provides the functionality defined in the ServerJS Securable Modules proposal. It tries to locate a module in the module path, loads it and returns its exports object. import(moduleName) The import function builds on top of require, additionally setting a property in the calling module scope whose name is the name of the loaded module and whose value is the loaded module's exports object. include(moduleName) The include function builds on top of require, additionally copying all exported properties of the loaded module to the calling module scope. export(propertyName[, ...]) The export function provides an alternative method to the exports object to define exported properties in a module by passing the names of exported properties as arguments. addToClasspath(pathName) This function adds a jar file or directory to the classpath. By default, all jar files in the Helma NG lib directory are included in the classpath. getResource(pathName) This looks for a file with the given path name in the module path and returns a resource object. This can be used to load resources other than JavaScript files using the same lookup rules as the module loader. Web Framework The Helma Web Framework is a web application framework written mostly in JavaScript built on top of the Helma Runtime. To run the demo application that is part of Helma NG run the following command: helma apps/demo/main.js This starts and serves the demo web app on port 8080: http://localhost:8080/ The demo app showcases a number of tools and libraries to build web apps. As Helma NG is still pretty young, many features found in Helma 1.6 are still missing, most notably a persistence layer. These features are currently being implemented. The exciting thing is that it will be possible to implement much of it in Javascript, meaning you can help doing so without hacking on helma core. The new modular concept will even allow to use Helma NG with several frameworks, even on the same server instance. Visit http://helma.org/wiki/Helma+NG/ and join the Helma NG mailing list to keep up with Helma NG core and module development! [Less]
Posted over 15 years ago
Contents [hide]Module Path SetupModule and Resource Loading Module Path Setup Helma NG loads JavaScript resources using a module loader that is compliant with the ServerJS Securable Modules proposal: ... [More] https://wiki.mozilla.org/ServerJS/Modules/SecurableModules Helma NG actually goes one step further and makes sure every module has its own top level scope, so modules are fully isolated from each other, providing a programming environment that resembles that of Python environment more than the one of ordinary client-side JavaScript runtime. Helma uses the concept of a module path to look up and load modules that is similar to the PATH environment variable used to find executables on most operating systems. By default, the module path consists of two entries: The application root, which is the parent directory of the command line script, or the current working directory if called without script argument. The system modules root, which corresponds to the modules directory in the Helma NG home directory. Helma NG provides several ways to access and set the module path. The simplest is to set the HELMAMODULEPATH environment variable, separating multiple entries with ':' or whatever character is used to separate PATH entries on your system: export HELMA_MODULE_PATH=../foo/lib:../my/lib Alternatively, you can define the module path using the helma.modulepath Java system property, and you can add entries to the module path using the addRepository() method in the helma/system module. Module and Resource Loading Helma NG provides three functions with different semantics to load modules: require(moduleName) The require function provides the functionality defined in the ServerJS Securable Modules proposal. It tries to locate a module in the module path, loads it and returns its exports object. import(moduleName) The import function builds on top of require, additionally setting a property in the calling module scope whose name is the name of the loaded module and whose value is the loaded module's exports object. include(moduleName) The include function builds on top of require, additionally copying all exported properties of the loaded module to the calling module scope. export(propertyName[, ...]) The export function provides an alternative method to the exports object to define exported properties in a module by passing the names of exported properties as arguments. addToClasspath(pathName) This function adds a jar file or directory to the classpath. By default, all jar files in the Helma NG lib directory are included in the classpath. getResource(pathName) This looks for a file with the given path name in the module path and returns a resource object. This can be used to load resources other than JavaScript files using the same lookup rules as the module loader. [Less]