Re: Actions for Collections
"Maksim Lin for technical support mailling lists" <[email protected]>
| Newsgroups | gmane.comp.java.helma.general |
|---|---|
| Message-ID | <[email protected]> |
Oops patch attahced this time. > -----Original Message----- > From: [email protected] > [mailto:[email protected]] On Behalf Of Maksim Lin > for technical support mailling lists > Sent: Monday, 23 April 2007 18:39 > To: Helma User Mailing List > Subject: [Helma-user] Actions for Collections > > Hi all, > > I'm hoping to raise again an issue I emailed back in june > last year (as its really starting to bother me again). > It would be really nice to let actions be defined on > collections as well as on mountpoints for both consistency as > well as convience 9since you often want/need to use a > collection rather then a mountpoint) > > I have been looking at the code again in Relation.js and > still cannot see any reason why this cannot be done as > collections (like mountpoints) are always specified for only > 1 Prototype so being able to have actions called on > collections are after all HopObjects too. > > >From my experiments all it takes is the attched patch. > > Hannes this makes a lot of nice generic code possible so I'd > really like this to go into helma or at least really > appreciate feedback on why its not a good idea. > > Thanks, > Maks. > _______________________________________________ > Helma-user mailing list > [email protected] > http://helma.org/mailman/listinfo/helma-user > > > _______________________________________________ Helma-user mailing list [email protected] http://helma.org/mailman/listinfo/helma-user
col-action.diff
(application/octet-stream, 1.1 KB)
Index: Relation.java
===================================================================
RCS file: /opt/cvs/hop/helma/src/helma/objectmodel/db/Relation.java,v
retrieving revision 1.64
diff -u -r1.64 Relation.java
--- Relation.java 17 Apr 2007 21:37:06 -0000 1.64
+++ Relation.java 23 Apr 2007 08:41:48 -0000
@@ -169,6 +169,7 @@
if ("collection".equalsIgnoreCase(ref)) {
virtual = !"_children".equalsIgnoreCase(propName);
reftype = COLLECTION;
+ prototype = proto;
} else if ("mountpoint".equalsIgnoreCase(ref)) {
virtual = true;
reftype = COLLECTION;
@@ -727,9 +728,9 @@
// if the collection node is prototyped, return the app's DbMapping
// for that prototype
- if (prototype != null) {
- return otherType;
- }
+// if (prototype != null) {
+// return otherType;
+// }
// create a synthetic DbMapping that describes how to fetch the
// collection's child objects.