Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-15502

Content Edit Handler - new hook store()

    XMLWordPrintable

Details

    Description

      The contentedithandler is a powerfull mechanism to do somesting in editing process for example
      do something after an object is published.

      But at the moment you can't hook on the 'StoreButton' functionality in eZ.

      I give you an example.

      When you create a new image object you get
      1. the edit mask
      2. you choose an image and you could upload this image with press button 'store draft'
      3. the image is uploaded and you have to out the name and caption attribute

      I have a functionality where you can read iptc data from images and i already use this in after 'publish' to use this metainformation like title, description to set these to the ez attributes of the image 'name' and 'caption'. All is fine.

      I want to have this functionality for manually uploading an image, too.
      For this i need a hook after storing all the ez attributes.
      This hook enables me to manipulate all the attributes and other things .

      The new steps for uploading an image with reading iptc data are:

      1. image the edit mask
      2. you choose an image and you could upload this image with press button 'store draft'
      3. the image is uploaded
      4. the after store hook reads the iptc data and store iptc data like title, description to the imag class
      attributes name, caption
      5. you can edit this data and publish the image

      The image example is one use case.

      But i think this new after 'store' hook is quite usefull for other things and is eqal to use like the publish function.
      You only have to define a store() function in your contentedithandler and all is fine

      I create a patch for this and hopefully it will be part of the ez core.

      code example for contendedithandler

      class myedithandler extends eZContentObjectEditHandler
      {
      
          function __construct() {}
         
      
          /*!
           \abstract
           Do content object store operations.
          */
          static function store( &$module, &$class, &$object, &$version, &$contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage )
          {
               // do something after store draft in editing process
          }
      
      
          /*!
           \abstract
      
           Do content object publish operations.
          */
          function publish( $contentObjectID, $contentObjectVersion )
          {
              // do something after publish
          }
      
      /*!
           Override this function in the extension to handle edit input parameters.
          */
          function fetchInput( $http, &$module, &$class, $object, &$version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage )
          {
          }
      
          /*!
           \abstract
      
           Return list of HTTP postparameters which should trigger store action.
          */
          static function storeActionList()
          {
             // return array( 'SetImageMetaData' );
          }
      
      

      Attachments

        Activity

          People

            unknown unknown
            4d91e976-d41f-487b-ae85-f7216bd06dac@accounts.ibexa.co Felix Woldt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated: