Class specification import

Author Message

Eirik Alfstad Johansen

Monday 01 November 2010 8:59:37 am

Hi guys,

Whenever we're working on a project, we start off by defining the classes we'll use, and their attributes with associated datatypes to get a clear overview of the project. We're now looking for a way to create a specification which we can then later import directly into eZ to create new classes, and/or modifiy existing ones. This would also be especially useful for projects where the the class structure changes during the project build, and where several developers have their own instance of the installation.

We have a pretty good idea of how we would go about doing something like this, but before we get cracking we were wondering if anyone had done anything similar in the past.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

Gaetano Giunta

Monday 01 November 2010 3:14:51 pm

Classes can be imported and exported natively using the Pacakging system (but objects of a given class will not be updated if you import an updated class definition).

Elsewhere in the forums I have written a code snippet for a cronjobs that checks if class definitions have changed since the last time and, when so, creates a new version of a package with definition of all classes.

The ezxmlinstaller extension can probably already do what you need (eg. class import with content upgrade).

The ggsysinfo extension in its latest version has a nice printable report with definition of all classes that can be saved as part of project documentation.

There are probably other extensions doing something silmilar...

Principal Consultant International Business
Member of the Community Project Board

Heath

Monday 01 November 2010 3:27:10 pm

Hello Eirik,

Normally I would use the package system for this task.

Though I am just a bit curious what you come up with instead.

Please remember to share the solution you end up going with.

Cheers,

Heath

Brookins Consulting | http://brookinsconsulting.com/
Certified | http://auth.ez.no/certification/verify/380350
Solutions | http://projects.ez.no/users/community/brookins_consulting
eZpedia community documentation project | http://ezpedia.org

Eirik Alfstad Johansen

Monday 08 November 2010 6:31:48 am

Hi guys,

Thanks for weighing in. I too have thought about the package system, but I do not completely trust it. Allthough its early kinks seems to have been ironed out, I'm not sure how it would handle modifications to an existing class and, for instance, the order ot its attributes. Also, packages are created from existing content classes, and since I won't be having on of those, but rather a specification of it, the code envolved in producing the package might make the project unreasonably time consuming.

I might end up creating and checking the content classes directly towards the eZContentClass class.

Sincerely,

Eirik Alfstad Johansen
http://www.netmaking.no/

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 21:14:39
Script start
Timing: Jan 18 2025 21:14:39
Module start 'layout'
Timing: Jan 18 2025 21:14:39
Module start 'content'
Timing: Jan 18 2025 21:14:40
Module end 'content'
Timing: Jan 18 2025 21:14:40
Script end

Main resources:

Total runtime0.9021 sec
Peak memory usage4,096.0000 KB
Database Queries62

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 587.9141152.6250
Module start 'layout' 0.00560.0027 740.539139.4531
Module start 'content' 0.00830.8921 779.9922596.6719
Module end 'content' 0.90040.0016 1,376.664116.1641
Script end 0.9020  1,392.8281 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00350.3934160.0002
Check MTime0.00130.1481160.0001
Mysql Total
Database connection0.00130.140710.0013
Mysqli_queries0.844593.6168620.0136
Looping result0.00060.0683600.0000
Template Total0.870196.520.4350
Template load0.00210.234520.0011
Template processing0.867996.218920.4340
Template load and register function0.00010.012710.0001
states
state_id_array0.00180.200010.0018
state_identifier_array0.00110.125820.0006
Override
Cache load0.00180.1960270.0001
Sytem overhead
Fetch class attribute can translate value0.00100.106330.0003
Fetch class attribute name0.00130.144670.0002
XML
Image XML parsing0.00130.139630.0004
class_abstraction
Instantiating content class attribute0.00000.001580.0000
General
dbfile0.00210.2275290.0001
String conversion0.00000.000640.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
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/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: 14
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs