Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

According to the HTML specification, "If the processing of a form is is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms...If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST." For this reason, POST requests are not cached.

Configuration

Static Data

Except as noted, parameters are identical for both static and runtime data. The channel state variables are initially set acccording to static data, or defaults. Runtime data modifies the equivalent channel state variables. All parameters are then passed through to the stylesheets based on the current state. The parameters are:

  • cw_xml: a URI representing the source XML or HTML document. I.e. the backend application.
  • cw_ssl: a URI representing the corresponding .ssl (stylesheet list) file.
  • cw_xslTitle: a title representing the stylesheet (optional). If no title parameter is specified, a default stylesheet will be chosen according to the media.
  • cw_xsl: a URI representing the stylesheet to use. If cw_xsl is supplied, cw_ssl and cw_xslTitle will be ignored.
  • cw_info: a URI to be called for the info event.
  • cw_help: a URI to be called for the help event.
  • cw_edit: a URI to be called for the edit event.
  • cw_tidy: if set to on, filter the source document through JTidy, converting HTML to XHTML.
  • cw_passThrough: indicates that runtime data not specific to the portal is to be passed through. If passThrough is supplied, and not set to "none", additional runtime data parameters and values will be passed as request parameters to the cw_xml.
    Note
    iconfalse
    titlecw_passThrough values
    • none: (default). Don't do anything.
    • marked: If runtime data includes cw_inChannelLink, pass through other runtime data as request parameters.
    • application: Only URLs referring to the application are kept in-channel.
    • all: All link URLs are rewritten to go through the channel.
  • cw_cacheDefaultTimeout - Default timeout in seconds.
  • cw_cacheDefaultMode - Default caching mode. May be none (normally don't cache), or all (cache everything).
  • cw_cacheTimeout - override default for this request only. Primarily intended as a runtime parameter, but can user statically to override the first instance.
  • cw_cacheMode - override default for this request only. Primarily intended as a runtime parameter, but can user statically to override the first instance.
  • 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.
  • 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.
  • 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.

Properties

CWebProxy has a few properties which act as portal-wide defaults for equivalent static data (channel publish-time parameters). These are set in the properties/portal.properties configuration file.

...

  • cw_reset: An instruction to reset internal variables. The value return resets cw_xml to its last value before changed by button events.
  • 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

Portal Events

CWebProxy supports the button events for help, about, and edit. A channel instance can specify URIs for any of these via static or runtime data. A button event will then redirect the channel to the appropriate URI. Note that these URIs are subject to the same filtering and stylesheets are the normal URI. The event URI should return control to the original application via the runtime attribute cw_reset=return.

...

  • JTidy must be recompiled to work with some servlet containers. See Software Dependencies.
  • HTTP-style caching is not yet implemented.
  • HTML and XHTML <body> background colours and images are not reflected in the output.
  • Any <link> elements from the <head> of an HTML document, including those that reference CSS stylesheets, are not reflected in the output. This would require access to the <head> element generated by the portal.
  • URLs that use frames cannot be incorporated as channels.
  • Suppression of JTidy diagnostic output has not been tested on non-UNIX platforms.
  • UTF-8 is the default character encoding for JTidy. If the character encoding is specified in the HTTP headers, CWebProxy will set it accordingly. Note that JTidy does not yet recognize the use of the HTML meta element for specifying the character encoding.
  • The cw_reset=reset runtime command is not implemented yet.
  • If cw_xml is changed before cw_reset=return is called, your are returned to the last cw_xml used, not necessarily the one that was in use before a button event.
  • The source html cannot specify a namespace if cw_tidy is on.
  • Caution must be used with URLs leaving out a required trailing slash ("/").

Scripts

Limited support is provided for included scripts, but they may not work exactly as they would when viewed directly. Note in particular that if your script generates URLs, they will probably need to be absolute URLs, not relative, to work through a portal.

XHTML 1.0 indicates that an XHTML document must be valid XML so if embedded JavaScript code contains <, &, > or −−, it must be wrapped in a CDATA section element. However, CDATA sections are recognized by XML processors but not browsers. According to XHTML 1.0, external scripts should be used if your script uses those character sequences. CWebProxy supports embedded JavaSript containing these characters only if it is wrapped in a CDATA section element and sent through JTidy. Note that the output will not be valid XML, and thus not valid XHTML.

Major Changes since uPortal 2.0.2

  • Multivalued http request attributes are now supported.
  • Keyword-style HTTP query strings are now supported.
  • The channel now implements the IMultithreadedCachable interface for better performance.
  • Back-end HTTP applications are sent parameters using the method by which the channel was invoked by the browser. Previously GET was always used.
  • URL-rewriting is done via SAX filters rather than XSL stylesheet.
  • Communication with applications goes through the new LocalConnectionContext, allowing local interface technology and policy to be implemented without modifying CWebProxy
  • IPerson attributes may now optionally be passed to the application automatically.

Examples

The unmodified Tomcat numguess.jsp and servlet examples are set up as examples in uPortal as distributed. They can be seen in the CWebProxy Examples tab of the demo user, and are available for subscription via Preferences. See the webpages/media/org/jasig/portal/channels/webproxy/examples directory for the info and help files.

Further examples can be found in the tutorial on the CWebProxy home page.

Software Dependencies

CWebProxy uses the JTidy package is used to convert HTML to XHTML.

...

Software Dependencies

CWebProxy uses the JTidy package is used to convert HTML to XHTML.

Under some servlet containers, JTidy r6 has a compatibility problem with the classloader. This is an issue for some versions of Tomcat, for example. You will know you've got this problem if CWebProxy isn't working and you see a line in your logfile that says:

...

The JTidy developers have noted the problem, and hopefully will fix it in the next release. In the meantime, it can be worked around by recompiling for your platform. To do this, get the source distribution, unzip it, build it with "ant jar", and replace your old tidy.jar with build/Tidy.jar. I've put a Tidy.jar rebuilt on Linux here, if you'd prefer to try that first.

Authors
Andrew Draskóy <andrew@mun.ca> and
Sarah Arnott <sarnott@mun.ca>
Computing and Communications
Memorial University of Newfoundland

Last Modified December 3, 2002.

Examples

The unmodified Tomcat numguess.jsp and servlet examples are set up as examples in uPortal as distributed. They can be seen in the CWebProxy Examples tab of the demo user, and are available for subscription via Preferences. See the webpages/media/org/jasig/portal/channels/webproxy/examples directory for the info and help files.

Further examples can be found in the tutorial on the CWebProxy home page.