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

eZ debug

Timing: Jan 19 2025 21:20:08
Script start
Timing: Jan 19 2025 21:20:08
Module start 'content'
Timing: Jan 19 2025 21:20:09
Module end 'content'
Timing: Jan 19 2025 21:20:09
Script end

Main resources:

Total runtime0.8071 sec
Peak memory usage4,096.0000 KB
Database Queries205

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0068 589.2109180.7969
Module start 'content' 0.00680.6826 770.0078626.7734
Module end 'content' 0.68940.1176 1,396.7813341.0234
Script end 0.8070  1,737.8047 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00400.4970210.0002
Check MTime0.00150.1819210.0001
Mysql Total
Database connection0.00060.077410.0006
Mysqli_queries0.717388.87532050.0035
Looping result0.00220.27422030.0000
Template Total0.779996.620.3899
Template load0.00190.233320.0009
Template processing0.778096.394120.3890
Template load and register function0.00020.030710.0002
states
state_id_array0.00090.116910.0009
state_identifier_array0.00070.083520.0003
Override
Cache load0.00170.2087420.0000
Sytem overhead
Fetch class attribute can translate value0.00190.233240.0005
Fetch class attribute name0.00110.132490.0001
XML
Image XML parsing0.00470.577340.0012
class_abstraction
Instantiating content class attribute0.00000.0028120.0000
General
dbfile0.00780.9625400.0002
String conversion0.00000.001030.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
6content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
6content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs