Skip to main content

Lepido, Tools for Apache Cocoon


Introduction

The Lepido project is a proposed open source project under the Eclipse Technology Project.

This proposal is in the Project Proposal Phase (as defined in the Eclipse Development Process document) and is written to declare its intent and scope. This proposal is written to solicit additional participation and input from the Eclipse community. You are invited to comment on and/or join the project. Please send all feedback to the eclipse.technology.lepido newsgroup.

Background

Apache Cocoon is a top-level project of the Apache Software Foundation. It is a web application framework built around the concepts of XML processing pipelines and component-based application development. The project was started in 1999 and has since then grown both in features and user base, and is now widely used by a lot of people for mission-critical web sites.

Apache Cocoon uses a lot of XML-related technologies and XML-based configuration files. Although very powerful and efficient once mastered, the framework has a steep learning curve, and having dedicated tools to help newcomers getting started and experienced users to be more productive would attract much more people to this innovative product.

The purpose of this project is therefore to build a set of opensource tools to ease the development of web applications with Apache Cocoon. These tools will include wizards to quickly lay out a project structure, dedicated editors for the various XML files involved in application development, and runtime tools such as debuggers or profilers. Lepido will provide a usable feature set along with an extensible framework to build new editors and features.

Description

Lepido will provide various features corresponding to all stages of the application development lifecycle. As a Cocoon application runs in a J2EE/XML environment, a Lepido project will build on top of the project natures brought by the Web Tools Platform. Plugins provided by Lepido will also heavily rely on WTP features.

Architecture

The following diagram outlines the global architecture of the Lepido project and its relation with other Eclipse projects.

Lepido architecture

Features

Wizards

Apache Cocoon can be used in a lot of different situations and comes with a lot of “blocks”, which are modules dedicated either to a particular library (e.g. FOP, Batik) or a particular functional area (e.g. portal, databases). Setting up a new project requires to select the appropriate blocks from an Apache Cocoon distribution and add them to the newly created project.

To this effect, there will be a Cocoon project setup wizard, that will allow the user to choose the blocks that are to be included in the project, also allowing also further modification of the selected blocks during the project lifetime.

Other wizards will also be provided to quickly set up typical project layouts for common Cocoon project types such as website publication, web application or mutichannel publication. These layouts will also promote best practices in Cocoon applications architecture.

Editors

Apache Cocoon provides a lot of powerful features that are used and configured using XML files. These files can be classified in two main categories:

  • Mixed content files, used in dynamic page production language such as XSLT, XSP, JXTemplate, and also embedded markup used by transformation components such as i18n directives, include statements or form templates.
  • Configuration files, which have a well-defined and regular stucture. This includes for example the sitemap, form definition and binding files, portal definition and layout, etc.

Mixed content editors will be built on top of WST components such as XML editor and SSE, providing adaptative syntax checking and code completion.

Configuration files editors will be multi-page (à la plugin.xml), providing the classical source view and form-driven views allowing people to be guided in their work and also to be more productive by concentrating on the content without having to care about the underlying XML structure. The source view will be built on top of WST components similarily to mixed content editors. Form-driven views will be built using AXE, the XUL-like system for JFace forms that has been developped by Anyware Technologies.

The use of AXE allows to very quickly develop new editors by providing a declarative approach to building form-oriented editors without requiring an intimate knowledge of JFace, and by associating form widgets to XPath expressions in the XML document, thus making it easy to bidirectionally bind forms to the target source file.

The AXE component has been proposed for inclusion as a new WTP component and according the the latest WTP PMC report will be eventually included in WTP 1.1. In the meantime AXE will reside in the Lepido project before moving to the org.eclipse.wtp namespace.

Debugger

Developping applications with Apache Cocoon involves many technologies, most of which are processed on the fly (XML transformation chains) or interpreted (e.g. sitemap, XSLT, templates, forms). Even if the interpreted languages are precompiled into some kind of evaluation trees for faster performance, none of them except XSP directly translates to Java bytecode, thus preventing the use of traditional debuggers to step through the application execution.

Lepido will therefore provide a debugger for these interpreted languages. As not all libaries used by Apache Cocoon are hosted within the project and that few of them provide the necessary hooks to plug in a debugger, the Lepido debugger will use AOP techniques to instrument interpreters at run time to provide debugging support.

