 HOWTO: Including Other Web Information
Last modified 1/10/2007.
This document describes how you can include information from other
web resources directly into the pages of forums in CourseForum and
ProjectForum.
Ways to Incorporate Web Information
CourseForum and ProjectForum have long allowed referencing pages
on other web sites via links, as well as including images from other web
sites as part of forum pages. As of version 3.0, both products (full
versions only) now also allow you to incorporate the (non-graphic)
content of external web pages directly into CourseForum or ProjectForum
pages.
Two new mechanisms are provided for doing this: a new standard
"[include:]" link markup, which will directly include the content
of another page, and custom link types, which are ideal for invoking
web services to feed content into pages.
The "[include:]" Link Markup
New content from an arbitrary website can be included via adding a link
to the page prefaced with the keyword "include:". The remainder of the
link name will be the URL to fetch the external content from. For
example:
[include:http://www.courseforum.com/testimonials.html]
would insert the HTML from that page into the rendered CF/PF page at the
point where the link was located.
Custom Links
The custom links feature
provides another way to incorporate outside information. See that
page for details.
Technical Details
For links using both "include:" as well as those using new prefixes,
all data should be returned as it would normally be if the user visited
a page using their browser; as a normal HTTP response containing a number
of HTTP/MIME headers followed by a body.
CourseForum/ProjectForum will interpret the header and body as noted below,
but will behave sensibly when the headers are not present.
Content Type.
Data to be included into forum pages must be
either plain text (text/plain) or HTML (text/html). The Content-Type
header will be used to indicate the type of material returned.
For plain text pages, the material will be inserted into the page
as preformatted text (i.e. surrounded by <pre> </pre> tags).
For HTML, no surrounding tags will be added, and the body inserted
directly. Before insertion however, any HTML material outside the
body will be discarded. That is, if the tags are present, all material
before a <body> tag, and after a </body>
tag is discarded.
Pages having other content types will be ignored.
Caching and Timeouts.
An 'Expires' header will be checked to determine how often a particular URL
should be refetched. If not present, a time of 1 hour will be assumed.
If a requested URL is not received within a small interval (5 seconds),
the link is instead rendered with a message to the effect that the
content to be inserted is not presently available. The fetch will
continue for a longer interval (30 seconds), and if successful, the
content will be added to the cache. The next time the user visits the
page, the content will be available if it has not already expired from the
cache.
Including Other Information
If you need assistance with including other pages, need help developing
web services to integrate information from within your organization into
your forums, or have other needs, please contact us to discuss your
situation.
|