org.exoplatform.services.wcm.publication.lifecycle.simple
Class SimplePublicationPlugin

java.lang.Object
  extended by org.exoplatform.container.component.BaseComponentPlugin
      extended by org.exoplatform.services.ecm.publication.PublicationPlugin
          extended by org.exoplatform.services.wcm.publication.WebpagePublicationPlugin
              extended by org.exoplatform.services.wcm.publication.lifecycle.simple.SimplePublicationPlugin
All Implemented Interfaces:
org.exoplatform.container.component.ComponentPlugin

public class SimplePublicationPlugin
extends WebpagePublicationPlugin

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


Field Summary
static java.lang.String CURRENT_STATE
          The Constant CURRENT_STATE.
static java.lang.String DEFAULT_STATE
          The Constant DEFAULT_STATE.
static java.lang.String HISTORY
          The Constant HISTORY.
static java.lang.String IMG_PATH
          The Constant IMG_PATH.
static java.lang.String LIFECYCLE_NAME
          The Constant LIFECYCLE_NAME.
static java.lang.String LIFECYCLE_PROP
          The Constant LIFECYCLE_PROP.
static java.lang.String PUBLICATION
          The Constant PUBLICATION.
static java.lang.String WCM_PUBLICATION_MIXIN
          The Constant WCM_PUBLICATION_MIXIN.
 
Fields inherited from class org.exoplatform.container.component.BaseComponentPlugin
desc, name
 
Constructor Summary
SimplePublicationPlugin()
          Instantiates a new wCM publication plugin.
 
