lumis.portal.page
Class PageManager

Package class diagram package PageManager
java.lang.Object
  extended by lumis.portal.page.PageManager
All Implemented Interfaces:
IPageManager, IConfigDeleter, IConfigKeyChecker

public class PageManager
extends Object
implements IPageManager

Page manager implementation.

Since:
4.0.0

Constructor Summary
PageManager()
           
 
Method Summary
 String add(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
          Add a page.
 void addCssLink(SessionConfig sessionConfig, String pageId, String cssId, int position, ITransaction transaction)
          Add the hyperlink to the page's CSS file.
 void addOrUpdate(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
          Add or Update a Page, depending on its previous existence.
 void clearCache(SessionConfig sessionConfig, Collection<String> pageIds, ITransaction transaction)
          Clears the cache for a group of pages.
 void clearCache(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Clear the page cache.
 void copy(SessionConfig sessionConfig, String sourcePageId, String destinationPageId, ITransaction transaction)
          Copy the layout and properties from the original page to the destination page.
 void delete(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Delete a page.
 void deleteConfig(DeserializationContext deserializationContext, String configId)
           
 void deleteCssLink(SessionConfig sessionConfig, String pageId, String cssId, ITransaction transaction)
          Delete the hyperlink to the page's CSS file.
 void deleteOrphanInterfaces(SessionConfig sessionConfig, String pageId, ITransaction daoTransaction)
          Remove any interface instance associated to the page that is not being referenced in it's layout.
 String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node pageNode, boolean firstDeserialization, ITransaction transaction)
           
 String deserialize(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node pageNode, ITransaction transaction)
           
 void deserializeCss(SessionConfig sessionConfig, DeserializationConfig deserializationConfig, Node cssLinksNodes, ITransaction transaction)
           
protected  void disconnectFromTemplate_Internal(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
           
 void disconnectFromTemplate(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Disconnect the page from its template if one exists
 PageConfig get(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Get the configuration of the page.
 int getCachePage(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
           
 boolean getCenterPage(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
           
 List<String> getCssIds(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Get a list of Css Ids of the page.
 List<String> getCssIdsRecursively(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Get a list of Css Ids of the page including inherited Css.
 String getFirstIdByChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
           
 List<String> getIdsByParentChannelId(SessionConfig sessionConfig, String channelId, ITransaction transaction)
          Returns all the pages that have the given channel as their parent channel.
 List<String> getIdsByParentChannelIdRecursively(SessionConfig sessionConfig, String channelId, ITransaction transaction)
           
 Collection<String> getIdsByParentTemplateId(SessionConfig sessionConfig, String parentTemplateId, ITransaction transaction)
           
 Collection<String> getIdsByServiceInstanceId(SessionConfig sessionConfig, String serviceInstanceId, ITransaction transaction)
           
 List<String> getMetaTagIdsRecursively(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
          Get a list of Meta-Tags Ids of the page including inherited Meta-Tags.
 List<String> getParentPathIds(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Returns the Ids of parent channels recursively.
 String getPath(SessionConfig sessionConfig, String pageId, ITransaction transaction)
          Returns the complete path beginnig from the root channel to the page.
 String getProtocolScheme(SessionConfig sessionConfig, int protocolType, ITransaction transaction)
          Return the protocol Scheme of the page given a protocol type.
 int getProtocolType(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
          Returns the protocolType of the given page.
 boolean keyExists(SessionConfig sessionConfig, Object configKey, Object config, ITransaction transaction)
          Checks if configId matches an already persisted object
 void serialize(SessionConfig sessionConfig, String pageId, OutputStream outputStream, ITransaction transaction)
           
 void serializeCss(SessionConfig sessionConfig, String pageId, OutputStream outputStream, ITransaction transaction)
           
 void update(SessionConfig sessionConfig, PageConfig pageConfig, ITransaction transaction)
          Update a page.
 void updateDeserializedPageLayout(SessionConfig sessionConfig, DeserializationConfig deserealizationConfig, String pageId, ITransaction transaction)
           
 void updateLayout(SessionConfig sessionConfig, String pageId, String layout, ITransaction transaction)
          Update the page layout.
 void updateSsiProperty(SessionConfig sessionConfig, ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig, ITransaction transaction)
          Updates the server side include property of the interface's page.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PageManager

public PageManager()
Method Detail

addOrUpdate

public void addOrUpdate(SessionConfig sessionConfig,
                        PageConfig pageConfig,
                        ITransaction transaction)
                 throws ManagerException,
                        PortalException
Description copied from interface: IPageManager
Add or Update a Page, depending on its previous existence.

Specified by:
addOrUpdate in interface IPageManager
Throws:
ManagerException
PortalException

add

public String add(SessionConfig sessionConfig,
                  PageConfig pageConfig,
                  ITransaction transaction)
           throws ManagerException,
                  PortalException
Description copied from interface: IPageManager
Add a page. If the page is a page template, and its layout is null, a default layout containing an interface holder is set in the page template.

Specified by:
add in interface IPageManager
Returns:
a String.
Throws:
ManagerException
PortalException

get

public PageConfig get(SessionConfig sessionConfig,
                      String pageId,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Description copied from interface: IPageManager
Get the configuration of the page.

Specified by:
get in interface IPageManager
Returns:
a PageConfig.
Throws:
ManagerException
PortalException

delete

public void delete(SessionConfig sessionConfig,
                   String pageId,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IPageManager
Delete a page.

Specified by:
delete in interface IPageManager
Throws:
ManagerException
PortalException

update

public void update(SessionConfig sessionConfig,
                   PageConfig pageConfig,
                   ITransaction transaction)
            throws ManagerException,
                   PortalException
Description copied from interface: IPageManager
Update a page.

Specified by:
update in interface IPageManager
Throws:
ManagerException
PortalException

disconnectFromTemplate_Internal

protected void disconnectFromTemplate_Internal(SessionConfig sessionConfig,
                                               PageConfig pageConfig,
                                               ITransaction transaction)
                                        throws ManagerException,
                                               PortalException
Throws:
ManagerException
PortalException

disconnectFromTemplate

public void disconnectFromTemplate(SessionConfig sessionConfig,
                                   String pageId,
                                   ITransaction transaction)
                            throws ManagerException,
                                   PortalException
Description copied from interface: IPageManager
Disconnect the page from its template if one exists

Specified by:
disconnectFromTemplate in interface IPageManager
Throws:
ManagerException
PortalException

updateLayout

public void updateLayout(SessionConfig sessionConfig,
                         String pageId,
                         String layout,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Description copied from interface: IPageManager
Update the page layout.

Specified by:
updateLayout in interface IPageManager
Throws:
ManagerException
PortalException

updateSsiProperty

public void updateSsiProperty(SessionConfig sessionConfig,
                              ServiceInterfaceInstanceConfig serviceInterfaceInstanceConfig,
                              ITransaction transaction)
                       throws PortalException
Description copied from interface: IPageManager
Updates the server side include property of the interface's page.

If the server side include is to be calculated automatically, this method checks if any of the interface instances within the page have the ssi property set to true. If so the ssi property of the page is set to true.

Specified by:
updateSsiProperty in interface IPageManager
Throws:
PortalException

deleteOrphanInterfaces

public void deleteOrphanInterfaces(SessionConfig sessionConfig,
                                   String pageId,
                                   ITransaction daoTransaction)
                            throws ManagerException,
                                   PortalException
Description copied from interface: IPageManager
Remove any interface instance associated to the page that is not being referenced in it's layout.

Specified by:
deleteOrphanInterfaces in interface IPageManager
Throws:
ManagerException
PortalException

getPath

public String getPath(SessionConfig sessionConfig,
                      String pageId,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Description copied from interface: IPageManager
Returns the complete path beginnig from the root channel to the page.

Specified by:
getPath in interface IPageManager
Returns:
a String.
Throws:
ManagerException
PortalException

getParentPathIds

public List<String> getParentPathIds(SessionConfig sessionConfig,
                                     String pageId,
                                     ITransaction transaction)
                              throws ManagerException,
                                     PortalException
Description copied from interface: IPageManager
Returns the Ids of parent channels recursively.

Specified by:
getParentPathIds in interface IPageManager
Returns:
an array of Strings.
Throws:
ManagerException
PortalException

getIdsByParentChannelId

public List<String> getIdsByParentChannelId(SessionConfig sessionConfig,
                                            String channelId,
                                            ITransaction transaction)
                                     throws ManagerException,
                                            PortalException
Description copied from interface: IPageManager
Returns all the pages that have the given channel as their parent channel.

Specified by:
getIdsByParentChannelId in interface IPageManager
Parameters:
sessionConfig - The user session id must have rights to read the page list
channelId - Id of the channel
transaction - A transaction that should be used for acessing information from the database
Returns:
an arrays of Strings.
Throws:
ManagerException
PortalException

getFirstIdByChannelId

public String getFirstIdByChannelId(SessionConfig sessionConfig,
                                    String channelId,
                                    ITransaction transaction)
                             throws ManagerException,
                                    PortalException
Specified by:
getFirstIdByChannelId in interface IPageManager
Returns:
Throws:
ManagerException
PortalException

getIdsByParentChannelIdRecursively

public List<String> getIdsByParentChannelIdRecursively(SessionConfig sessionConfig,
                                                       String channelId,
                                                       ITransaction transaction)
                                                throws ManagerException,
                                                       PortalException
Specified by:
getIdsByParentChannelIdRecursively in interface IPageManager
Returns:
a array of strings.
Throws:
ManagerException
PortalException

addCssLink

public void addCssLink(SessionConfig sessionConfig,
                       String pageId,
                       String cssId,
                       int position,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IPageManager
Add the hyperlink to the page's CSS file. To access this method, the user needs the PERMISSION_TYPE_PAGES_LAYOUT permission.

Specified by:
addCssLink in interface IPageManager
Throws:
ManagerException
PortalException

deleteCssLink

public void deleteCssLink(SessionConfig sessionConfig,
                          String pageId,
                          String cssId,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Description copied from interface: IPageManager
Delete the hyperlink to the page's CSS file. To access this method, the user needs the PERMISSION_TYPE_PAGES_LAYOUT permission.

Specified by:
deleteCssLink in interface IPageManager
Throws:
ManagerException
PortalException

getCssIds

public List<String> getCssIds(SessionConfig sessionConfig,
                              String pageId,
                              ITransaction transaction)
                       throws ManagerException,
                              PortalException
Description copied from interface: IPageManager
Get a list of Css Ids of the page.

Specified by:
getCssIds in interface IPageManager
Returns:
an arrays of Strings.
Throws:
ManagerException
PortalException

getCssIdsRecursively

public List<String> getCssIdsRecursively(SessionConfig sessionConfig,
                                         String pageId,
                                         ITransaction transaction)
                                  throws ManagerException,
                                         PortalException
Description copied from interface: IPageManager
Get a list of Css Ids of the page including inherited Css.

Specified by:
getCssIdsRecursively in interface IPageManager
Returns:
an arrays of Strings.
Throws:
ManagerException
PortalException

getMetaTagIdsRecursively

public List<String> getMetaTagIdsRecursively(SessionConfig sessionConfig,
                                             PageConfig pageConfig,
                                             ITransaction transaction)
                                      throws ManagerException,
                                             PortalException
Description copied from interface: IPageManager
Get a list of Meta-Tags Ids of the page including inherited Meta-Tags.

Specified by:
getMetaTagIdsRecursively in interface IPageManager
Returns:
Throws:
ManagerException
PortalException

getCenterPage

public boolean getCenterPage(SessionConfig sessionConfig,
                             PageConfig pageConfig,
                             ITransaction transaction)
                      throws ManagerException,
                             PortalException
Specified by:
getCenterPage in interface IPageManager
Returns:
true if the ... and false otherwise.
Throws:
ManagerException
PortalException

getCachePage

public int getCachePage(SessionConfig sessionConfig,
                        PageConfig pageConfig,
                        ITransaction transaction)
                 throws ManagerException,
                        PortalException
Specified by:
getCachePage in interface IPageManager
Returns:
an interger.
Throws:
ManagerException
PortalException

getProtocolScheme

public String getProtocolScheme(SessionConfig sessionConfig,
                                int protocolType,
                                ITransaction transaction)
                         throws ManagerException,
                                PortalException
Description copied from interface: IPageManager
Return the protocol Scheme of the page given a protocol type.

This method returns a string representation of the protocol type.

Specified by:
getProtocolScheme in interface IPageManager
Returns:
If the protocol type is PageConfig.PAGE_PROTOCOL_HTTP, PageConfig.PAGE_PROTOCOL_HTTP_NAME is returned.
If the protocol type is PageConfig.PAGE_PROTOCOL_HTTPS, PageConfig.PAGE_PROTOCOL_HTTPS_NAME is returned.
In all other cases null is returned.
Throws:
ManagerException
PortalException

getProtocolType

public int getProtocolType(SessionConfig sessionConfig,
                           PageConfig pageConfig,
                           ITransaction transaction)
                    throws ManagerException,
                           PortalException
Description copied from interface: IPageManager
Returns the protocolType of the given page.

This method checks recursively up the page´s ancestors until it finds a protocolType that is not PageConfig.PAGE_PROTOCOL_INHERIT.

Possible protocol types are:

Specified by:
getProtocolType in interface IPageManager
Returns:
Throws:
ManagerException
PortalException

copy

public void copy(SessionConfig sessionConfig,
                 String sourcePageId,
                 String destinationPageId,
                 ITransaction transaction)
          throws ManagerException,
                 PortalException
Description copied from interface: IPageManager
Copy the layout and properties from the original page to the destination page. Also replace all the destination page's interface instances with new instances of interfaces that exists in the source page.

Specified by:
copy in interface IPageManager
Throws:
ManagerException
PortalException

serialize

public void serialize(SessionConfig sessionConfig,
                      String pageId,
                      OutputStream outputStream,
                      ITransaction transaction)
               throws ManagerException,
                      PortalException
Specified by:
serialize in interface IPageManager
Throws:
ManagerException
PortalException

deserialize

public String deserialize(SessionConfig sessionConfig,
                          DeserializationConfig deserializationConfig,
                          Node pageNode,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Specified by:
deserialize in interface IPageManager
Returns:
a String.
Throws:
ManagerException
PortalException

deserialize

public String deserialize(SessionConfig sessionConfig,
                          DeserializationConfig deserializationConfig,
                          Node pageNode,
                          boolean firstDeserialization,
                          ITransaction transaction)
                   throws ManagerException,
                          PortalException
Specified by:
deserialize in interface IPageManager
Throws:
ManagerException
PortalException

updateDeserializedPageLayout

public void updateDeserializedPageLayout(SessionConfig sessionConfig,
                                         DeserializationConfig deserealizationConfig,
                                         String pageId,
                                         ITransaction transaction)
                                  throws PortalException
Specified by:
updateDeserializedPageLayout in interface IPageManager
Throws:
ManagerException
PortalException

getIdsByServiceInstanceId

public Collection<String> getIdsByServiceInstanceId(SessionConfig sessionConfig,
                                                    String serviceInstanceId,
                                                    ITransaction transaction)
                                             throws PortalException
Specified by:
getIdsByServiceInstanceId in interface IPageManager
Parameters:
sessionConfig - identifier for the session.
serviceInstanceId - the id of the service instance.
transaction - the transaction for persistence access.
Returns:
the ids of the pages that contain an interface of the given service instance id.
Throws:
PortalException

serializeCss

public void serializeCss(SessionConfig sessionConfig,
                         String pageId,
                         OutputStream outputStream,
                         ITransaction transaction)
                  throws ManagerException,
                         PortalException
Specified by:
serializeCss in interface IPageManager
Throws:
ManagerException
PortalException

deserializeCss

public void deserializeCss(SessionConfig sessionConfig,
                           DeserializationConfig deserializationConfig,
                           Node cssLinksNodes,
                           ITransaction transaction)
                    throws ManagerException,
                           PortalException
Specified by:
deserializeCss in interface IPageManager
Throws:
ManagerException
PortalException

getIdsByParentTemplateId

public Collection<String> getIdsByParentTemplateId(SessionConfig sessionConfig,
                                                   String parentTemplateId,
                                                   ITransaction transaction)
                                            throws ManagerException,
                                                   PortalException
Specified by:
getIdsByParentTemplateId in interface IPageManager
Returns:
Throws:
ManagerException
PortalException

clearCache

public void clearCache(SessionConfig sessionConfig,
                       String pageId,
                       ITransaction transaction)
                throws ManagerException,
                       PortalException
Description copied from interface: IPageManager
Clear the page cache.

This method clears the following caches

Specified by:
clearCache in interface IPageManager
Throws:
ManagerException
PortalException
See Also:
IPageManager.clearCache(SessionConfig, Collection, ITransaction)

clearCache

public void clearCache(SessionConfig sessionConfig,
                       Collection<String> pageIds,
                       ITransaction transaction)
                throws PortalException
Description copied from interface: IPageManager
Clears the cache for a group of pages. The following caches are cleared: This method is most suited for bulk cache clearing. For small cache clearing, consider using IPageManager.clearCache(SessionConfig, String, ITransaction).

Specified by:
clearCache in interface IPageManager
Parameters:
sessionConfig - the user session information.
pageIds - the page identifiers.
transaction - the transaction for persistence access.
Throws:
PortalException
See Also:
IPageManager.clearCache(SessionConfig, String, ITransaction)

deleteConfig

public void deleteConfig(DeserializationContext deserializationContext,
                         String configId)
                  throws PortalException
Specified by:
deleteConfig in interface IConfigDeleter
Throws:
PortalException

keyExists

public boolean keyExists(SessionConfig sessionConfig,
                         Object configKey,
                         Object config,
                         ITransaction transaction)
Description copied from interface: IConfigKeyChecker
Checks if configId matches an already persisted object

Specified by:
keyExists in interface IConfigKeyChecker
config - Optional, allows a checker to read aditional fields to check composed keys
Returns:
true if configId matches an already persisted object


Lumisportal  4.1.0.071221 - Copyright © 2001-2007, Lumis. All Rights Reserved.