Skip Headers

Oracle® Application Developer's Guide - XML
10g (9.0.4)

Part Number B12099-01
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Go to previous page Go to next page

D
XDK for Java Beans: Specifications and Cheat Sheets

This Appendix describes the XDK for Java Bean specifications and cheat sheets.

This appendix contains the following section:

XDK for Javabeans: Transviewer Bean Cheat Sheet

The followng tables list the primary classes and methods of the Transviewer Beans in XDK for Java Beans:

DOMBuilder Bean Cheat Sheet

Table D-1 lists the primary classes and methods in DOMBuilder Bean.

Table D-1 DOMBuilder Bean Classes and Methods 
Class Summary Description
Interfaces

-

DOMBuilderErrorListener

This interface must be implemented in order to receive notifications when error is found during parsing.

DOMBuilderListener

This interface must be implemented in order to receive notifications about events during the asyncronous parsing.

Classes

-

DOMBuilder

This class encapsulates an eXtensible Markup Language (XML) 1.0 parser to parse an XML document and build a DOM tree. The parsing is done in a separate thread and DOMBuilderListener interface must be used for notification when the tree is built.

DOMBuilderBeanInfo

-

DOMBuilderErrorEvent

This class defines the error event which is sent when parse exception occurs.

DOMBuilderEvent

The event object that DOMBuilder uses to notify all registered listeners about parse events.

ResourceManager

Simple semaphore that maintains access to fixed number of logical resources.

XSLTransformer Bean Cheat Sheet

Table D-2 lists the primary XSLTransformer Bean classes and methods.

Table D-2 XSLTransformer Bean Classes and Methods 
Member Summary Description
Class XSLTransformer

Applies XSL transformation in a background thread.

Constructors

-

XSLTransformer()

XSLTransformer constructor

XSLTransformer(int)

XSLTransformer constructor

Methods

-

addXSLTransformerErrorListener(XSLTransformerErrorListener)

Adds an error event listener

addXSLTransformerListener(XSLTransformerListener)

Adds a listener

Returns the unique XSLTransformer id

getResult()

Returns the document fragment for the resulting document.

processXSL(XSLStylesheet, InputStream, URL)

Initiate XSL Transformation in the background.

processXSL(XSLStylesheet, Reader, URL)

Initiate XSL Transformation in the background.

processXSL(XSLStylesheet, URL, URL)

Initiate XSL Transformation in the background.

Initiate XSL Transformation in the background.

processXSL(XSLStylesheet, XMLDocument, OutputStream)

Initiate XSL Transformation in the background.

removeDOMTransformerErrorListener(XSLTransformerErrorListener)

Renmoves an error event listener

removeXSLTransformerListener(XSLTransformerListener)

Removes a listener

run()

-

Sets the error stream used by the XSL processor

showWarnings(boolean)

Sets the showWarnings flage used by the XSL processor

Class

XSLTransformerErrorEvent

The error event object that XSLTransformer uses to notify all registered listeners about transformation error events.

Class

XSLTransformerEvent

The event object that XSLTransformer uses to notify all registered listeners about transformation events.

Class

XSLTransformerErrorListener

This interface must be implemented in order to receive notifications about error events during the asyncronous transformation.

Class

XSLTransformerListener

This interface must be implemented in order to receive notifications about events during the asyncronous transformation.

XMLTreeView Bean Cheat Sheet

Table D-3 lists the XMLTreeView Bean primary class and methods.

Table D-3 XMLTreeView Bean Class and Methods 
Class or Method Description

Class

XMLTreeView()

The class constructor.

Methods

getPreferredSize()

Returns the XMLTreeView preffered size.

setXMLDocument(Document)

Associates the XMLTreeViewer with a XML document.

updateUI()

Forces the XMLTreeView to update/refresh UI.

Class XMLTreeViewBeanInfo()

--

Methods getIcon(int)

--

getPropertyDescriptors()

--

XMLTransformPanel Cheat Sheet

Table D-4 lists XMLTransformPanel Bean primary classes and methods.

Table D-4 XMLTransformPanel Bean Classes and Methods 
Classes and Methods Description

Class

XMLTransformPanel

XMLTransformPanel visual bean applies XSL transformations on XML documents. Visualizes the result. Allows editing of input XML and XSL documents/files.

Constructors

XMLTransformPanel()

public XMLTransformPanel() The class constructor. Creates an object of type XMLTransformPanel.

XMLTransformPanelBeanInfo

-

Constructors XMLTransformPanelBeanInfo()

public XMLTransformPanelBeanInfo()

Methods

getIcon(int)

public java.awt.Image getIcon(int iconKind) Overrides: java.beans.SimpleBeanInfo.getIcon(int) in class java.beans.SimpleBeanInfo

getPropertyDescriptors()

public java.beans.PropertyDescriptor[] getPropertyDescriptors() Overrides: java.beans.SimpleBeanInfo.getPropertyDescriptors() in class java.beans.SimpleBeanInfo

DBViewer Bean Cheat Sheet

Table D-5 lists the DBViewer bean primary class and methods.

Table D-5 DBViewer Bean Class and Methods  
Class and Methods Description

Class DBViewer()

Constructs a new instance. Displays database queries or any XML by applying XSL stylesheets and visualizing the resulted HTML in scrollable swing panel. This bean has tree buffers: XML, XSL and result buffer. DBViewer bean allows the calling program to load/save the buffers from various sources and to apply stylesheet transformation to the XML buffer using the stylesheet in the XSL buffer. The result can be stored in the result buffer. The XML and XSL buffers content can be shown as source or as a tree structure. The result buffer content can be rendered as HTML and also shown as source or tree structure. The XML buffer can be loaded from database query. All buffers can load and save files from CLOB tables in Oracle database and from file system as well. Therefore, the control can be also used to move files between the file system and the user schema in the database.

Methods getHostname()

Get database host name

getInstancename()

Get database instance name

getPassword()

Get user password

getPort()

Get database port number

getResBuffer()

Get the content of the result buffer

getResCLOBFileName()

Get result CLOB file name

getResCLOBTableName()

Get result CLOB table name

getResFileName()

Get Result file name

getUsername()

Get user name

getXmlBuffer()

Get the content of the XML buffer

getXmlCLOBFileName()

Get XML CLOB file name

getXmlCLOBTableName()

Get XML CLOB table name

getXmlFileName()

Get XML file name

getXMLStringFromSQL(String)

Get XML presentation of result set from SQL query

getXslBuffer()

Get the content of the XSL buffer

getXslCLOBFileName()

Get the XSL CLOB file name

getXslCLOBTableName()

Get XSL CLOB table name

getXslFileName()

Get XSL file name

loadResBuffer(String)

Load the result buffer from file

loadResBuffer(String, String)

Load the result buffer from CLOB file

loadResBufferFromClob()

Load the result buffer from CLOB file

loadResBufferFromFile()

Load the result buffer from file

loadXmlBuffer(String)

Load the XML buffer from file

loadXmlBuffer(String, String)

Load the XML buffer from CLOB file

loadXmlBufferFromClob()

Load the XML buffer from CLOB file

loadXmlBufferFromFile()

Load the XML buffer from file

loadXMLBufferFromSQL(String)

Load the XML buffer from SQL result set

loadXslBuffer(String)

Load the XSL buffer from file

loadXslBuffer(String, String)

Load the XSL buffer from CLOB file

loadXslBufferFromClob()

Load the XSL buffer from CLOB file

loadXslBufferFromFile()

Load the XSL buffer from file

parseResBuffer()

Parse the result buffer and refresh the tree view and source view

parseXmlBuffer()

Parse the XML buffer and refresh the tree view and source view

parseXslBuffer()

Parse the XSL buffer and refresh the tree view and source view

saveResBuffer(String)

Save the result buffer to file

saveResBuffer(String, String)

Save the result buffer to CLOB file

saveResBufferToClob()

Save the result buffer to CLOB file

saveResBufferToFile()

Save the result buffer to file

saveXmlBuffer(String)

Save the XML buffer to file

saveXmlBuffer(String, String)

Save the XML buffer to CLOB file

saveXmlBufferToClob()

Save the XML buffer to CLOB file

saveXmlBufferToFile()

Save the XML buffer to file

saveXslBuffer(String)

Save the XSL buffer to file

saveXslBuffer(String, String)

Save the XSL buffer to CLOB file

saveXslBufferToClob()

Save the XSL buffer to CLOB file

saveXslBufferToFile()

Save the XSL buffer to file

setHostname(String)

Set database host name

setInstancename(String)

Set database instance name

setPassword(String)

Set user password

setPort(String)

Set database port number

setResBuffer(String)

Set new text in the result buffer

setResCLOBFileName(String)

Set Result CLOB file name

setResCLOBTableName(String)

Set Result CLOB table name

setResFileName(String)

Set Result file name

setResHtmlView(boolean)

Show the result buffer as rendered HTML

setResSourceEditView(boolean)

