Class DefaultConfigurationPortletDataHandler
Object
com.liferay.exportimport.kernel.lar.BasePortletDataHandler
com.liferay.exportimport.kernel.lar.DefaultConfigurationPortletDataHandler
- All Implemented Interfaces:
PortletDataHandler
- Author:
- Eduardo GarcĂa
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeleteData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) Deletes the data created by the portlet.exportData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) Returns a string of data to be placed in the <portlet-data> section of the LAR file.longgetExportModelCount(ManifestSummary manifestSummary) Returns the number of entities defined for this data handler that are available for export according to the provided manifest summary, or-1if no entities are included in the manifest summary.protected StringgetExportPortletPreferencesUuid(PortletDataContext portletDataContext, Portlet portlet, String className, long primaryKeyLong) protected LonggetImportPortletPreferencesNewPrimaryKey(PortletDataContext portletDataContext, Class<?> clazz, long companyGroupId, Map<Long, Long> primaryKeys, String uuid) importData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences, String data) Handles any special processing of the data when the portlet is imported into a new layout.protected voidupdateExportPortletPreferencesClassPKs(PortletDataContext portletDataContext, Portlet portlet, PortletPreferences portletPreferences, String key, String className) protected voidupdateImportPortletPreferencesClassPKs(PortletDataContext portletDataContext, PortletPreferences portletPreferences, String key, Class<?> clazz, long companyGroupId) Methods inherited from class com.liferay.exportimport.kernel.lar.BasePortletDataHandler
addDefaultData, addExportDataRootElement, addImportDataRootElement, addUncheckedModelAdditionCount, doAddDefaultData, doDeleteData, doExportData, doImportData, doPrepareManifestSummary, doValidateSchemaVersion, getDataLevel, getDataPortletPreferences, getDeletionSystemEventStagedModelTypes, getExportConfigurationControls, getExportConfigurationControls, getExportControls, getExportDataRootElementString, getExportMetadataControls, getExportModelCount, getImportConfigurationControls, getImportConfigurationControls, getImportControls, getImportMetadataControls, getPortletId, getRank, getResourceName, getSchemaVersion, getServiceName, getStagedModelTypes, getStagingControls, isDataAlwaysStaged, isDataLocalized, isDataPortalLevel, isDataPortletInstanceLevel, isDataSiteLevel, isDisplayPortlet, isPublishToLiveByDefault, isRollbackOnException, prepareManifestSummary, prepareManifestSummary, setDataAlwaysStaged, setDataLevel, setDataLocalized, setDataPortletPreferences, setDeletionSystemEventStagedModelTypes, setExportControls, setExportMetadataControls, setImportControls, setImportMetadataControls, setPortletId, setPublishToLiveByDefault, setRank, setStagingControls, validateSchemaVersionMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.exportimport.kernel.lar.PortletDataHandler
getClassNames, getName, getNamespace, isCompany, isConfigurationEnabled, isEnabled, isStaged, isSupportsDataStrategyCopyAsNew, isSupportsDataStrategyMirrorWithOverwriting
-
Constructor Details
-
DefaultConfigurationPortletDataHandler
public DefaultConfigurationPortletDataHandler()
-
-
Method Details
-
deleteData
public PortletPreferences deleteData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) Description copied from interface:PortletDataHandlerDeletes the data created by the portlet. It can optionally return a modified version of the portlet preferences if it contains references to data that no longer exists.- Specified by:
deleteDatain interfacePortletDataHandler- Overrides:
deleteDatain classBasePortletDataHandler- Parameters:
portletDataContext- the context of the data deletionportletId- the portlet ID of the portletportletPreferences- the portlet preferences of the portlet- Returns:
- a modified version of the portlet preferences that should be
saved, or
nullif the data handler made no changes to the portlet preferences
-
exportData
public String exportData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences) Description copied from interface:PortletDataHandlerReturns a string of data to be placed in the <portlet-data> section of the LAR file. This data will be passed as thedataparameter ofimportData().- Specified by:
exportDatain interfacePortletDataHandler- Overrides:
exportDatain classBasePortletDataHandler- Parameters:
portletDataContext- the context of the data exportportletId- the portlet ID of the portletportletPreferences- the portlet preferences of the portlet- Returns:
- a string of data to be placed in the LAR, which can be, but not
limited to XML, or
nullif no portlet data is to be written out
-
getExportModelCount
Description copied from interface:PortletDataHandlerReturns the number of entities defined for this data handler that are available for export according to the provided manifest summary, or-1if no entities are included in the manifest summary.- Specified by:
getExportModelCountin interfacePortletDataHandler- Overrides:
getExportModelCountin classBasePortletDataHandler- Parameters:
manifestSummary- the manifest summary listing the number of exportable entities- Returns:
- the number of entities that are available for export according to
the manifest summary, or
-1if no entities are included in the manifest summary
-
importData
public PortletPreferences importData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences, String data) Description copied from interface:PortletDataHandlerHandles any special processing of the data when the portlet is imported into a new layout. Can optionally return a modified version ofpreferencesto be saved in the new portlet.- Specified by:
importDatain interfacePortletDataHandler- Overrides:
importDatain classBasePortletDataHandler- Parameters:
portletDataContext- the context of the data importportletId- the portlet ID of the portletportletPreferences- the portlet preferences of the portletdata- the string data that was returned byexportData()- Returns:
- a modified version of the portlet preferences that should be
saved, or
nullif the data handler made no changes to the portlet preferences
-
getExportPortletPreferencesUuid
protected String getExportPortletPreferencesUuid(PortletDataContext portletDataContext, Portlet portlet, String className, long primaryKeyLong) throws Exception - Throws:
Exception
-
getImportPortletPreferencesNewPrimaryKey
protected Long getImportPortletPreferencesNewPrimaryKey(PortletDataContext portletDataContext, Class<?> clazz, long companyGroupId, Map<Long, Long> primaryKeys, String uuid) throws Exception- Throws:
Exception
-
updateExportPortletPreferencesClassPKs
protected void updateExportPortletPreferencesClassPKs(PortletDataContext portletDataContext, Portlet portlet, PortletPreferences portletPreferences, String key, String className) throws Exception - Throws:
Exception
-
updateImportPortletPreferencesClassPKs
protected void updateImportPortletPreferencesClassPKs(PortletDataContext portletDataContext, PortletPreferences portletPreferences, String key, Class<?> clazz, long companyGroupId) throws Exception - Throws:
Exception
-