com.bea.content.ui.jsp.templates.utils
Class TemplateSupport

java.lang.Object
  extended by com.bea.content.ui.jsp.templates.utils.TemplateSupport

public class TemplateSupport
extends Object


Field Summary
static String CONTENT_SELECTOR_ERROR_TAG
           
static String DEFAULT_EDIT_BUTTON_SRC
           
static String ICON_SIZE_16
           
static String ICON_SIZE_32
           
static String NODE_IMAGE_ARCHIVE
           
static String NODE_IMAGE_AUDIO
           
static String NODE_IMAGE_EXCEL
           
static String NODE_IMAGE_FOLDER
           
static String NODE_IMAGE_GENERIC
           
static String NODE_IMAGE_HTML
           
static String NODE_IMAGE_IMAGE
           
static String NODE_IMAGE_PDF
           
static String NODE_IMAGE_POWERPOINT
           
static String NODE_IMAGE_TEXT
           
static String NODE_IMAGE_VIDEO
           
static String NODE_IMAGE_WORD
           
static String NODE_IMAGE_XML
           
static String NODE_LARGE_IMAGE_ARCHIVE
           
static String NODE_LARGE_IMAGE_AUDIO
           
static String NODE_LARGE_IMAGE_EXCEL
           
static String NODE_LARGE_IMAGE_FOLDER
           
static String NODE_LARGE_IMAGE_GENERIC
           
static String NODE_LARGE_IMAGE_HTML
           
static String NODE_LARGE_IMAGE_IMAGE
           
static String NODE_LARGE_IMAGE_PDF
           
static String NODE_LARGE_IMAGE_POWERPOINT
           
static String NODE_LARGE_IMAGE_TEXT
           
static String NODE_LARGE_IMAGE_VIDEO
           
static String NODE_LARGE_IMAGE_WORD
           
static String NODE_LARGE_IMAGE_XML
           
 
Constructor Summary
TemplateSupport()
           
 
Method Summary
static boolean canUserConfigurePortlet(javax.servlet.http.HttpServletRequest request)
          Determines if the current user is entitled to configure the current portlet.
static boolean checkMimeType(Node node, String mimeType)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is equal to the mime type that was passed in
static Property getBinaryProperty(Node node)
          This will take a best guess at which binary property represents the passed in node, and then return that property.
static BinaryValue getBinaryValue(Node node)
          This will take a best guess at which binary property represents the passed in node, and then return that binary vlaue.
static String getDownloadURL(javax.servlet.http.HttpServletRequest request, Node node)
          This will take a best guess at which binary property represents the passed in node, and then return a url to the 'DownloadBinaryServlet' that can be used to download the binary belonging to that property.
static String getDownloadURL(javax.servlet.http.HttpServletRequest request, Node node, Property property)
          This will return a url to the 'DownloadBinaryServlet' that can be used to download the binary belonging to the property that is passed in.
static String getEditButtonSrc(javax.servlet.http.HttpServletRequest request)
          Deprecated The getEditButtonSrc(request) has been deprecated in 10.2, but will return TemplateSupport.DEFAULT_EDIT_BUTTON_SRC as the default value. Those that use this function are encouraged to use a direct image name rather than this function.
static String getFileContents(Node node)
          This will take a best guess at which binary property represents the passed in node, and then return the contents of the binary.
static String getFileContents(Node node, Property property)
          This will return the contents of the binary that corresponds to the passed in property.
static String getImageNameForNode(Node node)
          This is a utility method that will set get the name of the image file that best represents the binary file that belongs to the node, if any.
static String getImageNameForNodeWithSize(Node node, String sizeConstant)
          This is a utility method that will set get the name of the image file that best represents the binary file that belongs to the node, if any.
static String getImageSource(javax.servlet.http.HttpServletRequest request, Node node)
          This will take a best guess at which binary property represents the passed in node, and then return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property.
static String getImageSource(javax.servlet.http.HttpServletRequest request, Node node, Property property)
          This will return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property that is passed in.
static String getImageSource(javax.servlet.http.HttpServletRequest request, Node node, String propertyName)
          This will return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property that is passed in.