Show the result buffer as XML source and enter edit mode

setResSourceView(boolean)

Show the result buffer as XML source

setResTreeView(boolean)

Show the result buffer as XML tree view

setUsername(String)

Set user name

setXmlBuffer(String)

Set new text in the XML buffer

setXmlCLOBFileName(String)

Set XML CLOB table name

setXmlCLOBTableName(String)

Set XML CLOB table name

setXmlFileName(String)

Set XML file name

setXmlSourceEditView(boolean)

Show the XML buffer as XML source and enter edit mode

setXmlSourceView(boolean)

Show the XML buffer as XML source

setXmlTreeView(boolean)

Show the XML buffer as tree

setXslBuffer(String)

Set new text in the XSL buffer

setXslCLOBFileName(String)

Set XSL CLOB file name

setXslCLOBTableName(String)

Set XSL CLOB table name

setXslFileName(String)

Set XSL file name

setXslSourceEditView(boolean)

Show the XSL buffer as XML source and enter edit mode

setXslSourceView(boolean)

Show the XSL buffer as XML source

setXslTreeView(boolean)

Show the XSL buffer as tree

transformToDoc()

Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

transformToRes()

Apply the stylesheet transformation from the XSL buffer to the XML in the XML buffer and stores the result into the result buffer

transformToString()

Transfroms the content of the XML buffer by applying the stylesheet from the XSL buffer.

XMLSourceView Bean Cheat Sheet

Table D-6 lists the primary classes and methods of XMLSourceView Bean.

Table D-6 XMLSourceView Bean Classes and Methods 
Class and Methods Description

Class

XMLSourceView

Shows an XML document. Recognizes the following XML token types: Tag, Attribute Name, Attribute Value, Comment, CDATA, PCDATA, PI Data, PI Name and NOTATION Symbol. Each token type has a foreground color and font. The default color/font settings can be changed by the user. Takes as input an org.w3c.dom.Document object.

Fields

inputDOMDocument, jScrollPane, jTextPane, xmlStyledDocument

-

Constructors

XMLSourceView()

The class constructor. Creates an object of type XMLSourceView.

Methods

fontGet(AttributeSet)

Extracts and returns the font from a given attributeset. Parameters: attributeset - The source Attributeset. Returns: The extracted Font.

fontSet(MutableAttributeSet, Font)

Sets the mutableattributeset font. Parameters: mutableattributeset - The mutableattributeset to update, font - The new Font for the mutableattributeset.

getAttributeNameFont()

Returns the Attribute Value font. Returns: The Font object.

getAttributeNameForeground()

Returns the Attribute Name foreground color. Returns: The Color object.

getAttributeValueFont()

Returns the Attribute Value font. Returns: The Font object.

getAttributeValueForeground()

public java.awt.Color getAttributeValueForeground() Returns the Attribute Value foreground color. Returns: The Color object.

getBackground()

public java.awt.Color getBackground() Returns the background color.Overrides: java.awt.Component.getBackground() in class java.awt.Component Returns: The Color object.

getCDATAFont()

public java.awt.Font getCDATAFont() Returns the CDATA font. Returns: The Font object.

getCDATAForeground()

public java.awt.Color getCDATAForeground() Returns the CDATA foreground color. Returns: The Color object.

getCommentDataFont()

public java.awt.Font getCommentDataFont() Returns the Comment Data font. Returns: The Font object.

getCommentDataForeground()

public java.awt.Color getCommentDataForeground() Returns the Comment Data foreground color.Returns: The Color object

getEditedText()

public java.lang.String getEditedText() Returns the edited text. Returns: The String object containing the edited text.

getJTextPane()

public javax.swing.JTextPane getJTextPane() Returns the viewer JTextPane component. Returns: The JTextPane object used by XMLSourceViewer

getMinimumSize()

public java.awt.Dimension getMinimumSize() Returns the XMLSourceView minimal size. Overrides: javax.swing.JComponent.getMinimumSize() in class javax.swing.JComponent Returns: The Dimension object containing the XMLSourceView minimum size.

getNodeAtOffset(int)

public org.w3c.dom.Node getNodeAtOffset(int i) Returns the XML node at a given offset. Parameters: i - The node offset. Returns: The Node object from offset i.

getPCDATAFont()

public java.awt.Font getPCDATAFont() Returns the PCDATA font. Returns: The Font object.

getPCDATAForeground()

public java.awt.Color getPCDATAForeground() Returns the PCDATA foreground color. Returns: The Color object.

getPIDataFont()

public java.awt.Font getPIDataFont() Returns the PI Data font. Returns: The Font object