The Lepido debugger will thus be architected into three main parts:

  • The debugger UI, that will build on Eclipse's generic debugger infrastructure.
  • A debugger runtime core, managing the communication between the different intepreter debugging drivers (see below) and the debugger UI
  • Interpreter debugger drivers, implementing generic debugging contracts managed by the debugger runtime core. When no debugger hook exist, these drivers will be injected using AOP tools within the interpreter engine bytecode to connect it to the debugger runtime.

Lepido will provide drivers for the most frequently used interpreted languages in typical Cocoon projects, e.g. the sitemap, XSLT, flowscript (a page flow controller using the Rhino Javascript engine), JXTempate, form processing. The pluggable architecture of the debugger runtime will allow other drivers to be added later as needed.

Refactoring

The separation of concerns, which is one of Cocoon's strengths, also comes with a price as many entities are cross-referenced in several different files, thus making it sometimes difficult to maintain consistency and refactor an application. Such cross-referenced entities are for example sitemap components, input modules, form widgets or even files (e.g. XSLT files).

A Lepido project will have a semantic model of the application being built, tracking places where a single entity is defined and referenced. This model will be used to build features such as consistency checkers and refactoring tools. A common refactoring is renaming and moving, other features being highly dependent on the entity actually being considered.

Monitoring and profiling

Although there are no precise plans for it at this time, a possible direction for Lepido is the integration with TPTP to provide features to monitor and profile Cocoon applications.

Initial Contribution

The initial contribution consists in existing plugins that have been developped by Anyware Technologies:

  • A Cocoon project setup wizard that quickly sets up the project structure and files.
  • A set of multi-page editors for the Cocoon sitemap, logkit configuration and Cocoon Forms definition files. These editors are built on top of AXE, a XUL-like system which is part of this contribution.
  • An XSP editor, based on SSE.

Some preliminary developments have been made on the debugger, proving the feasability of the proposed architecture. The AOP engine used is AspectWerkz, who recently announced its merging with AspectJ.

The following picture shows the form definition editor in action (click for a larger picture):

Form definition editor (click for a larger picture)

Q&A

Why is it called “Lepido”?

Lepido stands for “lepidoptera”, which is the scientific name for butterflies. As you certainly know, bufferflies come out of cocoons! So Lepido is there to help you getting the best out of Apache Cocoon!

What does it bring to Apache Cocoon?

Apache Cocoon is a very powerful but complex framework, which can frighten some people away. Having a nice and friendly IDE will make it more appealing for an increased number of users, and also to managers that will find a complete open source solution rather that only a powerful runtime component.

What does it bring to the Eclipse Foundation?

Lepido will heavily use WTP components. Being hosted by Eclipse allows close cooperation between the teams working on the two projects. Lepido also brings some features that can be of interest to the Eclipse community at large, such as the AXE editor infrastructure and the pluggable interpreter debugger.

At a “corporate” level, Lepido is also an opportunity to strengthen the relations between the Eclipse Foundation and the Apache Software Foundation, respective leaders in IDE and server commercial-friendly opensource software, and leverage the best of both to provide complete solutions with which people and companies can build applications and products.

Organization

We propose this project should be undertaken as an incubator within the Eclipse Technology Project. It is intended to complement and build on top of WTP, and some parts of Lepido may be found to be of such general interest that they are considered for inclusion as components of WTP, similarily to the current AXE proposal.

The current goals of WTP don't allow the inclusion of Lepido as a a WTP subproject, but this can surely be considered if ever the WTP project extends its scope to a wider range of web-related technologies.

Proposed project lead and initial committers

Interested parties

The architecture of Lepido, mainly the AXE-based editors and the pluggable debugger drivers, is designed to allow to easily add support for new XML dialects and runtime interpreters without requiring expert Eclipse skills.

Our hope is that current members of the Cocoon development team and advanced users will join the Lepido project, turning the initial contribution into a real community project that will enhance it and ensure its features will always be up to date regarding the evolution of the project at Apache. In addition, we believe that an IDE team close to the runtime team will encourage new features of Apache Cocoon to be Lepido-friendly, and therefore user-friendly.

At this time, the following people and companies have expressed their interest in actively participating to this project:

During a poll on the Cocoon user and developper lists, a number of people also expressed their interest in seeing such a project come to life and offered to help as far as they can by providing feature wishes, bug reports, etc.

Back to the top