| Summary: | make collections updatable | ||
|---|---|---|---|
| Product: | Helma | Reporter: | tobi <interface@p3k.org> |
| Component: | HopObject Functionality | Assignee: | Helma Developer Mailing List <helma-dev@helma.org> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | manfred.andres@orf.at |
| Priority: | P2 | ||
| Version: | CVS trunk | ||
| Target Milestone: | --- | ||
| Hardware: | Other | ||
| OS: | other | ||
| Bug Depends on: | |||
| Bug Blocks: | 398, 451 | ||
| Attachments: | Patch for making subnode-collections updateable | ||
Created an attachment (id=19) [details]
Patch for making subnode-collections updateable
By modifying the type.porperties (to let Helma know which creterias are used
for updating this collection) and
calling ".updateSubnodes()" inside the JavaScript-environment, ONLY these new
Nodes will be fetched from
the database.
For example:
type.properties:
someCollection=collection(somePrototype)
someCollection.order=SOMEFIELD desc, .....
someCollection.updateCreteria=ID asc, CREATETIME asc
(Database fieldnames are in upper case)
This mapping would cause someCollection.updateSubnodes() to fetch all Nodes
having a higher ID than the
highest ID currently known and all Nodes having a higher CREATETIME than the
highest CREATETIME known.
These nodes would be added to this collection honouring the order given by the
type.properties.
Committed Manfred's last patch to CVS branch "updateable_collections"
Doesn't seem to work. First: Both collection properties "updateable" and "updateCriteria" seem to be loaded only at startup but not on the fly. Second: Even if I use the ID column (autoincrement) as updateCriteria, old rows are read and added to the collection so that I end up having the same rows over and over again, when this collection is updated (using MySQL).