com.cassinidivision.oce.rendering
Class RenderingHelper

java.lang.Object
  extended bycom.cassinidivision.oce.rendering.RenderingHelper

public class RenderingHelper
extends Object

A collection of convenience utilities for retrieving rendering context information from the current session.


Constructor Summary
RenderingHelper()
           
 
Method Summary
static C_Feature currentFeature(RenderingSession aSession)
          Retrieve the current feature recorded in the rendering context (if any).
static C_FeaturePage currentPage(RenderingSession aSession)
          Retrieve the current feature page recorded in the rendering context (if any).
static String currentPageIndex(RenderingSession aSession)
          Retrieve the index of the current feature page recorded in the rendering context (if any).
static C_PageVersion currentPageVersion(RenderingSession aSession)
          Retrieve the current page version recorded in the rendering context (if any).
static N_Section currentSection(RenderingSession aSession)
          Retrieve the current section recorded in the rendering context (if any).
static N_WebSite currentWebSite(RenderingSession aSession)
          Retrieve the current web site recorded in the rendering context (if any).
static boolean inWebSiteFrontPage(RenderingSession session)
          Determine if the root section feature page (front page) is being previewed or published.
static boolean isPreviewing(RenderingSession aSession)
          Determine if the current rendering process is for previewing or publishing.
static boolean isPreviewingInContext(RenderingContext aContext)
          Determine if the current rendering process is for previewing or publishing.
static C_FeaturePage nextPage(RenderingSession aSession)
          Retrieve the next feature page (if there is a current page registered).
static NSArray orderedSectionsInCurrentSite(RenderingSession aSession)
          Retrieve the current set of root-level ordered sections in the web site registered.
static C_FeaturePage previousPage(RenderingSession aSession)
          Retrieve the previous feature page (if there is a current page registered).
static Object render(RenderingSession aSession, Object renderedObject)
          Retrieve a representation for a requested object using the default formatter registered in the rendering context.
static String stringRender(RenderingSession aSession, Object renderedObject)
          Retrieve a string representation for a requested object using the default formatter registered in the rendering context.
static String urlForNextPage(RenderingSession aSession)
          Derive a unique URL for a feature page following to the current registered page based on information provided in the session's rendering context.
static String urlForPreviousPage(RenderingSession aSession)
          Derive a unique URL for a feature page previous to the current registered page based on information provided in the session's rendering context.
static String urlInCurrentContextForPage(RenderingSession aSession, C_FeaturePage aPage)
          Derive a unique URL for a generated feature page based on information provided in the session's rendering context.
static NSArray visiblePageDetailsForFeature(C_Feature feature, RenderingSession session)
          Returns information for all visible authorized (published) pages of the feature requested.
static NSArray visiblePageDetailsForFeature(C_Feature feature, RenderingSession session, boolean publishedOnly)
          Returns information for all visible pages of the feature requested.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RenderingHelper

public RenderingHelper()
Method Detail

render

public static Object render(RenderingSession aSession,
                            Object renderedObject)
Retrieve a representation for a requested object using the default formatter registered in the rendering context.

Parameters:
aSession - The current session.
renderedObject - The source object.
Returns:
The generated representation.

stringRender

public static String stringRender(RenderingSession aSession,
                                  Object renderedObject)
Retrieve a string representation for a requested object using the default formatter registered in the rendering context.

A non-null string will always be returned by this method.

Parameters:
aSession - The current session.
renderedObject - The source object.
Returns:
The generated string representation.

currentSection

public static N_Section currentSection(RenderingSession aSession)
Retrieve the current section recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
The current section instance, or null if none was registered.

currentWebSite

public static N_WebSite currentWebSite(RenderingSession aSession)
Retrieve the current web site recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
The current web site instance, or null if none was registered.

currentFeature

public static C_Feature currentFeature(RenderingSession aSession)
Retrieve the current feature recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
The current feature instance, or null if none was registered.

currentPage

