How do I know that the user leaves an edited object for good?

Author Message

Gabriel Ambuehl

Friday 04 February 2005 5:40:03 am

I'm working on a custom datatype that needs to store some information in the session. However, I need that information to be deleted after the user stops editing the current object (it
needs to stay if he goes browsing for related objects and the like) by either publishing or explicitely saving the draft.

How do I know that from inside a datatype?

Visit http://triligon.org

Lazaro Ferreira

Friday 04 February 2005 7:09:33 am

Hi,

I only know one way to do it, programming an extension that check DRAFT and PUBLISH content actions and decide what to do with the session data, i.e : destroy session variables

On the other hand you may also have code that start new session variables when content object is created( don't remember which content action is)

Lazaro
http://www.mzbusiness.com

Gabriel Ambuehl

Friday 04 February 2005 7:18:35 am

If that's really the only way (and there's not a POST variable or some such that indicates this reliably) I'll rather find another way to keep state ;-). It's only a list of ints anyhow, so I can put them on the form too.

Visit http://triligon.org

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 19 2025 06:13:43
Script start
Timing: Jan 19 2025 06:13:43
Module start 'layout'
Timing: Jan 19 2025 06:13:43
Module start 'content'
Timing: Jan 19 2025 06:13:44
Module end 'content'
Timing: Jan 19 2025 06:13:44
Script end

Main resources:

Total runtime0.8851 sec
Peak memory usage4,096.0000 KB
Database Queries57

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0070 589.4141152.6563
Module start 'layout' 0.00700.0042 742.070339.5078
Module start 'content' 0.01120.8728 781.5781494.6328
Module end 'content' 0.88400.0011 1,276.21098.2500
Script end 0.8851  1,284.4609 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.3581160.0002
Check MTime0.00130.1462160.0001
Mysql Total
Database connection0.00110.125710.0011
Mysqli_queries0.845195.4782570.0148
Looping result0.00050.0553550.0000
Template Total0.849796.020.4248
Template load0.00200.223120.0010
Template processing0.847795.770320.4238
Template load and register function0.00010.011410.0001
states
state_id_array0.00250.288110.0025
state_identifier_array0.00080.087620.0004
Override
Cache load0.00160.1771120.0001
Sytem overhead
Fetch class attribute can translate value0.00040.049420.0002
Fetch class attribute name0.00080.089830.0003
XML
Image XML parsing0.00020.022520.0001
class_abstraction
Instantiating content class attribute0.00000.001030.0000
General
dbfile0.00080.0861100.0001
String conversion0.00000.001640.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/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/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: 9
 Number of unique templates used: 5

Time used to render debug report: 0.0001 secs