Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

oracle.jdeveloper.webapp.utils
Class WebDocumentUtil

java.lang.Object
  extended by oracle.jdeveloper.webapp.utils.WebDocumentUtil

public final class WebDocumentUtil
extends java.lang.Object


Constructor Summary
WebDocumentUtil()
           
 
Method Summary
static void addTagLibrary(JspLibrary jspTagLibrary, oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext)
           
static void addTagLibrary(JspLibrary jspTagLibrary, Project project, oracle.bali.xml.model.AbstractModel model)
          Configures JSP page and the project it belongs to to use given JSP tag library.
static void addTagLibrary(java.lang.String jspLibraryURI, oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext)
           
static void addTagLibrary(java.lang.String jspLibraryURI, Project project, oracle.bali.xml.model.AbstractModel model)
           
static oracle.bali.xml.gui.jdev.JDevXmlContext createJspXmlContext(Context context, java.lang.String jspContent, boolean xmlSyntax)
          Creates an in memory JDevXmlContext for the JSP page/document.
static java.lang.String findHtmlNamespace(oracle.bali.xml.model.AbstractModel model, java.lang.String fallbackNamespace)
          Finds namespace of HTML elements in the given model.
static java.lang.String findJspNamespace(oracle.bali.xml.model.AbstractModel model, java.lang.String fallbackNamespace)
          Finds namespace of JSP core syntax elements in the given model.
static java.util.Iterator findNodes(oracle.bali.xml.model.AbstractModel model, java.lang.String localName, java.lang.String namespace)
          Finds all nodes in the document that match given name and the namespace.
static java.util.Iterator findTagLibDirectives(oracle.bali.xml.model.AbstractModel model)
          Finds all taglib directive nodes in the document.
static java.lang.String getDefaultHtmlNamespace(oracle.bali.xml.model.XmlContext context)
          Returns a default HTML namespace to be used in the given context.
static java.lang.String getDefaultJspNamespace(oracle.bali.xml.model.XmlContext context)
          Returns a default JSP core syntax namespace to be used in the given context.
static java.lang.String getHtmlNamespace(oracle.bali.xml.model.AbstractModel model)
          Finds HTML namesapce used in the document of the given model, or if none is used returns default HTML namesapce in its context.
static java.util.List getJSFActionMethodBindings(oracle.bali.xml.model.AbstractModel model)
          Returns a List of Strings for all of the JSF elements in the model whose action attributes are method bindings.
static java.lang.String getJspNamespace(oracle.bali.xml.model.AbstractModel model)
          Finds JSP namesapce used in the document of the given model, or if none is used returns default JSP namesapce in its context.
static java.util.Set<java.lang.String> getTagLibsDeclared(oracle.bali.xml.model.AbstractModel model)
          Finds and returns all the declared tag libraries in JSP Document/ JSP Page
static org.w3c.dom.Node importFragment(oracle.bali.xml.model.AbstractModel model, java.lang.String text, oracle.bali.xml.dom.position.DomPosition location)
          Parses the given markup text into a node then inserts it by calling insertNode().
static org.w3c.dom.Node importNode(oracle.bali.xml.model.AbstractModel model, org.w3c.dom.Node newNode, oracle.bali.xml.dom.position.DomPosition location)
          Delegates import of node to the XmlModel.insertNodes() method without copying given node.
static org.w3c.dom.Node importNodes(oracle.bali.xml.model.AbstractModel model, org.w3c.dom.Node[] newNodes, oracle.bali.xml.dom.position.DomPosition location, java.lang.String transactionName)
          Delegates import of nodes to the XmlModel.insertNodes() method without copying given nodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDocumentUtil

public WebDocumentUtil()
Method Detail

importNode

public static org.w3c.dom.Node importNode(oracle.bali.xml.model.AbstractModel model,
                                          org.w3c.dom.Node newNode,
                                          oracle.bali.xml.dom.position.DomPosition location)
                                   throws oracle.bali.xml.model.XmlCommitException
Delegates import of node to the XmlModel.insertNodes() method without copying given node.

Parameters:
model -
newNode -
location -
Returns:
inserted node
Throws:
oracle.bali.xml.model.XmlCommitException
See Also:
AbstractModel#insertNodes(DomPosition, String, Transferable, boolean)

importFragment

public static org.w3c.dom.Node importFragment(oracle.bali.xml.model.AbstractModel model,
                                              java.lang.String text,
                                              oracle.bali.xml.dom.position.DomPosition location)
                                       throws oracle.bali.xml.model.XmlCommitException
Parses the given markup text into a node then inserts it by calling insertNode().

Parameters:
model -
text - XML markup to parse
location - in the document where to insert given nodes
Returns:
inserted node or null if parse fails
Throws:
oracle.bali.xml.model.XmlCommitException

importNodes

public static org.w3c.dom.Node importNodes(oracle.bali.xml.model.AbstractModel model,
                                           org.w3c.dom.Node[] newNodes,
                                           oracle.bali.xml.dom.position.DomPosition location,
                                           java.lang.String transactionName)
                                    throws oracle.bali.xml.model.XmlCommitException
Delegates import of nodes to the XmlModel.insertNodes() method without copying given nodes. Nodes are inserted at the given location in order they are in the array.

Parameters:
model -
newNodes - list of nodes to be inserted in the model
location - location in the document where to insert given nodes
transactionName - name of the transaction
Returns:
first inserted node
Throws:
oracle.bali.xml.model.XmlCommitException - if transaction can not be completed
See Also:
AbstractModel#insertNodes(DomPosition, String, Transferable, boolean);

findNodes

public static java.util.Iterator findNodes(oracle.bali.xml.model.AbstractModel model,
                                           java.lang.String localName,
                                           java.lang.String namespace)
