Class extensions

Author Message

Sao Tavi

Wednesday 23 March 2011 5:30:51 pm

This is something that I came across and it could be pretty useful. The implementation would not be tricky, but the results should be pretty rewarding in putting the URLs in order.

So, my proposal is class extensions. That is the possibility to create extensions for specific classes.

For example, let's consider we want to create with eZ Publish a wiki. Each wiki page (class 'wiki_page') should have a discussion forum (module forum extends class wiki_page). We would like to access this forum by the URL modern-engine/wiki/my-topic/discussion and not with discussion/topic_id or modern-engine/wiki/my-topic/(discussion) (I don't actually know if the last one is correct, I am still learning eZ Publish).

The second example: we have a class user that will contain user data. The URL to access elements of this class would be users/{username}. I would like to extend this class with module (let's say we have a gaming website) high-scores, so everyone can see the user's high-scores. Or, let's say we access the list with his forum activity, article written, rated articles, a photo album and so on. Yes, I agree, using the user's id we can still do that, but that is like programming with arrays and using the keys to identify the correlated data instead of using objects.

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 01:10:23
Script start
Timing: Jan 18 2025 01:10:23
Module start 'layout'
Timing: Jan 18 2025 01:10:23
Module start 'content'
Timing: Jan 18 2025 01:10:24
Module end 'content'
Timing: Jan 18 2025 01:10:24
Script end

Main resources:

Total runtime0.9372 sec
Peak memory usage4,096.0000 KB
Database Queries46

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 587.7969152.6094
Module start 'layout' 0.00530.0035 740.406339.4375
Module start 'content' 0.00880.9271 779.8438400.7656
Module end 'content' 0.93590.0013 1,180.60948.1875
Script end 0.9371  1,188.7969 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.3282160.0002
Check MTime0.00130.1361160.0001
Mysql Total
Database connection0.00060.062710.0006
Mysqli_queries0.903396.3847460.0196
Looping result0.00050.0492440.0000
Template Total0.907096.820.4535
Template load0.00220.236620.0011
Template processing0.904796.540620.4524
Template load and register function0.00020.025610.0002
states
state_id_array0.00100.104310.0010
state_identifier_array0.00160.167520.0008
Override
Cache load0.00170.178870.0002
Sytem overhead
Fetch class attribute can translate value0.00060.062010.0006
Fetch class attribute name0.00060.063610.0006
XML
Image XML parsing0.00010.010610.0001
class_abstraction
Instantiating content class attribute0.00000.000410.0000
General
dbfile0.00070.0758100.0001
String conversion0.00000.001040.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
1content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 4
 Number of unique templates used: 4

Time used to render debug report: 0.0001 secs