Forums / Developer / Automatically location assignment when creating new object?

Automatically location assignment when creating new object?

Author Message

liu spider

Monday 20 December 2004 7:03:22 pm

I wonder whether it is possible to assign more than one default locations when creating new object.

What I want to implement is: As some "folder" has more than one locations in the content tree, when I add "article" to one place of a folder, I hope the article could be automatically placed under the other places of its parent folder.

I have a look at the code of eZ, and can not find any special code for this purpose. Do you think this is possible? Or is there any other better approach?

Thanks in advance.

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Xavier Dutoit

Tuesday 21 December 2004 1:19:37 am

It isn't very complicated to create an event for a workflow that does that (tiggered content post publication).
On the event, check that the object is from the proper class or has the proper main parent, then add it elsewhere on the content tree (if it isn't there already).

Gook luck.

X+

http://www.sydesy.com

liu spider

Tuesday 21 December 2004 8:40:05 am

thanks a lot for your tip. I will have a try.

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

Paul Borgermans

Tuesday 21 December 2004 12:41:39 pm

Hi

I think this should be possible to implement in a dedicated edit template file. You have the parent node available in $node, so you just need to add the other locations if they are not yet defined.

Edit template tuning can be a bit of a pain if you have not done it yet, but you can do a lot there

hth

-paul

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

liu spider

Tuesday 21 December 2004 5:35:47 pm

Hi Paul,
Do you think it is possible for me to add several node ids into a input field (or maybe an array), so when I create a new object, it will be placed under all the other places?

That sounds good...

However, if under all circumstances, I want the behavior stated in the top floor, which do you think is a better way? a dedicated tpl or a customized workflow?

Thanks.

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd

liu spider

Tuesday 21 December 2004 7:00:47 pm

The eventype is almost done, however I can not figure out how to add a question before actually do the trick.

I follow the example here:
http://www.ez.no/ez_publish/documentation/development/extensions/workflow_events/wrapping_event

However, use the technique there, it seems after I click the "next" button, the workflow can not be resumed.

(I did return EZ_WORKFLOW_TYPE_STATUS_FETCH_TEMPLATE_REPEAT in the execute function)

According to the doc above, the form action should be requestURI (which is in fact "/content/edit/node_id/version"), however, after I click the "next" button, I was redirected to /content/versions/node_id/version : it seems to me that eZ forgot all about the unfinished workflow.

Could someone tell me what the form action should look like if I want to continue with the unfinished workflow/event? Or did I miss some post variables in the form body?

(I can not find a working sample, so asking it here is the only left choice)

Thanks.

http://liucougar.scim-im.org
SCIM Input Method Platform
http://scim.sf.net
SJSD Online Editor
http://sf.net/projects/sjsd