Liferay 6.2-ce-ga5

com.liferay.portal.kernel.lar
Class BasePortletDataHandler

java.lang.Object
  extended by com.liferay.portal.kernel.lar.BasePortletDataHandler
All Implemented Interfaces:
PortletDataHandler
Direct Known Subclasses:
BasePortletDataHandler, BlogsPortletDataHandler, BookmarksPortletDataHandler, CalendarPortletDataHandler, DDLPortletDataHandler, DefaultConfigurationPortletDataHandler, DLPortletDataHandler, JournalPortletDataHandler, LayoutPrototypePortletDataHandler, LayoutSetPrototypePortletDataHandler, MBPortletDataHandler, MDRPortletDataHandler, PasswordPolicyPortletDataHandler, PollsPortletDataHandler, PortletDisplayTemplatePortletDataHandler, RolesAdminPortletDataHandler, RSSPortletDataHandler, UserGroupsAdminPortletDataHandler, UsersAdminPortletDataHandler, WikiPortletDataHandler

public abstract class BasePortletDataHandler
extends Object
implements PortletDataHandler


Constructor Summary
BasePortletDataHandler()
           
 
Method Summary
protected  Element addExportDataRootElement(PortletDataContext portletDataContext)
           
protected  Element addImportDataRootElement(PortletDataContext portletDataContext, String data)
           
protected  void addUncheckedModelAdditionCount(PortletDataContext portletDataContext, PortletDataHandlerControl portletDataHandlerControl)
           
 PortletPreferences deleteData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
          Deletes the data created by the portlet.
protected  PortletPreferences doDeleteData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
protected  String doExportData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
protected  PortletPreferences doImportData(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences, String data)
           
protected  void doPrepareManifestSummary(PortletDataContext portletDataContext, PortletPreferences portletPreferences)
           
