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

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.