Liferay 6.1.2-ce-ga3

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, BlogsPortletDataHandlerImpl, BookmarksPortletDataHandlerImpl, CalendarPortletDataHandlerImpl, DDLDisplayPortletDataHandlerImpl, DDLPortletDataHandlerImpl, DDMPortletDataHandlerImpl, DLDisplayPortletDataHandlerImpl, DLPortletDataHandlerImpl, JournalContentPortletDataHandlerImpl, JournalPortletDataHandlerImpl, MBPortletDataHandlerImpl, MDRPortletDataHandlerImpl, PageCommentsPortletDataHandlerImpl, PageRatingsPortletDataHandlerImpl, PollsDisplayPortletDataHandlerImpl, PollsPortletDataHandlerImpl, WikiDisplayPortletDataHandlerImpl, WikiPortletDataHandlerImpl

public abstract class BasePortletDataHandler
extends Object
implements PortletDataHandler


Constructor Summary
BasePortletDataHandler()
           
 
Method Summary
 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)
           
 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.
 String[] getDataPortletPreferences()
          Returns an array of the portlet preferences that reference data.
 PortletDataHandlerControl[] getExportControls()
          Returns an array of the controls defined for this data handler.
 PortletDataHandlerControl[] getExportMetadataControls()
          Returns an array of the metadata controls defined for this data handler.
 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.
 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 isAlwaysExportable()
          Returns true to allow the user to export data for this portlet even though it may not belong to any pages.
 boolean isAlwaysStaged()
           
 boolean isDataLocalized()
           
 boolean isPublishToLiveByDefault()
          Returns whether the data exported by this handler should be included by default when publishing to live.
 
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

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

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

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

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

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

isAlwaysExportable

public boolean isAlwaysExportable()
Description copied from interface: PortletDataHandler
Returns true to allow the user to export data for this portlet even though it may not belong to any pages. See LPS-1624.

Specified by:
isAlwaysExportable in interface PortletDataHandler
Returns:
true to allow the user to export data for this portlet even though it may not belong to any pages

isAlwaysStaged

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

isDataLocalized

public boolean isDataLocalized()
Specified by:
isDataLocalized 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

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

Liferay 6.1.2-ce-ga3