|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.portal.providers.ProviderAdapter
com.sun.portal.providers.ProfileProviderAdapter
com.sun.portal.providers.urlscraper.URLScraperProvider
com.sun.portal.providers.xml.XMLProvider
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.
Field Summary |
Fields inherited from class com.sun.portal.providers.urlscraper.URLScraperProvider |
typeTable |
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 | |
java.lang.StringBuffer |
getContent(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
protected java.lang.String |
getContentEncodingFromContentBytes(byte[] contentBytes)
Gets the charset from content This method determines the charset from the XML Header |
protected java.lang.StringBuffer |
getXML(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
|
protected java.io.File |
getXSL(java.lang.String xslFileName)
Gets the XSL file object. |
Methods inherited from class com.sun.portal.providers.urlscraper.URLScraperProvider |
forward, getContentEncoding, getFile, getFileAsBuffer, getHttpContent, getInputEncoding, getRuleSetID, getTimeout, getURL, isPresentable |
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 |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLProvider()
Method Detail |
protected java.io.File getXSL(java.lang.String xslFileName) throws ProviderException
Gets the XSL file object.
ProviderException
- if the xsl url specified in the storage
is not a valid url.protected java.lang.StringBuffer getXML(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws ProviderException
Gets the XML file as a string buffer.
This method calls the getHttpContent
in class
URLScraperProvider to get the XML file content as a StringBuffer
if the XML URL specified is a http or https url.
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).
ProviderException
- if the xml URL specified in the storage
is not a valid URL.URLScraperProvider.getHttpContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
public java.lang.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
getContent
in interface Provider
getContent
in class URLScraperProvider
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).
ProviderException
ProviderException
,
URLScraperProvider.getHttpContent(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.lang.String)
,
URLScraperProvider.getURL()
protected java.lang.String getContentEncodingFromContentBytes(byte[] contentBytes)
getContentEncodingFromContentBytes
in class URLScraperProvider
contentBytes
- Bytes from the scraped content
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |