org.pentaho.platform.util.xml
Class XForm

java.lang.Object
  extended by org.pentaho.platform.util.xml.XForm

public class XForm
extends Object


Field Summary
static int OUTPUT_HTML
           
static int OUTPUT_HTML_PAGE
           
static int OUTPUT_XFORM
           
static int TYPE_CHECK_MULTI
           
static int TYPE_CHECK_MULTI_SCROLL
           
static int TYPE_CHECK_MULTI_SCROLL_2_COLUMN
           
static int TYPE_CHECK_MULTI_SCROLL_3_COLUMN
           
static int TYPE_CHECK_MULTI_SCROLL_4_COLUMN
           
static int TYPE_LIST
           
static int TYPE_LIST_MULTI
           
static int TYPE_RADIO
           
static int TYPE_SELECT
           
static int TYPE_TEXT
           
 
Constructor Summary
XForm()
           
 
Method Summary
static String completeXForm(int outputType, String formName, StringBuffer xformHeader, StringBuffer xformBody, IPentahoSession session, IDocumentResourceLoader loader)
           
static void completeXFormHeader(String formName, StringBuffer xformHeader)
           
static void createXFormControl(int type, String fieldName, Object defaultValues, List values, Map displayNames, String formName, StringBuffer xformHeader, StringBuffer xformBody)
           
static void createXFormControl(String fieldName, Object defaultValues, String formName, StringBuffer xformHeader, StringBuffer xformBody, boolean visible)
           
static void createXFormHeader(String formName, StringBuffer xformHeader)
           
static void createXFormSubmit(String formName, StringBuffer xformBody, String buttonText)
           
static String transform(String xForm, String method, IPentahoSession session, IDocumentResourceLoader loader)
          Using html4.xsl, transform the xml in the xForm string to an HTML form snippet.
static String transformSnippet(org.dom4j.Node xForm, IPentahoSession session, IDocumentResourceLoader loader)
           
static String transformSnippet(String xFormSnippet, String method, IPentahoSession session, IDocumentResourceLoader loader)
          Using html4.xsl, wrap the XForm String in xFormSnippet in a <pho:snippet>, and transform the wrapped XSL into an HTML form snippet.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_RADIO

public static final int TYPE_RADIO
See Also:
Constant Field Values

TYPE_SELECT

public static final int TYPE_SELECT
See Also:
Constant Field Values

TYPE_LIST

public static final int TYPE_LIST
See Also:
Constant Field Values

TYPE_LIST_MULTI

public static final int TYPE_LIST_MULTI
See Also:
Constant Field Values

TYPE_CHECK_MULTI

public static final int TYPE_CHECK_MULTI
See Also:
Constant Field Values

TYPE_CHECK_MULTI_SCROLL

public static final int TYPE_CHECK_MULTI_SCROLL
See Also:
Constant Field Values

TYPE_CHECK_MULTI_SCROLL_2_COLUMN

public static final int TYPE_CHECK_MULTI_SCROLL_2_COLUMN
See Also:
Constant Field Values

TYPE_CHECK_MULTI_SCROLL_3_COLUMN

public static final int TYPE_CHECK_MULTI_SCROLL_3_COLUMN
See Also:
Constant Field Values

TYPE_CHECK_MULTI_SCROLL_4_COLUMN

public static final int TYPE_CHECK_MULTI_SCROLL_4_COLUMN
See Also:
Constant Field Values

TYPE_TEXT

public static final int TYPE_TEXT
See Also:
Constant Field Values

OUTPUT_XFORM

public static final int OUTPUT_XFORM
See Also:
Constant Field Values

OUTPUT_HTML

public static final int OUTPUT_HTML
See Also:
Constant Field Values

OUTPUT_HTML_PAGE

public static final int OUTPUT_HTML_PAGE
See Also:
Constant Field Values
Constructor Detail

XForm

public XForm()
Method Detail

transformSnippet

public static String transformSnippet(org.dom4j.Node xForm,
                                      IPentahoSession session,
                                      IDocumentResourceLoader loader)
                               throws TransformerException
Throws:
TransformerException

transformSnippet

public static String transformSnippet(String xFormSnippet,
                                      String method,
                                      IPentahoSession session,
                                      IDocumentResourceLoader loader)
                               throws TransformerException
Using html4.xsl, wrap the XForm String in xFormSnippet in a <pho:snippet>, and transform the wrapped XSL into an HTML form snippet.

Parameters:
xFormSnippet - The xml snippet being transformed.
method - HTML form method, generally either "post" or "get".
session -
Returns:
HTML form snippet, null on error.
Throws:
TransformerException - if the transform fails.

transform

public static String transform(String xForm,
                               String method,
                               IPentahoSession session,
                               IDocumentResourceLoader loader)
                        throws TransformerException
Using html4.xsl, transform the xml in the xForm string to an HTML form snippet.

Parameters:
xForm - The xml string being transformed.
method - HTML form method, generally either "post" or "get".
session -
Returns:
HTML form snippet, null on error.
Throws:
TransformerException - if the transform fails.

createXFormHeader

public static void createXFormHeader(String formName,
                                     StringBuffer xformHeader)

completeXFormHeader

public static void completeXFormHeader(String formName,
                                       StringBuffer xformHeader)

createXFormSubmit

public static void createXFormSubmit(String formName,
                                     StringBuffer xformBody,
                                     String buttonText)

completeXForm

public static String completeXForm(int outputType,
                                   String formName,
                                   StringBuffer xformHeader,
                                   StringBuffer xformBody,
                                   IPentahoSession session,
                                   IDocumentResourceLoader loader)
                            throws TransformerException
Throws:
TransformerException

createXFormControl

public static void createXFormControl(String fieldName,
                                      Object defaultValues,
                                      String formName,
                                      StringBuffer xformHeader,
                                      StringBuffer xformBody,
                                      boolean visible)

createXFormControl

public static void createXFormControl(int type,
                                      String fieldName,
                                      Object defaultValues,
                                      List values,
                                      Map displayNames,
                                      String formName,
                                      StringBuffer xformHeader,
                                      StringBuffer xformBody)