static String getPropertyDisplayValue(javax.servlet.http.HttpServletRequest request, Node node, String propertyName)
          This will take the passed in property name and use it to create a String that will best show that property.
static String getPropertyDisplayValueShowHTML(javax.servlet.http.HttpServletRequest request, Node node, Property property)
          This will take the passed in property and use it to create a String that will best show that property.
static Node getSingleNodeFromIterator(Iterator iterator)
          This is a utility method that will return the first node that is contained within an iterator of Nodes.
static Node getTemplateNode(javax.servlet.http.HttpServletRequest request)
          This is a utility method that will return the first node that is contained within the managed iterator of Nodes.
static Iterator getTemplateNodes(javax.servlet.http.HttpServletRequest request)
          This utility method retrieves the current page of the resulting paged resultset.
static Property getUsableProperty(Node node)
          This will take a best guess at which property represents the passed in node, and then return that property.
static String getUsablePropertyValue(Node node)
          This will take a best guess at which property represents the passed in node, and then return the value of that property.
static boolean isAudio(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'audio/'
static boolean isContentSelectorException(Exception exception)
          Determines if the passed in exception, is caused by the backing content selector
static boolean isExcel(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-excel', 'application/excel', 'application/x-excel', or 'application/x-msexcel'
static boolean isExceptionAuthorizationException(Exception exception)
          Determines if the passed in exception, or any causes of the exception, are an instance of com.bea.content.AuthorizationException.
static boolean isExceptionDisplayTemplateException(Exception exception)
          Determines if the passed in exception, is caused by errors within the templating framework.
static boolean isExceptionInvalidQueryException(Exception exception)
          Determines if the passed in exception, is caused by errors with the current query.
static boolean isExceptionNodeListException(Exception exception)
          Determines if the passed in exception, or any causes of the exception, are an instance of ContentUIException.
static boolean isExceptionNoSuchNodeException(Exception exception)
          Determines if the passed in exception, or any causes of the exception, are an instance of NoSuchNodeException.
static boolean isFolder(Node node)
          This will determine if a node is a folder (hierarchy) node.
static boolean isGIF(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/gif'
static boolean isHTML(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/html'
static boolean isImage(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/'
static boolean isJPEG(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/jpeg'
static boolean isMSWord(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-word' or 'application/msword'
static boolean isNodePublished(Node node)
          This convenience method determines if the passed in node is published.
static boolean isPDF(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/pdf'
static boolean isPlainText(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/plain'
static boolean isPNG(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/png'
static boolean isPortletDebugEnabled(javax.servlet.http.HttpServletRequest request)
          Returns if portlet debugging is enabled.
static boolean isPortletStatusPreview(javax.servlet.http.HttpServletRequest request)
          Determines if the current portlet is in preview mode.
static boolean isPortletThemeBorderless(javax.servlet.http.HttpServletRequest request)
          Determines if the current portlet's theme is the OOTB Borderless theme.
static boolean isPowerPoint(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-powerpoint', 'application/mspowerpoint', or 'application/x-mspowerpoint'
static boolean isRichText(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/richtext'
static boolean isVideo(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'video/'
static boolean isXML(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/xml'
static boolean isZip(Node node)
          This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/zip'
static void setObjectInContext(javax.servlet.http.HttpServletRequest request, String attributeName, Object object)
          This is a utility method that will set the object as an attribute on the current request under the attribute name passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NODE_IMAGE_ARCHIVE

public static final String NODE_IMAGE_ARCHIVE
See Also
Constants Summary

NODE_IMAGE_AUDIO

public static final String NODE_IMAGE_AUDIO
See Also
Constants Summary

NODE_IMAGE_EXCEL

public static final String NODE_IMAGE_EXCEL
See Also
Constants Summary

NODE_IMAGE_GENERIC

public static final String NODE_IMAGE_GENERIC
See Also
Constants Summary

NODE_IMAGE_HTML

public static final String NODE_IMAGE_HTML
See Also
Constants Summary

NODE_IMAGE_IMAGE

public static final String NODE_IMAGE_IMAGE
See Also
Constants Summary

NODE_IMAGE_PDF

public static final String NODE_IMAGE_PDF
See Also
Constants Summary

NODE_IMAGE_POWERPOINT

public static final String NODE_IMAGE_POWERPOINT
See Also
Constants Summary

NODE_IMAGE_TEXT

public static final String NODE_IMAGE_TEXT
See Also
Constants Summary

NODE_IMAGE_VIDEO

public static final String NODE_IMAGE_VIDEO
See Also
Constants Summary

NODE_IMAGE_WORD

public static final String NODE_IMAGE_WORD
See Also
Constants Summary

NODE_IMAGE_XML

public static final String NODE_IMAGE_XML
See Also
Constants Summary

NODE_IMAGE_FOLDER

public static final String NODE_IMAGE_FOLDER
See Also
Constants Summary

NODE_LARGE_IMAGE_ARCHIVE

public static final String NODE_LARGE_IMAGE_ARCHIVE
See Also
Constants Summary

NODE_LARGE_IMAGE_AUDIO

public static final String NODE_LARGE_IMAGE_AUDIO
See Also
Constants Summary

NODE_LARGE_IMAGE_EXCEL

public static final String NODE_LARGE_IMAGE_EXCEL
See Also
Constants Summary

NODE_LARGE_IMAGE_GENERIC

public static final String NODE_LARGE_IMAGE_GENERIC
See Also
Constants Summary

NODE_LARGE_IMAGE_HTML

public static final String NODE_LARGE_IMAGE_HTML
See Also
Constants Summary

NODE_LARGE_IMAGE_IMAGE

public static final String NODE_LARGE_IMAGE_IMAGE
See Also
Constants Summary

NODE_LARGE_IMAGE_PDF

public static final String NODE_LARGE_IMAGE_PDF
See Also
Constants Summary

NODE_LARGE_IMAGE_POWERPOINT

public static final String NODE_LARGE_IMAGE_POWERPOINT
See Also
Constants Summary

NODE_LARGE_IMAGE_TEXT

public static final String NODE_LARGE_IMAGE_TEXT
See Also
Constants Summary

NODE_LARGE_IMAGE_VIDEO

public static final String NODE_LARGE_IMAGE_VIDEO
See Also
Constants Summary

NODE_LARGE_IMAGE_WORD

public static final String NODE_LARGE_IMAGE_WORD
See Also
Constants Summary

NODE_LARGE_IMAGE_XML

public static final String NODE_LARGE_IMAGE_XML
See Also
Constants Summary

NODE_LARGE_IMAGE_FOLDER

public static final String NODE_LARGE_IMAGE_FOLDER
See Also
Constants Summary

DEFAULT_EDIT_BUTTON_SRC

public static final String DEFAULT_EDIT_BUTTON_SRC
See Also
Constants Summary

CONTENT_SELECTOR_ERROR_TAG

public static final String CONTENT_SELECTOR_ERROR_TAG
See Also
Constants Summary

ICON_SIZE_16

public static final String ICON_SIZE_16
See Also
Constants Summary

ICON_SIZE_32

public static final String ICON_SIZE_32
See Also
Constants Summary
Constructor Detail

TemplateSupport

public TemplateSupport()
Method Detail

isPlainText

public static boolean isPlainText(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/plain'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'text/plain'

isRichText

public static boolean isRichText(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/richtext'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'text/richtext'

isHTML

public static boolean isHTML(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/html'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'text/html'

isXML

public static boolean isXML(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'text/xml'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'text/xml'

isPDF

public static boolean isPDF(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/pdf'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'application/pdf'

isZip

public static boolean isZip(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/zip'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'application/zip'

isMSWord

public static boolean isMSWord(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-word' or 'application/msword'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'application/vnd.ms-word' or 'application/msword'

isImage

public static boolean isImage(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'image/'

isJPEG

public static boolean isJPEG(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/jpeg'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'image/jpeg'

isGIF

public static boolean isGIF(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/gif'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'image/gif'

isPNG

public static boolean isPNG(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'image/png'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'image/png'

isAudio

public static boolean isAudio(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'audio/'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'audio/'

isVideo

public static boolean isVideo(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'video/'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type is 'video/'

isExcel

public static boolean isExcel(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-excel', 'application/excel', 'application/x-excel', or 'application/x-msexcel'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type matches an Excel file

isPowerPoint

public static boolean isPowerPoint(Node node)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is 'application/vnd.ms-powerpoint', 'application/mspowerpoint', or 'application/x-mspowerpoint'

Parameters
node - - The node we want to inspect
Returns
boolean - true if the mime type matches a PowerPoint file

isFolder

public static boolean isFolder(Node node)
This will determine if a node is a folder (hierarchy) node.

Parameters
node - - The node we want to inspect
Returns
boolean - true if the node is a folder/hierarchy node

checkMimeType

public static boolean checkMimeType(Node node,
                                    String mimeType)
This will take a best guess at which binary property represents the passed in node, and then check to see if that binary's mime type is equal to the mime type that was passed in

Parameters
node - - The node we want to inspect
mimeType - - The mime type we want to check
Returns
boolean - true if the mime type is 'application/vnd.ms-powerpoint'

getFileContents

public static String getFileContents(Node node)
This will take a best guess at which binary property represents the passed in node, and then return the contents of the binary. This is to be used when wanting to inline the contents of a nodes binary. For example, if the node is represented by an html file, you can use this to get the html from the binary file.

Parameters
node - - The node we want to inspect
Returns
String - The contents of the binary that best represents the node

getFileContents

public static String getFileContents(Node node,
                                     Property property)
This will return the contents of the binary that corresponds to the passed in property. This is to be used when wanting to inline the contents of a nodes binary. For example, if the node is represented by an html file, you can use this to get the html from the binary file.

Parameters
node - - The node we want to inspect
property - - The property that contains the binary that we want to get
Returns
String - The contents of the binary that best represents the node

getBinaryProperty

public static Property getBinaryProperty(Node node)
This will take a best guess at which binary property represents the passed in node, and then return that property.

Parameters
node - - The node we want to inspect
Returns
Property - The binary property best representing the node

getBinaryValue

public static BinaryValue getBinaryValue(Node node)
This will take a best guess at which binary property represents the passed in node, and then return that binary vlaue.

Parameters
node - - The node we want to inspect
Returns
BinaryValue - The binary value of the property best representing the node

getImageSource

public static String getImageSource(javax.servlet.http.HttpServletRequest request,
                                    Node node)
This will take a best guess at which binary property represents the passed in node, and then return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property. This is meant to be used in the 'src' attribute of an 'img' tag (i.e. )

Parameters
request - - The current request
node - - The node we want to inspect
Returns
String - A URL to the ShowPropertyServlet that will retrieve the image within an 'img' tag

getImageSource

public static String getImageSource(javax.servlet.http.HttpServletRequest request,
                                    Node node,
                                    Property property)
This will return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property that is passed in. This is meant to be used in the 'src' attribute of an 'img' tag (i.e. )

Parameters
request - - The current request
node - - The node we want to inspect
property - - The property that contains the image we want to create the URL for
Returns
String - A URL to the ShowPropertyServlet that will retrieve the image within an 'img' tag

getImageSource

public static String getImageSource(javax.servlet.http.HttpServletRequest request,
                                    Node node,
                                    String propertyName)
This will return a url to the 'ShowPropertyServlet' that can be used to display the image belonging to that property that is passed in. This is meant to be used in the 'src' attribute of an 'img' tag (i.e. )

Parameters
request - - The current request
node - - The node we want to inspect
propertyName - - The name of the property that contains the image we want to create the URL for
Returns
String - A URL to the ShowPropertyServlet that will retrieve the image within an 'img' tag

getDownloadURL

public static String getDownloadURL(javax.servlet.http.HttpServletRequest request,
                                    Node node)
This will take a best guess at which binary property represents the passed in node, and then return a url to the 'DownloadBinaryServlet' that can be used to download the binary belonging to that property. This is meant to be used in the 'href' attribute of an 'a' tag (i.e. )

Parameters
request - - The current request
node - - The node we want to inspect
Returns
String - A URL to the DownloadBinaryServlet that will download the binary from an 'a' tag

getDownloadURL

public static String getDownloadURL(javax.servlet.http.HttpServletRequest request,
                                    Node node,
                                    Property property)
This will return a url to the 'DownloadBinaryServlet' that can be used to download the binary belonging to the property that is passed in. This is meant to be used in the 'href' attribute of an 'a' tag (i.e. )

Parameters
request - - The current request
node - - The node we want to inspect
property - - The property that contains the binary we want to create the URL for
Returns
String - A URL to the DownloadBinaryServlet that will download the binary from an 'a' tag

getUsablePropertyValue

public static String getUsablePropertyValue(Node node)
This will take a best guess at which property represents the passed in node, and then return the value of that property. This is to be used when some value should be displayed for the node, but unsure about what to display. If there is an actual value on any property of the node, then this method will return something. Otherwise it will return an empty String.

Parameters
node - - The node we want to inspect
Returns
String - The value of the property best representing the node

getUsableProperty

public static Property getUsableProperty(Node node)
This will take a best guess at which property represents the passed in node, and then return that property. This is to be used when some value should be displayed for the node, but unsure about what property to use. If there is an actual value on any property of the node, then this method will return something. Otherwise it will return null.

Parameters
node - - The node we want to inspect
Returns
String - The value of the property best representing the node

getPropertyDisplayValue

public static String getPropertyDisplayValue(javax.servlet.http.HttpServletRequest request,
                                             Node node,
                                             String propertyName)
This will take the passed in property name and use it to create a String that will best show that property. If the property holds an image binary, a completed 'img' tag will be returned that will display the image. If the property holds any other kind of binary, a completed 'a' tag will be returned that will download the binary. Otherwise, the value of the property will be returned. This is to be used when wanting to display a specific property but not wanting to worry about how best to do it.

Parameters
request - - The current request
node - - The node we want to inspect
propertyName - - The name of the property we want to get the display value for.
Returns
String - The value of the property best representing the node

getPropertyDisplayValueShowHTML

public static String getPropertyDisplayValueShowHTML(javax.servlet.http.HttpServletRequest request,
                                                     Node node,
                                                     Property property)
This will take the passed in property and use it to create a String that will best show that property. If the property holds an image binary, a completed 'img' tag will be returned that will display the image. If the property holds any other kind of binary, a completed 'a' tag will be returned that will download the binary. Otherwise, the value of the property will be returned. This is to be used when wanting to display a specific property but not wanting to worry about how best to do it.

Parameters
request - - The current request
node - - The node we want to inspect
property - - The property we want to get the display value for.
Returns
String - The value of the property best representing the node

getSingleNodeFromIterator

public static Node getSingleNodeFromIterator(Iterator iterator)
This is a utility method that will return the first node that is contained within an iterator of Nodes. This is to provide some help when using EL.

Parameters
iterator - - The Node iterator used to get the first Node out of
Returns
Node - The first Node contained within the iterator

getTemplateNodes

public static Iterator getTemplateNodes(javax.servlet.http.HttpServletRequest request)
This utility method retrieves the current page of the resulting paged resultset.

Parameters
request - - The current request
Returns
Iterator - An iterator for the current page

getTemplateNode

public static Node getTemplateNode(javax.servlet.http.HttpServletRequest request)
This is a utility method that will return the first node that is contained within the managed iterator of Nodes. This is to provide some help when using EL.

Parameters
request - - The request object.
Returns
Node - The first Node contained within the iterator
See Also
getSingleNodeFromIterator(Iterator)

setObjectInContext

public static void setObjectInContext(javax.servlet.http.HttpServletRequest request,
                                      String attributeName,
                                      Object object)
This is a utility method that will set the object as an attribute on the current request under the attribute name passed in. This is to provide some help when using EL.

Parameters
request - - The current request
attributeName - - The name of the attribute the object will be set under
object - - The object to be set as a request attribute

getImageNameForNode

public static String getImageNameForNode(Node node)
This is a utility method that will set get the name of the image file that best represents the binary file that belongs to the node, if any. The image names that are returned are just the image names WITHOUT any path information. This method returns the 16 pixel sized image icon. The images can be found in the commonui library madule and are best referenced with the tag, ie; <img src='<render:resolveImagePath uri="${templates:getImageNameForNode(node)}"/>'/>

Parameters
node - - The node whose icon we want to retrieve
Returns
An image name to be used with the tag

getImageNameForNodeWithSize

public static String getImageNameForNodeWithSize(Node node,
                                                 String sizeConstant)
This is a utility method that will set get the name of the image file that best represents the binary file that belongs to the node, if any. The image names that are returned are just the image names WITHOUT any path information. The images can be found in the commonui library madule and are best referenced with the tag, ie; <img src='<render:resolveImagePath uri="${getImageNameForNodeWithSize(node)}"/>'/> This method takes a second paramter which determines the size of icon to retieve. The default return value is the 16 pixel sized icon if an invalid size is passed in.

Parameters
node - - The node whose icon we want to retrieve
sizeConstant - - A constant for the size of icon to return. Either use ICON_SIZE_16 or ICON_SIZE_32
Returns
An image name to be used with the tag

isPortletStatusPreview

public static boolean isPortletStatusPreview(javax.servlet.http.HttpServletRequest request)
Determines if the current portlet is in preview mode.

Parameters
request - The HttpServletRequest
Returns
True if the portlet is in preview state, false otherwise

isPortletThemeBorderless

public static boolean isPortletThemeBorderless(javax.servlet.http.HttpServletRequest request)
Determines if the current portlet's theme is the OOTB Borderless theme.

Parameters
request - The HttpServletRequest
Returns
True if the portlet's theme is Borderless, false otherwise

canUserConfigurePortlet

public static boolean canUserConfigurePortlet(javax.servlet.http.HttpServletRequest request)
Determines if the current user is entitled to configure the current portlet.

Parameters
request - The HttpServletRequest
Returns
True if the current user is entitled to configure, false otherwise.

getEditButtonSrc

@Deprecated
public static String getEditButtonSrc(javax.servlet.http.HttpServletRequest request)
Deprecated The getEditButtonSrc(request) has been deprecated in 10.2, but will return TemplateSupport.DEFAULT_EDIT_BUTTON_SRC as the default value. Those that use this function are encouraged to use a direct image name rather than this function.

Returns the image name (without path) to use as the edit icon.

Parameters
request - The HttpServletRequest
Returns
The name (path not included) of the image icon to use.

isExceptionNoSuchNodeException

public static boolean isExceptionNoSuchNodeException(Exception exception)
Determines if the passed in exception, or any causes of the exception, are an instance of NoSuchNodeException.

Parameters
exception - The exception to test
Returns
True if the exception, or anything that caused the exception, was an instance of NoSuchNodeException

isExceptionAuthorizationException

public static boolean isExceptionAuthorizationException(Exception exception)
Determines if the passed in exception, or any causes of the exception, are an instance of com.bea.content.AuthorizationException.

Parameters
exception - The exception to test
Returns
True if the exception, or anything that caused the exception, was an instance of com.bea.content.AuthorizationException

isExceptionNodeListException

public static boolean isExceptionNodeListException(Exception exception)
Determines if the passed in exception, or any causes of the exception, are an instance of ContentUIException.

Parameters
exception - The exception to test
Returns
True if the exception, or anything that caused the exception, was an instance of ContentUIException

isExceptionInvalidQueryException

public static boolean isExceptionInvalidQueryException(Exception exception)
Determines if the passed in exception, is caused by errors with the current query.

Parameters
exception - The exception to test
Returns
True if the exception, is caused by errors with the current query

isExceptionDisplayTemplateException

public static boolean isExceptionDisplayTemplateException(Exception exception)
Determines if the passed in exception, is caused by errors within the templating framework.

Parameters
exception - The exception to test
Returns
True if the exception, is caused by errors within the templating framework

isContentSelectorException

public static boolean isContentSelectorException(Exception exception)
Determines if the passed in exception, is caused by the backing content selector

Parameters
exception - The exception to test
Returns
True if the exception, is caused by the backing content selector

isNodePublished

public static boolean isNodePublished(Node node)
This convenience method determines if the passed in node is published.

Parameters
node - - The node we want to inspect
Returns
boolean - true if the workflow status is set to com.bea.content.virtual.workflow.Workflow.PUBLISHED

isPortletDebugEnabled

public static boolean isPortletDebugEnabled(javax.servlet.http.HttpServletRequest request)
Returns if portlet debugging is enabled.

Returns
true if debugging is enabled, false otherwise.


Copyright © 2008 BEA Systems, Inc. All Rights Reserved