Version 35 by Philipp on 13. January 2010, 15:54
| 77 | === Property Naming === |
| 78 | 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. |
| 79 | |
| 86 | Makes 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) |
| 75 | 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. |
Version 32 by Philipp on 27. October 2009, 09:57
| 75 | 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 when defining the collection. <tt>_children = collection(PrototypeToCollect)</tt> |
Version 31 by Philipp on 27. October 2009, 09:54
| 75 | 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 when defining the collection. |
| 76 |
Version 30 by Philipp on 27. October 2009, 09:38
| 1 | 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 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
| 16 | Helma 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 |
| 39 | The 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
- Set useMarkdown to
| 37 | _name = NAME_COLUMN |
| 38 | |
| 39 | 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. |
| 40 | |
| 41 |
Version 26 by Philipp on 10. March 2009, 14:35
| 61 | If 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 |
| 63 | agency = object(Agency) |
| 64 | </tt> |
| 65 | |
| 66 | 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>. |
Version 25 by Philipp on 10. March 2009, 14:04
| 57 | 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. |
| 58 | |
| 59 | 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. |
| 60 | |
| 61 | If 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
| 55 | 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. |
Version 23 by Philipp on 01. August 2008, 16:12
| 34 | Download 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
| 34 | Download 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 | |
| 30 | The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism. |
| 31 | |
| 32 | 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() |
| 33 | |
| 34 | |
| 35 | ==== Inheritance ==== |
| 36 | |
| 37 | _extends = Prototype |
| 38 | |
| 39 | The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism. |
| 40 | |
| 41 | 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() |
Version 19 by Philipp on 01. August 2008, 15:46
| 34 | _extensionId = String or Integer |
| 35 | |
| 36 | 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. |
| 37 | |
| 38 | 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'! |
| 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 | |
| 16 | The _extends entry engages Helma to inherit properties, functions and skins from another prototype. This can be compared to Java’s subclassing mechanism. |
| 17 | |
| 18 | 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() |
| 19 | |
| 27 | _parent ==== localPropertyName, localProperty.parentsCollectionName, root.collectionNameInheritance ==== |
| 29 | 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._extends = If a property in the list is null, Helma will look on the following one to fetch a parent object.Prototype |
| 31 | If 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. |
| 33 | 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() |
| 34 | |
| 35 | ==== Object Management ==== |
| 36 | |
| 37 | |
| 38 | _parent = localPropertyName, localProperty.parentsCollectionName, root.collectionName |
| 39 | |
| 40 | 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. |
| 41 | |
| 42 | 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. 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
| 39 | 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. |
Version 16 by Philipp on 06. June 2008, 15:17
| 29 | Note: 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
| 21 | Helma 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 | |
| 24 | 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". |
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
| 17 | 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() |
| 18 |
Version 11 by Philipp on 04. June 2008, 17:29
| 13 | _extends = Prototype |
| 14 | |
| 15 | The _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 | |
| 31 | 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. |
| 32 | |
| 33 | simplePropertyName.readonly = true |
| 34 | |
| 35 | Makes the property read only and initializes it with the value from the database. |
| 36 | |
| 37 | simplePropertyName.private = true |
| 38 | |
| 39 | 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. |
Version 9 by hypersmil on 09. May 2008, 17:34
| 7 | 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. |
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 | |
| 23 | The _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
| 17 | 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 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 | |
| 17 | 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 one of the properties in the list is null, Helma will look on the following one to fetch a parent object. |
| 18 | |
| 19 | 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. 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 | |
| 5 | 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. 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 | |
| 9 | 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) |
Version 1 by klemens on 08. May 2008, 11:09
- Set tags to
| 1 | _db |
| 2 | |
| 3 | _table |
| 4 | |
| 5 | _prototype |
| 6 | |
| 7 | _parent |
| 8 | |
| 9 | _id |
| 10 | |
| 11 | somePrimitiveProperty |
| 12 | |
| 13 | _children |
| 14 | |
| 15 | obj = object(SomeHopObject) |
| 16 | |
| 17 | obj.local |
| 18 | |
| 19 | obj.foreign |
| 20 | |
| 21 | obj.local.X |
| 22 | |
| 23 | obj.foreign.X |
| 24 | |
| 25 | obj.logicalOperator |
| 26 | |
| 27 | coll = collection(SomeHopObject) |
| 28 | |
| 29 | coll.local |
| 30 | |
| 31 | coll.foreign |
| 32 | |
| 33 | coll.loadmode |
| 34 | |
| 35 | coll.cachemode |
| 36 | |
| 37 | coll.order |
| 38 | |
| 39 | coll.filter |
| 40 | |
| 41 | coll.filter.additionalTables |
| 42 | |
| 43 | coll.hints |
| 44 | |
| 45 | coll.maxSize |
| 46 | |
| 47 | coll.accessname |
| 48 | |
| 49 | coll.group |
| 50 | |
| 51 | coll.group.order |
| 52 | |
| 53 | coll.group.prototype |
| 54 | |
| 55 | moutpointName = mountpoint(SomeTransientHopObject) |