public abstract class BasePortletDataHandler extends Object implements PortletDataHandler
| Constructor and Description |
|---|
BasePortletDataHandler() |
| Modifier and Type | Method and Description |
|---|---|
javax.portlet.PortletPreferences |
addDefaultData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences)
Returns the portlet's preferences with default data added.
|
protected Element |
addExportDataRootElement(PortletDataContext portletDataContext) |
protected Element |
addImportDataRootElement(PortletDataContext portletDataContext,
String data) |
protected void |
addUncheckedModelAdditionCount(PortletDataContext portletDataContext,
PortletDataHandlerControl portletDataHandlerControl) |
javax.portlet.PortletPreferences |
deleteData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences)
Deletes the data created by the portlet.
|
protected javax.portlet.PortletPreferences |
doAddDefaultData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences) |
protected javax.portlet.PortletPreferences |
doDeleteData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences) |
protected String |
doExportData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences) |
protected javax.portlet.PortletPreferences |
doImportData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences,
String data) |
protected void |
doPrepareManifestSummary(PortletDataContext portletDataContext,
javax.portlet.PortletPreferences portletPreferences) |
protected boolean |
doValidateSchemaVersion(String schemaVersion) |
String |
exportData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences)
Returns a string of data to be placed in the <portlet-data> section
of the LAR file.
|
DataLevel |
getDataLevel() |
String[] |
getDataPortletPreferences()
Returns an array of the portlet preferences that reference data.
|
StagedModelType[] |
getDeletionSystemEventStagedModelTypes() |
PortletDataHandlerControl[] |
getExportConfigurationControls(long companyId,
long groupId,
Portlet portlet,
boolean privateLayout) |
PortletDataHandlerControl[] |
getExportConfigurationControls(long companyId,
long groupId,
Portlet portlet,
long plid,
boolean privateLayout) |
PortletDataHandlerControl[] |
getExportControls()
Returns an array of the controls defined for this data handler.
|
protected String |
getExportDataRootElementString(Element rootElement) |
PortletDataHandlerControl[] |
getExportMetadataControls()
Returns an array of the metadata controls defined for this data handler.
|
long |
getExportModelCount(ManifestSummary manifestSummary)
Returns the number of entities defined for this data handler that are
available for export according to the provided manifest summary, or
-1 if no entities are included in the manifest summary. |
protected long |
getExportModelCount(ManifestSummary manifestSummary,
PortletDataHandlerControl[] portletDataHandlerControls) |
PortletDataHandlerControl[] |
getImportConfigurationControls(Portlet portlet,
ManifestSummary manifestSummary) |
PortletDataHandlerControl[] |
getImportConfigurationControls(String[] configurationPortletOptions) |
PortletDataHandlerControl[] |
getImportControls()
Returns an array of the controls defined for this data handler.
|
PortletDataHandlerControl[] |
getImportMetadataControls()
Returns an array of the metadata controls defined for this data handler.
|
String |
getPortletId() |
int |
getRank() |
String |
getResourceName() |
String |
getSchemaVersion()
Returns the schema version for this data handler, which represents the
staging and export/import aspect of a component.
|
String |
getServiceName() |
PortletDataHandlerControl[] |
getStagingControls()
Returns an array of the controls defined for this data handler.
|
javax.portlet.PortletPreferences |
importData(PortletDataContext portletDataContext,
String portletId,
javax.portlet.PortletPreferences portletPreferences,
String data)
Handles any special processing of the data when the portlet is imported
into a new layout.
|
boolean |
isDataAlwaysStaged() |
boolean |
isDataLocalized() |
boolean |
isDataPortalLevel() |
boolean |
isDataPortletInstanceLevel() |
boolean |
isDataSiteLevel() |
boolean |
isDisplayPortlet() |
boolean |
isPublishToLiveByDefault()
Returns whether the data exported by this handler should be included by
default when publishing to live.
|
boolean |
isRollbackOnException()
Returns
true if the data handler stops operations and rolls
back their transactions on operations throwing exceptions. |
void |
prepareManifestSummary(PortletDataContext portletDataContext) |
void |
prepareManifestSummary(PortletDataContext portletDataContext,
javax.portlet.PortletPreferences portletPreferences) |
protected void |
setDataAlwaysStaged(boolean dataAlwaysStaged) |
protected void |
setDataLevel(DataLevel dataLevel) |
protected void |
setDataLocalized(boolean dataLocalized) |
protected void |
setDataPortletPreferences(String... dataPortletPreferences) |
protected void |
setDeletionSystemEventStagedModelTypes(StagedModelType... deletionSystemEventStagedModelTypes) |
protected void |
setExportControls(PortletDataHandlerControl... exportControls) |
protected void |
setExportMetadataControls(PortletDataHandlerControl... exportMetadataControls) |
protected void |
setImportControls(PortletDataHandlerControl... importControls) |
protected void |
setImportMetadataControls(PortletDataHandlerControl... importMetadataControls) |
void |
setPortletId(String portletId) |
protected void |
setPublishToLiveByDefault(boolean publishToLiveByDefault) |
void |
setRank(int rank) |
protected void |
setStagingControls(PortletDataHandlerControl... stagingControls) |
boolean |
validateSchemaVersion(String schemaVersion) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetClassNames, getNamespace, isConfigurationEnabled, isStaged, isSupportsDataStrategyCopyAsNew, isSupportsDataStrategyMirrorWithOverwritingpublic javax.portlet.PortletPreferences addDefaultData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws PortletDataException
PortletDataHandleraddDefaultData in interface PortletDataHandlerportletDataContext - the context of the data additionportletId - the portlet ID of the portletportletPreferences - the portlet preferences of the portletnull if the data handler made no changes
to the portlet preferencesPortletDataException - if a portlet data exception occurredpublic javax.portlet.PortletPreferences deleteData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws PortletDataException
PortletDataHandlerdeleteData in interface PortletDataHandlerportletDataContext - the context of the data deletionportletId - the portlet ID of the portletportletPreferences - the portlet preferences of the portletnull if the data handler made no changes
to the portlet preferencesPortletDataException - if a portlet data exception occurredpublic String exportData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws PortletDataException
PortletDataHandlerdata
parameter of importData().exportData in interface PortletDataHandlerportletDataContext - the context of the data exportportletId - the portlet ID of the portletportletPreferences - the portlet preferences of the portletnull if no portlet data is to be
written outPortletDataException - if a portlet data exception occurredpublic DataLevel getDataLevel()
getDataLevel in interface PortletDataHandlerpublic String[] getDataPortletPreferences()
PortletDataHandlergetDataPortletPreferences in interface PortletDataHandlerpublic StagedModelType[] getDeletionSystemEventStagedModelTypes()
getDeletionSystemEventStagedModelTypes in interface PortletDataHandlerpublic PortletDataHandlerControl[] getExportConfigurationControls(long companyId, long groupId, Portlet portlet, boolean privateLayout) throws Exception
getExportConfigurationControls in interface PortletDataHandlerExceptionpublic PortletDataHandlerControl[] getExportConfigurationControls(long companyId, long groupId, Portlet portlet, long plid, boolean privateLayout) throws Exception
getExportConfigurationControls in interface PortletDataHandlerExceptionpublic PortletDataHandlerControl[] getExportControls()
PortletDataHandlergetExportControls in interface PortletDataHandlerpublic PortletDataHandlerControl[] getExportMetadataControls()
PortletDataHandlergetExportMetadataControls in interface PortletDataHandlerpublic long getExportModelCount(ManifestSummary manifestSummary)
PortletDataHandler-1 if no entities are included in the manifest summary.getExportModelCount in interface PortletDataHandlermanifestSummary - the manifest summary listing the number of
exportable entities-1 if no entities are
included in the manifest summarypublic PortletDataHandlerControl[] getImportConfigurationControls(Portlet portlet, ManifestSummary manifestSummary)
getImportConfigurationControls in interface PortletDataHandlerpublic PortletDataHandlerControl[] getImportConfigurationControls(String[] configurationPortletOptions)
getImportConfigurationControls in interface PortletDataHandlerpublic PortletDataHandlerControl[] getImportControls()
PortletDataHandlergetImportControls in interface PortletDataHandlerpublic PortletDataHandlerControl[] getImportMetadataControls()
PortletDataHandlergetImportMetadataControls in interface PortletDataHandlerpublic String getPortletId()
getPortletId in interface PortletDataHandlerpublic int getRank()
getRank in interface PortletDataHandlerpublic String getResourceName()
getResourceName in interface PortletDataHandlerpublic String getSchemaVersion()
PortletDataHandler
Schema versions follow the semantic versioning format
major.minor.bugfix. The schema version is added to the LAR
file for each application being processed. During import, the current
schema version in an environment is compared to the schema version in the
LAR file. The generic semantic versioning rules apply during this
comparison:
Examples:
getSchemaVersion in interface PortletDataHandlerpublic String getServiceName()
getServiceName in interface PortletDataHandlerpublic PortletDataHandlerControl[] getStagingControls()
PortletDataHandlergetStagingControls in interface PortletDataHandlerpublic javax.portlet.PortletPreferences importData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences, String data) throws PortletDataException
PortletDataHandlerpreferences to be saved in the new portlet.importData in interface PortletDataHandlerportletDataContext - the context of the data importportletId - the portlet ID of the portletportletPreferences - the portlet preferences of the portletdata - the string data that was returned by
exportData()null if the data handler made no changes
to the portlet preferencesPortletDataException - if a portlet data exception occurredpublic boolean isDataAlwaysStaged()
isDataAlwaysStaged in interface PortletDataHandlerpublic boolean isDataLocalized()
isDataLocalized in interface PortletDataHandlerpublic boolean isDataPortalLevel()
isDataPortalLevel in interface PortletDataHandlerpublic boolean isDataPortletInstanceLevel()
isDataPortletInstanceLevel in interface PortletDataHandlerpublic boolean isDataSiteLevel()
isDataSiteLevel in interface PortletDataHandlerpublic boolean isDisplayPortlet()
isDisplayPortlet in interface PortletDataHandlerpublic boolean isPublishToLiveByDefault()
PortletDataHandlertrue
for data that is meant to be managed in an staging environment such as
CMS content, but not for data meant to be input by users such as wiki
pages or message board posts.isPublishToLiveByDefault in interface PortletDataHandlertrue if the data exported by this handler should be
included by default when publishing to live; false
otherwisepublic boolean isRollbackOnException()
PortletDataHandlertrue if the data handler stops operations and rolls
back their transactions on operations throwing exceptions.isRollbackOnException in interface PortletDataHandlertrue if the data handler stops operations and rolls
back their transactions on operations throwing exceptions;
false otherwisepublic void prepareManifestSummary(PortletDataContext portletDataContext) throws PortletDataException
prepareManifestSummary in interface PortletDataHandlerPortletDataExceptionpublic void prepareManifestSummary(PortletDataContext portletDataContext, javax.portlet.PortletPreferences portletPreferences) throws PortletDataException
prepareManifestSummary in interface PortletDataHandlerPortletDataExceptionpublic void setPortletId(String portletId)
setPortletId in interface PortletDataHandlerpublic void setRank(int rank)
setRank in interface PortletDataHandlerpublic boolean validateSchemaVersion(String schemaVersion)
validateSchemaVersion in interface PortletDataHandlerprotected Element addExportDataRootElement(PortletDataContext portletDataContext)
protected Element addImportDataRootElement(PortletDataContext portletDataContext, String data) throws DocumentException
DocumentExceptionprotected void addUncheckedModelAdditionCount(PortletDataContext portletDataContext, PortletDataHandlerControl portletDataHandlerControl)
protected javax.portlet.PortletPreferences doAddDefaultData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws Exception
Exceptionprotected javax.portlet.PortletPreferences doDeleteData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws Exception
Exceptionprotected String doExportData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences) throws Exception
Exceptionprotected javax.portlet.PortletPreferences doImportData(PortletDataContext portletDataContext, String portletId, javax.portlet.PortletPreferences portletPreferences, String data) throws Exception
Exceptionprotected void doPrepareManifestSummary(PortletDataContext portletDataContext, javax.portlet.PortletPreferences portletPreferences) throws Exception
Exceptionprotected boolean doValidateSchemaVersion(String schemaVersion)
throws Exception
Exceptionprotected String getExportDataRootElementString(Element rootElement)
protected long getExportModelCount(ManifestSummary manifestSummary, PortletDataHandlerControl[] portletDataHandlerControls)
protected void setDataAlwaysStaged(boolean dataAlwaysStaged)
protected void setDataLevel(DataLevel dataLevel)
protected void setDataLocalized(boolean dataLocalized)
protected void setDataPortletPreferences(String... dataPortletPreferences)
protected void setDeletionSystemEventStagedModelTypes(StagedModelType... deletionSystemEventStagedModelTypes)
protected void setExportControls(PortletDataHandlerControl... exportControls)
protected void setExportMetadataControls(PortletDataHandlerControl... exportMetadataControls)
protected void setImportControls(PortletDataHandlerControl... importControls)
protected void setImportMetadataControls(PortletDataHandlerControl... importMetadataControls)
protected void setPublishToLiveByDefault(boolean publishToLiveByDefault)
protected void setStagingControls(PortletDataHandlerControl... stagingControls)