getPIDataForeground()

public java.awt.Color getPIDataForeground() Returns the PI Data foreground color. Returns: The Color object.

getPINameFont()

public java.awt.Font getPINameFont() Returns the PI Name font. Returns: The Font object.

getPINameForeground()

public java.awt.Color getPINameForeground() Returns the PI Data foreground color. Returns: The Color object.

getSymbolFont()

public java.awt.Font getSymbolFont() Returns the NOTATION Symbol font. Returns: The Font object.

getSymbolForeground()

public java.awt.Color getSymbolForeground() Returns the NOTATION Symbol foreground color.Returns: The Color object.

getTagFont()

public java.awt.Font getTagFont() Returns the Tag font. Returns: The Font object.

getTagForeground()

public java.awt.Color getTagForeground() Returns the Tag foreground color. Returns: The Color object.

getText()

public java.lang.String getText() Returns the XML document as a String. Returns: The String object containing the XML document.

isEditable()

public boolean isEditable() Returns boolean to indicate whether this object is editable.

selectNodeAt(int)

public void selectNodeAt(int i) Moves the cursor to XML Node at offset i. Parameters: i - The node offset.

setAttributeNameFont(Font)

public void setAttributeNameFont(java.awt.Font font) Sets the Attribute Name font. Parameters: font - The new Font for Attribute Name.

setAttributeNameForeground(Color)

public void setAttributeNameForeground(java.awt.Color color) Sets the Attribute Name foreground color.Parameters: color - The new Color for Attribute Name.

setAttributeValueFont(Font)

public void setAttributeValueFont(java.awt.Font font) Sets the Attribute Value font. Parameters: font - The new Font for Attribute Value.

setAttributeValueForeground(Color)

public void setAttributeValueForeground(java.awt.Color color) Sets the Attribute Value foreground color. Parameters: color - The new Color for Attribute Value.

setBackground(Color)

public void setBackground(java.awt.Color color) Sets the background color. Overrides: javax.swing.JComponent.setBackground(java.awt.Color) in class javax.swing.JComponent Parameters: color - The new background Color.

setCDATAFont(Font)

public void setCDATAFont(java.awt.Font font) Sets the CDATA font. Parameters: font - The new Font for CDATA.

setCDATAForeground(Color)

public void setCDATAForeground(java.awt.Color color) Sets the CDATA foreground color. Parameters: color - The new Color for CDATA.

setCommentDataFont(Font)

public void setCommentDataFont(java.awt.Font font) Sets the Comment font. Parameters: font - The new Font for the XML Comments.

setCommentDataForeground(Color)

public void setCommentDataForeground(java.awt.ColoSets the Comment foreground color. Parameters: color - The new Color for Comment.r color)

setEditable(boolean)

public void setEditable(boolean edit) Sets the specified boolean to indicate whether this object should be editable. Parameters: doc - The new boolean value.

setPCDATAFont(Font)

public void setPCDATAFont(java.awt.Font font) Sets the PCDATA font. Parameters: font - The new Font for PCDATA.

setPCDATAForeground(Color)

public void setPCDATAForeground(java.awt.Color color) Sets the PCDATA foreground color. Parameters: color - The new Color for PCDATA.

setPIDataFont(Font)

public void setPIDataFont(java.awt.Font font) Sets the PI Data font. Parameters: font - The new Font for PI Data.

setPIDataForeground(Color)

public void setPIDataForeground(java.awt.Color color) Sets the PI Data foreground color. Parameters: color - The new Color for PI Data.

setPINameFont(Font)

public void setPINameFont(java.awt.Font font) Sets the PI Name font. Parameters: font - The new Font for the PI Names.

setPINameForeground(Color)

public void setPINameForeground(java.awt.Color color) Sets the PI Name foreground color. Parameters: color - The new Color for PI Name.

setSelectedNode(Node)

public void setSelectedNode(org.w3c.dom.Node node) Sets the cursor position at the selected XML node. Parameters: node - The selected node.

setSymbolFont(Font)

public void setSymbolFont(java.awt.Font font) Sets the NOTATION Symbol font. Parameters: color - The new Font for NOTATION Symbol.

setSymbolForeground(Color)

public void setSymbolForeground(java.awt.Color color) Sets the NOTATION Symbol foreground color. Parameters: color - The new Color for NOTATION Symbol.

setTagFont(Font)

public void setTagFont(java.awt.Font font) Sets the Tag font. Parameters: font - The new Font for the XML Tags.

setTagForeground(Color)

