Using ezc PersistentObject in eZ Publish extension

Author Message

Nabil Imran

Tuesday 13 October 2009 2:36:41 am

Hello,

I'm working on an eZ Pulish extension, that handles some complex data within its own database tables.
As the table structure is kinda complex, I want to use some kind of an object relational mapping api. As eZ Components is already part of eZ Publish and contains a component for that (PersistentObject) I decided to make use of that.

Now I'm kinda stuck, unsure where I should start.
Where should I put the mapping files and relation definitions? Is there a place for that already in eZ Publish (I think so, because eZ Publish uses PersistenObject component itself).

The eZ Component documentation does not say anything about where to put the files.

- How can I start?
- Where put mapping and relation files?
- How can I make sure the files are loaded if (and only if) needed?
- (How) can I make use of already existing PersistenSession from eZ Publish?
- Is what I'm planning to do recommented anyhow? Anyone done that before?
- Best practises?

Thank you very much for help any Hint!

André R.

Tuesday 13 October 2009 4:49:32 am

eZ Publish does not use ezcPersistentObject yet, it uses eZPersistentObject the eZ Publish equivalent. Search for " extends eZPersistentObject" to see some 110+ examples of use.

eZ Online Editor 5: http://projects.ez.no/ezoe || eZJSCore (Ajax): http://projects.ez.no/ezjscore || eZ Publish EE http://ez.no/eZPublish/eZ-Publish-Enterprise-Subscription
@: http://twitter.com/andrerom

Nabil Imran

Tuesday 13 October 2009 5:45:19 am

Hmm ok..

So can you in short state what is the main difference between ezc PersistenObject and eZ Publish equivalent?

You said it doesn't use it "YET". is that planned?. Does that mean ezc library is more powerful and recommendet to use?

I'm new to both and for me it seems, that I should go for the ezc library. Or would that cause problems incompatibilities with the eZ Publish lib?

Thank you for some more information here, I'll also do more research on my own in mean time.

Piotrek Karaś

Tuesday 13 October 2009 8:49:32 am

So can you in short state what is the main difference between ezc PersistenObject and eZ Publish equivalent?
You said it doesn't use it "YET". is that planned?. Does that mean ezc library is more powerful and recommendet to use?
I'm new to both and for me it seems, that I should go for the ezc library. Or would that cause problems incompatibilities with the eZ Publish lib?

eZ Components are independent application components that stand a project separate from eZ Publish for now, but are likely to become the building foundation of future releases of eZ Publish if it gets partially/fully re-factored. Currently eZ Publish natively uses eZPersistentObject and it may be more fully integrated with the system (for example support for function attributes which can be used when accessing the objects/variables in the template layer). I would expect eZC version to be more interesting as it fully incorporates PHP5 object oriented architecture (vs. a rather basic OO in current eZP implementation).

eZ Publish does not use ezcPersistentObject yet, it uses eZPersistentObject the eZ Publish equivalent.

It would be possible to use it for custom extension, wouldn't it? I would only worry about sharing/duplicating database connection...

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Nabil Imran

Wednesday 14 October 2009 12:39:45 am

I would only worry about sharing/duplicating database connection... 

Thats exactly what I thought. I don't even know if that is possible. Next to the side effects it might cause...
I'm still investigating on that..

Does anyone know more about that?.

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 11:28:16
Script start
Timing: Jan 18 2025 11:28:16
Module start 'layout'
Timing: Jan 18 2025 11:28:16
Module start 'content'
Timing: Jan 18 2025 11:28:17
Module end 'content'
Timing: Jan 18 2025 11:28:17
Script end

Main resources:

Total runtime0.6865 sec
Peak memory usage4,096.0000 KB
Database Queries65

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0056 588.0469152.6406
Module start 'layout' 0.00560.0037 740.687539.4922
Module start 'content' 0.00930.6757 780.1797622.6484
Module end 'content' 0.68500.0014 1,402.828116.1250
Script end 0.6865  1,418.9531 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.4597160.0002
Check MTime0.00130.1849160.0001
Mysql Total
Database connection0.00080.120310.0008
Mysqli_queries0.620790.4154650.0095
Looping result0.00060.0921630.0000
Template Total0.653595.220.3268
Template load0.00210.308420.0011
Template processing0.651494.881820.3257
Template load and register function0.00020.023910.0002
states
state_id_array0.00110.164210.0011
state_identifier_array0.00130.188820.0006
Override
Cache load0.00180.2662400.0000
Sytem overhead
Fetch class attribute can translate value0.00070.102730.0002
Fetch class attribute name0.00120.171680.0001
XML
Image XML parsing0.00320.468230.0011
class_abstraction
Instantiating content class attribute0.00000.0032100.0000
General
dbfile0.00260.3789300.0001
String conversion0.00000.001540.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
5content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 28
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs