how to make page for editing multiple objects?

Author Message

Vytautas Germanavičius

Friday 26 August 2005 12:44:23 am

I need to update prices for all products in my shop.
For doing this i need to open every time all product, one by one.
This takes so much time, that i must start new update after i finish current...

{set-block scope=root variable=cache_ttl}0{/set-block}

Bertrand Dunogier

Sunday 28 August 2005 10:57:39 am

You can't do that out of the box. eZ is based on the node approach, e.g. you edit one node at a time, and a node contains one object.

You will probably have to write a custom extension for that. Have a look at the files in kernel/content/, for instance edit.php, and build an extension based on that... the API is very good, so you should be able to achieve that.

Gabriel Ambuehl

Sunday 28 August 2005 12:16:07 pm

I think you actually can (as I did essentially did that in the enhanced object relation extension).

Try calling node_view_gui edit for multiple nodes at a time and see what happens.

If that doesn't work, look dig thru my code to see however I managed to do that back then (sorry, cant remember)

Visit http://triligon.org

Xavier Dutoit

Sunday 28 August 2005 11:55:59 pm

Plan B: export all your products into a format you can modify (csv or xml), changes the prices on this file and import it.

I don't know if the contribs doing import/export are able to handle versionnning, but shouldn't be too complicated to add if it isn't the case.

X+

http://www.sydesy.com

Mazen Alsibai

Monday 29 August 2005 7:04:11 am

Hi:
i think that we are in the same boat,we are trying to do that also,i am trying to work using the hint of Gabriel ,and i hope together we can find a solution ;-)
i think that editing multible objects in the same page is possible somehow,but then how to save these objects?
can anyone tell me?

Bertrand Dunogier

Monday 29 August 2005 10:32:13 am

Actually Gabriel is right, I've answered too fast, sorry about that :)

If you can find some formal infos about how to do that I'm definitely interested !

Gabriel Ambuehl

Tuesday 30 August 2005 12:51:21 am

You'll likely need some extra PHP code to handle submission of multiple classes. It's in the eor code (related to the addition and edits on newly created relations), I just can't remember where exactly ;).

I originally took it from object relation list (which can do it too to some extent), BTW but I think I changed it to some extent.

Visit http://triligon.org

Aladdin Mouhaimeed

Wednesday 07 September 2005 7:07:05 am

I think the problem can be solved if we could solve this partial one:
edit two separate objects simultaneously, make all fields from both objects in the same form,
and then save draft for both of them.
This is my problem right now, I believe everything will be so easy if I could save draft for the two object in one button click.

Lex 007

Wednesday 07 September 2005 7:22:47 am

I would personnaly use plan B from Xavier :)

You could then write a custom cronjob to handle this, and manage the configuration (list of objects/prices) with a custom web interface.

Aladdin Mouhaimeed

Wednesday 07 September 2005 12:43:50 pm

Well, you are right to suggest this,
But in fact I have nothing to do with updating prices.
My goal is totaly different,
What I need is really to edit two or more objects and save them by only clicking on one save button.( maybe I'd better start a separate thread for this edia ;) ).

Now, what do you think about saving draft of two ojbects???

Thank you

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

eZ debug

Timing: Jan 18 2025 22:30:07
Script start
Timing: Jan 18 2025 22:30:07
Module start 'layout'
Timing: Jan 18 2025 22:30:07
Module start 'content'
Timing: Jan 18 2025 22:30:08
Module end 'content'
Timing: Jan 18 2025 22:30:08
Script end

Main resources:

Total runtime0.7662 sec
Peak memory usage4,096.0000 KB
Database Queries88

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0043 588.0469152.6406
Module start 'layout' 0.00430.0028 740.687539.4766
Module start 'content' 0.00710.7576 780.1641787.8984
Module end 'content' 0.76470.0014 1,568.062520.1250
Script end 0.7662  1,588.1875 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.4254160.0002
Check MTime0.00140.1793160.0001
Mysql Total
Database connection0.00050.068910.0005
Mysqli_queries0.693990.5653880.0079
Looping result0.00100.1247860.0000
Template Total0.729595.220.3647
Template load0.00210.268020.0010
Template processing0.727494.937620.3637
Template load and register function0.00010.016810.0001
states
state_id_array0.00230.303610.0023
state_identifier_array0.00170.222820.0009
Override
Cache load0.00180.2359460.0000
Sytem overhead
Fetch class attribute can translate value0.00070.091070.0001
Fetch class attribute name0.00190.2479130.0001
XML
Image XML parsing0.00200.257370.0003
class_abstraction
Instantiating content class attribute0.00000.0022130.0000
General
dbfile0.00100.1287280.0000
String conversion0.00000.001340.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
10content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
10content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 29
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs