Forums / Developer / Multiple Object creation

Multiple Object creation

Author Message

Vincent Saulnier

Thursday 28 August 2003 11:56:15 am

When a user create an Object from a class, is there a way to force the creation of an other object of a different class?

I need to do a step by step way of creating objects!

Vincent Saulnier

Friday 29 August 2003 10:49:19 am

Anybody?

Paul Forsyth

Friday 29 August 2003 11:08:25 am

Can you give a clearer example of what you want to do here?

thanks

paul

Vincent Saulnier

Friday 29 August 2003 11:21:24 am

I'll first explain why I want to do this.

I'm creating a system for Printer companies. With this system, they will be able to manage their company like (RequestForQuotes, Quotes, Clients, Process, etc.) Right now I'm working on the Request for quotes and quotes section. I want to use ezcontentobjects as different quotes requestObjects for different Request needs (posters, company papers, cards, etc.). But using only one class for the objects is too slow because of the complexity of such quotes. So I decided to divide this class in smaller ones and build a step by step process.

Basically, what I want is to be able to force the client to create :
1. Class General Info
2. Class Cover
3. Class Binding
4. Class Shipping

From the first one to the last one in a step by step way.

Paul Forsyth

Sunday 31 August 2003 4:18:22 am

Thats similar to what i would like to see. For a particular class you would be to have related classes, and when you came to create an object from it you would automatically get related objects.

Unfortunately, at the moment you cannot do this with ez.

ez crew, any plans for something like this?

The new ezmatrix datatype in v3.2 is a small start but needs work as you can only define instances of matrices when the object is created, not per class which would be infinitely more useful.

paul

Paul Borgermans

Sunday 31 August 2003 7:47:27 am

This sounds like a workflow job to me. With related objects lists you can add the in-line, but that's not what you want.

I think a new workflow event type should be made which (when defining it):

- lets you choose the "master" object class for which to trigger the next workflow event (can already be done with the multiplexer event type)
- lets you choose which class the new object should be
- let you define the placement of this object (most useful would be as a child of the "master" object I guess)
- should be followed by a publish (or approve) event.

In short: this would be a very general purpose and useful new workflow event.

Who starts writing it?

-another paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Forsyth

Monday 01 September 2003 8:29:56 am

Mmm, sounds interesting. I havent used the workflow mechanism for anything too complex yet.

Could this somehow be integrated into class creation? This is the ideal place to have related classes I think. I am a touch worried that this type of functionality would be limited to being run from only the workflow section in the admin.

Paul

Paul Borgermans

Monday 01 September 2003 9:00:49 am

Hi Paul

In theory this is 50% possible:

- I can't see object creation of a "special" class be able to trigger a workflow
- However, one could setup a general workflow event which checks for certain attributes (like class dependence) and which "forces" the creation of dependent objects from certain other classes. This can intrinsically be made recursive (class A forces creation of class B objects which forces the creation of class C objects).

I want this too since the idea of having a "super class" where attributes are treated in chunks through a workflow is perhaps not that nice: it means a workflow event to be created for every new class that falls under such a scenario.

Instead I think its better to create child objects of a certain classes which hold (meta-) data through a generalised workflow process. This would involve a new datatype which contains a selector which relates to one ore more other classes from which to create child objects. The selector should be tied either to another attribute or behave more or less like an enum datatype (think book, article, poster which lead to different kinds of child objects).

I should know how to do it since Jo Henrik teached me the basics to do so ;-) ... Where is that clone machine?

-paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

Paul Forsyth

Monday 01 September 2003 12:54:17 pm

Paul,

I do like the idea of a datatype as the basis for class relations.

A configuration .ini file could contain information about where related classes would be created; a child of the object being created would be good default as you have said.

When creating the new object it may even be possible to tie the children of the parent into other objects that exist within the database, in effect converting a related class list into a related object list, with the need of creating further objects. The admin interface may present existing objects that are of the same class as those specified by the class definition.

