Datatypes: object creation function sequence a.o.

Author Message

Sebastian Schoeller

Friday 17 June 2011 6:53:02 am

Dear all,

I am trying to create a datatype to enable us having workshop/teamroom like functionality with a specific but various class type. I am using extensions like ezteamroom, membership, ezssp etc. and datatypes as templates in order to learn/advance. The idea is the following:

  1. one attaches a new attribute to a class, which takes sections, user and manager roles as input.
  2. one creates objects which are based on information being stored in 1. At first creation two hidden user groups are being created named user_group and manager_group.
  3. when editing the object one is not actually storing any object related information, but executing related actions, like copying user objects to a user groups or adding or removing roles/sections and the like.

I started with the datatype and implemented the functions 

  • eZWorkshopType
  • validateClassAttributeHTTPInput
  • fetchClassAttributeHTTPInput
  • parseXML
  • defaultClassAttributeContent
  • preStoreClassAttribute
  • storeClassAttributeContent
  • createClassDOMDocument
  • storeClassDOMDocument
  • domString
  • isTranslatable 

After loading the extension. I can attach the attribute to a created class. Also manipulating and storing class contents works from the template subdirectories 

  • class/edit
  • class/view

I can also access the class related data from the templates in

  • content/view
  • content/edit

My trouble starts with the object related information. I do not know which method is called in which sequence for object creation, based on the class definition. I have tried debugging using eZDebug::writeDebug, but I did not succeed in finding the starting point.

  1. First question now: Is there going to be any short-coming with this kind of implementation style for the desired functionality?
  2. Second question: is there a tutorial on how to set up for php debugging within eZPublish? I am used to line-based execution sequence of scripts.
  3. Third question: could somebody point out the exact calling order for object creation for datatypes? I could not figure it out myself from Thomas Koch's tutorial.

Looking forward to any hints 

Best wishes

Sebastian

André R.

Saturday 18 June 2011 1:30:53 am

Isn't it better to use worflow / edit handlers for such logic?

Not so sure about order of excution of datatypes, but from a bit higher level you can see order of publish operation in kernel/content/operation_definition.php. Also make sure you take  look at extensions that uses external objects, like ezgmaplocation, ezobjectrelation and so on.

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

Sebastian Schoeller

Saturday 18 June 2011 5:21:06 am

André,

thanks for replying. I will continue with the two blog entries from Serwatka

http://serwatka.net/blog/ez_publish_3_8_new_custom_edit_handler

http://serwatka.net/blog/enhanced_content_edit_handler_for_validation_rules_in_ez_publish_4_1

Cheers for pointing out the edit handlers. About workflow I have no idea still, but whenever I get there I will ask for some advice.

Best wishes

Sebastian

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