com.lotus.xsl.client
Class LotusXSLControl

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--com.lotus.xsl.client.LotusXSLControl

public class LotusXSLControl
extends java.applet.Applet

Class for LotusXSLControl applet.

See Also:
Serialized Form

Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
LotusXSLControl()
           
 
Method Summary
 void destroy()
           
 java.lang.String escapeString(java.lang.String s)
          Given a string with markup in it, escape the markup so it can be displayed in the browser.
 void freeCache()
          The processor keeps a cache of the source and style trees around, so the caller has to call freeCache() if they changed something, or if they want them garbage collected.
 java.lang.String getAppletInfo()
           
 java.lang.String getHtmlText()
          Having set the stylesheet URI and the input XML URI, parse both XML into DOM trees, produce the result DOM tree, and return the result in the form of a string.
 java.lang.String[][] getParameterInfo()
           
 java.lang.String getResultTreeAsText()
          Get the HTML result Tree as a text string suiteable for display in a browser.
 java.lang.String getSourceTreeAsText()
          Get the XML source Tree as a text string suiteable for display in a browser.
 java.lang.String getStyleTreeAsText()
          Get the XSL style Tree as a text string suiteable for display in a browser.
 java.lang.String getTreeAsText(com.lotus.xsl.client.Document tree)
          Get a DOM tree as escaped text, suitable for display in the browser.
 void init()
          Standard applet initialization.
 void paint(java.awt.Graphics g)
           
 void setDocumentURL(java.lang.String urlString)
          Set the URI to the XML document that will be displayed via the XSL stylesheet.
 void setStyleSheetAttribute(java.lang.String nameOfIDAttrOfElemToModify, java.lang.String elemId, java.lang.String attrName, java.lang.String value)
          Set an attribute in the stylesheet, which gives the ability to have some dynamic selection control.
 void setStylesheetParam(java.lang.String key, java.lang.String expr)
          Push a param for the stylesheet.
 void setStyleURL(java.lang.String urlString)
          Set the URI to the XSL stylesheet that will be used to display the input XML.
 void start()
           
 void stop()
           
 java.lang.String transformToHtml(java.lang.String doc)
          Process a document and a stylesheet and return the text.
 java.lang.String transformToHtml(java.lang.String doc, java.lang.String style)
          Process a document and a stylesheet and return the text.
 
Methods inherited from class java.applet.Applet
getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LotusXSLControl

public LotusXSLControl()
Method Detail

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

init

public void init()
Standard applet initialization.
Overrides:
init in class java.applet.Applet

destroy

public void destroy()
Overrides:
destroy in class java.applet.Applet

paint

public void paint(java.awt.Graphics g)
Overrides:
paint in class java.awt.Container

start

public void start()
Overrides:
start in class java.applet.Applet

stop

public void stop()
Overrides:
stop in class java.applet.Applet

setStyleURL

public void setStyleURL(java.lang.String urlString)
Set the URI to the XSL stylesheet that will be used to display the input XML. No processing is done yet.
Parameters:
valid - URI string.

setDocumentURL

public void setDocumentURL(java.lang.String urlString)
Set the URI to the XML document that will be displayed via the XSL stylesheet. No processing is done yet.
Parameters:
valid - URI string.

freeCache

public void freeCache()
The processor keeps a cache of the source and style trees around, so the caller has to call freeCache() if they changed something, or if they want them garbage collected.

setStyleSheetAttribute

public void setStyleSheetAttribute(java.lang.String nameOfIDAttrOfElemToModify,
                                   java.lang.String elemId,
                                   java.lang.String attrName,
                                   java.lang.String value)
Set an attribute in the stylesheet, which gives the ability to have some dynamic selection control.
Parameters:
nameOfIDAttrOfElemToModify - The name of an attribute to search for a unique id.
elemId - The unique ID to look for.
attrName - Once the element is found, the name of the attribute to set.
value - The value to set the attribute to.

setStylesheetParam

public void setStylesheetParam(java.lang.String key,
                               java.lang.String expr)
Push a param for the stylesheet. For the moment, only one param is supported.
Parameters:
key - The name of the param.
expr - The expression to be evaluated.

escapeString

public java.lang.String escapeString(java.lang.String s)
Given a string with markup in it, escape the markup so it can be displayed in the browser.

getHtmlText

public java.lang.String getHtmlText()
Having set the stylesheet URI and the input XML URI, parse both XML into DOM trees, produce the result DOM tree, and return the result in the form of a string. This calls a trusted thread created when the applet was instantiated, because the thread that calls this function is not trusted and therefore can not access data via the URLs.

getTreeAsText

public java.lang.String getTreeAsText(com.lotus.xsl.client.Document tree)
                               throws java.io.IOException
Get a DOM tree as escaped text, suitable for display in the browser.

getSourceTreeAsText

public java.lang.String getSourceTreeAsText()
                                     throws java.lang.Exception
Get the XML source Tree as a text string suiteable for display in a browser. Note that this is for display of the XML itself, not for rendering of HTML by the browser.
Throws:
java.lang.Exception - thrown if tree can not be converted.

getStyleTreeAsText

public java.lang.String getStyleTreeAsText()
                                    throws java.lang.Exception
Get the XSL style Tree as a text string suiteable for display in a browser. Note that this is for display of the XML itself, not for rendering of HTML by the browser.
Throws:
java.lang.Exception - thrown if tree can not be converted.

getResultTreeAsText

public java.lang.String getResultTreeAsText()
                                     throws java.lang.Exception
Get the HTML result Tree as a text string suiteable for display in a browser. Note that this is for display of the XML itself, not for rendering of HTML by the browser.
Throws:
java.lang.Exception - thrown if tree can not be converted.

transformToHtml

public java.lang.String transformToHtml(java.lang.String doc,
                                        java.lang.String style)
Process a document and a stylesheet and return the text. If one of these is null, the given existing value won't be effected.

transformToHtml

public java.lang.String transformToHtml(java.lang.String doc)
Process a document and a stylesheet and return the text. Use the xsl:stylesheet PI to find the document, if one exists.