Liferay 6.1.2-ce-ga3

com.liferay.portlet.journal.lar
Class JournalPortletDataHandlerImpl

java.lang.Object
  extended by com.liferay.portal.kernel.lar.BasePortletDataHandler
      extended by com.liferay.portlet.journal.lar.JournalPortletDataHandlerImpl
All Implemented Interfaces:
PortletDataHandler
Direct Known Subclasses:
RSSPortletDataHandlerImpl

public class JournalPortletDataHandlerImpl
extends BasePortletDataHandler

Provides the Journal portlet export and import functionality, which is to clone all articles, structures, and templates associated with the layout's group. Upon import, new instances of the corresponding articles, structures, and templates are created or updated according to the DATA_MIRROW strategy The author of the newly created objects are determined by the JournalCreationStrategy class defined in portal.properties. That strategy also allows the text of the journal article to be modified prior to import.

This PortletDataHandler differs from JournalContentPortletDataHandlerImpl in that it exports all articles owned by the group whether or not they are actually displayed in a portlet in the layout set.

See Also:
PortletDataHandler, JournalContentPortletDataHandlerImpl, JournalCreationStrategy

Constructor Summary
JournalPortletDataHandlerImpl()
           
 
Method Summary
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)
           
static void exportArticle(PortletDataContext portletDataContext, Element articlesElement, Element structuresElement, Element templatesElement, Element dlFileEntryTypesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element dlRepositoriesElement, Element dlRepositoryEntriesElement, JournalArticle article, boolean checkDateRange)
           
protected static String exportDLFileEntries(PortletDataContext portletDataContext, Element dlFileEntryTypesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element dlRepositoriesElement, Element dlRepositoryEntriesElement, Element entityElement, String content, boolean checkDateRange)
           
protected static void exportFeed(PortletDataContext portletDataContext, Element feedsElement, JournalFeed feed)
           
protected static String exportLayoutFriendlyURLs(PortletDataContext portletDataContext, String content)
           
protected static String exportLinksToLayout(PortletDataContext portletDataContext, String content)
           
static String exportReferencedContent(PortletDataContext portletDataContext, Element dlFileEntryTypesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element dlRepositoriesElement, Element dlRepositoryEntriesElement, Element entityElement, String content)
           
protected static void exportStructure(PortletDataContext portletDataContext, Element structuresElement, JournalStructure structure)
           
protected static void exportTemplate(PortletDataContext portletDataContext, Element templatesElement, Element dlFileEntryTypesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element dlRepositoriesElement, Element dlRepositoryEntriesElement, JournalTemplate template)
           
protected static String getArticleImagePath(PortletDataContext portletDataContext, JournalArticle article)
           
protected static String getArticleImagePath(PortletDataContext portletDataContext, JournalArticle article, JournalArticleImage articleImage, Image image)
           
static String getArticlePath(PortletDataContext portletDataContext, JournalArticle article)
           
protected static String getArticleSmallImagePath(PortletDataContext portletDataContext, JournalArticle article)
           
 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.
protected static String getFeedPath(PortletDataContext portletDataContext, JournalFeed feed)
           
 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.
static PortletDataHandlerControl[] getMetadataControls()
           
protected static String getStructurePath(PortletDataContext portletDataContext, String uuid)
           
protected static String getTemplatePath(PortletDataContext portletDataContext, JournalTemplate template)
           
protected static String getTemplateSmallImagePath(PortletDataContext portletDataContext, JournalTemplate template)
           
static void importArticle(PortletDataContext portletDataContext, Element articleElement)
           
protected static String importDLFileEntries(PortletDataContext portletDataContext, Element parentElement, String content)
           
static void importFeed(PortletDataContext portletDataContext, Element feedElement)
           
protected static String importLayoutFriendlyURLs(PortletDataContext portletDataContext, String content)
           
protected static String importLinksToLayout(PortletDataContext portletDataContext, String content)
           
