Liferay 6.0.5

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

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 context, String portletId, PortletPreferences preferences)
           
protected  String doExportData(PortletDataContext context, String portletId, PortletPreferences preferences)
           
protected  PortletPreferences doImportData(PortletDataContext context, String portletId, PortletPreferences preferences, String data)
           
protected static void exportArticle(PortletDataContext context, Element articlesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element igFoldersElement, Element igImagesElement, JournalArticle article, boolean checkDateRange)
           
protected static String exportDLFileEntries(PortletDataContext context, Element foldersElement, Element fileEntriesElement, Element fileRanksElement, Element entityElement, String content)
           
protected static void exportFeed(PortletDataContext context, Element feedsElement, JournalFeed feed)
           
protected static String exportIGImages(PortletDataContext context, Element foldersElement, Element imagesElement, Element entityElement, String content)
           
protected static String exportLayoutFriendlyURLs(PortletDataContext context, String content)
           
protected static void exportStructure(PortletDataContext context, Element structuresElement, JournalStructure structure)
           
protected static void exportTemplate(PortletDataContext context, Element templatesElement, Element dlFoldersElement, Element dlFileEntriesElement, Element dlFileRanksElement, Element igFoldersElement, Element igImagesElement, JournalTemplate template)
           
protected static String getArticleImagePath(PortletDataContext context, JournalArticle article)
           
protected static String getArticleImagePath(PortletDataContext context, JournalArticle article, JournalArticleImage articleImage, Image image)
           
protected static String getArticlePath(PortletDataContext context, JournalArticle article)
           
protected static String getArticleSmallImagePath(PortletDataContext context, JournalArticle article)
           
 PortletDataHandlerControl[] getExportControls()
          Returns an array of the controls defined for this data handler.
protected static String getFeedPath(PortletDataContext context, JournalFeed feed)
           
 PortletDataHandlerControl[] getImportControls()
          Returns an array of the controls defined for this data handler.
protected static String getStructurePath(PortletDataContext context, JournalStructure structure)
           
protected static String getTemplatePath(PortletDataContext context, JournalTemplate template)
           
protected static String getTemplateSmallImagePath(PortletDataContext context, JournalTemplate template)
           
protected static void importArticle(PortletDataContext context, Element articleElement)
           
protected static String importDLFileEntries(PortletDataContext context, Element parentElement, String content)
           
protected static void importFeed(PortletDataContext context, Element feedElement)
           
protected static String importIGImages(PortletDataContext context, Element parentElement, String content)
           
protected static void importStructure(PortletDataContext context, Element structureElement)
           
protected static void importTemplate(PortletDataContext context, 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 isPublishToLiveByDefault()
          Returns whether the data exported by this handler should be included by default when publishing to live.
 
Methods inherited from class com.liferay.portal.kernel.lar.BasePortletDataHandler
deleteData, exportData, importData
 
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

protected static void exportArticle(PortletDataContext context,
                                    Element articlesElement,
                                    Element dlFoldersElement,
                                    Element dlFileEntriesElement,
                                    Element dlFileRanksElement,
                                    Element igFoldersElement,
                                    Element igImagesElement,
                                    JournalArticle article,
                                    boolean checkDateRange)
                             throws Exception
Throws:
Exception

exportDLFileEntries

protected static String exportDLFileEntries(PortletDataContext context,
                                            Element foldersElement,
                                            Element fileEntriesElement,
                                            Element fileRanksElement,
                                            Element entityElement,
                                            String content)

exportFeed

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

exportIGImages

protected static String exportIGImages(PortletDataContext context,
                                       Element foldersElement,
                                       Element imagesElement,
                                       Element entityElement,
                                       String content)

exportLayoutFriendlyURLs

protected static String exportLayoutFriendlyURLs(PortletDataContext context,
                                                 String content)

exportStructure

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

exportTemplate

protected static void exportTemplate(PortletDataContext context,
                                     Element templatesElement,
                                     Element dlFoldersElement,
                                     Element dlFileEntriesElement,
                                     Element dlFileRanksElement,
                                     Element igFoldersElement,
                                     Element igImagesElement,
                                     JournalTemplate template)
                              throws Exception
Throws:
Exception

getArticleImagePath

protected static String getArticleImagePath(PortletDataContext context,
                                            JournalArticle article)

getArticleImagePath

protected static String getArticleImagePath(PortletDataContext context,
                                            JournalArticle article,
                                            JournalArticleImage articleImage,
                                            Image image)

getArticlePath

protected static String getArticlePath(PortletDataContext context,
                                       JournalArticle article)

getArticleSmallImagePath

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

getFeedPath

protected static String getFeedPath(PortletDataContext context,
                                    JournalFeed feed)

getStructurePath

protected static String getStructurePath(PortletDataContext context,
                                         JournalStructure structure)

getTemplatePath

protected static String getTemplatePath(PortletDataContext context,
                                        JournalTemplate template)

getTemplateSmallImagePath

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

importArticle

protected static void importArticle(PortletDataContext context,
                                    Element articleElement)
                             throws Exception
Throws:
Exception

importDLFileEntries

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

importFeed

protected static void importFeed(PortletDataContext context,
                                 Element feedElement)
                          throws Exception
Throws:
Exception

importIGImages

protected static String importIGImages(PortletDataContext context,
                                       Element parentElement,
                                       String content)
                                throws Exception
Throws:
Exception

importStructure

protected static void importStructure(PortletDataContext context,
                                      Element structureElement)
                               throws Exception
Throws:
Exception

importTemplate

protected static void importTemplate(PortletDataContext context,
                                     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.

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.

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

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

doDeleteData

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

doExportData

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

doImportData

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

Liferay 6.0.5