|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.channels.webproxy.CWebProxy
public class CWebProxy
A channel which transforms and interacts with dynamic XML or HTML. See docs/website/developers/channel_docs/reference/CwebProxy.html for full documentation.
Static and Runtime Channel Parameters: These parameters can be configured both as ChannelStaticData parameters and as ChannelRuntimeData parameters. These 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.
none
(normally don't cache), or
all
(cache everything).
Static Channel Parameters: These parameters can be configured only as ChannelStaticData parameters. They can no longer (as of uPortal 2.5.1) be changed at runtime. This closes some serious security vulnerabilities wherein the Adversary would manipulate these parameters at runtime to access resources on the local filesystem.
cw_xsl
is supplied, cw_ssl
and cw_xslTitle
will be ignored.
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.
xmlUri
will be passed though Jtidy
info
event.
help
event.
edit
event.
Runtime Channel Parameters:
The following parameters are runtime-only.return
resets cw_xml
to its last value before changed by button events. The
value "reset" returns all variables to the static data
values.
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>
Nested Class Summary | |
---|---|
private class |
CWebProxy.ChannelState
All state variables are stored in this inner class. |
Field Summary | |
---|---|
static java.lang.String |
ALLOW_URI_PREFIXES_PARAM
The name of the optional ChannelStaticData parameter the value of which will be a String containing a whitespace-delimited list of allowable URI prefixes for URIs from which the configured CWebProxy instance will obtain XML and XSLT. |
static java.lang.String |
BLOCK_URI_PREFIXES_PARAM
The name of the optional ChannelStaticData parameter the value of which will be a String containing a whitespace-delimited list of explicitly blocked URI prefixes for URIs from which the configured CWebProxy instance will not obtain XML and XSLT. |
(package private) static java.io.PrintWriter |
devNull
|
private static org.apache.commons.logging.Log |
log
|
private static MediaManager |
MEDIAMANAGER
|
static java.lang.String |
RESTRICT_STATIC_XMLURI_PREFIXES_PARAM
The name of the optional ChannelStaticData parameter the value of which will be the String "true" to convey that the xmlUri should be restricted as received from both ChannelStaticData and CHannelRuntimeData and any other value to convey that it should be restricted only as received from ChannelRuntimeData. |
(package private) java.util.Map |
stateTable
|
(package private) static java.lang.String |
systemCacheId
|
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. |
private java.net.URLConnection |
getConnection(java.lang.String uri,
CWebProxy.ChannelState state)
|
java.lang.String |
getContentType(java.lang.String uid)
Returns the MIME type of the content. |
(package private) static java.io.PrintWriter |
getErrout()
|
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. |
private java.lang.String |
getTidiedXml(java.lang.String uri,
CWebProxy.ChannelState state)
Get the contents of a URI as a String but send it through tidy first. |
private org.w3c.dom.Document |
getXml(java.lang.String uri,
CWebProxy.ChannelState state)
Get the contents of a URI as a Document object. |
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 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.apache.commons.logging.Log log
public static final java.lang.String ALLOW_URI_PREFIXES_PARAM
public static final java.lang.String BLOCK_URI_PREFIXES_PARAM
public static final java.lang.String RESTRICT_STATIC_XMLURI_PREFIXES_PARAM
private static final MediaManager MEDIAMANAGER
java.util.Map stateTable
static final java.lang.String systemCacheId
static java.io.PrintWriter devNull
Constructor Detail |
---|
public CWebProxy()
Method Detail |
---|
public void setStaticData(ChannelStaticData sd, java.lang.String uid) throws PortalException
setStaticData
in interface IMultithreadedChannel
sd
- channel static datauid
- 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.
PortalException
ChannelStaticData
public void setRuntimeData(ChannelRuntimeData rd, java.lang.String uid)
setRuntimeData
in interface IMultithreadedChannel
rd
- channel runtime dataChannelRuntimeData
public void receiveEvent(PortalEvent ev, java.lang.String uid)
receiveEvent
in interface IMultithreadedChannel
ev
- the eventpublic ChannelRuntimeProperties getRuntimeProperties(java.lang.String uid)
getRuntimeProperties
in interface IMultithreadedChannel
ChannelRuntimeProperties
public void renderXML(org.xml.sax.ContentHandler out, java.lang.String uid) throws PortalException
renderXML
in interface IMultithreadedChannel
out
- the SAX ContentHandler to output content to
PortalException
private org.w3c.dom.Document getXml(java.lang.String uri, CWebProxy.ChannelState state) throws java.lang.Exception
uri
- the URI
java.lang.Exception
private java.lang.String getTidiedXml(java.lang.String uri, CWebProxy.ChannelState state) throws java.lang.Exception
uri
- the URI
java.lang.Exception
private java.net.URLConnection getConnection(java.lang.String uri, CWebProxy.ChannelState state) throws java.lang.Exception
java.lang.Exception
public ChannelCacheKey generateKey(java.lang.String uid)
IMultithreadedCacheable
generateKey
in interface IMultithreadedCacheable
static java.io.PrintWriter getErrout() throws java.io.FileNotFoundException
java.io.FileNotFoundException
public boolean isCacheValid(java.lang.Object validity, java.lang.String uid)
IMultithreadedCacheable
isCacheValid
in interface IMultithreadedCacheable
public java.lang.String getContentType(java.lang.String uid)
IMultithreadedMimeResponse
getContentType
in interface IMultithreadedMimeResponse
public java.io.InputStream getInputStream(java.lang.String uid) throws java.io.IOException
IMultithreadedMimeResponse
getInputStream
in interface IMultithreadedMimeResponse
java.io.IOException
public void downloadData(java.io.OutputStream out, java.lang.String uid) throws java.io.IOException
IMultithreadedMimeResponse
downloadData
in interface IMultithreadedMimeResponse
java.io.IOException
public java.lang.String getName(java.lang.String uid)
IMultithreadedMimeResponse
getName
in interface IMultithreadedMimeResponse
public java.util.Map getHeaders(java.lang.String uid)
IMultithreadedMimeResponse
getHeaders
in interface IMultithreadedMimeResponse
public void reportDownloadError(java.lang.Exception e)
IMultithreadedMimeResponse
reportDownloadError
in interface IMultithreadedMimeResponse
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |