Oracle Fusion Middleware JSP Tag Java API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.2)
E14256-03

Content Presenter Display Template Support Functions


Standard Syntax:
     <%@ taglib prefix="templates" uri="http://www.bea.com/servers/content/ui/jsp/templates" %>

XML Syntax:
     <anyxmlelement xmlns:templates="http://www.bea.com/servers/content/ui/jsp/templates" />

The Content Presenter Display Template Support functions are meant to aid Display Template developers. These functions are only available when the web project references the optional Content Presenter Framework facet of WebLogic Portal. Unlike traditional JSP tags, these are expression language functions, for example: "${templates:isPlainText(node)}". These functions will aid in:
1) Determining the best MIME type for a content node
2) Generating HTML to best display a node (by determining the most representative property and intelligently displaying that property value as best we can)
3) Determining some context about the Content Presenter portlet that the template is displayed in

Tag Library Information
Display NameContent Presenter Display Template Support Functions
Version2.0
Short Nametemplates
URIhttp://www.bea.com/servers/content/ui/jsp/templates
 

Function Summary
booleanisPlainText( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is text/plain
booleanisRichText( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is text/richtext
booleanisHTML( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is text/html
booleanisXML( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is text/xml
booleanisPDF( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is application/pdf
booleanisZip( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is application/zip
booleanisMSWord( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is application/vnd.ms-word
booleanisImage( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary starts with image/
booleanisJPEG( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is image/jpeg
booleanisGIF( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is image/gif
booleanisPNG( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is image/png
booleanisAudio( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary starts with audio/
booleanisVideo( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary starts with video/
booleanisExcel( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is application/vnd.ms-excel
booleanisPowerPoint( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then check to see if the MIME type of that binary is application/vnd.ms-powerpoint
booleanisFolder( com.bea.content.Node node) This will determine if a node is a folder (hierarchy) node.
booleancheckMimeType( com.bea.content.Node node, java.lang.String mimeType) This will take a best guess at which binary property represents the passed in node, and then check to see if the mime type of that binary is equal to the mime type that was passed in.
StringgetFileContents( com.bea.content.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 binary property. For example, if the node is represented by an html file, you can use this to get the html from the binary file.
com.bea.content.PropertygetBinaryProperty( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then return that property.
com.bea.content.BinaryValuegetBinaryValue( com.bea.content.Node node) This will take a best guess at which binary property represents the passed in node, and then return that binary value.
StringgetImageSource( javax.servlet.http.HttpServletRequest request, com.bea.content.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 which will display the image belonging to that property. This is meant to be used as the src attribute of an img tag.
StringgetDownloadURL( javax.servlet.http.HttpServletRequest request, com.bea.content.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 which generates a URL to download the binary belonging to that property. This is meant to be used as the value of the href attribute of an anchor (a) tag.
StringgetUsablePropertyValue( com.bea.content.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.
StringgetUsableProperty( com.bea.content.Node node) This will take a best guess at which property represents the passed in node, and then return it as a 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.
StringgetPropertyDisplayValue( javax.servlet.http.HttpServletRequest request, com.bea.content.Node node, java.lang.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 anchor (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 you want to display a specific property but do not want to worry about how best to do it.
StringgetPropertyDisplayValueShowHTML( javax.servlet.http.HttpServletRequest request, com.bea.content.Node node, com.bea.content.Property property) 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 a binary whose MIME type starts with text/ then its text will be returned (this is convenient for returning HTML content). If the property holds any other kind of binary, a completed anchor (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 you want to display a specific property but do not want to worry about how best to do it.
NodegetSingleNodeFromIterator( java.util.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.
NodegetTemplateNode( javax.servlet.http.HttpServletRequest request) 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.
java.util.IteratorgetTemplateNodes( javax.servlet.http.HttpServletRequest request) This utility method retrieves the current page of the resulting paged resultset.
voidsetObjectInContext( javax.servlet.http.HttpServletRequest request, java.lang.String attributeName, java.lang.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.
StringgetImageNameForNode( com.bea.content.Node node) This is a utility method that will set get the name of the image icon file that best represents the kind of binary file that belongs to the node, if any. There are icons for Word, Excel, PDF, XML, etc. 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 module and are best referenced with the "resolveImagePath" tag from the "render" taglib.
StringgetImageNameForNodeWithSize( com.bea.content.Node node, java.lang.String sizeConstant) This is a utility method that will set get the name of the image icon file that best represents the kind of binary file that belongs to the node, if any. There are icons for Word, Excel, PDF, XML, etc. 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 module and are best referenced with the "resolveImagePath" tag from the "render" taglib.
booleanisPortletStatusPreview( javax.servlet.http.HttpServletRequest request) Determines if the current Content Presenter portlet is in preview mode.
booleanisPortletThemeBorderless( javax.servlet.http.HttpServletRequest request) Determines if the current portlet theme is the OOTB Borderless theme.
StringdetermineBestTitleForNode( javax.servlet.http.HttpServletRequest request, com.bea.content.Node node) This is a utility method that can be used to determine the best title to use for a given node. The properties of the node are iterated over, and if property a with the name "title" is found, the value of that property will be used. If not, a property with the name "name" will be used. If neither of these are found, then we check a couple of other property name possibilities to guess the best title. If there is a binary, we will use the the file name of the first binary property whose MIME type starts with "application/", if not then we will choose any property whose name that contains the word "title" or "name" (internationalized strings), if not then we will use the name of the file of the first binary property we can find, regardless of MIME type. If all else fails, the name of the node itself will be returned. Since this logic is subjective, we encourage editing of this method (source supplied in /{yourwebapp}/src/public/com/bea/content/ui/jsp/ContentPresenterUtils.java) to tailor it to customer-specific needs, rules, or conventions. If any exceptions are encountered, an empty String ("") will be returned. The string values of "title" and "name" are internationalized, and can be found in com/bea/content/ui/jsp/ContentPresenterUtils.properties within the message bundle jar. Localized .properties files can be created with translations.
booleancanUserConfigurePortlet( javax.servlet.http.HttpServletRequest request) Determines if the current user has rights to configure the Content Presenter portlet.
booleanisExceptionNoSuchNodeException( java.lang.Exception exception) Determines if the passed in exception, or any causes of the exception, are an instance of NoSuchNodeException.
booleanisContentSelectorException( java.lang.Exception exception) Determines if the passed in exception, is caused by the backing content selector
booleanisExceptionNodeListException( java.lang.Exception exception) Determines if the passed in exception, or any causes of the exception, are an instance of ContentUIException.
booleanisExceptionDisplayTemplateException( java.lang.Exception exception) Determines if the passed in exception is caused by errors within the templating framework.
booleanisExceptionAuthorizationException( java.lang.Exception exception) Determines if the passed in exception is caused by com.bea.content.AuthorizationException.
booleanisExceptionInvalidQueryException( java.lang.Exception exception) Determines if the passed in exception is caused by com.bea.content.expression.InvalidQueryException.
booleanisNodePublished( com.bea.content.Node node) This convenience method determines if the passed in node is in the published state.
StringgetEditButtonSrc( javax.servlet.http.HttpServletRequest request) This convenience method returns the src string for the edit icon normally in the portlet title bar.
booleanisPortletDebugEnabled( javax.servlet.http.HttpServletRequest request) Determines if portlet debugging is enabled. If enabled, a header will be placed on each portlet instance that displays valuable information with regard to the portlet instance.
 


Oracle Fusion Middleware JSP Tag Java API Reference for Oracle WebLogic Portal
10g Release 3 (10.3.2)
E14256-03

Copyright © 2010, Oracle. All rights reserved.