Posted
over 15 years
ago
The Helma 1.7.0 release contains some bug fixes and major improvements, such as programmable HopObject collections and prototype mappings, Apache Commons Daemon support, a profiler for measuring function runtime and invocation frequency, and
... [More]
skin/macro introspection, to mention just a few. It also contains an updated version of Rhino and is the first Helma release that has Javascript 1.7 features enabled by default. The Helma 1.7.0 Changelog has the nitty gritty details. Better get it now, before there is an even better one. Really, it's that good! [Less]
|
Posted
over 15 years
ago
The Helma 1.7.0 release contains some bug fixes and major improvements, such as programmable HopObject collections and prototype mappings, Apache Commons Daemon support, a profiler for measuring function runtime and invocation frequency, and
... [More]
skin/macro introspection, to mention just a few. It also contains an updated version of Rhino and is the first Helma release that has Javascript 1.7 features enabled by default.
Our bugzilla has a list of bugs fixed in Helma 1.7.0.
Added ability to create HopObject collections programmatically and on the fly, without having to define them in the prototype's type.properties file.
Prototype mappings can now be defined programmatically as well using the newly added global function definePrototype().
Added 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.
Property names in HopObjects are now case sensitive.
Added support for lazy collection loading, setting collection.lazyloading = true changes HopObject.list() to no longer fetch all contained objects, amongst other aspects.
HopObject.href() now takes an optional second argument, an object which will be encoded to a query string and added to the generated URL.
Added a profiler for measuring function runtime and invocation frequency.
Added generic header manipulation methods getHeader(), addHeader(), setHeader(), removeHeader() to the helma.Mail object.
Backported improved helma.file module from Helma NG, which takes an options object as argument and allows to specify the default charset to use.
Changed Object.prototype.dontEnum to be overridable and not read-only.
Added support for __defineGetter__ and __defineSetter__ to HopObjects.
Write locks for non-persistable properties on HopObjects are no longer checked.
A Rendering bug involving case in skin name has disappeared.
Fixed strictvars mode to produce the appropriate errors.
Fixed a bug where debug logging level wasn't unset if the debug property was set to false during runtime.
Network ports are now checked at startup by opening a ServerSocket on the port in question and seeing if it works.
Fixed a regression where dynamic relations were broken when the parent wasn't explicitely set.
Replaced encumbered code base of helma.util.Diff with an alternative implementation.
Fixed a comparison bug in loop macro in HopObject.js.
Fixed a slowdown when using getDBConnection() and oracle db that was due to running connection tests to often.
Fixed an error when retrieving HopObjects by accessname on a programmatic collection.
Fixed a problem where the return value of a HopObject's size() method did not change when removing children of a collection.
Fixed a problem with limit and offset on normal collections not working properly.
Adding an object to a grouped collection right after removing an object from that collection, which was in the same group and was added in the same request, now works.
Changed sessions for requests that do not already have one to be only created when actually needed.
Fixed a bug that caused helma.Html.isSelected() method to fail when the last argument was an array.
Added Skin.getMacros() to offer start and end properties, and getName, getHandlerType, getNamedParams, getPositionalParams and hasNestedMacros methods for skin/macro introspection.
Fixed a problem with persist() and collections using accessName.
Calling list() method with min and/or max arguments on HopObjects that are transient now works.
Changed String.URLPATTERN to use a regular expression instead of java.net.URL.
[Less]
|
Posted
over 15 years
ago
(Draft)
The Helma 1.7.0 release contains numerous bug fixes and many minor improvements, such as programmable HopObject collections and prototype mappings, Apache Commons Daemon support, a profiler for measuring function runtime and invocation
... [More]
frequency, and skin/macro introspection, to mention just a few.
Our bugzilla has a list of bugs fixed in Helma 1.7.0.
Added ability to create HopObject collections programmatically and on the fly, without having to define them in the prototype's type.properties file.
Prototype mappings can now be defined programmatically as well using the newly added global function definePrototype().
Added 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.
Property names in HopObjects are now case sensitive.
Added support for lazy collection loading, setting collection.lazyloading = true changes HopObject.list() to no longer fetch all contained objects, amongst other aspects.
HopObject.href() now takes an optional second argument, an object which will be encoded to a query string and added to the generated URL.
Added a profiler for measuring function runtime and invocation frequency.
Added generic header manipulation methods getHeader(), addHeader(), setHeader(), removeHeader() to the helma.Mail object.
Backported improved helma.file module from Helma NG, which takes an options object as argument and allows to specify the default charset to use.
Changed Object.prototype.dontEnum to be overridable and not read-only.
Added support for __defineGetter__ and __defineSetter__ to HopObjects.
Write locks for non-persistable properties on HopObjects are no longer checked.
A Rendering bug involving case in skin name has disappeared.
Fixed strictvars mode to produce the appropriate errors.
Fixed a bug where debug logging level wasn't unset if the debug property was set to false during runtime.
Network ports are now checked at startup by opening a ServerSocket on the port in question and seeing if it works.
Fixed a regression where dynamic relations were broken when the parent wasn't explicitely set.
Replaced encumbered code base of helma.util.Diff with an alternative implementation.
Fixed a comparison bug in loop macro in HopObject.js.
Fixed a slowdown when using getDBConnection() and oracle db that was due to running connection tests to often.
Fixed an error when retrieving HopObjects by accessname on a programmatic collection.
Fixed a problem where the return value of a HopObject's size() method did not change when removing children of a collection.
Fixed a problem with limit and offset on normal collections not working properly.
Adding an object to a grouped collection right after removing an object from that collection, which was in the same group and was added in the same request, now works.
Changed sessions for requests that do not already have one to be only created when actually needed.
Fixed a bug that caused helma.Html.isSelected() method to fail when the last argument was an array.
Added Skin.getMacros() to offer start and end properties, and getName, getHandlerType, getNamedParams, getPositionalParams and hasNestedMacros methods for skin/macro introspection.
Fixed a problem with persist() and collections using accessName.
Calling list() method with min and/or max arguments on HopObjects that are transient now works.
Changed String.URLPATTERN to use a regular expression instead of java.net.URL.
[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:
alphazoo.at - weblog communityantville.org - weblog communityblogger.de - weblog communityblogmax.at - weblog
... [More]
communityblogr.com - your space for photos, videos, podcasts and your blogblogs.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 siteevolver.at - webzinefm4.orf.at - public broadcast media 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, 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 studieskaveikiavaldzia.lt - site for tracking lithuanian parliament and goverment newsknallgrau.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 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 archiveshnitzl.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 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 sitezumbrunn.com - corporate/personal site
Want to buy term papers?
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
(Draft)
The Helma 1.7.0 release contains numerous bug fixes and many minor improvements, such as programmable HopObject collections and prototype mappings, Apache Commons Daemon support, a profiler for measuring function runtime and invocation
... [More]
frequency, and skin/macro introspection, to mention just a few.
Our bugzilla has a list of bugs fixed in Helma 1.7.0.
Added ability to create HopObject collections programmatically and on the fly, without having to define them in the prototype's type.properties file.
Prototype mappings can now be defined programmatically as well using the newly added global function definePrototype().
Added 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.
Property names in HopObjects are now case sensitive.
Optimized lazy collection loading, changing HopObject.list() to no longer fetch all contained objects, amongst other aspects.
HopObject.href() now takes an optional second argument, an object which will be encoded to a query string and added to the generated URL.
Added a profiler for measuring function runtime and invocation frequency.
Added generic header manipulation methods getHeader(), addHeader(), setHeader(), removeHeader() to the helma.Mail object.
Backported improved helma.file module from Helma NG, which takes an options object as argument and allows to specify the default charset to use.
Changed Object.prototype.dontEnum to be overridable and not read-only.
Added support for __defineGetter__ and __defineSetter__ to HopObjects.
Write locks for non-persistable properties on HopObjects are no longer checked.
A Rendering bug involving case in skin name has disappeared.
Fixed strictvars mode to produce the appropriate errors.
Fixed a bug where debug logging level wasn't unset if the debug property was set to false during runtime.
Network ports are now checked at startup by opening a ServerSocket on the port in question and seeing if it works.
Fixed a regression where dynamic relations were broken when the parent wasn't explicitely set.
Replaced encumbered code base of helma.util.Diff with an alternative implementation.
Fixed a comparison bug in loop macro in HopObject.js.
Fixed a slowdown when using getDBConnection() and oracle db that was due to running connection tests to often.
Fixed an error when retrieving HopObjects by accessname on a programmatic collection.
Fixed a problem where the return value of a HopObject's size() method did not change when removing children of a collection.
Fixed a problem with limit and offset on normal collections not working properly.
Adding an object to a grouped collection right after removing an object from that collection, which was in the same group and was added in the same request, now works.
Changed sessions for requests that do not already have one to be only created when actually needed.
Fixed a bug that caused helma.Html.isSelected() method to fail when the last argument was an array.
Added Skin.getMacros() to offer start and end properties, and getName, getHandlerType, getNamedParams, getPositionalParams and hasNestedMacros methods for skin/macro introspection.
Fixed a problem with persist() and collections using accessName.
Calling list() method with min and/or max arguments on HopObjects that are transient now works.
Changed String.URLPATTERN to use a regular expression instead of java.net.URL.
[Less]
|
Posted
over 15 years
ago
Contents [hide]MacrosFilters
Macros
now(offset) - current Date + offsetrenderSkin(skin) - renders the given skin, should be in HopObject & Globalrandom(from, to) - returns a random between 0 and 1 or param.from to param.toqueryParam(name) -
... [More]
returns the req.queryParampostParam(name) - returns the req.postParam
Filters
append(str) - append the str to the incomming string.prepend(str) - like append.boolean(true, false) - return the true or false parameter, depending on inputif(x, is, a, then, y, else, z) - http://code.google.com/p/antville/source/browse/trunk/code/Global/Global.js#237switch(case1, case2, ...) - return the value of the case defined by the inputisNaN - returns true or false, maybe followed by a boolean-filterisNull - returns true or false, maybe followed by a boolean-filterisLowerThan(val) - returns true or false, maybe followed by a boolean-filterisBiggerThan(val) - returns true or false, maybe followed by a boolean-filterisEqual(val) - returns true or false, maybe followed by a boolean-filtertoggle(option1, option2) - toggles between option1 or option2formatDuration - formats the incomming input from seconds to HH:mm:ssformatFilesize(to) - formats the incomming filesize in byte KB, MB, GB, TBformatNumber - calls Helma's Number.format()formatParagraphs - call Helma's formatParagraphs()macroTag - render the input in macro-tags, e.g. "mymacro" | macroTag should return " [Unhandled macro: mymacro] "bindHandler - bind the input object to res.handlers[param.name]dateOffset(days,months,years) - increases the incomming Date by the given paramslink - call html.linkAsString()href - call the href on the input objecttoFixed(c) - calls Number.toFixed(c) [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:
alphazoo.at - weblog communityantville.org - weblog communityblogger.de - weblog communityblogmax.at - weblog
... [More]
communityblogr.com - your space for photos, videos, podcasts and your blogblogs.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 siteevolver.at - webzinefm4.orf.at - public broadcast media 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, 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 studieskaveikiavaldzia.lt - site for tracking lithuanian parliament and goverment newsknallgrau.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 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 archiveshnitzl.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 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 sitezumbrunn.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
To store your HopObjects into a relational database system you need to define a database mapping. This is done in the type.properties files located in the persistent HopObject's prototype directory (e.g. apps/myApp/MyPrototype). The type.properties
... [More]
files contain no JDBC connection information, which is located in the db.properties file in the Helma installation directory or in the application directory.
Contents [hide]Configuration SettingsDatabase relatedInheritanceObject ManagementProperty NamingSimple PropertiesReferenced ObjectsCollectionsMountpoints
Configuration Settings
Database related
_db = datasourceName
The _db entry describes the database source to use for managing objects of this type. datasourcename is the connection's name defined in the db.properties, which is located in Helma’s installation directory or the application directory. The db.properties file contains information about the JDBC connections, like the JDBC driver, the connection URL and the database username and password.
_table = TABLENAME
The _table entry tells Helma which table to use for objects of this type within the database. To avoid problems with reserved words of SQL or your database system you should prefix your table names. (e.g. T_Story for the Story prototype’s table)
_prototype = PROTOTYPE_COLUMN_NAME
Extended prototypes are usually stored in the same relational database table. Thus, Helma needs a way to tell which row in the table should be instantiated with which object prototype. This is done using the _prototype entry, specifying a column in the table containing the name of the prototype for each row.
This picture shows a database table where Animals and Dogs could be stored. A Dog is a sub-prototype of the Animal prototype. It inherits every property from the Animal and defines two new properties called "Breed" and "Color".
Note: The Dog’s type.properties just defines the two new properties. All other stuff will be inherited from the Animal.
_extensionId = String or Integer
If you extend a prototype, Helma will use the name of the sub-prototype as value for the _prototype database column. This could slow down the performance. Better would be to choose a numeric value, which result faster index retrievals and queries. You can define this numeric value in the _extensionId property of the sub-prototype.
Example: If Helma needs all cats, the db-layer can filter all animals with the value '260486'. The value '260486' is defined in the cat’s type.properties as _extensionId! For dogs the _extensionId is set to a 'dogu dugu' string. Animals’ type.properties defines no _extensionId, so Helma uses the prototype’s name, which is 'Animal'!
Download the animal demo application:
nametypesizetypeproperties_prototype.pngundefined bytestypeproperties_prototype_helma.pngundefined bytestypeproperties_prototype_extensionid.pngundefined bytesdemo_animalfarm.zipundefined bytes
_name = NAME_COLUMN
The optional _name entry tells Helma which database column to use as object name. This is important for the user prototype, since it defines which column constitutes the user name. This field is only used by the session.login(name, pw)/app.registerUser(name, pw) functionality!
Inheritance
_extends = Prototype
The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism.
For example could be a Dog's _extends value the Animal, which inherits to the Dog prototype basic properties like father or mother, some skins and standard functions like getBiologicalClassification()
Object Management
_id = primaryKeyColumnName
The _id entry defines the column to use as primary key. Helma requires a single primary key with no other functionality. You can read this unique ID from the _id-property of the HopObject.
_parent = localPropertyName, localProperty.parentsCollectionName, root.collectionName
The _parent entry contains a comma-separated list of properties of objects of this type to be used as parent. Objects must know their parent in order to generate correct URLs in their href() function. If a property in the list is null, Helma will look on the following one to fetch a parent object.
If an entry in the _parent item does not contain a dot, it is interpreted as an object property of the current object that acts as the object's parent. If an entry contains a dot character, the part after the dot is interpreted as a collection in the parent object in which the current object is contained. Alternatively or additionally, a second or third dot separated part may indicate an object reference instead or in addition to a collection or mountpoint. If the _parent is specified as "root", it is not interpreted as a property of the current object. Instead, the application's root object is used as parent object.
The _parent entry solves a very specific problem: HopObjects do not know their canonical URLs if you call the href() function, since they can be members of more than one collection.
Example: James Nachtwey, Steve McCurry and Annie Leibovitz are well known photographers. A photographer might work for an agency, so the photographer’s prototype contains a property acency, but if they don’t, it’s null. Nachtwey and McCurry are war photographers, so a root.warphotographers collection cointains both. Leibovitz is neither taking pictures in war zones, nore working for an agency. All photographers are stored in the root’s photographers collection.
The Photographer's types.properties looks like that:
_parent = root.warphotographers, agency, root.photographers
agency = object(Agency)
Helma’s href() will look first in the war photographers collection and return an URL like /warphotographers/nachtwey, if the person is member of this. Now you call href() on the object Annie Leibovitz. She isn’t member of warphotographers, her agency property is null, but she is member of root.photographers, so href() will return /photographers/leibovitz.
_children = collection(SomeHopObject)
It is used to define a HopObject itself as a collection. The keyword _children acts like a normal property, so you can use all of the collection specifications (.local, .foreign, .accessname, etc.) when defining the collection.
Property Naming
The property naming is case sensitive since Helma 1.7. This means that obj.foo, obj.Foo and obj.FOO no longer point to the same property. Properties starting with '_' are not persistable! If you define a property like '_lastAccess', Helma will not map it to a database column, even if you define a mapping.
Simple Properties
simplePropertyName = DB_COLUMN_NAME
A simple property maps a property name of the object to a column of the database table. The type of the table's column need not be specified. Helma does all necessary conversion when reading or writing a property value.
simplePropertyName.readonly = true
Initializes the property with the value from the database and will not propagate updates on this property to the database. Please note that the property still can be modified by the application but all changes will be lost after restarting the application or reloading it's value from the database. If you need to prevent any modification on a property, you have to provide a setter function for it.
simplePropertyName.private = true
The private flag forces Helma to update this column only in the database, but prevents any updates on collections and references containing the modified object.
Referenced Objects
obj = object(SomeHopObject)
obj.local
obj.foreign
obj.local.X
obj.foreign.X
obj.logicalOperator
Collections
coll = collection(SomeHopObject)
coll.local
coll.foreign
coll.loadmode
coll.cachemode
coll.order
coll.filter
coll.filter.additionalTables
coll.hints
coll.maxSize
coll.accessname
coll.group
coll.group.order
coll.group.prototype
Mountpoints
moutpointName = mountpoint(SomeTransientHopObject)
[Less]
|
Posted
over 15 years
ago
Contents [hide]IntroductionInstallation And SetupUsing HopReplGetting NiftyTo Do
Introduction
HopRepl is similar to Helma Shell with the tiny difference that it does not run in a browser window but in a terminal environment (aka command line).
... [More]
Note: Chris Langreiter was here years ago already when he published HopShell, a Repl written in Rebol.
The four letters Repl actually are in fact used synonymously for a shell.
Thus, you can enter simple commands to inspect and manipulate Helma space. And commands are of course JavaScript statements!
This is an alpha version, ie. you will get excepctions, stuck and not always what you expected.
Thanks to Robert and Hannes for their help; it would not be even alpha without them.
Update: I added the file patch-for-emacs-integration.diff which Massimiliano sent to me; he “added a few bits, namely set/get/push/popenv and the multiline input mode, needed for Emacs integration.” Maybe this helps other Emacs users, too.
Here is what you can do with HopRepl:
Installation And Setup
First, move the two files attached to this wiki as repl.zip and repl.jar into your application directory. I recommend the manage application because it already provides some interesting objects to explore.
nametypesizerepl.zipundefined bytesrepl.jarundefined bytespatch-for-emacs-integration.diffundefined bytesrepl-599.jarundefined bytesrepl-599.zipundefined bytes
To be sure that the HopRepl code is really compiled into the application a Helma restart will not hurt.
Now you can start the HopRepl server by navigating to the “repl” action in your browser. In my case the location is http://localhost:8080/manage/repl
There you will see one simple line saying “HopRepl server (stopped)” followed by two links “Start” and “Restart”.
Click on the “Start” link and your HopRepl should be started. Simultaneously, the link will change to “Stop” and the port number will be displayed in brackets.
(If not you might check if anything else is running behind that port on your computer already. Use the application property replPort to change the port number.)
Using HopRepl
Let us check if you can connect from the command line shell to the HopRepl server by entering
telnet localhost 1234
(Be sure to use the desired port number if you should have changed it in the previous step.)
Note: To add command editing, history and completion features to the Repl you could prefix the above command with rlwrap – which of course needs to be installed on your machine.
If everyhing goes well HopRepl should welcome you with a short message and the Repl prompt:
Hello! This is HopRepl Alpha (c) 2008 Tobi Schäfer
Helma>
After the prompt you can enter any JavaScript statement you like. It will be (R)ead, (E)valuated and the result will be (P)rinted in your terminal. Finally, the (L)oop starts again with your next input. That is the generic principle behind Repl.
Helma> new Date
Thu Jan 17 2008 12:21:57 GMT+0100 (CET)
Helma> Math
[object Math]
Helma> this
[object GlobalObject]
There is one special object added to the JavaScript as defined by Rhino and Helma. It is called repl and acts as a helper object providing methods to make navigating and exploring the namespace more convenient.
Helma> repl
HopRepl server (port 1234)
To get a clue where in Helma space you are right now you can use the whereAmI() method:
Helma> repl.whereAmI()
[object GlobalObject]
The look() method prints a list of all available properties and methods in the current context:
Helma> repl.look()
this.Repl = [function]
this.Server = [function]
this.Thread = [function]
this.Xml = {class helma.scripting.rhino.extensions.XmlObject}
this.app = {class helma.framework.core.ApplicationBean}
this.appStat = [function]
this.checkAddress = [function]
this.checkAuth = [function]
this.createAddressFilter = [function]
...
this.req = {class helma.framework.RequestBean}
this.res = {class helma.framework.ResponseBean}
this.root = {class helma.main.Server}
this.scheduler = [function]
this.session = {class helma.framework.core.SessionBean}
this.skin_macro = [function]
this.sortByName = [function]
this.sortProps = [function]
For convenience you do not have to always type in “this” to access a property or a method. HopRepl provides all available properties of the current context as global variables:
Helma> res
[Response]
Helma> session
[Anonymous Session]
Helma> skin_macro
function skin_macro(par) {
if (par && par.name) {
renderSkin(par.name);
}
}
The enter() method changes the context to another object:
Helma> repl.enter(root)
helma.main.Server@d03ed2
Helma> repl.look()
this.application = undefined
this.applications = {class [Ljava.lang.Object;}
this.appsHome = {class java.io.File}
this.appsProperties = undefined
this.checkAppManager = [function]
this.class = {class java.lang.Class}
this.dbHome = {class java.io.File}
...
Helma> repl.enter(checkAppManager)
function checkAppManager() {/*
void checkAppManager(int)
*/}
To get back to the previous context the back() method is at hand:
Helma> repl.back()
helma.main.Server@d03ed2
And the home() method brings you even further back, straight up to the top-level context:
Helma> repl.home()
[object GlobalObject]
If you should have enough of tinkering with HopRepl the quit() method closes the connection to the server:
Helma> repl.quit()
Connection closed by foreign host.
Getting Nifty
Of course you can also call methods, not only enter their contextes. Here is a more elaborated example of using HopRepl to stop an application:
Helma> repl.home()
[object GlobalObject]
Helma> repl.enter(root)
helma.main.Server@d03ed2
Helma> repl.enter(getApplication("test"))
[Application test]
Helma> isRunning()
true
Helma> stop()
Helma> isRunning()
false
Further manipulation is possible, too. Let us change a HopObject’s property:
Helma> repl.home()
[object GlobalObject]
Helma>> repl.enter(root)
helma.main.Server@d03ed2
Helma> repl.enter(getApplication("antville"))
[Application antville]
Helma> repl.enter(dataRoot)
HopObject Site 14
Helma> repl.enter(creator)
HopObject p3k
Helma> repl.look()
this.comments = [object]
this.created = [object]
this.email = [email protected]
this.files = [object]
...
Helma> email = "[email protected]"
[email protected]
Please note that the e-mail address is not changed in the database, yet. To achieve this one has to add a res.commit() at this point. After invalidating the application – which of course can be done in HopRepl as well by invoking app.clearCache() – the new value is still persistent:
Helma> res.commit()
Helma> repl.back(); repl.back() // Back to the application’s context
[Application antville]
Helma> clearCache()
Helma> dataRoot.creator.email
[email protected]
That is it so far. Maybe this first attempt will grow and if anyone is interested in picking up the pieces, please contact me via the helma-dev mailing list.
To Do
Eat those nasty java.lang.Nullpointer exceptions (could be something with entering Java class context) Fixed by preventing HopRepl from entering scopes with undefined constructor property.Allow modifications of properties to trickle down to the database Works with res.commit()
Inspired by Massimiliano Mirra’s MozRepl project.
// tobi [Less]
|
Posted
over 15 years
ago
This is a wiki page intended for the collection of pending changes/additions to the reference guide.
The reference guide for Helma 1.x is maintained using subversion and is automatically generated using the jsdoc toolkit. If you notice any errors
... [More]
or omissions and do not have commit access to directly make the fix in subversion, please add a notice or a text recommendation here.
Contents [hide]Missing:Pending Changes:in general
Missing:
I just looked after helma.Http.evalUrl and it isn't in the reference.httpOnlySessionCookie in apps.properties is missing.getMacroHandler() is missing in HopObject - http://tenez.at/blog/2009/12/helma-deep-macro-invocation/helma.File.readln() needs an open() before reading it, readAll() not. Maybe this should be also added to the doc: http://helma.server-side-javascript.org/reference/helma.File.html#helma.File.open
Pending Changes:
_prototype, _name, __created__, __lastModified__, __fullname__, __hash__, __node__ HopObject properties are not documented: http://helma.zumbrunn.com/hopbot/2007-08-08 http://helma.zumbrunn.com/hopbot/2008-08-05HopObject.subnodeRelation is missing in the docs. It allows to dynamically adjust the .filter usually set in type.propertiesGlobal.path documentation code example is broken. Because path is not a real array, in that it is keyed on prototype names, Not integer indexes, therefore the code should be: for (var i in path) {
res.writeln(path[i]);
}
in general
All reference pages should include an index with links to all contained methods and properties, the way the HopObject page already does.
[Less]
|