public class JournalCreationStrategyImpl extends java.lang.Object implements JournalCreationStrategy
Provides the strategy for creating new content when new Journal content is imported into a layout set from a LAR. The default strategy implemented by this class is to return zero for the author and approval user IDs, which causes the default user ID import strategy to be used. Content will be added as is with no transformations.
JournalContentPortletDataHandler,
JournalPortletDataHandlerARTICLE_CONTENT_UNCHANGED, USE_DEFAULT_USER_ID_STRATEGY| Constructor and Description |
|---|
JournalCreationStrategyImpl() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addGroupPermissions(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
Returns
true if the default group permissions should be
added when the specified journalObj is created. |
boolean |
addGuestPermissions(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
Returns
true if the default guest permissions should be
added when the specified journalObj is created. |
long |
getAuthorUserId(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
Returns the author's user ID to assign to newly created content.
|
java.lang.String |
getTransformedContent(com.liferay.portal.kernel.lar.PortletDataContext context,
com.liferay.portlet.journal.model.JournalArticle newArticle)
Gives the content creation strategy an opportunity to transform the
content before the new article is saved to the database.
|
public boolean addGroupPermissions(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
throws java.lang.Exception
JournalCreationStrategytrue if the default group permissions should be
added when the specified journalObj is created.addGroupPermissions in interface JournalCreationStrategycontext - the portlet data contextjournalObj - the journal objecttrue if default group permissions should be added to
the specified journalObjjava.lang.Exception - if an exception occurredpublic boolean addGuestPermissions(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
throws java.lang.Exception
JournalCreationStrategytrue if the default guest permissions should be
added when the specified journalObj is created.addGuestPermissions in interface JournalCreationStrategycontext - the portlet data contextjournalObj - the journal objecttrue if default guest permissions should be added to
the specified journalObjjava.lang.Exception - if an exception occurredpublic long getAuthorUserId(com.liferay.portal.kernel.lar.PortletDataContext context,
java.lang.Object journalObj)
throws java.lang.Exception
JournalCreationStrategygetAuthorUserId in interface JournalCreationStrategycontext - the portlet data contextjournalObj - the journal objectjava.lang.Exception - if an exception occurredpublic java.lang.String getTransformedContent(com.liferay.portal.kernel.lar.PortletDataContext context,
com.liferay.portlet.journal.model.JournalArticle newArticle)
throws java.lang.Exception
JournalCreationStrategynull is returned, the article content will be added
unchanged.getTransformedContent in interface JournalCreationStrategycontext - the portlet data contextnewArticle - the new journal articlejava.lang.Exception - if an exception occurred