com.filenet.wcm.toolkit.server.util.xml
Class WcmXSLUtil

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.xml.WcmXSLUtil

public class WcmXSLUtil
extends java.lang.Object

Base class for UI Modules that do XSLT transformations.


Nested Class Summary
static class WcmXSLUtil.NodeSet
          NodeSet is an implementation of the org.w3c.dom.NodeList interface, representing a collection of XML DOM Nodes.
 
Constructor Summary
WcmXSLUtil()
           
WcmXSLUtil(java.util.Locale locale)
           
 
Method Summary
static org.w3c.dom.NodeList convertToNodeList(java.util.List values)
          Converts a List with String objects into a NodeList with text nodes.
static org.w3c.dom.NodeList convertToNodeList(java.lang.String[] valuesArray)
          Converts String array into a NodeList with text nodes.
 java.lang.Object getXML()
          Returns the source XML in the format it was orignially set in setXML() method.
 java.lang.Object getXSLParameter(java.lang.String key)
          Returns previously set XSL Parameter.
 void setClientLocale(java.util.Locale clientLocale)
          Sets clientLocale parameter
static void setRefreshInterval(long value)
          Sets the update interval for XSL files
 void setXML(org.w3c.dom.Document document)
          Sets the source XML as Document.
 void setXML(java.io.InputStream inputStream)
          Sets the source XML as InputStream
 void setXML(java.io.Reader reader)
          Sets the source XML as Reader
 void setXML(java.lang.String str)
          Sets the source XML as String.
 void setXSL(java.lang.String xslFile)
          Sets the XSL File to use for the transformation.
 void setXSLParameter(java.lang.String key, boolean value)
          Sets XSL Parameter as boolean.
 void setXSLParameter(java.lang.String key, double value)
          Sets XSL Parameter as double.
 void setXSLParameter(java.lang.String key, org.w3c.dom.Node node)
          Sets XSL Parameter as Node.
 void setXSLParameter(java.lang.String key, org.w3c.dom.NodeList nodes)
          Sets XSL Parameter as NodeList.
 void setXSLParameter(java.lang.String key, java.lang.Object value)
          Sets XSL Parameter as Object.
 void setXSLParameter(java.lang.String key, java.lang.String value)
          Sets XSL Parameter as String.
 void setXSLRelative(java.lang.String xslFile)
          Sets the XSL File to use for the transformation.
 void tranform(java.io.Writer w)
          Deprecated. Use transform(Writer w)
 void transform(java.io.Writer w)
          Writes out the results of the transformation.
 org.w3c.dom.Document transformToDom()
          Writes out the results of the transformation to XML DOM.
 java.lang.String transformToString()
          Writes out the results of the transformation to a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WcmXSLUtil

public WcmXSLUtil()

WcmXSLUtil

public WcmXSLUtil(java.util.Locale locale)
Method Detail

setRefreshInterval

public static void setRefreshInterval(long value)
Sets the update interval for XSL files

Parameters:
value - value in milliseconds

getXML

public final java.lang.Object getXML()
Returns the source XML in the format it was orignially set in setXML() method.

Returns:
Object with the source XML

setXSL

public final void setXSL(java.lang.String xslFile)
                  throws java.lang.Exception
Sets the XSL File to use for the transformation.

Parameters:
xslFile - The fully qualified path to the XSL file.
Throws:
java.lang.Exception

setXSLRelative

public final void setXSLRelative(java.lang.String xslFile)
                          throws java.lang.Exception
Sets the XSL File to use for the transformation.

Parameters:
xslFile - The path to the XSL file as a resource within the web application (relative to the application root).
Throws:
java.lang.Exception

setXML

public final void setXML(java.lang.String str)
Sets the source XML as String.

Parameters:
str - Source XML in a String

setXML

public final void setXML(org.w3c.dom.Document document)
Sets the source XML as Document.

Parameters:
document - Source XML in DOM Document

setXML

public final void setXML(java.io.InputStream inputStream)
Sets the source XML as InputStream

Parameters:
inputStream - InputStream object with the source XML

setXML

public final void setXML(java.io.Reader reader)
Sets the source XML as Reader

Parameters:
reader - Reader object with the source XML

tranform

public void tranform(java.io.Writer w)
              throws java.lang.Exception
Deprecated. Use transform(Writer w)

Writes out the results of the transformation.

Parameters:
w - Writer object where the results will be written
Throws:
java.lang.Exception - If there are any errors in the transformation

transform

public void transform(java.io.Writer w)
               throws java.lang.Exception
Writes out the results of the transformation.

Parameters:
w - Writer object where the results will be written
Throws:
java.lang.Exception - If there are any errors in the transformation

transformToDom

public org.w3c.dom.Document transformToDom()
                                    throws java.lang.Exception
Writes out the results of the transformation to XML DOM.

Returns:
The result XML DOM Document.
Throws:
java.lang.Exception - If there were any errors in the transformation.

transformToString

public java.lang.String transformToString()
                                   throws java.lang.Exception
Writes out the results of the transformation to a string.

Returns:
The result XML String.
Throws:
java.lang.Exception - If there were any errors in the transformation.

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  boolean value)
Sets XSL Parameter as boolean.

Parameters:
key - Key
value - Boolean value

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  double value)
Sets XSL Parameter as double.

Parameters:
key - Key
value - Double value

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  org.w3c.dom.NodeList nodes)
Sets XSL Parameter as NodeList.

Parameters:
key - Key
nodes - NodeList value

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  org.w3c.dom.Node node)
Sets XSL Parameter as Node.

Parameters:
key - Key
node - Node value

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  java.lang.Object value)
Sets XSL Parameter as Object.

Parameters:
key - Key
value - Object value

setXSLParameter

public final void setXSLParameter(java.lang.String key,
                                  java.lang.String value)
Sets XSL Parameter as String.

Parameters:
key - Key
value - String value

getXSLParameter

public final java.lang.Object getXSLParameter(java.lang.String key)
Returns previously set XSL Parameter.

Parameters:
key - parameter name
Returns:
XObject with the parameter value

setClientLocale

public final void setClientLocale(java.util.Locale clientLocale)
Sets clientLocale parameter

Parameters:
clientLocale - object

convertToNodeList

public static final org.w3c.dom.NodeList convertToNodeList(java.lang.String[] valuesArray)
Converts String array into a NodeList with text nodes.

Parameters:
valuesArray - A string array to be converted
Returns:
NodeList of text nodes containing the values of the String array

convertToNodeList

public static final org.w3c.dom.NodeList convertToNodeList(java.util.List values)
Converts a List with String objects into a NodeList with text nodes.

Parameters:
values - A List of String objects to be converted
Returns:
NodeList of text nodes containing the values of the List


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.