Forums / Setup & design / Mapping a Composition

Mapping a Composition

Author Message

Michael Zeidler

Sunday 29 January 2006 2:07:01 pm

I want to set up a composition regarding the classes acting as a container. This should be set up as a rule/policy. The scenario is that a class is definied as a container which can only contain object instances of another certain class. Also the objects residing within the container should never be able to be instantiated outside the container.
Let say, I definied a class car which is acting as a container for objects like a wheel. Objects of the class wheel can only reside within a car-object. The other way: When deciding to create an object the selection besides the "creat-here"-button should only contain the wheel-class.

You can determine a rule/policy that a content-object of a specific class can only be child of another class by setting its parent-class. So you can define this for a wheel to be a subitem of a car-object. But how to do this the other way, that a car-object can only contain a wheel?

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Mark Marsiglio

Sunday 29 January 2006 2:36:17 pm

I don't have the answer to your question (sorry), but do you mind answering one for me? You say that it is possible to restrict the parent class of an object...how is this done?

I have, for instance, an FAQ Question, which I would only want to allow (and preferably only show as an option) when the container class is FAQ List.

http://www.thinkcreative.com
Turning Ideas Into Strategic Solutions

Bruce Morrison

Sunday 29 January 2006 3:19:26 pm

Hi there

Firstly what we do is have a editor role that is assigned to all users that are doing content population. The Admin role is only used by "site Admins" to make configuration changes.

The Admin Role has access to all functions and create content anywhere as well as being able all other functions (like root on a unix system). The editor role has restricted permissions. This way you can allow editors to only create wheels under cars and FAQ questions within a FAQ list.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Michael Zeidler

Sunday 29 January 2006 5:20:06 pm

Hi Bruce,

you wrote that in your scenario that the editors are only able to tie a FAQ question to a FAQ list. I guess this is only possible when this restriction you mentioned is bound to a node or subtree that only a certain list of object types is allowed to be used while creating a new subitem. But what about when for instance there are different nodes where FAQ-List are tied to? This would mean that you always have to create new policies due to the new FAQ-lists created somewhere within the node-tree.
The ezsystem lacks of defining a general policy concerning to relationsships of different classes which should also be independent of roles.

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Bruce Morrison

Sunday 29 January 2006 9:40:32 pm

Hi SEAwolfx

I guess this is only possible when this restriction you mentioned is bound to a node or subtree that only a certain list of object types is allowed to be used while creating a new subitem.

I create a content classes FAQ List & FAQ question - this is what I refer to as a "feature". In addition there are "editor" permissions that define how the 2 classes interact. So where ever the editor can create the FAQ List they are able to add FAQ question children.

This method can result in quite a few content classes but makes permissions much simplier and flexiable.

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish

Michael Zeidler

Monday 30 January 2006 12:15:51 am

Bruce,
so you managed to keep the constraint that children of FAQ-list<b>s</b> can <b>only</b> be FAQ-answers and FAQ-answers can <b>only</b> been tied to FAQ-list<b>s</b> no matter where FAQ-lists are placed within the node-tree.
And the objects which can be children of an FAQ-List are <b>only</b> of the type FAQ-answers.
Would you mind to present these policies for the roles you mentioned?

-------------------------------------------------------------------------------------------
join #ezpublish on irc.freenode.org

Bruce Morrison

Monday 30 January 2006 12:27:25 am

Hiya SEAwolfx

+ 2 content classes FAQ Question & FAQ List
+ Add this rule to the editor role:

content  	 create  	 Class( FAQ Question ) , ParentClass( FAQ List )

Assumes that
+ <b>ALL</b> content population/editing is done by editors.
+ there are no other create rules that allow for FAQ Questions be be created anywhere

For completion here's the rule to allow FAQ List's to be created under Folders

 content  	 create  	 Class( Folder , Info Page , FAQ List  ) , Section( Standard section ) , ParentClass( Folder )

and you'd probably want edit & remove rules as well....

 content  	 edit  	 Class( Folder , Info Page , FAQ List  )
content  	 remove  	 Class( Folder , Info Page , FAQ List  )

Cheers
Bruce

My Blog: http://www.stuffandcontent.com/
Follow me on twitter: http://twitter.com/brucemorrison
Consolidated eZ Publish Feed : http://friendfeed.com/rooms/ez-publish