Finds all nodes in the document that match given name and the namespace. Caller should acquire a read lock on the model before accessing this method, and release the lock only after the returned iterator is not used any more.

Parameters:
model -
localName - name of the element to be matched. "link" for example. Do not use qualified name that includes prefix.
namespace -
Returns:
list of DOM Node objects that match given name and namespace

findTagLibDirectives

public static java.util.Iterator findTagLibDirectives(oracle.bali.xml.model.AbstractModel model)
Finds all taglib directive nodes in the document. Caller should acquire a read lock on the model before accessing this method, and release the lock only after the returned iterator is not used any more.

Parameters:
model -
Returns:
list of DOM Nodes

getDefaultHtmlNamespace

public static java.lang.String getDefaultHtmlNamespace(oracle.bali.xml.model.XmlContext context)
Returns a default HTML namespace to be used in the given context. This value should be used as HTML namespace in the given context if no other HTML namespcase has already been used.


getDefaultJspNamespace

public static java.lang.String getDefaultJspNamespace(oracle.bali.xml.model.XmlContext context)
Returns a default JSP core syntax namespace to be used in the given context. This value should be used as JSP core syntax namespace in the given context if no other JSP core syntax namespace has already been used.


findHtmlNamespace

public static java.lang.String findHtmlNamespace(oracle.bali.xml.model.AbstractModel model,
                                                 java.lang.String fallbackNamespace)
Finds namespace of HTML elements in the given model. If model does not have any HTML elements, it returns fallback namespace.

Parameters:
model - to be searched for HTML elements
fallbackNamespace - namespace to be returned of model does not contain any HTML elements.
Returns:
namespace of HTML elements found in document
See Also:
getDefaultHtmlNamespace(XmlContext)

getHtmlNamespace

public static java.lang.String getHtmlNamespace(oracle.bali.xml.model.AbstractModel model)
Finds HTML namesapce used in the document of the given model, or if none is used returns default HTML namesapce in its context.

Parameters:
model -
Returns:

findJspNamespace

public static java.lang.String findJspNamespace(oracle.bali.xml.model.AbstractModel model,
                                                java.lang.String fallbackNamespace)
Finds namespace of JSP core syntax elements in the given model. If model does not have any JSP core syntax elements, it returns fallback namespace.

Parameters:
model - to be searched for JSP core syntax elements
fallbackNamespace - namespace to be returned of model does not contain any JSP core syntax elements.
Returns:
namespace of JSP core syntax elements found in document
See Also:
getDefaultJspNamespace(XmlContext)

getJspNamespace

public static java.lang.String getJspNamespace(oracle.bali.xml.model.AbstractModel model)
Finds JSP namesapce used in the document of the given model, or if none is used returns default JSP namesapce in its context.

Parameters:
model -
Returns:

addTagLibrary

public static void addTagLibrary(java.lang.String jspLibraryURI,
                                 oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext)
                          throws oracle.bali.xml.model.XmlCommitException
Throws:
oracle.bali.xml.model.XmlCommitException
See Also:
#addTagLibrary( JspLibrary, JProject, AbstractModel )

addTagLibrary

public static void addTagLibrary(java.lang.String jspLibraryURI,
                                 Project project,
                                 oracle.bali.xml.model.AbstractModel model)
                          throws oracle.bali.xml.model.XmlCommitException
Throws:
oracle.bali.xml.model.XmlCommitException
See Also:
#addTagLibrary( JspLibrary, JProject, AbstractModel )

addTagLibrary

public static void addTagLibrary(JspLibrary jspTagLibrary,
                                 oracle.bali.xml.gui.jdev.JDevXmlContext xmlContext)
                          throws oracle.bali.xml.model.XmlCommitException
Throws:
oracle.bali.xml.model.XmlCommitException
See Also:
#addTagLibrary( JspLibrary, JProject, AbstractModel )

addTagLibrary

public static void addTagLibrary(JspLibrary jspTagLibrary,
                                 Project project,
                                 oracle.bali.xml.model.AbstractModel model)
                          throws oracle.bali.xml.model.XmlCommitException
Configures JSP page and the project it belongs to to use given JSP tag library. This will add tag library directive to the JSP page (or xmlns attribute to JSP document), and configure project to use given JSP tag library. If there are any configuration taks associated with the tag library they will be run too.

Parameters:
jspTagLibrary - JSP tag library.
project - Web application JSP page belongs to.
model - XML model of the one of the JSP file type documents.
Throws:
oracle.bali.xml.model.XmlCommitException

getJSFActionMethodBindings

public static java.util.List getJSFActionMethodBindings(oracle.bali.xml.model.AbstractModel model)
Returns a List of Strings for all of the JSF elements in the model whose action attributes are method bindings.


createJspXmlContext

public static oracle.bali.xml.gui.jdev.JDevXmlContext createJspXmlContext(Context context,
                                                                          java.lang.String jspContent,
                                                                          boolean xmlSyntax)
Creates an in memory JDevXmlContext for the JSP page/document. Clients have to call JDevXmlContext.dispose() to release the JDevXmlContext object.

Parameters:
context - IDE context has to have project.
jspContent - Content of the JSP page or document.
xmlSyntax - True if the given jsp content is in the XML format.
Returns:

getTagLibsDeclared

public static java.util.Set<java.lang.String> getTagLibsDeclared(oracle.bali.xml.model.AbstractModel model)
Finds and returns all the declared tag libraries in JSP Document/ JSP Page

Parameters:
model - to be searched
Returns:
an unmodifiable Set of declared tag libraries in the model.

Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference
11g Release 1 (11.1.1)

E13403-04

Copyright © 1997, 2010, Oracle. All rights reserved.