org.exoplatform.services.wcm.publication
Class PublicationUtil

java.lang.Object
  extended by org.exoplatform.services.wcm.publication.PublicationUtil

public class PublicationUtil
extends java.lang.Object

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


Field Summary
static java.lang.String APPLICATION_SEPARATOR
          The Constant APPLICATION_SEPARATOR.
static java.lang.String HISTORY_SEPARATOR
          The Constant HISTORY_SEPARATOR.
static java.lang.String URI_SEPARATOR
          The Constant URI_SEPARATOR.
 
Constructor Summary
PublicationUtil()
           
 
Method Summary
static org.exoplatform.portal.config.model.Application findAppInstancesById(org.exoplatform.portal.config.model.Container container, java.lang.String applicationId)
          Find app instances by id.
static java.util.List<java.lang.String> findAppInstancesByName(org.exoplatform.portal.config.model.Page page, java.lang.String applicationName)
          Find app instances by name.
static java.util.List<org.exoplatform.portal.config.model.PageNode> findPageNodeByPageId(org.exoplatform.portal.config.model.PageNavigation nav, java.lang.String pageId)
          Find page node by page id.
static void findPageNodeByPageId(org.exoplatform.portal.config.model.PageNode node, java.lang.String pageId, java.util.List<org.exoplatform.portal.config.model.PageNode> allPageNode)
          Find page node by page id.
static java.util.ArrayList<org.exoplatform.portal.config.model.PageNode> getAllPageNodeFromPageNavigation(org.exoplatform.portal.config.model.PageNavigation pageNavigation)
          Gets the all page node from page navigation.
static java.util.List<java.lang.String> getListApplicationIdByPage(org.exoplatform.portal.config.model.Page page, java.lang.String portletName)
          Gets the list application id by page.
static javax.jcr.Node getNodeByApplicationId(java.lang.String applicationId)
          Gets the node by application id.
static
<T> T
getServices(java.lang.Class<T> clazz)
          Gets the services.
static java.util.List<java.lang.String> getValuesAsString(javax.jcr.Node node, java.lang.String propName)
          Gets the values as string.
static boolean isNodeContentPublishedToPageNode(javax.jcr.Node contentNode, java.lang.String navNodeURI)
          Checks if is node content published to page node.
static java.lang.String[] parseMixedApplicationId(java.lang.String mixedApplicationId)
          Parses the mixed application id.
static java.lang.String[] parseMixedNavigationUri(java.lang.String mixedNavigationUri)
          Parses the mixed navigation uri.
static void removeApplicationFromPage(org.exoplatform.portal.config.model.Page page, java.util.List<java.lang.String> removedApplicationIds)
          Removes the application from page.
static java.lang.String setMixedApplicationId(java.lang.String pageId, java.lang.String applicationId)
          Sets the mixed application id.
static java.lang.String setMixedNavigationUri(java.lang.String portalName, java.lang.String pageNodeUri)
          Sets the mixed navigation uri.
static javax.jcr.Value[] toValues(javax.jcr.ValueFactory factory, java.util.List<java.lang.String> values)
          To values.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HISTORY_SEPARATOR

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

See Also:
Constant Field Values

APPLICATION_SEPARATOR

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

See Also:
Constant Field Values

URI_SEPARATOR

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

See Also:
Constant Field Values
Constructor Detail

PublicationUtil

public PublicationUtil()
Method Detail

findPageNodeByPageId

public static java.util.List<org.exoplatform.portal.config.model.PageNode> findPageNodeByPageId(org.exoplatform.portal.config.model.PageNavigation nav,
                                                                                                java.lang.String pageId)
                                                                                         throws java.lang.Exception
Find page node by page id.

Parameters:
nav - the nav
pageId - the page id
Returns:
the list< page node>
Throws:
java.lang.Exception - the exception

findPageNodeByPageId

public static void findPageNodeByPageId(org.exoplatform.portal.config.model.PageNode node,
                                        java.lang.String pageId,
                                        java.util.List<org.exoplatform.portal.config.model.PageNode> allPageNode)
                                 throws java.lang.Exception
