| org.apache.cocoon.transformation.AbstractTransformer org.apache.cocoon.portal.transformation.ProxyTransformer
ProxyTransformer | public class ProxyTransformer extends AbstractTransformer implements Serviceable,Disposable,Parameterizable(Code) | | This transformer is used to insert the XHTML data from an request
to an external application at the specified element ("envelope-tag" parameter).
Nesessary connection data for the external request like sessionid, cookies,
documentbase, the uri, etc. will be taken from the application coplet instance
data.
author: Friedrich Klenner author: Gernot Koller version: CVS $Id: ProxyTransformer.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
protected boolean | appendParameter(StringBuffer buffer, boolean firstparameter, boolean post, String name, String value) | protected String | checkForRedirect(HttpURLConnection connection, String documentBase) Check the http status code of the http response to detect any redirects. | protected String | checkForRedirect(Document doc, String documentBase) Analyses the XHTML response document for redirects in <meta http-equiv="refresh"> elements. | protected HttpURLConnection | connect(Request request, String uri, String query, boolean post) Establish the HttpURLConnection to the given uri. | public void | dispose() | public static CopletInstanceData | getInstanceData(ServiceManager manager, String copletID, String portalName) | public static CopletInstanceData | getInstanceData(ServiceManager manager, Map objectModel, Parameters parameters) Method getInstanceData. | public void | parameterize(Parameters parameters) For the proxy transformer the envelope-tag parameter can be specified. | protected void | processRequest() | protected Document | readXML(HttpURLConnection connection) | public void | recycle() | public static String | resolveURI(String uri, String documentBase) Resolve the possibly relative uri to an absolue uri based on given document base.
Parameters: uri - the uri to resolve Parameters: documentBase - the current document base returns an absolute URI based on document base (e.g. | public void | service(ServiceManager manager) | public void | setup(SourceResolver resolver, Map objectModel, String src, Parameters parameters) | public void | startElement(String uri, String name, String raw, Attributes attributes) |
COPLET_ID_PARAM | final public static String COPLET_ID_PARAM(Code) | | |
ENVELOPE_TAG_PARAMETER | final public static String ENVELOPE_TAG_PARAMETER(Code) | | Parameter for specifying the envelope tag
|
PORTAL_NAME_PARAM | final public static String PORTAL_NAME_PARAM(Code) | | |
PROTOCOL_HANDLER_PARAMETER | final public static String PROTOCOL_HANDLER_PARAMETER(Code) | | Parameter for specifying the java protocol handler (used for https)
|
configuredEncoding | protected int configuredEncoding(Code) | | The encoding (JTidy constant) if configured
|
defaultEnvelopeTag | protected String defaultEnvelopeTag(Code) | | The default value for the envelope Tag
|
documentBase | protected String documentBase(Code) | | The document base uri
|
envelopeTag | protected String envelopeTag(Code) | | This tag will include the external XHMTL
|
link | protected String link(Code) | | The current link to the external application
|
manager | protected ServiceManager manager(Code) | | The Avalon component manager
|
parameters | protected Parameters parameters(Code) | | The sitemap parameters
|
request | protected Request request(Code) | | The original request to the portal
|
userAgent | protected String userAgent(Code) | | The user agent identification string if confiugured
|
checkForRedirect | protected String checkForRedirect(HttpURLConnection connection, String documentBase) throws IOException(Code) | | Check the http status code of the http response to detect any redirects.
Parameters: connection - The HttpURLConnection Parameters: documentBase - The current documentBase (needed for relative redirects) the redirected URL or null if no redirects are detected. throws: IOException - if exceptions occure while analysing the response |
checkForRedirect | protected String checkForRedirect(Document doc, String documentBase) throws MalformedURLException(Code) | | Analyses the XHTML response document for redirects in <meta http-equiv="refresh"> elements.
Parameters: doc - The W3C DOM document containing the XHTML response Parameters: documentBase - The current document base (needed for relative redirects) String the redirected URL or null if no redirects are detected. throws: MalformedURLException - if the redirect uri is malformed. |
connect | protected HttpURLConnection connect(Request request, String uri, String query, boolean post) throws IOException(Code) | | Establish the HttpURLConnection to the given uri.
User-Agent, Accept-Language and Encoding headers will be copied from the original
request, if no other headers are specified.
Parameters: request - the original request Parameters: uri - the remote uri Parameters: query - the remote query string Parameters: post - true if request method was POST the established HttpURLConnection throws: IOException - on any exception |
dispose | public void dispose()(Code) | | See Also: org.apache.avalon.framework.activity.Disposable.dispose |
parameterize | public void parameterize(Parameters parameters)(Code) | | For the proxy transformer the envelope-tag parameter can be specified.
See Also: org.apache.avalon.framework.parameters.Parameterizable.parameterize(Parameters) |
processRequest | protected void processRequest() throws SAXException(Code) | | Processes the request to the external application
|
readXML | protected Document readXML(HttpURLConnection connection) throws SAXException(Code) | | Reads the HTML document from given connection and returns a correct W3C DOM XHTML document
Parameters: connection - hte HttpURLConnection to read from the result as valid W3C DOM XHTML document |
recycle | public void recycle()(Code) | | See Also: org.apache.avalon.excalibur.pool.Recyclable.recycle |
resolveURI | public static String resolveURI(String uri, String documentBase) throws MalformedURLException(Code) | | Resolve the possibly relative uri to an absolue uri based on given document base.
Parameters: uri - the uri to resolve Parameters: documentBase - the current document base returns an absolute URI based on document base (e.g. http://mydomain.com/some/file.html) throws: MalformedURLException - if uri or document base is malformed. |
service | public void service(ServiceManager manager) throws ServiceException(Code) | | See Also: org.apache.avalon.framework.service.Serviceable.service(org.apache.avalon.framework.service.ServiceManager) |
|
|