public interface StagedModelDataHandler<T extends StagedModel>
| Modifier and Type | Method and Description |
|---|---|
void |
deleteStagedModel(String uuid,
long groupId,
String className,
String extraData)
Deletes the staged model matching the parameters.
|
void |
deleteStagedModel(T stagedModel)
Deletes the staged model.
|
void |
exportStagedModel(PortletDataContext portletDataContext,
T stagedModel)
Exports the staged model and its references.
|
T |
fetchMissingReference(String uuid,
long groupId)
Returns a reference of the staged model.
|
T |
fetchStagedModelByUuidAndGroupId(String uuid,
long groupId)
Returns the staged model with the UUID and group.
|
List<T> |
fetchStagedModelsByUuidAndCompanyId(String uuid,
long companyId)
Returns the staged models with the UUID and company.
|
String[] |
getClassNames()
Returns the class names of the models the data handler handles.
|
String |
getDisplayName(T stagedModel)
Returns the staged model's display name.
|
int[] |
getExportableStatuses()
Returns the workflow statuses that are used as filters during the export
process.
|
Map<String,String> |
getReferenceAttributes(PortletDataContext portletDataContext,
T stagedModel)
Returns the attributes that are automatically merged into the XML element
of the staged model reference.
|
void |
importCompanyStagedModel(PortletDataContext portletDataContext,
Element element)
Deprecated.
As of Wilberforce (7.0.x), replaced by
importMissingReference(PortletDataContext, Element) |
void |
importCompanyStagedModel(PortletDataContext portletDataContext,
String uuid,
long classPK)
Deprecated.
As of Wilberforce (7.0.x), replaced by
importMissingReference(PortletDataContext, String, long,
long) |
void |
importMissingReference(PortletDataContext portletDataContext,
Element referenceElement)
Maps the ID of the existing staged model to the old ID in the reference
element.
|
void |
importMissingReference(PortletDataContext portletDataContext,
String uuid,
long groupId,
long classPK)
Maps the ID of the existing staged model to the old ID in the reference
element.
|
void |
importStagedModel(PortletDataContext portletDataContext,
T stagedModel)
Imports the staged model.
|
void |
restoreStagedModel(PortletDataContext portletDataContext,
T stagedModel)
Restores the staged model from the trash.
|
boolean |
validateReference(PortletDataContext portletDataContext,
Element referenceElement)
Returns
true if the staged model reference validation is
successful. |
void deleteStagedModel(String uuid,
long groupId,
String className,
String extraData)
throws PortalException
uuid - the staged model's UUIDgroupId - the primary key of the entity's groupclassName - the staged model's class nameextraData - the extra data containing useful information about the
staged model. This information makes the staged model easier to
identify and fetch for deletion. It is populated when a deletion
system event is added, usually in the
*LocalServiceImpl class of the model.PortalException - if a portal exception occurredvoid deleteStagedModel(T stagedModel) throws PortalException
stagedModel - the staged model to deletePortalException - if a portal exception occurredvoid exportStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
BaseStagedModelDataHandler#exportStagedModel(PortletDataContext, T)
method for a reference implementation. Refrain from overriding this
method; instead, override the BaseStagedModelDataHandler#doExportStagedModel(PortletDataContext, T)
method.portletDataContext - the portlet data context of the current
processstagedModel - the staged model to exportPortletDataException - if a portlet data exception occurredT fetchMissingReference(String uuid, long groupId)
uuid - the reference's UUIDgroupId - the primary key of the groupT fetchStagedModelByUuidAndGroupId(String uuid, long groupId)
uuid - the staged model's UUIDgroupId - the primary key of the groupList<T> fetchStagedModelsByUuidAndCompanyId(String uuid, long companyId)
uuid - the staged model's UUIDcompanyId - the primary key of the companyString[] getClassNames()
String getDisplayName(T stagedModel)
stagedModel - the staged model from which to extract the display
nameint[] getExportableStatuses()
Map<String,String> getReferenceAttributes(PortletDataContext portletDataContext, T stagedModel)
importMissingReference(PortletDataContext, Element) and validateReference(PortletDataContext, Element) methods.portletDataContext - the current process's portlet data contextstagedModel - the staged model for which to get attributes@Deprecated void importCompanyStagedModel(PortletDataContext portletDataContext, Element element) throws PortletDataException
importMissingReference(PortletDataContext, Element)PortletDataException@Deprecated void importCompanyStagedModel(PortletDataContext portletDataContext, String uuid, long classPK) throws PortletDataException
importMissingReference(PortletDataContext, String, long,
long)PortletDataExceptionvoid importMissingReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
portletDataContext - the portlet data context of the current
processreferenceElement - the XML element that contains information about
the staged model referencePortletDataException - if a portlet data exception occurredvoid importMissingReference(PortletDataContext portletDataContext, String uuid, long groupId, long classPK) throws PortletDataException
BaseStagedModelDataHandler, this method is called to override the BaseStagedModelDataHandler.importMissingReference(PortletDataContext,
Element) and BaseStagedModelDataHandler.doImportMissingReference(PortletDataContext,
Element) methods.portletDataContext - the portlet data context of the current
processuuid - the staged model's UUID from the reference elementgroupId - the primary key of the entity's group from the reference
elementclassPK - the class primary key of the staged model from the
reference elementPortletDataException - if a portlet data exception occurredimportMissingReference(PortletDataContext, Element)void importStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
BaseStagedModelDataHandler.importStagedModel(PortletDataContext,
StagedModel) method for a reference implementation. Refrain from
overriding this method; instead, override the BaseStagedModelDataHandler#doImportStagedModel(PortletDataContext, T)
method.portletDataContext - the portlet data context of the current
processstagedModel - the staged model to importPortletDataException - if a portlet data exception occurredvoid restoreStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
BaseStagedModelDataHandler.restoreStagedModel(PortletDataContext,
StagedModel) method for a reference implementation. Refrain from
overriding this method; instead, override the BaseStagedModelDataHandler.doRestoreStagedModel(PortletDataContext,
StagedModel) method.portletDataContext - the portlet data context of the current
processstagedModel - the staged model to restore from the trashPortletDataException - if a portlet data exception occurredboolean validateReference(PortletDataContext portletDataContext, Element referenceElement)
true if the staged model reference validation is
successful.portletDataContext - the portlet data context of the current
processreferenceElement - the XML element that contains information about
the referencetrue if the reference validation is successful;
false otherwise