Method Summary
 void addMixin(javax.jcr.Node node)
           
 boolean canAddMixin(javax.jcr.Node node)
           
 void changeState(javax.jcr.Node node, java.lang.String newState, java.util.HashMap<java.lang.String,java.lang.String> context)
           
 java.lang.String getLifecycleType()
          Gets the lifecycle type.
 java.util.List<java.lang.String> getListPageNavigationUri(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Gets the services.
 java.lang.String getLocalizedAndSubstituteMessage(java.util.Locale locale, java.lang.String key, java.lang.String[] values)
           
 javax.jcr.Node getNodeView(javax.jcr.Node node, java.util.Map<java.lang.String,java.lang.Object> context)
           
 java.lang.String[] getPossibleStates()
           
 byte[] getStateImage(javax.jcr.Node node, java.util.Locale locale)
           
 org.exoplatform.webui.form.UIForm getStateUI(javax.jcr.Node node, org.exoplatform.webui.core.UIComponent component)
           
 java.lang.String getUserInfo(javax.jcr.Node node, java.util.Locale locale)
           
 void publishContentToCLV(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 node to a portal page.
 void publishContentToPage(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page)
           
 void publishContentToSCV(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page, java.lang.String portalOwnerName)
          Publish content node to a portal page.
 void suspendPublishedContentFromPage(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page)
           
 void suspendPublishedContentFromPage(javax.jcr.Node content, org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Suspend published content from a portal page.
static int transfer(java.io.InputStream in, java.io.OutputStream out)
          Transfer.
 void updateLifecycleOnChangeNavigation(org.exoplatform.portal.config.model.PageNavigation navigation, java.lang.String remoteUser)
          Update lifecyle state of the any content relates to a navigation when the navigation is changed.
 void updateLifecycleOnRemovePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Update lifecyle state of the any content relates to the page when page is removed.
 void updateLifecyleOnChangeContent(javax.jcr.Node node, java.lang.String remoteUser)
          Update the lifecycle of the content depending of its current state.
 void updateLifecyleOnChangeContent(javax.jcr.Node node, java.lang.String remoteUser, java.lang.String newState)
          Update the lifecycle of the content depending of its current state.
 void updateLifecyleOnChangePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Update lifecyle state of the any content relates to the page when page is changed.
 void updateLifecyleOnCreateNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
          Update lifecyle state of the any content relates to a navigation when the navigation is created.
 void updateLifecyleOnCreatePage(org.exoplatform.portal.config.model.Page page, java.lang.String remoteUser)
          Update lifecyle state of the any content relates to the page when page is created.
 void updateLifecyleOnRemoveNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
          Update lifecyle state of the any content relates to a navigation when the navigation is removed.
 
Methods inherited from class org.exoplatform.services.ecm.publication.PublicationPlugin
getLifecycleName, getNodeLifecycleDesc
 
Methods inherited from class org.exoplatform.container.component.BaseComponentPlugin
getDescription, getName, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_STATE

public static final java.lang.String DEFAULT_STATE
The Constant DEFAULT_STATE.

See Also:
Constant Field Values

PUBLICATION

public static final java.lang.String PUBLICATION
The Constant PUBLICATION.


LIFECYCLE_PROP

public static final java.lang.String LIFECYCLE_PROP
The Constant LIFECYCLE_PROP.


CURRENT_STATE

public static final java.lang.String CURRENT_STATE
The Constant CURRENT_STATE.


HISTORY

public static final java.lang.String HISTORY
The Constant HISTORY.


WCM_PUBLICATION_MIXIN

public static final java.lang.String WCM_PUBLICATION_MIXIN
The Constant WCM_PUBLICATION_MIXIN.


LIFECYCLE_NAME

public static final java.lang.String LIFECYCLE_NAME
The Constant LIFECYCLE_NAME.


IMG_PATH

public static final java.lang.String IMG_PATH
The Constant IMG_PATH.

Constructor Detail

SimplePublicationPlugin

public SimplePublicationPlugin()
Instantiates a new wCM publication plugin.

Method Detail

getLifecycleType

public java.lang.String getLifecycleType()
Description copied from class: WebpagePublicationPlugin
Gets the lifecycle type.

Specified by:
getLifecycleType in class WebpagePublicationPlugin
Returns:
the lifecycle type

addMixin

public void addMixin(javax.jcr.Node node)
              throws java.lang.Exception
Specified by:
addMixin in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

canAddMixin

public boolean canAddMixin(javax.jcr.Node node)
                    throws java.lang.Exception
Specified by:
canAddMixin in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

changeState

public void changeState(javax.jcr.Node node,
                        java.lang.String newState,
                        java.util.HashMap<java.lang.String,java.lang.String> context)
                 throws org.exoplatform.services.ecm.publication.IncorrectStateUpdateLifecycleException,
                        java.lang.Exception
Specified by:
changeState in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
org.exoplatform.services.ecm.publication.IncorrectStateUpdateLifecycleException
java.lang.Exception

getPossibleStates

public java.lang.String[] getPossibleStates()
Specified by:
getPossibleStates in class org.exoplatform.services.ecm.publication.PublicationPlugin

getStateImage

public byte[] getStateImage(javax.jcr.Node node,
                            java.util.Locale locale)
                     throws java.io.IOException,
                            java.io.FileNotFoundException,
                            java.lang.Exception
Specified by:
getStateImage in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.io.IOException
java.io.FileNotFoundException
java.lang.Exception

transfer

public static int transfer(java.io.InputStream in,
                           java.io.OutputStream out)
                    throws java.io.IOException
Transfer.

Parameters:
in - the in
out - the out
Returns:
the int
Throws:
java.io.IOException - Signals that an I/O exception has occurred.

getStateUI

public org.exoplatform.webui.form.UIForm getStateUI(javax.jcr.Node node,
                                                    org.exoplatform.webui.core.UIComponent component)
                                             throws java.lang.Exception
Specified by:
getStateUI in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

getUserInfo

public java.lang.String getUserInfo(javax.jcr.Node node,
                                    java.util.Locale locale)
                             throws java.lang.Exception
Specified by:
getUserInfo in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

publishContentToPage

public void publishContentToPage(javax.jcr.Node content,
                                 org.exoplatform.portal.config.model.Page page)
                          throws java.lang.Exception
Throws:
java.lang.Exception

suspendPublishedContentFromPage

public void suspendPublishedContentFromPage(javax.jcr.Node content,
                                            org.exoplatform.portal.config.model.Page page)
                                     throws java.lang.Exception
Throws:
java.lang.Exception

getListPageNavigationUri

public java.util.List<java.lang.String> getListPageNavigationUri(org.exoplatform.portal.config.model.Page page,
                                                                 java.lang.String remoteUser)
                                                          throws java.lang.Exception
Gets the services.

Specified by:
getListPageNavigationUri in class WebpagePublicationPlugin
Parameters:
page - the page
remoteUser - the remote user
Returns:
the services
Throws:
java.lang.Exception - the exception

getNodeView

public javax.jcr.Node getNodeView(javax.jcr.Node node,
                                  java.util.Map<java.lang.String,java.lang.Object> context)
                           throws java.lang.Exception
Specified by:
getNodeView in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

updateLifecycleOnChangeNavigation

public void updateLifecycleOnChangeNavigation(org.exoplatform.portal.config.model.PageNavigation navigation,
                                              java.lang.String remoteUser)
                                       throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to a navigation when the navigation is changed.

Specified by:
updateLifecycleOnChangeNavigation in class WebpagePublicationPlugin
Parameters:
navigation - the navigation
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

updateLifecycleOnRemovePage

public void updateLifecycleOnRemovePage(org.exoplatform.portal.config.model.Page page,
                                        java.lang.String remoteUser)
                                 throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to the page when page is removed.

Specified by:
updateLifecycleOnRemovePage in class WebpagePublicationPlugin
Parameters:
page - the page
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

updateLifecyleOnChangePage

public void updateLifecyleOnChangePage(org.exoplatform.portal.config.model.Page page,
                                       java.lang.String remoteUser)
                                throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to the page when page is changed.

Specified by:
updateLifecyleOnChangePage in class WebpagePublicationPlugin
Parameters:
page - the page
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

updateLifecyleOnCreateNavigation

public void updateLifecyleOnCreateNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
                                      throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to a navigation when the navigation is created.

Specified by:
updateLifecyleOnCreateNavigation in class WebpagePublicationPlugin
Parameters:
navigation - the navigation
Throws:
java.lang.Exception - the exception

updateLifecyleOnCreatePage

public void updateLifecyleOnCreatePage(org.exoplatform.portal.config.model.Page page,
                                       java.lang.String remoteUser)
                                throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to the page when page is created.

Specified by:
updateLifecyleOnCreatePage in class WebpagePublicationPlugin
Parameters:
page - the page
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

updateLifecyleOnRemoveNavigation

public void updateLifecyleOnRemoveNavigation(org.exoplatform.portal.config.model.PageNavigation navigation)
                                      throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update lifecyle state of the any content relates to a navigation when the navigation is removed.

Specified by:
updateLifecyleOnRemoveNavigation in class WebpagePublicationPlugin
Parameters:
navigation - the navigation
Throws:
java.lang.Exception - the exception

getLocalizedAndSubstituteMessage

public java.lang.String getLocalizedAndSubstituteMessage(java.util.Locale locale,
                                                         java.lang.String key,
                                                         java.lang.String[] values)
                                                  throws java.lang.Exception
Specified by:
getLocalizedAndSubstituteMessage in class org.exoplatform.services.ecm.publication.PublicationPlugin
Throws:
java.lang.Exception

publishContentToCLV

public void publishContentToCLV(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 class: WebpagePublicationPlugin
Publish content node to a portal page.

Specified by:
publishContentToCLV in class WebpagePublicationPlugin
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

publishContentToSCV

public void publishContentToSCV(javax.jcr.Node content,
                                org.exoplatform.portal.config.model.Page page,
                                java.lang.String portalOwnerName)
                         throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Publish content node to a portal page. Base of each publication lifecycle implementation,a new portlet can be added to the page and the lifecyle state will be created

Specified by:
publishContentToSCV in class WebpagePublicationPlugin
Parameters:
content - the jcr content node
page - the portal page
portalOwnerName - the portal owner name
Throws:
java.lang.Exception - the exception

suspendPublishedContentFromPage

public void suspendPublishedContentFromPage(javax.jcr.Node content,
                                            org.exoplatform.portal.config.model.Page page,
                                            java.lang.String remoteUser)
                                     throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Suspend published content from a portal page. Base of each publication lifecycle implementation, a portlet that is used to publish the content can be removed to the page and the lifecyle state will be created

Specified by:
suspendPublishedContentFromPage in class WebpagePublicationPlugin
Parameters:
content - the content
page - the page
remoteUser - the remote user
Throws:
java.lang.Exception - the exception

updateLifecyleOnChangeContent

public void updateLifecyleOnChangeContent(javax.jcr.Node node,
                                          java.lang.String remoteUser)
                                   throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update the lifecycle of the content depending of its current state. This method is generally called when the node has been modified (saved).

Specified by:
updateLifecyleOnChangeContent in class WebpagePublicationPlugin
Parameters:
node - the node
remoteUser - the remote user
Throws:
java.lang.Exception - the exception
See Also:
PostCreateContentEventListener, PostEditContentEventListener

updateLifecyleOnChangeContent

public void updateLifecyleOnChangeContent(javax.jcr.Node node,
                                          java.lang.String remoteUser,
                                          java.lang.String newState)
                                   throws java.lang.Exception
Description copied from class: WebpagePublicationPlugin
Update the lifecycle of the content depending of its current state. This method is generally called when the node has been modified (saved).

Specified by:
updateLifecyleOnChangeContent in class WebpagePublicationPlugin
Parameters:
node - the node
remoteUser - the remote user
newState - the new state
Throws:
java.lang.Exception - the exception
See Also:
PostCreateContentEventListener, PostEditContentEventListener


Copyright © 2010 eXo Platform SAS. All Rights Reserved.