Find page node by page id.

Parameters:
node - the node
pageId - the page id
allPageNode - the all page node
Throws:
java.lang.Exception - the exception

findAppInstancesByName

public static java.util.List<java.lang.String> findAppInstancesByName(org.exoplatform.portal.config.model.Page page,
                                                                      java.lang.String applicationName)
Find app instances by name.

Parameters:
page - the page
applicationName - the application name
Returns:
the list< string>

findAppInstancesById

public static org.exoplatform.portal.config.model.Application findAppInstancesById(org.exoplatform.portal.config.model.Container container,
                                                                                   java.lang.String applicationId)
Find app instances by id.

Parameters:
container - the container
applicationId - the application id
Returns:
the application

getValuesAsString

public static java.util.List<java.lang.String> getValuesAsString(javax.jcr.Node node,
                                                                 java.lang.String propName)
                                                          throws java.lang.Exception
Gets the values as string.

Parameters:
node - the node
propName - the prop name
Returns:
the values as string
Throws:
java.lang.Exception - the exception

toValues

public static javax.jcr.Value[] toValues(javax.jcr.ValueFactory factory,
                                         java.util.List<java.lang.String> values)
To values.

Parameters:
factory - the factory
values - the values
Returns:
the value[]

getNodeByApplicationId

public static javax.jcr.Node getNodeByApplicationId(java.lang.String applicationId)
                                             throws java.lang.Exception
Gets the node by application id.

Parameters:
applicationId - the application id
Returns:
the node by application id
Throws:
java.lang.Exception - the exception

removeApplicationFromPage

public static void removeApplicationFromPage(org.exoplatform.portal.config.model.Page page,
                                             java.util.List<java.lang.String> removedApplicationIds)
Removes the application from page.

Parameters:
page - the page
removedApplicationIds - the removed application ids

getListApplicationIdByPage

public static java.util.List<java.lang.String> getListApplicationIdByPage(org.exoplatform.portal.config.model.Page page,
                                                                          java.lang.String portletName)
Gets the list application id by page.

Parameters:
page - the page
portletName - the portlet name
Returns:
the list application id by page

setMixedNavigationUri

public static java.lang.String setMixedNavigationUri(java.lang.String portalName,
                                                     java.lang.String pageNodeUri)
Sets the mixed navigation uri.

Parameters:
portalName - the portal name
pageNodeUri - the page node uri
Returns:
the string

parseMixedNavigationUri

public static java.lang.String[] parseMixedNavigationUri(java.lang.String mixedNavigationUri)
Parses the mixed navigation uri.

Parameters:
mixedNavigationUri - the mixed navigation uri
Returns:
the string[]

setMixedApplicationId

public static java.lang.String setMixedApplicationId(java.lang.String pageId,
                                                     java.lang.String applicationId)
Sets the mixed application id.

Parameters:
pageId - the page id
applicationId - the application id
Returns:
the string

parseMixedApplicationId

public static java.lang.String[] parseMixedApplicationId(java.lang.String mixedApplicationId)
Parses the mixed application id.

Parameters:
mixedApplicationId - the mixed application id
Returns:
the string[]

getServices

public static <T> T getServices(java.lang.Class<T> clazz)
Gets the services.

Parameters:
clazz - the clazz
Returns:
the services

isNodeContentPublishedToPageNode

public static boolean isNodeContentPublishedToPageNode(javax.jcr.Node contentNode,
                                                       java.lang.String navNodeURI)
                                                throws java.lang.Exception
Checks if is node content published to page node.

Parameters:
contentNode - the content node
navNodeURI - the nav node uri
Returns:
true, if is node content published to page node
Throws:
java.lang.Exception - the exception

getAllPageNodeFromPageNavigation

public static java.util.ArrayList<org.exoplatform.portal.config.model.PageNode> getAllPageNodeFromPageNavigation(org.exoplatform.portal.config.model.PageNavigation pageNavigation)
Gets the all page node from page navigation.

Parameters:
pageNavigation - the page navigation
Returns:
the all page node from page navigation


Copyright © 2011 eXo Platform SAS. All Rights Reserved.