Class PCMDataHandler

  extended by
All Implemented Interfaces:

public abstract class PCMDataHandler
extends Object
implements IDataHandler

The class that defines methods for loading and saving data in the editor context.
Extend this class to create a custom data handler for your editor for loading initial values into the editor controls, and saving the values entered by the user to the PCD. A data handler, which extends PCMDataHandler, implements loadData and saveData.
To make the data handler accessible to editors defined in other PAR files, the data handler must be defined as a service and implement com.sapportals.portal.prt.service.IService.

Constructor Summary
Method Summary getModifiedPropertyObject(IEditorContext context)
          Gets a property object that has been modified for the specified object.
static Object getPCMObject(IEditorContext context, principal, String objectId, String aspect, Hashtable additionalEnv, PPLogger logger)
          Gets a PCM object.
static getPropertyObject(IEditorContext context, String objectId)
          Gets a property object for the specified object.
 void saveData(IEditorContext ctx, principal, PPLogger logger)
          Saves the edited data for this editor.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface

Constructor Detail


public PCMDataHandler()
Method Detail


public static final Object getPCMObject(IEditorContext context,
                                        String objectId,
                                        String aspect,
                                        Hashtable additionalEnv,
                                        PPLogger logger)
                                 throws EditorDataException
Gets a PCM object. If this is the first request for this object in the current request, it loads the object using a lookup in the PCM, and caches it. Otherwise, it gets the object from the cache.
Note: The cache is cleared after each request.

context - the editor context
principal - a security principal
objectId - an object ID
aspect - a PCM aspect
additionalEnv - additional environment parameters to consider when loading this object (or null if there are no such parameters)
logger - a logger for logging messages
the PCM object
EditorDataException - if loading the object fails


public static getPropertyObject(IEditorContext context,
                                                                                                       String objectId)
Gets a property object for the specified object.

context - the current editor context
objectId - an object ID
the property object


public getModifiedPropertyObject(IEditorContext context)
Gets a property object that has been modified for the specified object.

context - the current editor context
the property object


public void saveData(IEditorContext ctx,
                     PPLogger logger)
              throws EditorDataException,
Description copied from interface: IDataHandler
Saves the edited data for this editor.

Specified by:
saveData in interface IDataHandler
ctx - the current editor context
principal - a security principal that saves the data
logger - a logger for sending log messages
EditorDataException - if the data could not be loaded or there are no permissions, an end-user message is presented and read-only mode is set
EditorResourceException - if an error occurs regarding the resource for this editor, the editor framework presents the specified end-user message instead of the regular editor user interface
Access Rights

This class can be accessed from:

SC DC Public Part ACH
[] EP-RUNTIME [] tc/ep/admin/api api EP-PIN

Copyright 2011 SAP AG Complete Copyright Notice