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.