public void setTagForeground(java.awt.Color color) Sets the Tag foreground color. Parameters: color - The new Color for the XML Tags.

setXMLDocument(Document)

public void setXMLDocument(org.w3c.dom.Document document) Associates the XMLviewer with a XML document. Parameters: doc - The Document document to display. See Also: getText()

DBAccess Bean Cheat Sheet

Table D-7 lists the DBAccess Bean primary classes and methods.

Table D-7 DBAccess Classes and Methods 
Classes and Methods Description

Class

DBAccess

Maintains CLOB tables that can hold multiple XML and text documents. Each table is created using the statement: CREATE TABLE tablename FILENAME CHAR( 16) UNIQUE, FILEDATA CLOB) LOB(FILEDATA) STORE AS (DISABLE STORAGE IN ROW). Each XML (or text) document is stored as a row in the table and the FILENAME field holds a unique string that is used as a key to retrieve, update or delete the row. The document text is stored in the FILEDATA field that is a CLOB object. This CLOB tables are automatically maintained by the transviewer bean. The CLOB tables maintained by this class can be later used by the transviewer bean. The class creates and deletes CLOB tables, list a CLOB table content and also add, replace or delete text documents in this CLOB tables.

Constructors

DBAccess()

public DBAccess()

Methods

createBLOBTable(Connection, String)

Create BLOB table Parameters: con - - the Connection object tablename - - the table name Returns: true if successfull

createXMLTable(Connection, String)

Create XML table Parameters: con - - the Connection object, tablename - - the table name Returns: true if successfull

deleteBLOBName(Connection, String, String)

Delete binary file from BLOB table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name Returns: true if successfull

deleteXMLName(Connection, String, String)

Delete file from XML table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name Returns: true if successfull

dropBLOBTable(Connection, String)

public boolean dropBLOBTable(java.sql.Connection con, java.lang.String tablename) Delete BLOB table Parameters: con - - the Connection object, tablename - - the table name Returns: true if successfull

dropXMLTable(Connection, String)

public boolean dropXMLTable(java.sql.Connection con, java.lang.String tablename) Delete XML table Parameters: con - - the Connection object, tablename - - the table name Returns: true if successfull

getBLOBData(Connection, String, String)

public byte[] getBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) Retrieve binary file from BLOB table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name Returns: file as a byte array

getNameSize()

public int getNameSize() Returns the size of the field where the filename is kept. Returns: filename size

getXMLData(Connection, String, String)

public java.lang.String getXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname) Retrieve text file from XML table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name Returns: file as a string

getXMLNames(Connection, String)

public java.lang.String[] getXMLNames(java.sql.Connection con, java.lang.String tablename) Returns all file names in XML table Parameters: con - - the Connection object, tablename - - the table name Returns: String array with all file names in this table

getXMLTableNames(Connection, String)

public java.lang.String[] getXMLTableNames(java.sql.Connection con, java.lang.String tablePrefix) Gets all XML tables with names starting with a given string Parameters: con - - the Connection object, tablePrefix - - table prefix string Returns: array of all XML tables that begin with tablePrefix

insertBLOBData(Connection, String, String, byte[])

public boolean insertBLOBData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, byte[] xmldata) Inserts binary file as a row in BLOB table Parameters: con - - the Connection object tablename - - the table name, xmlname - - the file name, xmldata - - byte array with file data Returns: true if successfull

insertXMLData(Connection, String, String, String)

public boolean insertXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata) Inserts text file as a row in XML table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name, xmldata - - string with the file data Returns: true if successfull

isXMLTable(Connection, String)

public boolean isXMLTable(java.sql.Connection con, java.lang.String tablename) Check if the table is XML table. Parameters: con - - the Connection object, tableName - - the table name to test Returns: true if this is XML table

replaceXMLData(Connection, String, String, String)

public boolean replaceXMLData(java.sql.Connection con, java.lang.String tablename, java.lang.String xmlname, java.lang.String xmldata) Replace text file as a row in XML table Parameters: con - - the Connection object, tablename - - the table name, xmlname - - the file name, xmldata - - string with the file data Returns: true if successfull

xmlTableExists(Connection, String)

public boolean xmlTableExists(java.sql.Connection con, java.lang.String tablename) Checks if the XML table exists Parameters: con - - the Connection object, tablename - - the table name Returns: true if the table exists

See Also:

Chapter 23, "Using XML Transviewer Beans".


Go to previous page Go to next page
Oracle
Copyright © 2001, 2003 Oracle Corporation.

All Rights Reserved.
Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index