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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 31 2025 08:07:56
Script start
Timing: Jan 31 2025 08:07:56
Module start 'layout'
Timing: Jan 31 2025 08:07:56
Module start 'content'
Timing: Jan 31 2025 08:07:56
Module end 'content'
Timing: Jan 31 2025 08:07:56
Script end

Main resources:

Total runtime0.0279 sec
Peak memory usage2,048.0000 KB
Database Queries3

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0061 588.1250151.2109
Module start 'layout' 0.00610.0055 739.335936.6484
Module start 'content' 0.01160.0146 775.9844102.2500
Module end 'content' 0.02620.0017 878.234441.9922
Script end 0.0279  920.2266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00279.8113140.0002
Check MTime0.00113.7851140.0001
Mysql Total
Database connection0.00103.500610.0010
Mysqli_queries0.005619.907230.0019
Looping result0.00000.046110.0000
Template Total0.00124.210.0012
Template load0.00103.433110.0010
Template processing0.00020.705810.0002
Override
Cache load0.00072.423110.0007
General
dbfile0.007827.920080.0010
String conversion0.00000.032540.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 1
 Number of unique templates used: 1

Time used to render debug report: 0.0001 secs