com.fatwire.gst.foundation.controller
Class BaseRenderPage

java.lang.Object
  extended by com.fatwire.gst.foundation.controller.BaseRenderPage
Direct Known Subclasses:
RenderPage, RenderPageAdapter

public class BaseRenderPage
extends Object

The BaseRenderPage class in the implementation that renders an asset. It's intended use is to be called from a Controller (outer wrapper).

For the passing of arguments it makes heavy use of page criteria on the calling Template

Since:
June 2010
Author:
Tony Field, Dolf Dijkstra

Field Summary
protected  AliasCoreFieldDao aliasCoreFieldDao
           
static List<String> CALLTEMPLATE_EXCLUDE_VARS
           
protected  COM.FutureTense.Interfaces.ICS ics
           
protected static org.apache.commons.logging.Log LOG
           
static String PACKEDARGS
           
protected  WraPathTranslationService pathTranslationService
           
static String URL_PATH
           
static String VIRTUAL_WEBROOT
           
protected  WraCoreFieldDao wraCoreFieldDao
           
 
Constructor Summary
BaseRenderPage()
           
 
Method Summary
protected  void callPage(AssetIdWithSite id, String pagename, String packedArgs)
           
protected  void callTemplate(AssetIdWithSite id, String tname)
           
protected  void findAndSetP(AssetIdWithSite id, Map<String,String> arguments)
          Add p to the input parameters, if it is known or knowable.
protected  void getCallTemplateArguments(AssetIdWithSite id, Map<String,String> arguments)
          This method collects additional arguments for the CallTemplate call.
protected  CallTemplate.Style getCallTemplateCallStyle(String target)
           
protected  VanityAsset getWraAndResolveAlias(AssetIdWithSite id)
          Load the WRA, or the alias, and return it for use by the controller.
protected  void imposeCallTemplateStyle(CallTemplate ct, String targetPagename)
          This method allows developers to override the automatically-selected CallTemplate call style.
protected  String massagePackedArgs(String packedargs)
           
protected  void recordCompositionalDependencies()
          Record compositional dependencies that are required for the controller
protected  void renderPage()
          This method is the entry of the class, it does the rendering of the page.
protected  AssetIdWithSite resolveAssetId()
          In this method the AssetId and the site are resolved.
protected  String unpackPackedArgs()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URL_PATH

public static final String URL_PATH
See Also:
Constant Field Values

VIRTUAL_WEBROOT

public static final String VIRTUAL_WEBROOT
See Also:
Constant Field Values

PACKEDARGS

public static final String PACKEDARGS
See Also:
Constant Field Values

LOG

protected static final org.apache.commons.logging.Log LOG

pathTranslationService

protected WraPathTranslationService pathTranslationService

wraCoreFieldDao

protected WraCoreFieldDao wraCoreFieldDao

aliasCoreFieldDao

protected AliasCoreFieldDao aliasCoreFieldDao

ics

protected COM.FutureTense.Interfaces.ICS ics

CALLTEMPLATE_EXCLUDE_VARS

public static final List<String> CALLTEMPLATE_EXCLUDE_VARS
Constructor Detail

BaseRenderPage

public BaseRenderPage()
Method Detail

callPage

protected void callPage(AssetIdWithSite id,
                        String pagename,
                        String packedArgs)

callTemplate

protected void callTemplate(AssetIdWithSite id,
                            String tname)

findAndSetP

protected final void findAndSetP(AssetIdWithSite id,
                                 Map<String,String> arguments)
Add p to the input parameters, if it is known or knowable. First check to see if it has been explicitly set, then look it up if it hasn't been. The variable is not guaranteed to be found.

Parameters:
id - asset id with site
arguments - calltemplate arguments

getCallTemplateArguments

protected void getCallTemplateArguments(AssetIdWithSite id,
                                        Map<String,String> arguments)
This method collects additional arguments for the CallTemplate call. New arguments are added to the map as name-value pairs.

Parameters:
id - AssetIdWithSite object
arguments - Map containing arguments for the nested CallTemplate call

getCallTemplateCallStyle

protected CallTemplate.Style getCallTemplateCallStyle(String target)

getWraAndResolveAlias

protected VanityAsset getWraAndResolveAlias(AssetIdWithSite id)
Load the WRA, or the alias, and return it for use by the controller. If the asset is not found, an exception is thrown

Parameters:
id - asset id
Returns:
WRA, never null. May be an instance of an Alias

imposeCallTemplateStyle

protected void imposeCallTemplateStyle(CallTemplate ct,
                                       String targetPagename)
This method allows developers to override the automatically-selected CallTemplate call style. By default, no override is done and the CallTemplate class determines the best call style.

Parameters:
ct - CallTemplate tag
targetPagename - target pagename
See Also:
#setStyle(CallTemplate.Style)

massagePackedArgs

protected String massagePackedArgs(String packedargs)

recordCompositionalDependencies

protected void recordCompositionalDependencies()
Record compositional dependencies that are required for the controller


renderPage

protected void renderPage()
This method is the entry of the class, it does the rendering of the page.


resolveAssetId

protected AssetIdWithSite resolveAssetId()
In this method the AssetId and the site are resolved. Based on either c/cid or the virtual-webroot/url-path arguments the site which this asset belongs to is discovered from the AssetPublication table.

Returns:
the AssetId and the site that the asset belongs to.

unpackPackedArgs

protected String unpackPackedArgs()


Copyright © 2010-2013 Oracle Corporation. All Rights Reserved.