static String importReferencedContent(PortletDataContext portletDataContext, Element parentElement, String content)
           
static void importReferencedData(PortletDataContext portletDataContext, Element entityElement)
           
static void importStructure(PortletDataContext portletDataContext, Element structureElement)
           
static void importTemplate(PortletDataContext portletDataContext, Element templateElement)
           
 boolean isAlwaysExportable()
          Returns true to allow the user to export data for this portlet even though it may not belong to any pages.
 boolean isDataLocalized()
           
 boolean isPublishToLiveByDefault()
          Returns whether the data exported by this handler should be included by default when publishing to live.
protected static void prepareLanguagesForImport(JournalArticle article)
           
 
Methods inherited from class com.liferay.portal.kernel.lar.BasePortletDataHandler
deleteData, exportData, getDataPortletPreferences, importData, isAlwaysStaged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JournalPortletDataHandlerImpl

public JournalPortletDataHandlerImpl()
Method Detail

exportArticle

public static void exportArticle(PortletDataContext portletDataContext,
                                 Element articlesElement,
                                 Element structuresElement,
                                 Element templatesElement,
                                 Element dlFileEntryTypesElement,
                                 Element dlFoldersElement,
                                 Element dlFileEntriesElement,
                                 Element dlFileRanksElement,
                                 Element dlRepositoriesElement,
                                 Element dlRepositoryEntriesElement,
                                 JournalArticle article,
                                 boolean checkDateRange)
                          throws Exception
Throws:
Exception

exportReferencedContent

public static String exportReferencedContent(PortletDataContext portletDataContext,
                                             Element dlFileEntryTypesElement,
                                             Element dlFoldersElement,
                                             Element dlFileEntriesElement,
                                             Element dlFileRanksElement,
                                             Element dlRepositoriesElement,
                                             Element dlRepositoryEntriesElement,
                                             Element entityElement,
                                             String content)
                                      throws Exception
Throws:
Exception

getArticlePath

public static String getArticlePath(PortletDataContext portletDataContext,
                                    JournalArticle article)
                             throws Exception
Throws:
Exception

getMetadataControls

public static PortletDataHandlerControl[] getMetadataControls()

importArticle

public static void importArticle(PortletDataContext portletDataContext,
                                 Element articleElement)
                          throws Exception
Throws:
Exception

importFeed

public static void importFeed(PortletDataContext portletDataContext,
                              Element feedElement)
                       throws Exception
Throws:
Exception

importReferencedContent

public static String importReferencedContent(PortletDataContext portletDataContext,
                                             Element parentElement,
                                             String content)
                                      throws Exception
Throws:
Exception

importReferencedData

public static void importReferencedData(PortletDataContext portletDataContext,
                                        Element entityElement)
                                 throws Exception
Throws:
Exception

importStructure

public static void importStructure(PortletDataContext portletDataContext,
                                   Element structureElement)
                            throws Exception
Throws:
Exception

importTemplate

public static void importTemplate(PortletDataContext portletDataContext,
                                  Element templateElement)
                           throws Exception
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
Overrides:
getExportControls in class BasePortletDataHandler
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
Overrides:
getExportMetadataControls in class BasePortletDataHandler
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
Overrides:
getImportControls in class BasePortletDataHandler
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
Overrides:
getImportMetadataControls in class BasePortletDataHandler
Returns:
an array of PortletDataHandlerControls

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
Overrides:
isAlwaysExportable in class BasePortletDataHandler
Returns:
true to allow the user to export data for this portlet even though it may not belong to any pages

isDataLocalized

public boolean isDataLocalized()
Specified by:
isDataLocalized in interface PortletDataHandler
Overrides:
isDataLocalized in class BasePortletDataHandler

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
Overrides:
isPublishToLiveByDefault in class BasePortletDataHandler
Returns:
true to publish to live by default

exportDLFileEntries