public static C_FeaturePage currentPage(RenderingSession aSession)
Retrieve the current feature page recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
The current feature page instance, or null if none was registered.

currentPageIndex

public static String currentPageIndex(RenderingSession aSession)
Retrieve the index of the current feature page recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
String describing the index number, or null if no feature page was registered.

currentPageVersion

public static C_PageVersion currentPageVersion(RenderingSession aSession)
Retrieve the current page version recorded in the rendering context (if any).

Parameters:
aSession - The current session.
Returns:
The current page version instance, or null if none was registered.

previousPage

public static C_FeaturePage previousPage(RenderingSession aSession)
Retrieve the previous feature page (if there is a current page registered).

Parameters:
aSession - The current session.
Returns:
The previous feature page instance, or null if no feature page was registered.

nextPage

public static C_FeaturePage nextPage(RenderingSession aSession)
Retrieve the next feature page (if there is a current page registered).

Parameters:
aSession - The current session.
Returns:
The next feature page, or null if no feature page was registered.

urlInCurrentContextForPage

public static String urlInCurrentContextForPage(RenderingSession aSession,
                                                C_FeaturePage aPage)
Derive a unique URL for a generated feature page based on information provided in the session's rendering context.

Parameters:
aSession - The current session.
aPage - The feature page in question.
Returns:
String describing the unique URL.

urlForPreviousPage

public static String urlForPreviousPage(RenderingSession aSession)
Derive a unique URL for a feature page previous to the current registered page based on information provided in the session's rendering context.

Parameters:
aSession - The current session.
Returns:
String describing the unique URL.

urlForNextPage

public static String urlForNextPage(RenderingSession aSession)
Derive a unique URL for a feature page following to the current registered page based on information provided in the session's rendering context.

Parameters:
aSession - The current session.
Returns:
String describing the unique URL.

orderedSectionsInCurrentSite

public static NSArray orderedSectionsInCurrentSite(RenderingSession aSession)
Retrieve the current set of root-level ordered sections in the web site registered.

Parameters:
aSession - The current session.
Returns:
Array of section instances.

isPreviewing

public static boolean isPreviewing(RenderingSession aSession)
Determine if the current rendering process is for previewing or publishing.

Parameters:
aSession - The current session.
Returns:
true if the rendering process is for previewing, false otherwise.

isPreviewingInContext

public static boolean isPreviewingInContext(RenderingContext aContext)
Determine if the current rendering process is for previewing or publishing.

Parameters:
aContext - A given rendering context.
Returns:
true if the rendering process is for previewing, false otherwise.

visiblePageDetailsForFeature

public static NSArray visiblePageDetailsForFeature(C_Feature feature,
                                                   RenderingSession session)
Returns information for all visible authorized (published) pages of the feature requested.

The method returns an array of dictionaries, one dictionary per visible page. Each dictionary contains the following following key/value pairs:

KEY VALUE

Parameters:
feature - The feature in question.
session - The current session.
Returns:
Array of dictionaries containing visible page information.

visiblePageDetailsForFeature

public static NSArray visiblePageDetailsForFeature(C_Feature feature,
                                                   RenderingSession session,
                                                   boolean publishedOnly)
Returns information for all visible pages of the feature requested.

The method returns an array of dictionaries, one dictionary per visible page. Each dictionary contains the following following key/value pairs:

KEY VALUE

Parameters:
feature - The feature in question.
session - The current session.
publishedOnly - Set true to include only authorized (published) pages, or false to include all pages.
Returns:
Array of dictionaries containing visible page information.

inWebSiteFrontPage

public static boolean inWebSiteFrontPage(RenderingSession session)
Determine if the root section feature page (front page) is being previewed or published.

WARNING: This method assumes the web site index URL obeys the default URL handler format, e.g.:

.../OCE_Feature/12345/0/...

In other words, the call may not work as expected for all URL handler classes.

Parameters:
session - The current session
Returns:
true if the front page is being rendered, false otherwise.