| java.lang.Object com.sun.portal.wireless.providers.rendering.RenderingUtil
RenderingUtil | public class RenderingUtil (Code) | | The RenderingUtil class acts as a wrapper to the
RenderingEngine interface. It also provides a method to do the
modified fileLookup to get the appropriate AML templates from the file
system. It provides static methods for the
JSPRenderingContainerProvider and the
JSPRenderingProvider JSPRenderingContainerProvider or
JSPRenderingProvider classes.
|
Method Summary | |
public static StringBuffer | doRender(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb, boolean cache, boolean fragment) The method that gets the instance of the Rendering Engine and
transforms the AML to device specific markup by calling the
RenderingEngine.renderContent. | public static StringBuffer | getTemplate(ContainerProviderContext cpc, String name, String file) Gets a desktop template relative to the filepath specified. | public static StringBuffer | getTemplate(ContainerProviderContext cpc, String name, String file, Hashtable table) Gets and tag swaps a desktop template relative to the filepath
specified. | public static File | getTemplateMostSpecificPath(ContainerProviderContext cpc, String name, String file) Gets the most specific template path for the given channel name,
the given template name and the given filepath. | public static File | getTemplatePath(ContainerProviderContext cpc, String name, String file) Gets the template path for the given channel name, the given template
name and the given filepath. | public static StringBuffer | renderContent(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb) This method is used to do the rendering of the content that the
Rendering Providers or Containers have retrieved. | public static StringBuffer | renderEditContent(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb) If the channel is a top level edit channel, it renders its contents.
Whereas if it is contained in some other container, then the edit
channel only renders if the parent is a Native container. |
doRender | public static StringBuffer doRender(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb, boolean cache, boolean fragment) throws ProviderException(Code) | | The method that gets the instance of the Rendering Engine and
transforms the AML to device specific markup by calling the
RenderingEngine.renderContent.
Parameters: request - The Http Servlet Request object that gets passed to the getContent call of the Provider/Container. Parameters: cpc - This is the ContainerProviderContext obtained from getProviderContext() call while in Provider/Container. Parameters: name - Name of the channel being rendered Parameters: sb - The StringBuffer representing the Content obtained from the Templates/JSPs. Parameters: cache - Boolean indicating whether to ask rendering engine to buffer the response or not. Parameters: fragment - Boolean indicating whether the AML being rendered is a complete AML document or a fragment. StringBuffer The device specific markup based on the client type throws: ProviderException - |
getTemplate | public static StringBuffer getTemplate(ContainerProviderContext cpc, String name, String file) throws ProviderContextException(Code) | | Gets a desktop template relative to the filepath specified. It
internally calls ProviderContext.getTemplate to get the template.
Parameters: cpc - - ContainerProviderContext of the calling provider Parameters: name - - Channel name Parameters: file - - Template name to return. Buffer containng the template. |
getTemplate | public static StringBuffer getTemplate(ContainerProviderContext cpc, String name, String file, Hashtable table) throws ProviderContextException(Code) | | Gets and tag swaps a desktop template relative to the filepath
specified. It internally calls ProviderContext.getTemplate to get
the template.
Parameters: cpc - - ContainerProviderContext of the calling provider Parameters: name - - Channel name Parameters: file - - Template name to return. Parameters: table - table to use for tag swapping Buffer containng the template. |
getTemplateMostSpecificPath | public static File getTemplateMostSpecificPath(ContainerProviderContext cpc, String name, String file) throws ProviderContextException(Code) | | Gets the most specific template path for the given channel name,
the given template name and the given filepath. The file returned may
not exist at all. If non-null, the key returned by this method will map
to the most specific template file. The file may or may not exist. It
internally calls ProviderContext.getTemplateMostSpecificPath to get
the template path.
Parameters: cpc - - ContainerProviderContext of the calling provider Parameters: name - - Channel name Parameters: file - - Template name Path key to access the template |
getTemplatePath | public static File getTemplatePath(ContainerProviderContext cpc, String name, String file) throws ProviderContextException(Code) | | Gets the template path for the given channel name, the given template
name and the given filepath. If non-null, the key returned by this
method will map to a valid template file. It internally calls
ProviderContext.getTemplateMostSpecificPath to get the template path.
Parameters: cpc - - ContainerProviderContext of the calling provider Parameters: name - - Channel name Parameters: file - - Template name Path key to access the template |
renderContent | public static StringBuffer renderContent(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb) throws ProviderException(Code) | | This method is used to do the rendering of the content that the
Rendering Providers or Containers have retrieved. The logic of whether
to do the conversion of AML document into device specific markup is
implemented in this method. It also decides whether the
Rendering Engine should cache the response buffer based on whether the
container calling it is a parent container or not.
The logic of whether to do the rendering or not is driven by the
following tables.
Behaviour of JSPRenderingContainerProvider
|
Parent Container |
Rendering
Container
|
Native
Container
|
Null - Top level
|
Client FilePath |
Native filepath e.g. 'wml'
|
NOOP
|
Render
|
Not applicable
|
Starts with 'aml'
|
NOOP
|
NOOP
|
Render
|
Behaviour of JSPRenderingProvider
|
Parent Container |
Rendering
Container
|
Native
Container
|
Client FilePath |
Native filepath e.g. 'wml'
|
NOOP
|
Render
|
Starts with 'aml'
|
NOOP
|
NOOP
|
Parameters: request - The Http Servlet Request object that gets passed to the getContent call of the Provider/Container. Parameters: cpc - This is the ContainerProviderContext obtained from getProviderContext() call while in Provider/Container. Parameters: name - Name of the channel being rendered Parameters: sb - The StringBuffer representing the Content obtained from the Templates/JSPs. StringBuffer The return content driven by the above mentioned logic. throws: ProviderException - |
renderEditContent | public static StringBuffer renderEditContent(HttpServletRequest request, ContainerProviderContext cpc, String name, StringBuffer sb) throws ProviderException(Code) | | If the channel is a top level edit channel, it renders its contents.
Whereas if it is contained in some other container, then the edit
channel only renders if the parent is a Native container.
renderEditContent determines whether to render or not based on the
HTTP attributes set by the parent ContainerProvider -
'.isTopLevel' and '.shouldRender'.
If these values are not set, then shouldRender is assumed to be
true and isTopLevel assumed to be false.
A RenderingContainer would sets shouldRender=false and isTopLevel=false.
So the channels in the RenderingContainer pass back AML to the
container. A NativeContainer on the other hand does not know to set
these these attributes, so they are assumed to be isTopLevel=false
and shouldRender=true. Thus the edit channel passes back device
specific markup back to the Native parent container.
Parameters: request - The Http Servlet Request object that gets passed to the getContent call of the Provider/Container. Parameters: cpc - This is the ContainerProviderContext obtained from getProviderContext() call while in Provider/Container. Parameters: name - Name of the channel being rendered Parameters: sb - The StringBuffer representing the Content obtained from the Templates/JSPs. StringBuffer The return content driven by the above mentioned logic. throws: ProviderException - |
|
|