Next: Properties
Up: Xbook scripts
Previous: Modules
  Contents
Output Restrictions and Requirements
In Section 5.1, we defined a number of methods that write HTML
code to a java stream. This code will then be returned to a portlet client
and displayed inside the portal framework. Depending on the implementation of
the portal framework, there may be restrictions on what HTML tags can be
included in the output. The following lists the output restrictions for
portlets built using the Jetspeed portal framework [17].
- Jetspeed uses tables to format the layout of the portal. Therefore, the
output that is returned by our xbook will be displayed inside one of the
table cells. Thus, any HTML tags written to the portlet should
be tags that are valid inside a table cell (i.e., body tags only). The
xbook should not write any header tags (e.g., HTML, HEAD, TITLE) nor
the BODY tag.
- Our portlet client is a subclass of VelocityPortlet which allows our
portlet client to be plugged into Jetspeed. The VelocityPortlet is
also form-based and therefore places our xbook output inside its
own specially formatted FORM tags. Therefore, our xbook output
should not contain FORM tags, only input tags.
Our xbook portlet also impose some additional restrictions:
- Input tags written by the xbook (i.e., xbook variables) need to be
differentiated from internal Jetspeed input variables and internal xbook
input variables. Therefore, we impose a naming restriction on the
xbook input variables. A xbook variable's name must be prefixed
with 'xbook.form.'. If a xbook input tag does not have this
special prefix, it will be ignored by the portlet and thus the value
will not be returned back to the xbook.
- As discussed in Section 3.2.3, the xbook portlet determines
whether a xbook session is complete by checking the value of a
variable called xbooks.keep_alive. Therefore, the xbook
must write a hidden input tag which has a boolean value. True
or '1' indicates that the xbook session is still active and the
portlet should expect more output to come.
<input type="hidden" name="xbooks.keep_alive" value="1">
While false or '0' indicates that this is the last output and
the portlet can shutdown the xbook manager.
<input type="hidden" name="xbooks.keep_alive" value="0">
- As described in Section 5.1, each xbook form must name the
doXXX routine that will handle the input values. The
xbook portlet reads in the name of the xbook method name from the
form variable xbooks.action. Thus, if the user creates
a method called doSubmit, they would express this in a
hidden input tag as follows:
<input type="hidden" name="xbooks.action" value="Submit">
Next: Properties
Up: Xbook scripts
Previous: Modules
  Contents
Shava Smallen
2002-12-31