Creating Content Classes from PHP?

Author Message

Dan C

Wednesday 23 February 2005 1:07:10 pm

Hi,

I was wondering if anyone knows a way to create content classes from php or something similar? Sometimes I need to create checkboxes or dropdown lists that contain 15-20 options and click 'add item' 20 times in the browser, waiting for it to load is a huge pain in the neck. These lists wont be used more than once so theres no reason to create new datatypes for them.

It would be nice if there was a manual way to create them either by php, db manipulation, or xml import. I've tried searching and haven't been able to find any topics on this.

Anybody have any solutions?

Thanks,

Dan

Kristian Hole

Friday 25 February 2005 12:24:45 am

I think this is described how to do this in PHP in the eZ publish book. Unfortunately I don't have the book here right now, but maybe someone else do?

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Olivier Pierret

Friday 25 February 2005 2:43:45 am

Hello,

I uploaded a code extension in the contrib section of this site that allow you to upload an xml file into EZ Publish. This xml file contains a list of object value (each attribute value of each object is provided. This xml is parsed and a series of new EZ Content objects are created and published in a specific node.

This may help you

Olivier Pierret

PS you can find this contribution at http://www.ez.no/community/contribs/import_export

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:26:21
Script start
Timing: Jan 18 2025 11:26:21
Module start 'layout'
Timing: Jan 18 2025 11:26:21
Module start 'content'
Timing: Jan 18 2025 11:26:22
Module end 'content'
Timing: Jan 18 2025 11:26:22
Script end

Main resources:

Total runtime0.9142 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0067 587.9219152.6250
Module start 'layout' 0.00670.0038 740.546939.4609
Module start 'content' 0.01050.9021 780.0078562.9688
Module end 'content' 0.91260.0016 1,342.976612.1563
Script end 0.9142  1,355.1328 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00330.3613160.0002
Check MTime0.00150.1607160.0001
Mysql Total
Database connection0.00100.107210.0010
Mysqli_queries0.866094.7258590.0147
Looping result0.00060.0695570.0000
Template Total0.881196.420.4406
Template load0.00220.244420.0011
Template processing0.878996.136020.4394
Template load and register function0.00030.033510.0003
states
state_id_array0.00090.100810.0009
state_identifier_array0.00110.115920.0005
Override
Cache load0.00180.2009190.0001
Sytem overhead
Fetch class attribute can translate value0.00090.095730.0003
Fetch class attribute name0.00110.121340.0003
XML
Image XML parsing0.00070.075330.0002
class_abstraction
Instantiating content class attribute0.00000.001040.0000
General
dbfile0.00080.0864160.0000
String conversion0.00000.001040.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
4content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 11
 Number of unique templates used: 6

Time used to render debug report: 0.0001 secs