com.sap.portal.admin.editor
Class PCMDataHandler

java.lang.Object
  |
  +--com.sap.portal.admin.editor.PCMDataHandler
All Implemented Interfaces:
IDataHandler

public abstract class PCMDataHandler
extends java.lang.Object
implements IDataHandler

PCMDataHandler The default inplementation of the data handler plugin. Load and save PCM objects.


Constructor Summary
PCMDataHandler()
           
 
Method Summary
 com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getModifiedPropertyObject(IEditorContext context)
           
static java.lang.Object getPCMObject(IEditorContext context, com.sap.security.api.IPrincipal principal, java.lang.String objectId, java.lang.String aspect, java.util.Hashtable additionalEnv, com.sapportals.common.PPLogger logger)
          Get a PCM object.
static com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getPropertyObject(IEditorContext context, java.lang.String objectId)
          Get the IPropertyObject for the given object id.
 void saveData(IEditorContext ctx, com.sap.security.api.IPrincipal principal, com.sapportals.common.PPLogger logger)
          Save the edited data of 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 java.lang.Object getPCMObject(IEditorContext context,
                                                  com.sap.security.api.IPrincipal principal,
                                                  java.lang.String objectId,
                                                  java.lang.String aspect,
                                                  java.util.Hashtable additionalEnv,
                                                  com.sapportals.common.PPLogger logger)
                                           throws EditorDataException
Get a PCM object. If it is the first demand for this object (id+aspect) in the current request, Load it (look up) from PCM, and cache it. Otherwise, return it from the cache.

Note: The life cycle of the cache is only during one request!

Parameters:
context - The editor current context
principal - The security principal which this object should be loaded with.
objectId - The id of the object to be loaded
aspect - The PCM aspect
additionalEnv - Additional environment parameters that must be consifered when loading this object (or null if there are no such parameters).
logger - The logger where log messages are sent to.
Returns:
The PCM objet
Throws:
EditorDataException - if there is problem of the object loading
Possible exceptions
  • EditorObjectNotFoundException- The PCM object could not be found
  • EditorDataException- The PCM object loading failed.

getPropertyObject

public static com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getPropertyObject(IEditorContext context,
                                                                                                       java.lang.String objectId)
Get the IPropertyObject for the given object id. An helper method
Parameters:
context - the current editor context
objectId - the id of the object that should be loaded
Returns:
the IPropertyObject for the given object id.

getModifiedPropertyObject

public com.sap.portal.admin.propertyeditor.api.data_providers.IPropertyObject getModifiedPropertyObject(IEditorContext context)

saveData

public void saveData(IEditorContext ctx,
                     com.sap.security.api.IPrincipal principal,
                     com.sapportals.common.PPLogger logger)
              throws EditorDataException,
                     EditorResourceException
Description copied from interface: IDataHandler
Save the edited data of this editor
Specified by:
saveData in interface IDataHandler
Following copied from interface: com.sap.portal.admin.editor.IDataHandler
Parameters:
ctx - Current editor context
principal - The security principal that save the data
logger - Logger to send log messages (can be used for any locking considerations during save)
Throws:
EditorDataException - data could not be saved or no permissions- The editor framework presents an end user message, but the editor UI will be presented.
EditorResourceException - an error occured regarding the resource that this editor deals with. This exception is a showstopper for the editor- The editor framework will present the given end user message instead of the regular editor UI.