org.exoplatform.services.wcm.publication
Class WCMPublicationServiceImpl

java.lang.Object
  extended by org.exoplatform.services.wcm.publication.WCMPublicationServiceImpl
All Implemented Interfaces:
WCMPublicationService, org.picocontainer.Startable

public class WCMPublicationServiceImpl
extends java.lang.Object
implements WCMPublicationService, org.picocontainer.Startable

Created by The eXo Platform SAS Author : Hoa Pham hoa.pham@exoplatform.com Sep 29, 2008


Field Summary
 
Fields inherited from interface org.exoplatform.services.wcm.publication.WCMPublicationService
UPDATE_EVENT
 
Constructor Summary
WCMPublicationServiceImpl()
          Instantiates a new WCM publication service.
 
Method Summary
 void addPublicationPlugin(WebpagePublicationPlugin p)
          Add a Web Publication Plugin to the service.
 void enrollNodeInLifecycle(javax.jcr.Node node, java.lang.String lifecycleName)
          Enroll in a web page publication lifecycle.
 void enrollNodeInLifecycle(javax.jcr.Node node, java.lang.String siteName, java.lang.String remoteUser)
          This default implementation uses "States and versions based publication" as a default lifecycle for all sites and "Simple Publishing" for the root user.
 java.lang.String getContentState(javax.jcr.Node node)
          returns the current state of the content.
 java.util.Map<java.lang.String,WebpagePublicationPlugin> getWebpagePublicationPlugins()
          Retrieves all added web page publication plugins.
 boolean isEnrolledInWCMLifecycle(javax.jcr.Node node)
          Checks if is enrolled in wcm lifecycle.
 void publishContentCLV(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page, java.lang.String clvPortletId, java.lang.String portalOwnerName, java.lang.String remoteUser)
          Publish content to a portal page when the node is in a publication lifecyle.
 void publishContentSCV(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page, java.lang.String portalOwnerName)
          Publish content to a portal page when the node is in a publication lifecyle.
 void start()
           
 void stop()
           
 void suspendPublishedContentFromPage(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Suspend a published content from a portal page.
 void unsubcribeLifecycle(javax.jcr.Node node)
          Unsubcribe node from a lifecycle plugin.
 void updateLifecycleOnChangeNavigation(org.exoplatform.portal.config.model.PageNavigation navigation, java.lang.String remoteUser)
          Retrieves all web page lifecycles and update the publication lifecycle when a navigation is changed.
 void updateLifecycleOnRemovePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Retrieves all web page lifecycles and update the publication lifecycle when a page is removed.
 void updateLifecyleOnChangeContent(javax.jcr.Node node, java.lang.String siteName, java.lang.String remoteUser)
          This default implementation simply delegates updates to the node WebpagePublicationPlugin.
 void updateLifecyleOnChangeContent(javax.jcr.Node node, java.lang.String siteName, java.lang.String remoteUser, java.lang.String newState)
          This default implementation checks if the state is valid then delegates the update to the node WebpagePublicationPlugin.
 void updateLifecyleOnChangePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Retrieves all web page lifecycles and update the publication lifecycle when a page is changed.
 void updateLifecyleOnCreateNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
          Retrieves all web page lifecycles and update the publication lifecycle when a navigation is created.
 void updateLifecyleOnCreatePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Retrieves all web page lifecycles and update the publication lifecycle when a page is created.
 void updateLifecyleOnRemoveNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
          Retrieves all web page lifecycles and update the publication lifecycle when a navigation is removed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WCMPublicationServiceImpl

public WCMPublicationServiceImpl()
Instantiates a new WCM publication service. This service delegate to PublicationService to manage the publication

Parameters:
publicationService - the publication service
Method Detail

addPublicationPlugin

public void addPublicationPlugin(WebpagePublicationPlugin p)
Description copied from interface: WCMPublicationService
Add a Web Publication Plugin to the service. The method caches all added plugins.

Specified by:
addPublicationPlugin in interface WCMPublicationService
Parameters:
p - the plugin to add

suspendPublishedContentFromPage

public void suspendPublishedContentFromPage(javax.jcr.Node content,
                                            org.exoplatform.portal.config.model.Page page,
                                            java.lang.String remoteUser)
                                     throws org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException,
                                            java.lang.Exception
Description copied from interface: WCMPublicationService
Suspend a published content from a portal page.

Specified by:
suspendPublishedContentFromPage in interface WCMPublicationService
Parameters:
content - the jcr content node
page - the portal page
Throws:
org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException - the not in publication lifecycle exception
java.lang.Exception - the exception

publishContentSCV

public void publishContentSCV(javax.jcr.Node content,
                              org.exoplatform.portal.config.model.Page page,
                              java.lang.String portalOwnerName)
                       throws org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException,
                              java.lang.Exception
Description copied from interface: WCMPublicationService
Publish content to a portal page when the node is in a publication lifecyle.

Specified by:
publishContentSCV in interface WCMPublicationService
Parameters:
content - the content
page - the page
Throws:
org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException - the not in publication lifecycle exception
java.lang.Exception - the exception

publishContentCLV

public void publishContentCLV(javax.jcr.Node content,
                              org.exoplatform.portal.config.model.Page page,
                              java.lang.String clvPortletId,
                              java.lang.String portalOwnerName,
                              java.lang.String remoteUser)
                       throws java.lang.Exception
Description copied from interface: WCMPublicationService
Publish content to a portal page when the node is in a publication lifecyle.

Specified by:
publishContentCLV in interface WCMPublicationService
Parameters:
content - the content
page - the page
clvPortletId - the clv portlet id
portalOwnerName - the portal owner name
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

enrollNodeInLifecycle

public void enrollNodeInLifecycle(javax.jcr.Node node,
                                  java.lang.String lifecycleName)
                           throws java.lang.Exception
Description copied from interface: WCMPublicationService
Enroll in a web page publication lifecycle. The method will be retrieve the web page publication lifecycle by lifecycle name and enroll to lifecycle

Specified by:
enrollNodeInLifecycle in interface WCMPublicationService
Parameters:
node - the node
lifecycleName - the lifecycle name
Throws:
java.lang.Exception - the exception

unsubcribeLifecycle

public void unsubcribeLifecycle(javax.jcr.Node node)
                         throws org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException,
                                java.lang.Exception
Description copied from interface: WCMPublicationService
Unsubcribe node from a lifecycle plugin. After unsubcribe, the node can enroll to other publication lifecycle

Specified by:
unsubcribeLifecycle in interface WCMPublicationService
Parameters:
node - the node
Throws:
org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException - the not in publication lifecycle exception
java.lang.Exception - the exception

getWebpagePublicationPlugins

public java.util.Map<java.lang.String,WebpagePublicationPlugin> getWebpagePublicationPlugins()
Description copied from interface: WCMPublicationService
Retrieves all added web page publication plugins. This method is notably used to enumerate possible lifecycles.

Specified by:
getWebpagePublicationPlugins in interface WCMPublicationService
Returns:
the map of web page publication plugin

updateLifecycleOnChangeNavigation

public void updateLifecycleOnChangeNavigation(org.exoplatform.portal.config.model.PageNavigation navigation,
                                              java.lang.String remoteUser)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a navigation is changed.

Specified by:
updateLifecycleOnChangeNavigation in interface WCMPublicationService
Parameters:
navigation - the navigation

updateLifecycleOnRemovePage

public void updateLifecycleOnRemovePage(org.exoplatform.portal.config.model.Page page,
                                        java.lang.String remoteUser)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a page is removed.

Specified by:
updateLifecycleOnRemovePage in interface WCMPublicationService
Parameters:
page - the page

updateLifecyleOnChangePage

public void updateLifecyleOnChangePage(org.exoplatform.portal.config.model.Page page,
                                       java.lang.String remoteUser)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a page is changed.

Specified by:
updateLifecyleOnChangePage in interface WCMPublicationService
Parameters:
page - the page

updateLifecyleOnCreateNavigation

public void updateLifecyleOnCreateNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a navigation is created.

Specified by:
updateLifecyleOnCreateNavigation in interface WCMPublicationService
Parameters:
navigation - the navigation

updateLifecyleOnCreatePage

public void updateLifecyleOnCreatePage(org.exoplatform.portal.config.model.Page page,
                                       java.lang.String remoteUser)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a page is created.

Specified by:
updateLifecyleOnCreatePage in interface WCMPublicationService
Parameters:
page - the page

updateLifecyleOnRemoveNavigation

public void updateLifecyleOnRemoveNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
Description copied from interface: WCMPublicationService
Retrieves all web page lifecycles and update the publication lifecycle when a navigation is removed.

Specified by:
updateLifecyleOnRemoveNavigation in interface WCMPublicationService
Parameters:
navigation - the navigation

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable

isEnrolledInWCMLifecycle

public boolean isEnrolledInWCMLifecycle(javax.jcr.Node node)
                                 throws org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException,
                                        java.lang.Exception
Description copied from interface: WCMPublicationService
Checks if is enrolled in wcm lifecycle.

Specified by:
isEnrolledInWCMLifecycle in interface WCMPublicationService
Parameters:
node - the node
Returns:
true, if is enrolled in wcm lifecycle
Throws:
org.exoplatform.services.ecm.publication.NotInPublicationLifecycleException - the not in publication lifecycle exception
java.lang.Exception - the exception

enrollNodeInLifecycle

public void enrollNodeInLifecycle(javax.jcr.Node node,
                                  java.lang.String siteName,
                                  java.lang.String remoteUser)
                           throws java.lang.Exception
This default implementation uses "States and versions based publication" as a default lifecycle for all sites and "Simple Publishing" for the root user.

Specified by:
enrollNodeInLifecycle in interface WCMPublicationService
Throws:
java.lang.Exception

updateLifecyleOnChangeContent

public void updateLifecyleOnChangeContent(javax.jcr.Node node,
                                          java.lang.String siteName,
                                          java.lang.String remoteUser)
                                   throws java.lang.Exception
This default implementation simply delegates updates to the node WebpagePublicationPlugin.

Specified by:
updateLifecyleOnChangeContent in interface WCMPublicationService
Throws:
java.lang.Exception
See Also:
PostCreateContentEventListener, PostEditContentEventListener

updateLifecyleOnChangeContent

public void updateLifecyleOnChangeContent(javax.jcr.Node node,
                                          java.lang.String siteName,
                                          java.lang.String remoteUser,
                                          java.lang.String newState)
                                   throws java.lang.Exception
This default implementation checks if the state is valid then delegates the update to the node WebpagePublicationPlugin.

Specified by:
updateLifecyleOnChangeContent in interface WCMPublicationService
Throws:
java.lang.Exception

getContentState

public java.lang.String getContentState(javax.jcr.Node node)
                                 throws java.lang.Exception
Description copied from interface: WCMPublicationService
returns the current state of the content. We consider the publication:currentState property mandatory in all lifecycles.

Specified by:
getContentState in interface WCMPublicationService
Returns:
the revision state stored in publication:currentState property
Throws:
java.lang.Exception


Copyright © 2011 eXo Platform SAS. All Rights Reserved.