com.sun.portal.providers.xml
Class XMLProvider

java.lang.Object
  |
  +--com.sun.portal.providers.ProviderAdapter
        |
        +--com.sun.portal.providers.ProfileProviderAdapter
              |
              +--com.sun.portal.providers.urlscraper.URLScraperProvider
                    |
                    +--com.sun.portal.providers.xml.XMLProvider
All Implemented Interfaces:
Provider, ProviderEditTypes, ProviderWidths

public class XMLProvider
extends URLScraperProvider

A XML Provider is used to convert and display the XML file according to the specified style sheet.

XMLProvider is an extension of the existing URLScraperProvider. It uses the URLScraperProvider to fetch the XML contents when the url is of type http://url or https://url and if the url is of type file://// , the XMLProvider manually reads the contents of the specified file .

The XMLProvider can transform generic XML content to specific markups using an XSLT engine. It allows creating multiple markup channels from a single XML source (local or over http/https)

XML Provider requires two arguments to do the transformation.

The XMLProvider-based channel has the following configurable attributes:

The path to the XML content can be specified as HTTP,HTTPs or file URL. If the path is HTTP or HTTPs the provider uses URLScraper provider to fetch the contents. If the path is a file URL, the provider reads the file into a StringBuffer.

The value for the XSL filename to use for transformation is stored as a value of the string attribute as indicated above. The user can either specify the complete path (including the file name) or can specify just the file name in which case it will be picked from the default directory. While specifying a value for this property there should not be any use of the protocols like "file://" or "http://" or "https://"

If both the XML file and the XSL file are present, the XMLProvider does the transformation using the XSLT engine. The generated contents are displayed in the channel. In order to do the conversion the XMLProvider uses the JAXP1.1 jar files.

NOTE: getEdit() and  processEdit() methods are not implemented in the XMLProvider.


Fields inherited from interface com.sun.portal.providers.ProviderWidths
WIDTH_FULL_BOTTOM, WIDTH_FULL_TOP, WIDTH_THICK, WIDTH_THIN
 
Fields inherited from interface com.sun.portal.providers.ProviderEditTypes
EDIT_COMPLETE, EDIT_SUBSET
 
Constructor Summary
XMLProvider()
           
 
Method Summary
 StringBuffer getContent(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)
          
 
Methods inherited from class com.sun.portal.providers.urlscraper.URLScraperProvider
getInputEncoding
 
Methods inherited from class com.sun.portal.providers.ProfileProviderAdapter
existsBooleanProperty, existsIntegerProperty, existsListProperty, existsListProperty, existsStringProperty, existsStringProperty, getBooleanProperty, getBooleanProperty, getClientProperty, getIntegerProperty, getIntegerProperty, getListProperty, getListProperty, getMapProperty, getMapProperty, getMapProperty, getMapProperty, getStringAttribute, getStringProperty, getStringProperty, getStringProperty, getStringProperty, getTemplate, getTemplate, isAllowed, setBooleanProperty, setClientProperty, setIntegerProperty, setListProperty, setMapProperty, setStringAttribute, setStringProperty
 
Methods inherited from class com.sun.portal.providers.ProviderAdapter
getContent, getDescription, getEdit, getEdit, getEditType, getHelp, getHelp, getName, getProviderContext, getRefreshTime, getResourceBundle, getResourceBundle, getTitle, getWidth, init, isEditable, isPresentable, processEdit, processEdit
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLProvider

public XMLProvider()
Method Detail

getContent

public StringBuffer getContent(javax.servlet.http.HttpServletRequest req,
                               javax.servlet.http.HttpServletResponse res)
                        throws ProviderException

Gets and displays the XML file contents after converting the xml file according to the specified XSL stylesheet

Overrides:
getContent in class URLScraperProvider
Parameters:
req - An HttpServletRequest that contains information related to this request for content.
res - An HttpServletResponse that allows the provider to influence the overall response for the desktop page (besides generating the content).
Returns:
Transformed XML contents.
Throws:
ProviderException -