protected static String exportDLFileEntries(PortletDataContext portletDataContext,
                                            Element dlFileEntryTypesElement,
                                            Element dlFoldersElement,
                                            Element dlFileEntriesElement,
                                            Element dlFileRanksElement,
                                            Element dlRepositoriesElement,
                                            Element dlRepositoryEntriesElement,
                                            Element entityElement,
                                            String content,
                                            boolean checkDateRange)
                                     throws Exception
Throws:
Exception

exportFeed

protected static void exportFeed(PortletDataContext portletDataContext,
                                 Element feedsElement,
                                 JournalFeed feed)
                          throws Exception
Throws:
Exception

exportLayoutFriendlyURLs

protected static String exportLayoutFriendlyURLs(PortletDataContext portletDataContext,
                                                 String content)

exportLinksToLayout

protected static String exportLinksToLayout(PortletDataContext portletDataContext,
                                            String content)
                                     throws Exception
Throws:
Exception

exportStructure

protected static void exportStructure(PortletDataContext portletDataContext,
                                      Element structuresElement,
                                      JournalStructure structure)
                               throws Exception
Throws:
Exception

exportTemplate

protected static void exportTemplate(PortletDataContext portletDataContext,
                                     Element templatesElement,
                                     Element dlFileEntryTypesElement,
                                     Element dlFoldersElement,
                                     Element dlFileEntriesElement,
                                     Element dlFileRanksElement,
                                     Element dlRepositoriesElement,
                                     Element dlRepositoryEntriesElement,
                                     JournalTemplate template)
                              throws Exception
Throws:
Exception

getArticleImagePath

protected static String getArticleImagePath(PortletDataContext portletDataContext,
                                            JournalArticle article)
                                     throws Exception
Throws:
Exception

getArticleImagePath

protected static String getArticleImagePath(PortletDataContext portletDataContext,
                                            JournalArticle article,
                                            JournalArticleImage articleImage,
                                            Image image)
                                     throws Exception
Throws:
Exception

getArticleSmallImagePath

protected static String getArticleSmallImagePath(PortletDataContext portletDataContext,
                                                 JournalArticle article)
                                          throws Exception
Throws:
Exception

getFeedPath

protected static String getFeedPath(PortletDataContext portletDataContext,
                                    JournalFeed feed)

getStructurePath

protected static String getStructurePath(PortletDataContext portletDataContext,
                                         String uuid)

getTemplatePath

protected static String getTemplatePath(PortletDataContext portletDataContext,
                                        JournalTemplate template)

getTemplateSmallImagePath

protected static String getTemplateSmallImagePath(PortletDataContext portletDataContext,
                                                  JournalTemplate template)
                                           throws Exception
Throws:
Exception

importDLFileEntries

protected static String importDLFileEntries(PortletDataContext portletDataContext,
                                            Element parentElement,
                                            String content)
                                     throws Exception
Throws:
Exception

importLayoutFriendlyURLs

protected static String importLayoutFriendlyURLs(PortletDataContext portletDataContext,
                                                 String content)
                                          throws Exception
Throws:
Exception

importLinksToLayout

protected static String importLinksToLayout(PortletDataContext portletDataContext,
                                            String content)
                                     throws Exception
Throws:
Exception

prepareLanguagesForImport

protected static void prepareLanguagesForImport(JournalArticle article)
                                         throws PortalException
Throws:
PortalException

doDeleteData

protected PortletPreferences doDeleteData(PortletDataContext portletDataContext,
                                          String portletId,
                                          PortletPreferences portletPreferences)
                                   throws Exception
Overrides:
doDeleteData in class BasePortletDataHandler
Throws:
Exception

doExportData

protected String doExportData(PortletDataContext portletDataContext,
                              String portletId,
                              PortletPreferences portletPreferences)
                       throws Exception
Overrides:
doExportData in class BasePortletDataHandler
Throws:
Exception

doImportData

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

Liferay 6.1.2-ce-ga3