protected  PortletPreferences doProcessExportPortletPreferences(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
protected  PortletPreferences doProcessImportPortletPreferences(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
 String exportData(PortletDataContext portletDataContext, String portletId, 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()
           
protected  String getDisplayTemplate(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
protected  long getDisplayTemplateGroupId(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
 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)
           
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()
           
 PortletPreferences 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.
 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 isSupportsDataStrategyCopyAsNew()
           
 void prepareManifestSummary(PortletDataContext portletDataContext)
           
 void prepareManifestSummary(PortletDataContext portletDataContext, PortletPreferences portletPreferences)
           
 PortletPreferences processExportPortletPreferences(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
 PortletPreferences processImportPortletPreferences(PortletDataContext portletDataContext, String portletId, PortletPreferences portletPreferences)
           
protected  void setAlwaysExportable(boolean alwaysExportable)
          Deprecated. As of 6.2.0
protected  void setAlwaysStaged(boolean alwaysStaged)
          Deprecated. As of 6.2.0
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)
           
protected  void setSupportsDataStrategyCopyAsNew(boolean supportsDataStrategyCopyAsNew)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePortletDataHandler

public BasePortletDataHandler()
Method Detail

deleteData

public PortletPreferences deleteData(PortletDataContext portletDataContext,
                                     String portletId,
                                     PortletPreferences portletPreferences)
                              throws PortletDataException
Description copied from interface: PortletDataHandler
Deletes the data created by the portlet. Can optionally return a modified version of preferences if it contains reference to data that does not exist anymore.

Specified by:
deleteData in interface PortletDataHandler
Parameters:
portletDataContext - the context of the data deletion
portletId - the portlet ID of the portlet
portletPreferences - the portlet preferences of the portlet
Returns:
A modified version of portlet preferences that should be saved. Null if the portlet preferences were unmodified by this data handler.
Throws:
PortletDataException - if a portlet data exception occurred

exportData

public String exportData(PortletDataContext portletDataContext,
                         String portletId,
                         PortletPreferences portletPreferences)
                  throws PortletDataException
Description copied from interface: PortletDataHandler
Returns a string of data to be placed in the <portlet-data> section of the LAR file. This data will be passed as the data parameter of importData().

Specified by:
exportData in interface PortletDataHandler
Parameters:
portletDataContext - the context of the data export
portletId - the portlet ID of the portlet
portletPreferences - the portlet preferences of the portlet
Returns:
A string of data to be placed in the LAR. It may be XML, but not necessarily. Null should be returned if no portlet data is to be written out.
Throws:
PortletDataException - if a portlet data exception occurred

getDataLevel

public DataLevel getDataLevel()
Specified by:
getDataLevel in interface PortletDataHandler

getDataPortletPreferences

public String[] getDataPortletPreferences()
Description copied from interface: PortletDataHandler
Returns an array of the portlet preferences that reference data. These preferences should only be updated if the referenced data is imported.

Specified by:
getDataPortletPreferences in interface PortletDataHandler
Returns:
A String array

getDeletionSystemEventStagedModelTypes

public StagedModelType[] getDeletionSystemEventStagedModelTypes()
Specified by:
getDeletionSystemEventStagedModelTypes in interface PortletDataHandler

getExportConfigurationControls

public PortletDataHandlerControl[] getExportConfigurationControls(long companyId,
                                                                  long groupId,
                                                                  Portlet portlet,
                                                                  boolean privateLayout)
                                                           throws Exception
Specified by:
getExportConfigurationControls in interface PortletDataHandler
Throws:
Exception

getExportConfigurationControls

public PortletDataHandlerControl[] getExportConfigurationControls(long companyId,
                                                                  long groupId,
                                                                  Portlet portlet,
                                                                  long plid,
                                                                  boolean privateLayout)
                                                           throws Exception
Specified by:
getExportConfigurationControls in interface PortletDataHandler
Throws:
Exception

getExportControls

public PortletDataHandlerControl[] getExportControls()
Description copied from interface: PortletDataHandler
Returns an array of the controls defined for this data handler. These controls enable the developer to create fine grained controls over export behavior. The controls are rendered in the export UI.

Specified by:
getExportControls in interface PortletDataHandler
Returns:
an array of PortletDataHandlerControls

getExportMetadataControls

public PortletDataHandlerControl[] getExportMetadataControls()
Description copied from interface: PortletDataHandler
Returns an array of the metadata controls defined for this data handler. These controls enable the developer to create fine grained controls over export behavior of metadata such as tags, categories, ratings or comments. The controls are rendered in the export UI.

Specified by:
getExportMetadataControls in interface PortletDataHandler
Returns:
an array of PortletDataHandlerControls

getExportModelCount

public long getExportModelCount(ManifestSummary manifestSummary)
Specified by:
getExportModelCount in interface PortletDataHandler

getImportConfigurationControls

public PortletDataHandlerControl[] getImportConfigurationControls(Portlet portlet,
                                                                  ManifestSummary manifestSummary)
Specified by:
getImportConfigurationControls in interface PortletDataHandler

getImportConfigurationControls

public PortletDataHandlerControl[] getImportConfigurationControls(String[] configurationPortletOptions)
Specified by:
getImportConfigurationControls in interface PortletDataHandler

getImportControls

public PortletDataHandlerControl[] getImportControls()
Description copied from interface: PortletDataHandler
Returns an array of the controls defined for this data handler. These controls enable the developer to create fine grained controls over import behavior. The controls are rendered in the import UI.

Specified by:
getImportControls in interface PortletDataHandler
Returns:
An array of PortletDataHandlerControls

getImportMetadataControls

public PortletDataHandlerControl[] getImportMetadataControls()
Description copied from interface: PortletDataHandler
Returns an array of the metadata controls defined for this data handler. These controls enable the developer to create fine grained controls over import behavior of metadata such as tags, categories, ratings or comments. The controls are rendered in the export UI.

Specified by:
getImportMetadataControls in interface PortletDataHandler
Returns:
an array of PortletDataHandlerControls

getPortletId

public String getPortletId()
Specified by:
getPortletId in interface PortletDataHandler

importData

public PortletPreferences importData(PortletDataContext portletDataContext,
                                     String portletId,
                                     PortletPreferences portletPreferences,
                                     String data)
                              throws PortletDataException
Description copied from interface: PortletDataHandler
Handles any special processing of the data when the portlet is imported into a new layout. Can optionally return a modified version of preferences to be saved in the new portlet.

Specified by:
importData in interface PortletDataHandler
Parameters:
portletDataContext - the context of the data import
portletId - the portlet ID of the portlet
portletPreferences - the portlet preferences of the portlet
data - the string data that was returned by exportData()
Returns:
A modified version of portlet preferences that should be saved. Null if the portlet preferences were unmodified by this data handler.
Throws:
PortletDataException - if a portlet data exception occurred

isDataLocalized

public boolean isDataLocalized()
Specified by:
isDataLocalized in interface PortletDataHandler

isDataPortalLevel

public boolean isDataPortalLevel()
Specified by:
isDataPortalLevel in interface PortletDataHandler

isDataPortletInstanceLevel

public boolean isDataPortletInstanceLevel()
Specified by:
isDataPortletInstanceLevel in interface PortletDataHandler

isDataSiteLevel

public boolean isDataSiteLevel()
Specified by:
isDataSiteLevel in interface PortletDataHandler

isDisplayPortlet

public boolean isDisplayPortlet()
Specified by:
isDisplayPortlet in interface PortletDataHandler

isPublishToLiveByDefault

public boolean isPublishToLiveByDefault()
Description copied from interface: PortletDataHandler
Returns whether the data exported by this handler should be included by default when publishing to live. This should only be true 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.

Specified by:
isPublishToLiveByDefault in interface PortletDataHandler
Returns:
true to publish to live by default

isSupportsDataStrategyCopyAsNew

public boolean isSupportsDataStrategyCopyAsNew()
Specified by:
isSupportsDataStrategyCopyAsNew in interface PortletDataHandler

prepareManifestSummary

public void prepareManifestSummary(PortletDataContext portletDataContext)
                            throws PortletDataException
Specified by:
prepareManifestSummary in interface PortletDataHandler
Throws:
PortletDataException

prepareManifestSummary

public void prepareManifestSummary(PortletDataContext portletDataContext,
                                   PortletPreferences portletPreferences)
                            throws PortletDataException
Specified by:
prepareManifestSummary in interface PortletDataHandler
Throws:
PortletDataException

processExportPortletPreferences

public PortletPreferences processExportPortletPreferences(PortletDataContext portletDataContext,
                                                          String portletId,
                                                          PortletPreferences portletPreferences)
                                                   throws PortletDataException
Specified by:
processExportPortletPreferences in interface PortletDataHandler
Throws:
PortletDataException

processImportPortletPreferences

public PortletPreferences processImportPortletPreferences(PortletDataContext portletDataContext,
                                                          String portletId,
                                                          PortletPreferences portletPreferences)
                                                   throws PortletDataException
Specified by:
processImportPortletPreferences in interface PortletDataHandler
Throws:
PortletDataException

setPortletId

public void setPortletId(String portletId)
Specified by:
setPortletId in interface PortletDataHandler

addExportDataRootElement

protected Element addExportDataRootElement(PortletDataContext portletDataContext)

addImportDataRootElement

protected Element addImportDataRootElement(PortletDataContext portletDataContext,
                                           String data)
                                    throws DocumentException
Throws:
DocumentException

addUncheckedModelAdditionCount

protected void addUncheckedModelAdditionCount(PortletDataContext portletDataContext,
                                              PortletDataHandlerControl portletDataHandlerControl)

doDeleteData

protected PortletPreferences doDeleteData(PortletDataContext portletDataContext,
                                          String portletId,
                                          PortletPreferences portletPreferences)
                                   throws Exception
Throws:
Exception

doExportData

protected String doExportData(PortletDataContext portletDataContext,
                              String portletId,
                              PortletPreferences portletPreferences)
                       throws Exception
Throws:
Exception

doImportData

protected PortletPreferences doImportData(PortletDataContext portletDataContext,
                                          String portletId,
                                          PortletPreferences portletPreferences,
                                          String data)
                                   throws Exception
Throws:
Exception

doPrepareManifestSummary

protected void doPrepareManifestSummary(PortletDataContext portletDataContext,
                                        PortletPreferences portletPreferences)
                                 throws Exception
Throws:
Exception

doProcessExportPortletPreferences

protected PortletPreferences doProcessExportPortletPreferences(PortletDataContext portletDataContext,
                                                               String portletId,
                                                               PortletPreferences portletPreferences)
                                                        throws Exception
Throws:
Exception

doProcessImportPortletPreferences

protected PortletPreferences doProcessImportPortletPreferences(PortletDataContext portletDataContext,
                                                               String portletId,
                                                               PortletPreferences portletPreferences)
                                                        throws Exception
Throws:
Exception

getDisplayTemplate

protected String getDisplayTemplate(PortletDataContext portletDataContext,
                                    String portletId,
                                    PortletPreferences portletPreferences)

getDisplayTemplateGroupId

protected long getDisplayTemplateGroupId(PortletDataContext portletDataContext,
                                         String portletId,
                                         PortletPreferences portletPreferences)

getExportDataRootElementString

protected String getExportDataRootElementString(Element rootElement)

getExportModelCount

protected long getExportModelCount(ManifestSummary manifestSummary,
                                   PortletDataHandlerControl[] portletDataHandlerControls)

setAlwaysExportable

protected void setAlwaysExportable(boolean alwaysExportable)
Deprecated. As of 6.2.0


setAlwaysStaged

protected void setAlwaysStaged(boolean alwaysStaged)
Deprecated. As of 6.2.0


setDataLevel

protected void setDataLevel(DataLevel dataLevel)

setDataLocalized

protected void setDataLocalized(boolean dataLocalized)

setDataPortletPreferences

protected void setDataPortletPreferences(String... dataPortletPreferences)

setDeletionSystemEventStagedModelTypes

protected void setDeletionSystemEventStagedModelTypes(StagedModelType... deletionSystemEventStagedModelTypes)

setExportControls

protected void setExportControls(PortletDataHandlerControl... exportControls)

setExportMetadataControls

protected void setExportMetadataControls(PortletDataHandlerControl... exportMetadataControls)

setImportControls

protected void setImportControls(PortletDataHandlerControl... importControls)

setImportMetadataControls

protected void setImportMetadataControls(PortletDataHandlerControl... importMetadataControls)

setPublishToLiveByDefault

protected void setPublishToLiveByDefault(boolean publishToLiveByDefault)

setSupportsDataStrategyCopyAsNew

protected void setSupportsDataStrategyCopyAsNew(boolean supportsDataStrategyCopyAsNew)

Liferay 6.2-ce-ga5