Paul, i think you have more experience of the new datatypes :) Can you say if either the selector or matrix datatype is suitable as a starting point for this? I think this is probably a 'start from scratch' datatype.

Does a workflow fit into this process? Generally a workflow should be something to be controlled by an admin, editor or user. I think this may be a fundamental function of the kernel class system and so shouldn't be subject to user control, except by ini file perhaps. Maybe im not understanding your workflow concept, im not a big user of them yet. Can you explain this further? thanks :)

Ez, are you following this thread? Have you plans along these lines for post 3.2?

Paul

Paul Forsyth

Tuesday 02 September 2003 12:28:09 am

Reading Björn's post:

http://ez.no/developer/ez_publish_3/forum/developer/help_related_objectsrelationassignmentsettings

I tried out the related object list and it is close to what we need. When created you can choose which classes should be listed when the object is created. It is up to the user to then choose to create objects of the selected classes if they want them...

I think it needs more work as when i tested i could only see an option to create articles, not folders, nor my new classes. Also, the creation of a new article uses a new form of inline object creation, a bit strange...

Ez, could we see some design documentation for this datatype?

Has anyone else been playing with this datatype?

Paul

Kai Duebbert

Friday 05 September 2003 2:07:41 am

Hmm.. The problem sounds interesting. I think the solution that I used for linking objects together might help. I documented it here: http://www.ez.no/developer/ez_publish_3/documentation/customization/components/datatypes/ezobjectrelation/selecting_related_objects_with_dropdown_boxes_checkboxes_etc

It solved the following situation:
1. You have several objects of class A in folder F.
2. You have a class B with related object attributes.
3. The user creates a new object of class B and gets all objects which are in folder F (and which he has permission to) as a dropdown box to link to. Simple fetch function, so you can select which ones he can link to.

So, you could do the following workflow controlled through template programming:
1. User has option to create object "General Info"
2. User gets new option (or is forced) to create object "Cover" which has in a hidden attribute a related link to the first object (fetch function)
3. User gets new option (or is forced) to create object "Binding" which has hidden attribute with the two related link to "general info" and "cover"
4. User gets new option (or is forced) to create object "Shipping" which has hidden attributes with realted links to the above objects.

It should be possible like this, but is a bit complicated on the template programming side. It can be done in one template.

The usage of related object links is really powerful and opens new possibilities without programming new datatypes (which I first did until I found the better solution).

Hope this helps a bit.

Kai

Fraser Hore

Saturday 17 April 2004 5:54:44 am

This is a fantastic feature! Did anyone ever come up with a final solution?

Cheers,

Fraser

eZ debug

Timing: Jan 18 2025 16:24:17
Script start
Timing: Jan 18 2025 16:24:17
Module start 'content'
Timing: Jan 18 2025 16:24:18
Module end 'content'
Timing: Jan 18 2025 16:24:18
Script end

Main resources:

Total runtime0.8783 sec
Peak memory usage4,096.0000 KB
Database Queries227

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0053 588.8281180.8359
Module start 'content' 0.00530.7410 769.6641763.2813
Module end 'content' 0.74630.1319 1,532.9453353.3125
Script end 0.8782  1,886.2578 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00410.4682210.0002
Check MTime0.00160.1812210.0001
Mysql Total
Database connection0.00070.080610.0007
Mysqli_queries0.787989.71502270.0035
Looping result0.00240.27002250.0000
Template Total0.853997.220.4270
Template load0.00200.222420.0010
Template processing0.852097.009020.4260
Template load and register function0.00030.031910.0003
states
state_id_array0.00120.137910.0012
state_identifier_array0.00100.111620.0005
Override
Cache load0.00180.2085880.0000
Sytem overhead
Fetch class attribute can translate value0.00210.241760.0004
Fetch class attribute name0.00110.1283140.0001
XML
Image XML parsing0.00180.206060.0003
class_abstraction
Instantiating content class attribute0.00000.0032150.0000
General
dbfile0.00240.2764340.0001
String conversion0.00000.000730.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
12content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
17content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
5content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 39
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs