uPortal 2.3.2
API Documentation

org.jasig.portal.channels.webproxy
Class CWebProxy

java.lang.Object
  extended by org.jasig.portal.channels.webproxy.CWebProxy
All Implemented Interfaces:
IMultithreadedCacheable, IMultithreadedChannel, IMultithreadedMimeResponse

public class CWebProxy
extends java.lang.Object
implements IMultithreadedChannel, IMultithreadedCacheable, IMultithreadedMimeResponse

A channel which transforms and interacts with dynamic XML or HTML. See docs/website/developers/channel_docs/reference/CwebProxy.html for full documentation.

Static Channel Parameters: Except where indicated, static parameters can be updated by equivalent Runtime parameters. Caching parameters can also be changed temporarily. Cache defaults and IPerson restrictions are loaded first from properties, and overridden by static data if there.

  1. "cw_xml" - a URI for the source XML document
  2. "cw_ssl" - a URI for the corresponding .ssl (stylesheet list) file
  3. "cw_xslTitle" - a title representing the stylesheet (optional) If no title parameter is specified, a default stylesheet will be chosen according to the media
  4. "cw_xsl" - a URI for the stylesheet to use If cw_xsl is supplied, cw_ssl and cw_xslTitle will be ignored.
  5. "cw_passThrough" - indicates how RunTimeData is to be passed through. If cw_passThrough is supplied, and not set to "all" or "application", additional RunTimeData parameters not starting with "cw_" or "upc_" will be passed as request parameters to the XML URI. If cw_passThrough is set to "marked", this will happen only if there is also a RunTimeData parameter of cw_inChannelLink. "application" is intended to keep application-specific links in the channel, while "all" should keep all links in the channel. This distinction is handled entirely in the URL Filters.
  6. "cw_tidy" - output from xmlUri will be passed though Jtidy
  7. "cw_info" - a URI to be called for the info event.
  8. "cw_help" - a URI to be called for the help event.
  9. "cw_edit" - a URI to be called for the edit event.
  10. "cw_cacheDefaultMode" - Default caching mode. May be none (normally don't cache), or all (cache everything).
  11. "cw_cacheDefaultTimeout" - Default timeout in seconds.
  12. "cw_cacheMode" - override default for this request only. Primarily intended as a runtime parameter, but can used statically to override the first instance.
  13. "cw_cacheTimeout" - override default for this request only. Primarily intended as a runtime parameter, but can be used statically to override the first instance.
  14. "cw_person" - IPerson attributes to pass. A comma-separated list of IPerson attributes to pass to the back end application. The static data value will be passed on all requests not overridden by a runtime data cw_person except some refresh requests.
  15. "cw_personAllow" - Restrict IPerson attribute passing to this list. A comma-separated list of IPerson attributes that may be passed via cw_person. An empty or non-existent value means use the default value from the corresponding property. The special value "*" means all attributes are allowed. The value "!*" means none are allowed. Static data only.
  16. "upc_localConnContext" - LocalConnectionContext implementation class. The name of a class to use when data sent to the backend application needs to be modified or added to suit local needs. Static data only.

Runtime Channel Parameters:

The following parameters are runtime-only.

  1. "cw_reset" - an instruction to return to reset internal variables. The value return resets cw_xml to its last value before changed by button events. The value "reset" returns all variables to the static data values.
  2. "cw_download" - use download worker for this link or form any link or form that contains this parameter will be handled by the download worker, if the pass-through mode is set to rewrite the link or form. This allows downloads from the proxied site to be delivered via the portal, primarily useful if the download requires verification of a session referenced by a proxied cookie

This channel can be used for all XML formats with appropriate stylesheets. All static data parameters as well as additional runtime data parameters passed to this channel via HttpRequest will in turn be passed on to the XSLT stylesheet as stylesheet parameters. They can be read in the stylesheet as follows: <xsl:param name="yourParamName">aDefaultValue</xsl:param>

Version:
$Revision: 1.9 $
Author:
Andrew Draskoy, andrew@mun.ca, Sarah Arnott, sarnott@mun.ca

Constructor Summary
CWebProxy()
           
 
Method Summary
 void downloadData(java.io.OutputStream out, java.lang.String uid)
          Pass the OutputStream object to the download code if it needs special handling (like outputting a Zip file).
 ChannelCacheKey generateKey(java.lang.String uid)
          Requests the channel to generate a key uniqly describing it's current state, and a description of key usage.
 java.lang.String getContentType(java.lang.String uid)
          Returns the MIME type of the content.
 java.util.Map getHeaders(java.lang.String uid)
          Returns a list of header values that can be set in the HttpResponse.
 java.io.InputStream getInputStream(java.lang.String uid)
          Returns the MIME content in the form of an input stream.
 java.lang.String getName(java.lang.String uid)
          Returns the name of the MIME file.
 ChannelRuntimeProperties getRuntimeProperties(java.lang.String uid)
          Acquires ChannelRuntimeProperites from the channel.
 boolean isCacheValid(java.lang.Object validity, java.lang.String uid)
          Requests the channel to verify validity of the retreived cache based on the validator object.
 void receiveEvent(PortalEvent ev, java.lang.String uid)
          Process portal events.
 void renderXML(org.xml.sax.ContentHandler out, java.lang.String uid)
          Ask channel to render its content.
 void reportDownloadError(java.lang.Exception e)
          Let the channel know that there were problems with the download
 void setRuntimeData(ChannelRuntimeData rd, java.lang.String uid)
          Passes ChannelRuntimeData to the channel.
 void setStaticData(ChannelStaticData sd, java.lang.String uid)
          Passes ChannelStaticData to the channel.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CWebProxy

public CWebProxy()
Method Detail

setStaticData

public void setStaticData(ChannelStaticData sd,
                          java.lang.String uid)
                   throws PortalException
Passes ChannelStaticData to the channel. This is done during channel instantiation time. see org.jasig.portal.ChannelStaticData

Specified by:
setStaticData in interface IMultithreadedChannel
Parameters:
sd - channel static data
uid - a string uniqly identifying a channel "instance" in the system. For example, a combination of session id and channel instance id would fit the bill.
Throws:
PortalException
See Also:
ChannelStaticData

setRuntimeData

public void setRuntimeData(ChannelRuntimeData rd,
                           java.lang.String uid)
                    throws PortalException
Passes ChannelRuntimeData to the channel. This function is called prior to the renderXML() call.

Specified by:
setRuntimeData in interface IMultithreadedChannel
Parameters:
rd - channel runtime data
Throws:
PortalException
See Also:
ChannelRuntimeData

receiveEvent

public void receiveEvent(PortalEvent ev,
                         java.lang.String uid)
Process portal events. Currently supported events are EDIT_BUTTON_EVENT, HELP_BUTTON_EVENT, ABOUT_BUTTON_EVENT, and SESSION_DONE. The button events work by changing the xmlUri. The new Uri's content should contain a link that will refer back to the old one at the end of its task.

Specified by:
receiveEvent in interface IMultithreadedChannel
Parameters:
ev - the event

getRuntimeProperties

public ChannelRuntimeProperties getRuntimeProperties(java.lang.String uid)
Acquires ChannelRuntimeProperites from the channel. This function may be called by the portal framework throughout the session.

Specified by:
getRuntimeProperties in interface IMultithreadedChannel
See Also:
ChannelRuntimeProperties

renderXML

public void renderXML(org.xml.sax.ContentHandler out,
                      java.lang.String uid)
               throws PortalException
Ask channel to render its content.

Specified by:
renderXML in interface IMultithreadedChannel
Parameters:
out - the SAX ContentHandler to output content to
Throws:
PortalException

generateKey

public ChannelCacheKey generateKey(java.lang.String uid)
Description copied from interface: IMultithreadedCacheable
Requests the channel to generate a key uniqly describing it's current state, and a description of key usage.

Specified by:
generateKey in interface IMultithreadedCacheable

isCacheValid

public boolean isCacheValid(java.lang.Object validity,
                            java.lang.String uid)
Description copied from interface: IMultithreadedCacheable
Requests the channel to verify validity of the retreived cache based on the validator object.

Specified by:
isCacheValid in interface IMultithreadedCacheable

getContentType

public java.lang.String getContentType(java.lang.String uid)
Description copied from interface: IMultithreadedMimeResponse
Returns the MIME type of the content.

Specified by:
getContentType in interface IMultithreadedMimeResponse

getInputStream

public java.io.InputStream getInputStream(java.lang.String uid)
                                   throws java.io.IOException
Description copied from interface: IMultithreadedMimeResponse
Returns the MIME content in the form of an input stream. Returns null if the code needs the OutputStream object

Specified by:
getInputStream in interface IMultithreadedMimeResponse
Throws:
java.io.IOException

downloadData

public void downloadData(java.io.OutputStream out,
                         java.lang.String uid)
                  throws java.io.IOException
Description copied from interface: IMultithreadedMimeResponse
Pass the OutputStream object to the download code if it needs special handling (like outputting a Zip file).

Specified by:
downloadData in interface IMultithreadedMimeResponse
Throws:
java.io.IOException

getName

public java.lang.String getName(java.lang.String uid)
Description copied from interface: IMultithreadedMimeResponse
Returns the name of the MIME file.

Specified by:
getName in interface IMultithreadedMimeResponse

getHeaders

public java.util.Map getHeaders(java.lang.String uid)
Description copied from interface: IMultithreadedMimeResponse
Returns a list of header values that can be set in the HttpResponse. Returns null if no headers need to be set.

Specified by:
getHeaders in interface IMultithreadedMimeResponse

reportDownloadError

public void reportDownloadError(java.lang.Exception e)
Description copied from interface: IMultithreadedMimeResponse
Let the channel know that there were problems with the download

Specified by:
reportDownloadError in interface IMultithreadedMimeResponse

uPortal 2.3.2
API Documentation