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

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 18 2025 17:42:31
Script start
Timing: Jan 18 2025 17:42:31
Module start 'layout'
Timing: Jan 18 2025 17:42:31
Module start 'content'
Timing: Jan 18 2025 17:42:33
Module end 'content'
Timing: Jan 18 2025 17:42:33
Script end

Main resources:

Total runtime1.0962 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0062 587.9141152.6250
Module start 'layout' 0.00620.0033 740.539139.4453
Module start 'content' 0.00961.0851 779.9844534.1328
Module end 'content' 1.09470.0014 1,314.117212.1641
Script end 1.0961  1,326.2813 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.3776160.0003
Check MTime0.00140.1263160.0001
Mysql Total
Database connection0.00070.062510.0007
Mysqli_queries1.043095.1537570.0183
Looping result0.00060.0537550.0000
Template Total1.051295.920.5256
Template load0.00180.161620.0009
Template processing1.049495.733420.5247
Template load and register function0.00020.019210.0002
states
state_id_array0.00840.770410.0084
state_identifier_array0.00120.111720.0006
Override
Cache load0.00140.1313300.0000
Sytem overhead
Fetch class attribute can translate value0.00050.044720.0002
Fetch class attribute name0.00110.098940.0003
XML
Image XML parsing0.00070.063520.0003
class_abstraction
Instantiating content class attribute0.00000.000740.0000
General
dbfile0.00110.0996160.0001
String conversion0.00000.000740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
6content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 15
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs