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 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 |
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
StagedModelDataHandler
deleteStagedModel
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
StagedModelDataHandler
deleteStagedModel
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
StagedModelDataHandler
BaseStagedModelDataHandler#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)
StagedModelDataHandler
fetchMissingReference
in interface StagedModelDataHandler<T extends StagedModel>
uuid
- the reference's UUIDgroupId
- the primary key of the grouppublic T fetchStagedModelByUuidAndGroupId(String uuid, long groupId)
StagedModelDataHandler
fetchStagedModelByUuidAndGroupId
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)
StagedModelDataHandler
fetchStagedModelsByUuidAndCompanyId
in interface StagedModelDataHandler<T extends StagedModel>
uuid
- the staged model's UUIDcompanyId
- the primary key of the companypublic abstract String[] getClassNames()
StagedModelDataHandler
getClassNames
in interface StagedModelDataHandler<T extends StagedModel>
public String getDisplayName(T stagedModel)
StagedModelDataHandler
getDisplayName
in interface StagedModelDataHandler<T extends StagedModel>
stagedModel
- the staged model from which to extract the display
namepublic int[] getExportableStatuses()
StagedModelDataHandler
getExportableStatuses
in interface StagedModelDataHandler<T extends StagedModel>
public Map<String,String> getReferenceAttributes(PortletDataContext portletDataContext, T stagedModel)
StagedModelDataHandler
StagedModelDataHandler.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>
PortletDataException
public void importMissingReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
StagedModelDataHandler
importMissingReference
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
StagedModelDataHandler
BaseStagedModelDataHandler
, 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
StagedModelDataHandler
importStagedModel(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
StagedModelDataHandler
restoreStagedModel(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)
StagedModelDataHandler
true
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
Exception
protected void doImportMissingReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
PortletDataException
protected void doImportMissingReference(PortletDataContext portletDataContext, String uuid, long groupId, long classPK) throws Exception
Exception
protected abstract void doImportStagedModel(PortletDataContext portletDataContext, T stagedModel) throws Exception
Exception
protected void doRestoreStagedModel(PortletDataContext portletDataContext, T stagedModel) throws Exception
Exception
protected void exportAssetCategories(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected void exportAssetTags(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected void exportComments(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected void exportRatings(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected int getProcessFlag()
protected void importAssetCategories(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected void importAssetTags(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected void importComments(PortletDataContext portletDataContext, T stagedModel) throws PortalException
PortalException
protected void importMissingGroupReference(PortletDataContext portletDataContext, Element referenceElement) throws PortletDataException
PortletDataException
protected void importRatings(PortletDataContext portletDataContext, T stagedModel) throws PortalException
PortalException
protected void importReferenceStagedModels(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected boolean isStagedModelInTrash(T stagedModel)
protected void validateExport(PortletDataContext portletDataContext, T stagedModel) throws PortletDataException
PortletDataException
protected boolean validateMissingGroupReference(PortletDataContext portletDataContext, Element referenceElement)
protected boolean validateMissingReference(String uuid, long groupId)