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

eZ debug

Timing: Jan 19 2025 01:11:25
Script start
Timing: Jan 19 2025 01:11:25
Module start 'content'
Timing: Jan 19 2025 01:11:27
Module end 'content'
Timing: Jan 19 2025 01:11:27
Script end

Main resources:

Total runtime1.8616 sec
Peak memory usage4,096.0000 KB
Database Queries208

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0064 588.9453180.8438
Module start 'content' 0.00641.5986 769.7891653.2266
Module end 'content' 1.60500.2566 1,423.0156345.0703
Script end 1.8616  1,768.0859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00440.2379210.0002
Check MTime0.00170.0927210.0001
Mysql Total
Database connection0.00100.053310.0010
Mysqli_queries1.750394.02052080.0084
Looping result0.00350.18922060.0000
Template Total1.824898.020.9124
Template load0.00230.125420.0012
Template processing1.822497.894420.9112
Template load and register function0.00010.006610.0001
states
state_id_array0.00090.050310.0009
state_identifier_array0.00320.170420.0016
Override
Cache load0.00210.1150520.0000
Sytem overhead
Fetch class attribute can translate value0.00270.144140.0007
Fetch class attribute name0.00120.0656100.0001
XML
Image XML parsing0.00190.102440.0005
class_abstraction
Instantiating content class attribute0.00000.0020140.0000
General
dbfile0.00610.3298380.0002
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
15content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 43
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs