Re: CPSShema and managment of relations between objects
"Santi Camps" <[email protected]>
| Newsgroups | gmane.comp.web.zope.cps.devel |
|---|---|
| Message-ID | <[email protected]> |
On 8/8/06, Anahide Tchertchian <[email protected]> wrote: > Hi, > > Sorry for answering so late... Well, CPSSchemas is not the way to go in > my point of view, CPSRelation is way more adapted to this kind of > feature, but if it's working for you this way, good :) Sure. The main reason to work with CPSSchemas is that I want an administrator be able to define relation fields, just saying "the field customer of the invoice schema will be a reference to an object with portal_type='Customer' " CPSRelation is probably a better way, but needs some programming on each new type of objects using relations, and doing it in CPSSchemas allows an advanced user to define new types an relations on its own. > Anyway, I'm just going to give some information about CPSRelation features. > Great, thanks > > Note that there are several types of graphs used in CPSRelation, storage > can be done in IOBTree structure or in any kind of backend provided by > the Redland framework (bdb, mysql, postrgesql for instance). > I think it would not be so difficult to add an sql graph if you'd like > to do it your own way. > Umm, this could be interesting to implement MN Relationships. Thanks for the information. > > The CPSComment product uses CPSRelation to store relations between > documents: a document is commented, its comment is actually stored in > portal_comments (and not in the hierarchy of workspaces and sections), > and the two documents are linked via CPSRelation. > The document docid is used as an identifier. > > Some additional relations can be added between comments (to state that a > comment is a reply to another one for instance). > > When comments or commented documents are deleted, Z3 events allow to > delete now useless relations. > I have implemented the opposite feature. When a dead document (with no proxies) is related with a live document, at least last revision of the document should remain in the portal_repository, so its information could be viewed from the live document. When all referencing objects are also dead, then the documents could be purged from the repository. > The default graph is an IOBTree graph to allow users to use the product > without having to install the Redland framework. > > A commit hook has also recently been added to be able to add/remove > relations at the end of the transaction (this is not used for CPSComment > as relations are used to control security set on the comment, so the > relation set is needed before the end of the transaction). > Cool !! This could be very useful to me. Thanks again > If you want to have a look at it, I would advise to checkout the > abstraction branches of the products: CPSRelation has refactored to be > able to switch from a type of graph to another one without having to > change third party code. See: > > https://svn.nuxeo.org/pub/CPS3/products/CPSRelation/branches/abstraction > https://svn.nuxeo.org/pub/CPS3/products/CPSComment/branches/abstraction > > Note that to comment a document, you have to allow discussion on it > (edit this on the metadata page). > > I'll take a look Thanks a lot for your answers -- Santi Camps Earcon S.L. - http://www.earcon.com - http://www.kmkey.com _______________________________________________ cps-devel mailing list http://lists.nuxeo.com/mailman/listinfo/cps-devel