Find below a proposal describing our new customizer. Well it's not really
proposal (to discuss), as I will check this in toworrow (unless somebody
stops us with a "-1000" ;-) ), so it's better rather as
information/documentation...
It won't be _the_ ultimate customizer (but a rather basic one), however
it's still better than a broken one (and will stop all these
why-does-the-customizer-link-not-work questions on the list). And it's
something we can build upon.
ingo.
====================================================================
Proposal: Page Customization & Portlet Selection Facility
1. Goal
The topic of this proposal is the Page Customization Utility.
The idea is to provide a facility for creating new pages,
selecting portlets and defining layouts for individual pages.
In the first step we provide a very simple Portlet Selection
Facility. This component allows for configuring HTML and WML
home pages (selecting portlets to be displayed).
The implementation provides a general mechanism, which allows
for replacing of a simple facility with a more sophisticated
one with a minimal effort.
2. Background
The Cocoon Customizer application portlet provided in the current
version of Jetspeed does not work properly; the only way to define
individual pages now is to edit user specific psml files manually.
3. Multi-page capability and customization
In the current release of Jetspeed only one page can be customized
per user. Introducing an �Improved WAP support� we raised the number
of pages to 2: one HTML and one WML specific home page.
The goal is to support an arbitrary number of pages per user. The page
is identified by name and can be either device-specific or
device-independent. If the user logs in to the Jetspeed portal,
the default
page for this user and this medium is displayed (otherwise the fallback
mechanism provides an opportunity of loading an device independent
default
page or default page for the corresponding role, etc.). The user
then has
an opportunity to select one of the pages from the list of his/her
customized
pages.
(For more information on the mechanism of mapping request information to a
profile resource see the Jetspeed Profiler Proposal by David S.
Taylor.)
To satisfy the requirements given by a multi-page concept we should provide
a 3-stage customization:
a. First, user creates a new page and defines its name. The
user can connect the page to a special device or
left it
be device independent.
b. Then, the portlets to be displayed are selected from the
list of all available portlets.
c. Last, the layout is configured.
The steps b. and c. can be integrated together. The step c. can be rather
sophisticated, especially if we would like to implement it
graphically.
The step c. can be implemented in different ways, e.g., either as
drag&drop
using DHTML, or a simple window that allows to change the order of
portlets
using list boxes like Yahoo!'s Customize Page screen.
4. Home page Customizer
Our first implementation consists of 2 parts:
a. General customization mechanism;
b. Simple Portlet Selection Facility.
General customization mechanism: Execution of a special Customize screen
starts the customization. The screen supposes that the customization
utility is implemented as one or several portlets. The portlet can be
either set explicitly in the customization URI as a parameter pair
(�portlet�, <portlet name>) or defined by a special psml resource.
The screen first checks, whether a portlet parameter is set in the URI, e.g.,
�/jetspeed/screen/Customize/portlet/CustomizePortlet.
In this case a portlet set is created and rendered for the given portlet.
Otherwise the screen checks whether an address of a customization psml is
provided in the JetspeedResource.properties, e.g.,
customization.psml=/content/psml/customize.psml
The psml file defined is then loaded, the portlet tree is created and the
content is rendered as usual.
This mechanism allows exchanging a customization utility without any changes
to the core Jetspeed code, namely, a new customization tool must be
implemented as a portlet, this portlet must be registered to the
Jetspeed
configuration, a new psml resource containing this portlet must be
created
and pointed to by the Jetspeed properties file.
Simple Portlet Selection Portlet provides a very simple mechanism for
selecting portlets to be displayed on the HTML and the WML home
pages.
The portlet content provides a list of all existing user (portlets
that
can be displayed on the user homepage, i.e. portlet which are not
abstract, not admin, not application and not hidden) portlets and
2 columns of check boxes for HTML and WML correspondingly. If a
portlet
is not capable of one of the media types the check box does not
appear
in the corresponding column. The portlets are preselected as defined
in the user specific psml resources. If nothing was saved, the
preselection
is done according to the default HTML and WML resources. The user
can select
and deselect portlets for both media types. When pushing the
finish button
the user initiates the saving process. The psml resource is
written in the
following way. For HTML two-column layout is created
automatically. The portlets
are written in turn first to the left, second to the right, third
to the
left, etc. For WML all portlet are decorated with the TitleControl
and are
written one by one in a column. It is not possible to make any changes to
the layout via the tool so far.
5. What is important?
1) A customization portlet must be registered in the Jetspeed
configuration, e.g.,
<portlet-entry type="instance" name="HomepageCustomizer">
<classname>org.apache.jetspeed.portal.portlets.customize.CustomizePortlet</classname>
<parameter name="jsp_location"
value="/content/dynamic/customizer/customize1.jsp"/>
</portlet-entry>
2) It is recommended to define a special psml resource for
customization. A ClearPortletControl should decorate
customization portlets.
3) We implemented a special ClearPortlet to handle a case of
an empty page (user deselects all portlets). This is
necessary since Castor classes generated from the psml
schema file do not allow a <portlets>-tree which
has no
child.
The portlet must be registered in the Jetspeed
configuration.
4) Top navigation must be changed to point to a correct URI
for customization. Use URILookup to get a proper
address
or create an URL manually using Turbine DynamicURI.
5) The default psml resource for HTML (default.psml) should
contain exactly 2 columns with portlets. For the
default
WML resource (defaultWML.psml) Customization Portlet
expects, that the portlets are combined to one column.
The structure in the html psml files must be as
follows:
<portlets>
<portlets>
<portlets>
<entry>
<entry>
...
</portlets>
<portlets>
<entry>
...
</portlets>
</portlets>
</portlets>
The structure in the WML psml files must be as follows:
<portlets>
<portlets>
<entry>
<entry>
</portlets>
</portlets>
6. Which classes/files have been changed/added?
org.apache.jetspeed.modules.screens.Customize � added,
org.apache.jetspeed.portal.portlets.customize.CustomizePortlet � added,
org.apache.jetspeed.portal.portlets.customize.CustomizeBean � added,
org.apache.jetspeed.portal.portlets.ClearPortlet � added,
\psml\customize.psml �added,
\dynamic\customizer\� -added,
\dynamic\customizer\customize.jsp -added
\conf\JetspeedResources.properties �changed,
\conf\Jetspeed-config.jcfg -changed.
7. Next steps
1) Add layout configuration facility.
2) Add page creation facility, e.g., Steve Belt's Java
Script based customizer
--
--------------------------------------------------------------
Please read the FAQ! <http://java.apache.org/faq/>
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Archives and Other: <http://marc.theaimsgroup.com/?l=jetspeed>
Problems?: [EMAIL PROTECTED]