Forums / Developer / Class specification import

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/

eZ debug

Timing: Jan 18 2025 18:34:55
Script start
Timing: Jan 18 2025 18:34:55
Module start 'content'
Timing: Jan 18 2025 18:34:56
Module end 'content'
Timing: Jan 18 2025 18:34:56
Script end

Main resources:

Total runtime1.0346 sec
Peak memory usage4,096.0000 KB
Database Queries199

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0066 588.8438180.8438
Module start 'content' 0.00660.8917 769.6875601.7500
Module end 'content' 0.89830.1362 1,371.4375337.3750
Script end 1.0345  1,708.8125 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00390.3813210.0002
Check MTime0.00150.1404210.0001
Mysql Total
Database connection0.00110.105410.0011
Mysqli_queries0.959592.74201990.0048
Looping result0.00200.19621970.0000
Template Total1.006797.320.5034
Template load0.00210.202120.0010
Template processing1.004697.102820.5023
Template load and register function0.00010.009610.0001
states
state_id_array0.00130.129910.0013
state_identifier_array0.00130.122820.0006
Override
Cache load0.00180.1734270.0001
Sytem overhead
Fetch class attribute can translate value0.00130.123040.0003
Fetch class attribute name0.00110.106170.0002
XML
Image XML parsing0.00190.184740.0005
class_abstraction
Instantiating content class attribute0.00000.001480.0000
General
dbfile0.00340.3324400.0001
String conversion0.00000.000630.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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