com.sap.portal.admin.editor

Class PCMDataHandler

java.lang.Object
  extended by com.sap.portal.admin.editor.PCMDataHandler
All Implemented Interfaces:
IDataHandler

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
PCMDataHandler()
           
 
Method Summary
 com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getModifiedPropertyObject(IEditorContext context)
          Gets a property object that has been modified for the specified object.
static Object getPCMObject(IEditorContext context, com.sap.security.api.IPrincipal principal, String objectId, String aspect, Hashtable additionalEnv, PPLogger logger)
          Gets a PCM object.
static com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getPropertyObject(IEditorContext context, String objectId)
          Gets a property object for the specified object.
 void saveData(IEditorContext ctx, com.sap.security.api.IPrincipal 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 com.sap.portal.admin.editor.IDataHandler
loadData
 

Constructor Detail

PCMDataHandler

public PCMDataHandler()
Method Detail

getPCMObject

public static final Object getPCMObject(IEditorContext context,
                                        com.sap.security.api.IPrincipal principal,
                                        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.

Parameters:
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
Returns:
the PCM object
Throws:
EditorDataException - if loading the object fails

getPropertyObject

public static com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getPropertyObject(IEditorContext context,
                                                                                                       String objectId)
Gets a property object for the specified object.

Parameters:
context - the current editor context
objectId - an object ID
Returns:
the property object

getModifiedPropertyObject

public com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getModifiedPropertyObject(IEditorContext context)
Gets a property object that has been modified for the specified object.

Parameters:
context - the current editor context
Returns:
the property object

saveData

public void saveData(IEditorContext ctx,
                     com.sap.security.api.IPrincipal principal,
                     PPLogger logger)
              throws EditorDataException,
                     EditorResourceException
Description copied from interface: IDataHandler
Saves the edited data for this editor.

Specified by:
saveData in interface IDataHandler
Parameters:
ctx - the current editor context
principal - a security principal that saves the data
logger - a logger for sending log messages
Throws:
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
[sap.com] EP-RUNTIME [sap.com] tc/ep/admin/api api EP-PIN


Copyright 2011 SAP AG Complete Copyright Notice