Personal tools
You are here: Home Documentation Tutorials ArchGenXML 1.x- Getting started Third Party Product Integration: Relations
Support

Get Help

Join our chat rooms or support forums if you have more specific questions.

Plone Training
Learn how to design, build, and deploy a website in Plone through one of the numerous Plone training sessions around the world.
Find Plone training…
 
Document Actions

Third Party Product Integration: Relations

Create relations between portal-types model-driven. Support for Relations Product (complex references). Define sets of rules for validation, creation and lifetime of Archetypes references. ArchGenXML can generate the necessary code and XML-configuration data to use this product.

Jens W. Klein

ArchGenXML is a code-generator for CMF/Plone applications (Products) based on the Archetypes framework. It parses UML models in XMI-Format (.xmi, .zargo, .zuml), created with applications such as ArgoUML, Poseidon or ObjectDomain. This tutorial will help you get started developing applications with the aid of ArchGenXML.
Page 12 of 17.

Prerequisites

To enable Relations install the Product (code-location).

Basics

As an option on command line, up to a tagged-value on model-level or on a single UML-Association you just define the relation_implementation and set it to relations. A directed Assoziation results in one Relation.

Give the association and its assoziation ends names. They'll be used as the names for the RelationField. If you dont want a field turn it off by setting a tagged value generate_reference_fields on class (or package, model) level to 0.

Inverse Relation

If the association is not directed (navigable on both association ends) an inverse relation will be created.

The tagged-value inverse_relation_name will be used for the back-relation on undirected associations. It defaults to a relation named toend_fromend, where these are the lowercased versions of the association ends. If the two ends are named the same, then the relation will be named association_inv, where association is the name of the association. (Finally, if the option old_inverse_relation_name is set, then it defaults to the association name postfixed by _inverse.)

Cardinality

You can use the Multiplicity on in UML to define the cardinality of an Relation. You can use the minimum and maximun value here using the syntax 1..5 which means at least one relationrelated objects but not more than five.

Constraints

type-constraint
as described above an association between two portal-types will be created.
interface-constraint
an association between an archetypes class and an interface will create an interface-constraint. the relation is allowed to all classes implementing this interface.

Association classes

Association classes can be used to store data on the relation as an object. You can model it using the UML association class or using a tagged value association_class on the association.

 
by Jens W. Klein last modified September 5, 2007 - 22:12
Contributors: jensens, optilude, reinout, frisi, fifer, et al
All content is copyright Plone Foundation and the individual contributors.

For any issues with the web site functionality, please file a ticket.

Please consult the policy on plone.org content if you want your content published on this site.

Servers and hosting by