|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
IObjectTypeHandler handles the object according to its type.
Every type of object must be provided with a handler implementation in order to be supported
by the toolkit with the new PCM API.
The framework calls this interface along the creation process and after it according to the
object's semantics.
This API is called from the SavePane as follows:
< get the handler from session > // create new descriptor Object descriptor = createObjectDescriptor(typeHandler,context); < get the wizard instance > < get the attributes map > // finalize the descriptor (add the attributes) wizard.finalizeDescriptor(attributesMap, descriptor, context); // save the object typeHandler.saveObject(descriptor, context); // finalize the object wizard.finalizeObject(context); ...
The toolkit provides default handlers that can be re-used or extended: iView, Page, Layout, System and Producer(Global Portal). How to use the handler mechanism:
AbstractObjectTypeHandler or implements this interface.
In this case the implementing class can implement IService for re-use, and publish
its key as a service in the portalapp.xml file, or be a core implementation for
private use.
ObjectCreationWizardConstants.OBJECT_TYPE_PARAM),
and looks for the correlating service from the public services.
ObjectType parameter is known to be one of the implemented types, there is no need
to set the property for the handler service, the toolkit finds it automatically.
AbstractPCMWizard| Method Summary | |
java.lang.Object |
createObjectDescriptor(java.lang.String targetId,
com.sap.portal.pcm.CreateMethod method,
IWizardContext context)
Create a new object descriptor that is in charge of storing the object's data. |
void |
saveObject(java.lang.Object descriptor,
IWizardContext context)
Saves the object in the persistence. |
| Method Detail |
public java.lang.Object createObjectDescriptor(java.lang.String targetId,
com.sap.portal.pcm.CreateMethod method,
IWizardContext context)
throws DescriptorNotCreatedException
Note: the implementation should deal only with the descriptor creation.
Everything else should be would be implemented in
AbstractPCMWizard.finalizeDescriptor(Map, Object, com.sapportals.admin.wizardframework.api.IWizardContext).
targetId - the target path.method - creation method CreateMethodcontext - the wizard contextDescriptorNotCreatedException - if the descriptor failed to be created.INewObjectDescriptor
public void saveObject(java.lang.Object descriptor,
IWizardContext context)
throws ObjectNotCreatedException
descriptor - the object descriptor, ready for save.context - wizard context.ObjectNotCreatedException - if the save has failed.AbstractObjectTypeHandler.saveObject(Object, IWizardContext),
Context.bind(String, Object)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||