Forums / Developer / Building Class Hierarchies

Building Class Hierarchies

Author Message

Tristan Koen

Thursday 12 June 2003 6:50:04 am

Hi All,

Is it possible to build class hierarchies in ezPublish? If I create two classes, A and B, I want to build them so that instances of B can only have an instance of A as a parent. Very much like a foreign key relationship in an RDBMS.
I could simulate this behaviour using related objects, but I cannot enforce the relationship which doesn't help.

Bruce Morrison

Thursday 12 June 2003 4:28:46 pm

You can do this using permissions. Configure the system so that you can only create a class B for parents of class A.

Class A acts like a "folder" having child content of class B.

Cheers
Bruce
designIT

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

Tristan Koen

Friday 13 June 2003 1:22:55 am

Hi Bruce.

Thanks for the answer, but you have really confused me. Where you say "Class A acts like a "folder" having child content of class B", that is exactly what I want, but I don't understand your reasoning.

My understanding is as follows:
1. Create class A and class B. Class B will have a "related object" attribute that will be used to make the link to A.
2. In the admin interface, create a new role called ABhierarchy for arguments' sake.
3. The role would make the following restriction:
- Module: content (you can't do all of them which makes me wonder why there is an 'All' option in the first place).
- Function: create
- Class: B
- Section: Any
- Parent Class: A
4. Apply this role to all of your users?

The problem with this approach is that the restriction is placed on the user, not on the data itself. I realise that the two are somewhat equivalent from a practical point of view, but it is possible that a mis-configured user could make a big mess. If you mean something else, please explain. I am getting horribly stuck here.

I would also like to have a data structure where an arbitrary number of objects of Class B can be created as children of object A.

Thanks

Tristan

eZ debug

Timing: Jan 30 2025 21:13:28
Script start
Timing: Jan 30 2025 21:13:28
Module start 'content'
Timing: Jan 30 2025 21:13:28
Module end 'content'
Timing: Jan 30 2025 21:13:29
Script end

Main resources:

Total runtime0.2979 sec
Peak memory usage8,192.0000 KB
Database Queries141

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0093 587.9297370.2969
Module start 'content' 0.00930.0133 958.22661,001.5156
Module end 'content' 0.02270.2751 1,959.74223,889.8125
Script end 0.2978  5,849.5547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00481.6261200.0002
Check MTime0.00130.4444200.0001
Mysql Total
Database connection0.00100.330710.0010
Mysqli_queries0.200867.42001410.0014
Looping result0.00120.41761390.0000
Template Total0.274792.210.2747
Template load0.00080.258210.0008
Template processing0.273991.967810.2739
Override
Cache load0.00050.181910.0005
Sytem overhead
Fetch class attribute can translate value0.00170.574110.0017
XML
Image XML parsing0.00020.077610.0002
General
dbfile0.00782.6078200.0004
String conversion0.00000.001330.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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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