Helma Logo
main list history

Version 35 by Philipp on 13. January 2010, 15:54

77=== Property Naming ===
78The 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.
79
86Makes Initializes the property read only and initializes it 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.

Version 34 by Philipp on 27. October 2009, 10:01

73 _children = collection(PrototypeToCollect)collection(SomeHopObject)

Version 33 by Philipp on 27. October 2009, 10:01

73 _children_children = collection(PrototypeToCollect)
75It 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.

Version 32 by Philipp on 27. October 2009, 09:57

75It 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 when defining the collection. <tt>_children = collection(PrototypeToCollect)</tt>

Version 31 by Philipp on 27. October 2009, 09:54

75It 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 when defining the collection.
76

Version 30 by Philipp on 27. October 2009, 09:38

1To 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 files contain no JDBC connection information, which is located in the db.properties file in the Helma installation directory or in the application directory.

Version 29 by Philipp on 27. October 2009, 09:35

16Helma can store multiple Extended prototypes into one single database table. This feature could be useful if you extend prototypes for inheritance and if you want to store all sub-prototypes into are usually stored in the same relational database table. To enable this feature just add Thus, Helma needs a column way to tell which row in the table where Helma can store the prototype’s nameshould be instantiated with which object prototype. This column is referenced done using the _prototype entry, specifying a column in the type.properties table containing the name of the affected prototypeprototype for each row.

Version 28 by Philipp on 23. October 2009, 17:21

10 _table = tableNameTABLENAME
14 _prototype = prototypeColumnNamePROTOTYPE_COLUMN_NAME
39The optional `_name` _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!

Version 27 by Philipp on 23. October 2009, 17:18

37 _name = NAME_COLUMN
38
39The 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.
40
41

Version 26 by Philipp on 10. March 2009, 14:35

61If you define <tt>_parent = rootThe Photographer's types.warphotographers, agency, root.photographers</tt> Helma’s <tt>href()</tt> will look first in the war photographers collection and return an URL properties looks like <tt>/warphotographers/nachtwey</tt>, if the person is member of this. Now you call <tt>href()</tt> on the object Annie Leibovitz. She isn’t member of warphotographers, her agency property is null, but she is member of root.photographers, so <tt>href()</tt> will return <tt>/photographers/leibovitz</tt>.that:
62<tt>_parent = root.warphotographers, agency, root.photographers
63agency = object(Agency)
64</tt>
65
66Helma’s <tt>href()</tt> will look first in the war photographers collection and return an URL like <tt>/warphotographers/nachtwey</tt>, if the person is member of this. Now you call <tt>href()</tt> on the object Annie Leibovitz. She isn’t member of warphotographers, her agency property is null, but she is member of root.photographers, so <tt>href()</tt> will return <tt>/photographers/leibovitz</tt>.

Version 25 by Philipp on 10. March 2009, 14:04

57The _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.
58
59Example: 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.
60
61If you define <tt>_parent = root.warphotographers, agency, root.photographers</tt> Helma’s <tt>href()</tt> will look first in the war photographers collection and return an URL like <tt>/warphotographers/nachtwey</tt>, if the person is member of this. Now you call <tt>href()</tt> on the object Annie Leibovitz. She isn’t member of warphotographers, her agency property is null, but she is member of root.photographers, so <tt>href()</tt> will return <tt>/photographers/leibovitz</tt>.
62

Version 24 by zumbrunn on 31. October 2008, 12:15

55If 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.

Version 23 by Philipp on 01. August 2008, 16:12

34Download this demo-application: <% this.attachment name="demo_animalfarm.zip" %>the animal demo application:
35<% this.attachments %>

Version 22 by Philipp on 01. August 2008, 16:12

34Download this demo-application: <% this.attachment name===="demo_animalfarm.zip" Demo Application ====%>
35<% this.attachments %>

Version 21 by Philipp on 01. August 2008, 16:11

34==== Demo Application ====
35<% this.attachments %>
36

Version 20 by Philipp on 01. August 2008, 15:47

26==== Inheritance ====
27
28 _extends = Prototype
29
30The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism.
31
32For 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()
33
34
35==== Inheritance ====
36
37 _extends = Prototype
38
39The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism.
40
41For 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()

Version 19 by Philipp on 01. August 2008, 15:46

34 _extensionId = String or Integer
35
36If 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.
37
38Example: 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'!
39
40<% this.image name="typeproperties_prototype_extensionid.png" %>
41

Version 18 by Philipp on 11. June 2008, 12:37

5==== Database related ====
14 _extends = Prototype
15
16The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism.
17
18For 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()
19
27 _parent ==== localPropertyName, localProperty.parentsCollectionName, root.collectionNameInheritance ====
29The _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._extends = If a property in the list is null, Helma will look on the following one to fetch a parent object.Prototype
31If an The _extends entry in the _parent item does not contain a dotengages Helma to inherit properties, it is interpreted as an object property of the current object that acts as the object's parentfunctions and skins from another prototype. 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. 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 objectThis can be compared to Java’s subclassing mechanism.
33For 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()
34
35==== Object Management ====
36
37
38 _parent = localPropertyName, localProperty.parentsCollectionName, root.collectionName
39
40The _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.
41
42If 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. 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.

Version 17 by Philipp on 06. June 2008, 15:37

39The _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.

Version 16 by Philipp on 06. June 2008, 15:17

29Note: The Dog’s type.properties just defines the two new properties. All other stuff will be inherited from the Animal.
30

Version 15 by Philipp on 06. June 2008, 15:15

27<% this.image name="typeproperties_prototype_helma.png" %>
28

Version 14 by Philipp on 06. June 2008, 14:58

21Helma can store multiple prototypes into one single database table. This feature could be useful if you extend prototypes for inheritance and if you want to store all sub-prototypes into the same table. To enable this feature just add a column to the table where Helma can store the prototype’s name. This column is referenced in the type.properties of the affected prototype.
22
23
24This 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".

Version 13 by Philipp on 06. June 2008, 14:51

19 _prototype_prototype = prototypeColumnName
20
21<% this.image name="typeproperties_prototype.png" %>

Version 12 by Philipp on 04. June 2008, 18:44

17For 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()
18

Version 11 by Philipp on 04. June 2008, 17:29

13 _extends = Prototype
14
15The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism.
16

Version 10 by Philipp on 04. June 2008, 17:16

27=== Simple Attributes Properties ===
29 simpleAttributeName simplePropertyName = tablecolumnnameDB_COLUMN_NAME
30
31A 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.
32
33 simplePropertyName.readonly = true
34
35Makes the property read only and initializes it with the value from the database.
36
37 simplePropertyName.private = true
38
39The private flag forces Helma to update this column only in the database, but prevents any updates on collections and references containing the modified object.

Version 9 by hypersmil on 09. May 2008, 17:34

7The _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.

Version 8 by Philipp on 09. May 2008, 17:17

21 _id = primaryColumnNameprimaryKeyColumnName

Version 7 by Philipp on 09. May 2008, 17:16

21 _id_id = primaryColumnName
22
23The _id entry defines the column to use as primary key. Helma requires a single primary key with no other functionality.

Version 6 by Philipp on 09. May 2008, 17:14

17The _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 one of the properties a property in the list is null, Helma will look on the following one to fetch a parent object.

Version 5 by Philipp on 09. May 2008, 17:00

5 _db = datasourcenamedatasourceName
9 _table = tablenametableName
15 _parent_parent = localPropertyName, localProperty.parentsCollectionName, root.collectionName
16
17The _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 one of the properties in the list is null, Helma will look on the following one to fetch a parent object.
18
19If 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. 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.

Version 4 by Philipp on 09. May 2008, 16:44

3=== Configuration Settings ===
4
18 somePrimitiveProperty
19
21=== Simple Attributes ===
22
23 simpleAttributeName = tablecolumnname
24
25=== Referenced Objects ===
34=== Collections ===
35
62
63=== Mountpoints ===

Version 3 by Philipp on 09. May 2008, 16:34

11 _prototype
13 _parent
15 _id
17 somePrimitiveProperty
19 _children
21 obj = object(SomeHopObject)
23 obj.local
25 obj.foreign
27 obj.local.X
29 obj.foreign.X
31 obj.logicalOperator
33 coll = collection(SomeHopObject)
35 coll.local
37 coll.foreign
39 coll.loadmode
41 coll.cachemode
43 coll.order
45 coll.filter
47 coll.filter.additionalTables
49 coll.hints
51 coll.maxSize
53 coll.accessname
55 coll.group
57 coll.group.order
59 coll.group.prototype
61 moutpointName = mountpoint(SomeTransientHopObject)

Version 2 by Philipp on 09. May 2008, 16:33

1_dbTo 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 files contain no JDBC connection information, which is located in the db.properties file in the Helma installation directory.
3_table _db = datasourcename
4
5The _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. The db.properties file contains information about the JDBC connections, like the JDBC driver, the connection URL and the database username and password.
6
7 _table = tablename
8
9The _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)

Version 1 by klemens on 08. May 2008, 11:09

1_db
2
3_table
4
5_prototype
6
7_parent
8
9_id
10
11somePrimitiveProperty
12
13_children
14
15obj = object(SomeHopObject)
16
17obj.local
18 
19obj.foreign
20
21obj.local.X
22
23obj.foreign.X
24
25obj.logicalOperator
26
27coll = collection(SomeHopObject)
28
29coll.local
30
31coll.foreign
32
33coll.loadmode
34
35coll.cachemode
36
37coll.order
38
39coll.filter
40
41coll.filter.additionalTables
42
43coll.hints
44
45coll.maxSize
46
47coll.accessname
48
49coll.group
50
51coll.group.order
52
53coll.group.prototype
54
55moutpointName = mountpoint(SomeTransientHopObject)