public abstract class BaseStagedModelDataHandler<T extends StagedModel> extends Object implements StagedModelDataHandler<T>
| Constructor and Description |
|---|
BaseStagedModelDataHandler() |
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
countStagedModel(PortletDataContext portletDataContext,
T stagedModel) |
abstract void |
deleteStagedModel(String uuid,
long groupId,
String className,
String extraData)
Deletes the staged model matching the parameters.
|
abstract void |
deleteStagedModel(T stagedModel)
Deletes the staged model.
|
protected abstract void |
doExportStagedModel(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
doImportMissingReference(PortletDataContext portletDataContext,
Element referenceElement) |
protected void |
doImportMissingReference(PortletDataContext portletDataContext,
String uuid,
long groupId,
long classPK) |
protected abstract void |
doImportStagedModel(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
doRestoreStagedModel(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
exportAssetCategories(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
exportAssetTags(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
exportComments(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
exportRatings(PortletDataContext portletDataContext,
T stagedModel) |
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.
|
abstract List<T> |
fetchStagedModelsByUuidAndCompanyId(String uuid,
long companyId)
Returns the staged models with the UUID and company.
|
abstract 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.
|
protected int |
getProcessFlag() |
Map<String,String> |
getReferenceAttributes(PortletDataContext portletDataContext,
T stagedModel)
Returns the attributes that are automatically merged into the XML element
of the staged model reference.
|
protected String[] |
getSkipImportReferenceStagedModelNames() |
protected void |
importAssetCategories(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
importAssetTags(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
importComments(PortletDataContext portletDataContext,
T stagedModel) |
void |
importCompanyStagedModel(PortletDataContext portletDataContext,
Element referenceElement)
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) |
protected void |
importMissingGroupReference(PortletDataContext portletDataContext,
Element referenceElement) |
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.
|
protected void |
importRatings(PortletDataContext portletDataContext,
T stagedModel) |
protected void |
importReferenceStagedModels(PortletDataContext portletDataContext,
T stagedModel) |
void |
importStagedModel(PortletDataContext portletDataContext,
T stagedModel)
Imports the staged model.
|
protected boolean |
isSkipImportReferenceStagedModels() |
protected boolean |
isStagedModelInTrash(T stagedModel) |
void |
restoreStagedModel(PortletDataContext portletDataContext,
T stagedModel)
Restores the staged model from the trash.
|
protected void |
validateExport(PortletDataContext portletDataContext,
T stagedModel) |
protected boolean |
validateMissingGroupReference(PortletDataContext portletDataContext,
Element referenceElement) |
protected boolean |
validateMissingReference(String uuid,
long groupId) |
boolean |
validateReference(PortletDataContext portletDataContext,
Element referenceElement)
Returns
true if the staged model reference validation is
successful. |
public abstract void deleteStagedModel(String uuid,
long groupId,
String className,
String extraData)
throws PortalException
StagedModelDataHandlerdeleteStagedModel in interface StagedModelDataHandler<T extends StagedModel>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 occurredpublic abstract void deleteStagedModel(T stagedModel) throws PortalException
StagedModelDataHandlerdeleteStagedModel in interface StagedModelDataHandler<T extends StagedModel>stagedModel - the staged model to deletePortalException - if a portal exception occurredpublic void exportStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
StagedModelDataHandlerBaseStagedModelDataHandler#exportStagedModel(PortletDataContext, T)
method for a reference implementation. Refrain from overriding this
method; instead, override the BaseStagedModelDataHandler#doExportStagedModel(PortletDataContext, T)
method.exportStagedModel in interface StagedModelDataHandler<T extends StagedModel>portletDataContext - the portlet data context of the current
processstagedModel - the staged model to exportPortletDataException - if a portlet data exception occurredpublic T fetchMissingReference(String uuid, long groupId)
StagedModelDataHandlerfetchMissingReference in interface StagedModelDataHandler<T extends StagedModel>uuid - the reference's UUIDgroupId - the primary key of the grouppublic T fetchStagedModelByUuidAndGroupId(String uuid, long groupId)
StagedModelDataHandlerfetchStagedModelByUuidAndGroupId in interface StagedModelDataHandler<T extends StagedModel>uuid - the staged model's UUIDgroupId - the primary key of the grouppublic abstract List<T> fetchStagedModelsByUuidAndCompanyId(String uuid, long companyId)
StagedModelDataHandlerfetchStagedModelsByUuidAndCompanyId in interface StagedModelDataHandler<T extends StagedModel>uuid - the staged model's UUIDcompanyId - the primary key of the companypublic abstract String[] getClassNames()
StagedModelDataHandlergetClassNames in interface StagedModelDataHandler<T extends StagedModel>public String getDisplayName(T stagedModel)
StagedModelDataHandlergetDisplayName in interface StagedModelDataHandler<T extends StagedModel>stagedModel - the staged model from which to extract the display
namepublic int[] getExportableStatuses()
StagedModelDataHandlergetExportableStatuses in interface StagedModelDataHandler<T extends StagedModel>public Map<String,String> getReferenceAttributes(PortletDataContext portletDataContext, T stagedModel)
StagedModelDataHandlerStagedModelDataHandler.importMissingReference(PortletDataContext, Element) and StagedModelDataHandler.validateReference(PortletDataContext, Element) methods.getReferenceAttributes in interface StagedModelDataHandler<T extends StagedModel>portletDataContext - the current process's portlet data contextstagedModel - the staged model for which to get attributes@Deprecated public void importCompanyStagedModel(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
importMissingReference(PortletDataContext, Element)importCompanyStagedModel in interface StagedModelDataHandler<T extends StagedModel>PortletDataException@Deprecated public void importCompanyStagedModel(PortletDataContext portletDataContext, String uuid, long classPK) throws PortletDataException
importMissingReference(PortletDataContext, String, long,
long)importCompanyStagedModel in interface StagedModelDataHandler<T extends StagedModel>PortletDataExceptionpublic void importMissingReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
StagedModelDataHandlerimportMissingReference in interface StagedModelDataHandler<T extends StagedModel>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 occurredpublic void importMissingReference(PortletDataContext portletDataContext, String uuid, long groupId, long classPK) throws PortletDataException
StagedModelDataHandlerBaseStagedModelDataHandler, this method is called to override the importMissingReference(PortletDataContext,
Element) and doImportMissingReference(PortletDataContext,
Element) methods.importMissingReference in interface StagedModelDataHandler<T extends StagedModel>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 occurredStagedModelDataHandler.importMissingReference(PortletDataContext, Element)public void importStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
StagedModelDataHandlerimportStagedModel(PortletDataContext,
StagedModel) method for a reference implementation. Refrain from
overriding this method; instead, override the BaseStagedModelDataHandler#doImportStagedModel(PortletDataContext, T)
method.importStagedModel in interface StagedModelDataHandler<T extends StagedModel>portletDataContext - the portlet data context of the current
processstagedModel - the staged model to importPortletDataException - if a portlet data exception occurredpublic void restoreStagedModel(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
StagedModelDataHandlerrestoreStagedModel(PortletDataContext,
StagedModel) method for a reference implementation. Refrain from
overriding this method; instead, override the doRestoreStagedModel(PortletDataContext,
StagedModel) method.restoreStagedModel in interface StagedModelDataHandler<T extends StagedModel>portletDataContext - the portlet data context of the current
processstagedModel - the staged model to restore from the trashPortletDataException - if a portlet data exception occurredpublic boolean validateReference(PortletDataContext portletDataContext, Element referenceElement)
StagedModelDataHandlertrue if the staged model reference validation is
successful.validateReference in interface StagedModelDataHandler<T extends StagedModel>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 otherwiseprotected boolean countStagedModel(PortletDataContext portletDataContext, T stagedModel)
protected abstract void doExportStagedModel(PortletDataContext portletDataContext, T stagedModel) throws Exception
Exceptionprotected void doImportMissingReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
PortletDataExceptionprotected void doImportMissingReference(PortletDataContext portletDataContext, String uuid, long groupId, long classPK) throws Exception
Exceptionprotected abstract void doImportStagedModel(PortletDataContext portletDataContext, T stagedModel) throws Exception
Exceptionprotected void doRestoreStagedModel(PortletDataContext portletDataContext, T stagedModel) throws Exception
Exceptionprotected void exportAssetCategories(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected void exportAssetTags(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected void exportComments(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected void exportRatings(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected int getProcessFlag()
protected String[] getSkipImportReferenceStagedModelNames()
protected void importAssetCategories(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected void importAssetTags(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected void importComments(PortletDataContext portletDataContext, T stagedModel) throws PortalException
PortalExceptionprotected void importMissingGroupReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
PortletDataExceptionprotected void importRatings(PortletDataContext portletDataContext, T stagedModel) throws PortalException
PortalExceptionprotected void importReferenceStagedModels(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected boolean isSkipImportReferenceStagedModels()
protected boolean isStagedModelInTrash(T stagedModel)
protected void validateExport(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataExceptionprotected boolean validateMissingGroupReference(PortletDataContext portletDataContext, Element referenceElement)
protected boolean validateMissingReference(String uuid,
long groupId)