[opencms-dev] Integrating OpenCms with WebWork2 or Spring

Stephen Cheng scheng at innaworks.com
Wed Jun 9 06:14:01 CEST 2004


I am evaluating various technologies for our new website. I love OpenCMS,
but it does not do all I need to do ;-) I am thinking about using both
OpenCMS and WebWork2/Spring. I wonder whether anyone had tried integrating
the OpenCMS with WebWork2 or Spring. It would be great if you could share
your experience and problems that I should look out for.

Context:
Our new website will have some pretty complex backend functionalities. The
web site will have
- Complex user management
- Shopping cart
- Voucher/credit management
- Application service provisioning and management, through SOAP, tying into
credit and user management. (Only registered customers with the correct
rights will have access to the application service through SOAP)

On the other hand, the website will also serve as a news, information and
forum portal. This is where OpenCMS come in. These features will be
essential:
- CMS
- Browser based editing
- Search
- Management of editors


Potential Solutions:
I am considering to use WebWork or Spring to implement the backend
functionalities. However I would like to use OpenCMS to implement the CMS
side of the website.

Webwork had two work models
(http://wiki.opensymphony.com/display/WW/What+is+Webwork):
Model-1
The basic idea in the Model-1 approach is to invoke the controller code from
within your presentation layer, e.g. the JSP's or templates. If you are
using JSP's this would mean that your WebWork actions are executed by using
the "webwork:action" custom tag, or by invoking regular JavaBeans using the
"webwork:bean" tag.

Model-2
In the Model-2 approach, the decision of what code to call and what view to
present is determined by a third party, normally a servlet dispatcher. The
dispatcher will decode the URL of the HTTP request, and determine what code
to execute. A Java object representing the controller code is retrieved and
executed, thus performing some custom application logic and business logic
processing. After the execution is done, the dispatcher forwards the request
to a view handler (for example a JSP), which then renders the result view
using the data from the previous processing.

Approach 1a:
Webwork would work in Model-1. I would imagine that OpenCMS JSP pages would
simply call various webwork actions through "webwork:action" custom tag.
Effectively OpenCMS would remain the primary technology for the website,
while relying Webwork to encapsulate the complicated back-end
functionalities. The advantage of this approach is that every page in the
website would be managed, and editable by OpenCMS.

Approach 1b:
Same as 1a, but use Spring instead of Webwork

Approach 2:
Webwork would work in Model-2. One of the webwork controller would delegate
to OpenCMS. In other words Webwork would the primary technology. This
approach has the advantage of completely separating presentation and action
through Webwork. Furthermore this approach should allow simple integration
with other OpenSymphony technologies such as ClickStream, and Webwork based
stuff such as JIRA.

I would be very keen to hear any opinion on this topic. Thanks in advance.

Stephen




More information about the opencms-dev mailing list