|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.jdeveloper.html.WebBeanImpl oracle.jdeveloper.html.DataWebBeanImpl oracle.jbo.html.DataWebBeanImpl oracle.jbo.html.databeans.XmlData
The XmlData class renders a canonical XML representation for the rows of an oracle.jbo.RowSet. Since oracle.jbo.ViewObject implements RowSet, XmlData can be used on any RowSet or View Object.
XmlData renders a canonical XML representation by iterating through the attribute defs for the initial "root" RowSet you specify when you instantiate it. It produces equivalent XML tags for each scalar attribute. When XmlData detects that an attribute is a "nested RowSet", it recurses into itself to print the nested XML for the nested RowSet. The result is an XML "tree" of elements, reflecting the deep data print of all the rows in the root RowSet, along with any nested (View Linked) detail information.
Optionally, the setStyleSheet method lets you transform the results of XmlData according to an XSLT stylesheet.
You instantiate XmlData by declaring:
XmlData d = new XmlData (rowset);
No other special set up is required, however, XmlData includes funtionality to let you:
By using custom properties, you can customize your XML output without having to edit your Java classes.
XML_ELEMENT
. Set
XML_ELEMENT equal to the element name you want to use.
To hide the attribute in the XML document, set that attribute's
XML_ELEMENT equal to the value #hide.If you have a View Object attribute value that contains characters requiring quotes, such as less-than (<) or ampersand (&), XmlData lets you treat it as an XML CDATA section. Within a CDATA section, you can omit quotes from characters that would otherwise require it. To treat an attribute value as a CDATA section, add a custom property to your View Object Attribute named CDATA with a value equal to "Y".
The JSP Element Wizard's definition of an XmlData instance includes these methods: setResultElement, setStylesheet, setMaxRows, setReleaseApplicationResources, initialize, and render. For example,
<jsp:useBean class="oracle.jbo.html.databeans.XmlData" id="xmlGen" scope="request" > <% xmlGen.setResultElement("Deptno"); xmlGen.setStylesheet("myXSL.xsl"); xmlGen.setMaxRows(10); xmlGen.setReleaseApplicationResources(false); xmlGen.initialize(application,session, request,response,out, "package3_Package3Module.DeptView"); xmlGen.render(); %> </jsp:useBean>
The value assigned to the setReleaseApplicationResources method determines whether the Application Module is released after the XmlData Data Web Bean processes it. Typically, the value should not be set to true unless this is the last Web Bean to be processed in the JSP page.
Field Summary |
Fields inherited from class oracle.jdeveloper.html.DataWebBeanImpl |
amName, bReleaseApplication, dispAttrs, ds |
Fields inherited from class oracle.jdeveloper.html.WebBeanImpl |
application, bUsedInTag, out, page, request, response, session |
Fields inherited from interface oracle.jdeveloper.html.WebBean |
contentFrameName, defaultCaboBase, defaultCaboImageBase, defaultImageBase, defaultJSPBase, defaultNLSFormat, JS_LIBRARIES, JS_NAMEID, JSButtonConstructorLib, JSCalendarConstructorLib, JSContainerConstructorLib, JSDataConstructLib, JSModalPageConstructorLib, JSTableConstructLib, JSToolbarConstructorLib, JSTreeConstructLib, JSUtilitiesLib |
Constructor Summary | |
XmlData()
|
Method Summary | |
Document |
getXMLDocument()
Returns an in-memory DOM Document for the ViewObject |
void |
internalInitialize()
Internal initialize. |
void |
print(java.io.PrintWriter out)
Prints the XML results to a PrintWriter. |
void |
render()
Renders the Web Bean's contents to the output stream. |
void |
setMaxRows(int val)
Specifies the maximum number of master rows to render. |
void |
setResultElement(java.lang.String elt)
Specifies the name of the document element for the results. |
void |
setRowSetTag(java.lang.String tag)
Overvie the default XML Element name to be used for the entire RowSet |
void |
setRowTag(java.lang.String tag)
Override the default XML Element name to be used for each Row in each rowset. |
void |
setStylesheet(java.lang.String uri)
Sets the URI of the XSLT stylesheet to (optionally) transform XML results. |
void |
setStylesheet(XSLStylesheet sheet)
Sets the instance of an XSLTStylesheet object to use to (optionally) transform XML results. |
void |
setStylesheetParam(java.lang.String name,
java.lang.String value)
|
void |
setStylesheetParamXPath(java.lang.String name,
java.lang.String value)
|
Methods inherited from class oracle.jbo.html.DataWebBeanImpl |
initialize, setUsedInTag |
Methods inherited from class oracle.jdeveloper.html.WebBeanImpl |
generateScriptSrc, getCookie, getOut, getRequest, getRequestVariable, getRequestVariable, getUniqueName, initBeanForJS, initBeanForJS, initBeanForJS, initialize, initialize, initialize, render, setRequestVariable, setRequestVariable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface oracle.jdeveloper.html.DataWebBean |
clearDisplayAttributes, getApplicationName, getDisplayAttributeDefs, getDisplayAttributes, getDisplayFieldRenderer, getEditFieldRenderer, getRowSet, getViewObjectName, handleCommit, initialize, initialize, isAppStateful, setDisplayAttributes, setDisplayFieldRenderer, setDisplayFieldRenderer, setEditFieldRenderer, setEditFieldRenderer, setReleaseApplicationResources, setRowSet, shouldDisplayAttribute |
Methods inherited from interface oracle.jdeveloper.html.WebBean |
initialize, initialize, render |
Constructor Detail |
public XmlData()
Method Detail |
public void setRowTag(java.lang.String tag)
tag
- XML Element name for each Row.public void setResultElement(java.lang.String elt)
If you do not specify a document element name, XmlData gives it the default name "Result".
elt
- any valid XML element name.public void setRowSetTag(java.lang.String tag)
tag
- XML Element name for rowsetpublic void setStylesheet(java.lang.String uri)
uri
- URI of the stylesheet. The URI can be expressed in any of these
formats:
public void setStylesheet(XSLStylesheet sheet)
public void setMaxRows(int val)
A suggested, useful value for the maximum is 1. If you do not specify a maximum, all master rows are returned.
val
- number of rows to render.public void print(java.io.PrintWriter out) throws java.lang.Exception
out
- target of the PrintWriter function.
java.lang.Exception
public Document getXMLDocument() throws java.lang.Exception
java.lang.Exception
public void render() throws java.lang.Exception
WebBean
render
in interface WebBean
render
in class WebBeanImpl
java.lang.Exception
public void setStylesheetParam(java.lang.String name, java.lang.String value)
public void setStylesheetParamXPath(java.lang.String name, java.lang.String value)
public void internalInitialize() throws java.lang.Exception
WebBean
internalInitialize
in interface WebBean
internalInitialize
in class DataWebBeanImpl
java.lang.Exception
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.