com.day.cq.compat.migration.contentbus
Class Page

java.lang.Object
  extended by com.day.cq.compat.migration.contentbus.Page

public class Page
extends Object

The Page class represents a page imported from a CQ4 system. Instances of this class are primarily created by deserializing a Durbo input stream and must not be confused with the actual ContentBus API page com.day.cq.contentbus.Page.


Constructor Summary
Page(String handle, String csd, String version, com.day.durbo.DurboInput.Element content, com.day.durbo.DurboInput durbo, com.day.cq.compat.core.ContentBusNameMapper mapper)
          Creates a new instance of this class along with the content of the Communique 4 page as read from the durbo file.
 
Method Summary
static void ensureNodeEnd(com.day.durbo.DurboInput.Element next)
           
static void ensureNodeEnd(com.day.durbo.DurboInput durbo)
           
 Atom getAtom(String path)
          Returns the atom with the given fully qualified content element path or null if no such atom exists or if a content element exists at the path but is not an Atom.
 Container getContent()
          Returns the top level container of this page.
 String getCsd()
          Returns the CSD of the ContentBus page in the Communique 4 system.
 String getHandle()
          Returns the handle of the page in the Communique 5 system.
 Calendar getLastModified()
          Returns the date and time of the last modification to this page in the Communique 4 system.
 String getLastModifiedBy()
          Returns the name of the user of the last modification to this page in the Communique 4 system.
 com.day.cq.compat.core.ContentBusNameMapper getMapper()
          Returns the ContentBusNameMapper used to map the old page handle to the new page handle and to map the atom labels to property names.
 String getOldHandle()
          Returns the handle of the page in the Communique 4 system.
 String getTemplate()
          Returns the template assigned to this page in the Communique 4 system.
 String getVersion()
          Returns the name of the version of this page instance in the Communique 4 system.
 boolean hasContent()
          Returns true if this page has content, that is if the getContent() method returns a non-null result.
 String toString()
          Returns a string representation of this page instance for logging purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Page

public Page(String handle,
            String csd,
            String version,
            com.day.durbo.DurboInput.Element content,
            com.day.durbo.DurboInput durbo,
            com.day.cq.compat.core.ContentBusNameMapper mapper)
     throws IOException
Creates a new instance of this class along with the content of the Communique 4 page as read from the durbo file.

Parameters:
handle - The handle of the page in the Communique 4 system. This handle is available from the getOldHandle() method. The new handle is calculated using the given mapper.
csd - The CSD of the Communique 4 page
version - The Version of the Communique 4 page
content - The Durbo Element representing the top level container
durbo - The DurboInput from which to read further content of the page
mapper - The ContentBusNameMapper to use to map handles to node paths and atom labels to property names.
Throws:
IOException - If an error occurrs reading from the Durbo input.
See Also:
getHandle(), getOldHandle(), getCsd(), getVersion(), getContent(), getMapper()
Method Detail

getOldHandle

public String getOldHandle()
Returns the handle of the page in the Communique 4 system. This handle is provided for reference and logging purposes.


getHandle

public String getHandle()
Returns the handle of the page in the Communique 5 system. This is the handle which addresses the migrated page and should actually be used to access this page or to refer to this page.


getCsd

public String getCsd()
Returns the CSD of the ContentBus page in the Communique 4 system.


getVersion

public String getVersion()
Returns the name of the version of this page instance in the Communique 4 system. This information is mainly provided for reference and logging.


getTemplate

public String getTemplate()
Returns the template assigned to this page in the Communique 4 system. This is a helper method to access the mapped content of the Template toplevel atom. If the Template atom does not exist, this method returns null.


getContent

public Container getContent()
Returns the top level container of this page.

See Also:
Container, hasContent()

hasContent

public boolean hasContent()
Returns true if this page has content, that is if the getContent() method returns a non-null result.

See Also:
getContent()

getAtom

public Atom getAtom(String path)
Returns the atom with the given fully qualified content element path or null if no such atom exists or if a content element exists at the path but is not an Atom.

Parameters:
path - The qualified name of the atom

toString

public String toString()
Returns a string representation of this page instance for logging purposes.

Overrides:
toString in class Object

getMapper

public com.day.cq.compat.core.ContentBusNameMapper getMapper()
Returns the ContentBusNameMapper used to map the old page handle to the new page handle and to map the atom labels to property names.


getLastModified

public Calendar getLastModified()
Returns the date and time of the last modification to this page in the Communique 4 system. This is the date/time part of the CmgrLastModified atom in the Communique 4 page. If no CmgrLastModified atom does not exist, this method returns a Calendar instance representing the current time.


getLastModifiedBy

public String getLastModifiedBy()
Returns the name of the user of the last modification to this page in the Communique 4 system. This is the user name part of the CmgrLastModified atom in the Communique 4 page. If no CmgrLastModified atom does not exist, this method returns a the string [unknown].


ensureNodeEnd

public static void ensureNodeEnd(com.day.durbo.DurboInput durbo)
                          throws IOException
Throws:
IOException

ensureNodeEnd

public static void ensureNodeEnd(com.day.durbo.DurboInput.Element next)
                          throws IOException
Throws:
IOException


Copyright © 2009 Day Management AG. All Rights Reserved.