Search:

Apache » Lenya
project logo
  • Project
  • Developer
  • Community
  • Version 2.0
  • Version 1.2
  • Version 2.0
    • FAQs
    • Installation
      • Download
      • Subversion Access
      • Install Instructions
    • Tutorials
      • Create a Publication
      • Create a Resource Type
        • Declaration
        • Creation
        • Presentation
        • Editing (One-Form)
        • Editing (BXE)
      • Implement a Usecase
        • Prerequisites
        • The Usecase
      • Setting up Eclipse
      • Proxying
        • Proxying
        • mod_proxy
        • mod_proxy_ajp
      • Best Practises
      • Production Checklist
      • Writing Tests
    • Concepts
      • Publication
      • Working with Documents
      • Authoring and Live mode
      • WYSIWYG
    • Technical Reference
      • Overview of Lenya Sitemaps
      • Repository
      • Access Control Specification
      • Usecase Framework
        • Overview
        • AbstractUsecase
      • Publications
        • Configuration
        • Publication Templating
      • Resource Types
      • Modules
      • Meta data
      • Protocols
        • lenya Protocol
        • lenya-document Protocol
        • site Protocol
        • lenyadoc Protocol
        • fallback Protocol
      • URLs and Links
        • URL Mapping
        • Link Management
      • Clustering
    • Core API
    • Core Modules
      • ac
        • Overview
        • API
      • acusecases
        • Overview
        • API
      • administration
        • Overview
        • API
      • cache
        • Overview
        • API
      • janitor
        • Overview
        • API
      • ldap
        • Overview
        • API
      • linking
        • Overview
        • API
      • observation
        • Overview
        • API
      • properties
        • Overview
        • API
      • sitemanagement
        • Overview
        • API
      • templating
        • Overview
        • API
      • usecase
        • Overview
        • API
      • workflow
        • Overview
        • API
    • Standard Modules
      • blog
        • Overview
        • API
      • bxe
        • Overview
      • cforms
        • Overview
        • API
      • collection
        • Overview
        • API
      • contactform
        • Overview
        • API
      • development
        • Overview
        • API
      • editors
        • Overview
        • API
      • export
        • Overview
        • API
      • fckeditor
        • Overview
        • API
      • kupu
        • Overview
        • API
      • languageselector
        • Overview
      • lenyadoc
        • Overview
        • API
      • linkcheck
        • Overview
        • API
      • links
        • Overview
        • API
      • lucene
        • Overview
        • API
      • migration
        • Overview
        • API
      • navigation
      • neutron
        • Overview
      • news
        • Overview
        • API
      • notification
        • Overview
        • API
      • opendocument
        • Overview
        • API
      • prettyprinting
        • Overview
      • profiling
        • Overview
      • resource
        • Overview
        • API
      • simplesite
        • Overview
        • API
      • sitetree
        • Overview
        • API
      • sourcerepository
        • Overview
        • API
      • svg
        • Rounded Corners
        • Resizing Images
        • API
      • tinymce
        • Overview
        • API
      • usecasedocument
        • Overview
        • API
      • webdav
        • Getting started
        • Monitoring
        • WebDAV Servers
        • API
      • xhtml
        • Overview
        • API
      • xopus
        • Overview

Current Event

Built with Apache Lenya

Setting up Your Development Environment

Table of Contents
  • Debugging Lenya

To ensure a good productivity when building Lenya applications, it is essential that you have a well-configured development environment.

The following steps guide you through the process of setting up the Eclipse IDE for Lenya. The paths apply to a Unix-like operating system, for Windows you have to change the paths accordingly and replace all shell script names with the names of the corresponding batch files.

  • Check out the Lenya trunk and the Cocoon branch 2.1 from the Subversion repository (see Installation Instructions). I suggest to use the following directory layout:

    src/
      apache/
        lenya/
          trunk/             -> LENYA_HOME
        cocoon/
          branches/
            BRANCH_2_1_X/    -> COCOON_HOME
    

    You don't need to set these environment variables, I only use them in this tutorial.

    Note that we don't use the Cocoon version which ships with Lenya, but a separate working copy of Cocoon. This is necessary because Eclipse doesn't support nested projects.

    The apache directory will come in handy when you start serious development, because you're likely to peek into the source code of other ASF projects like Excalibur or Xalan.

  • Edit $LENYA_HOME/local.build.properties and set the property cocoon.src.dir to the path of your $COCOON_HOME directory. When you use the suggested directory structure, this would be ../../cocoon/branches/BRANCH_2_1_X.
  • Go to the $COCOON_HOME directory and execute
    ./build.sh eclipse-project
    This creates the Cocoon project files for Eclipse.
  • Go to the $LENYA_HOME directory and execute
    ./build.sh eclipse-project
    This creates the Lenya project files for Eclipse.
  • You can now import both projects in Eclipse.
  • If your Lenya project complains that various packages are not found, it is probably necessary to edit the Java Build Path properties of your Cocoon project and select all libraries on the Order and Export tab.
  • In the Preferences pane, you have to configure the Java compiler to use the 1.4 compliance level.
  • Eclipse stores the class files in $LENYA_HOME/build/eclipse by default. Whenever you execute ./build.sh clean, it gets confused. To avoid this, set the default output folder in Project properties > Build path > Source to a different directory (e.g. $LENYA_HOME/eclipse).
  • A decent XML and XSLT editor is recommended, you can for instance install the web tools platform from the Eclipse project.
  • Have fun!

Debugging Lenya

There are two options to easily debug Lenya with the Eclipse debugger:

  • the servlet-debug target when starting with Jetty, and
  • the Tomcat plug-in for Eclipse.

To debug Lenya in Jetty,

  • Start the application using the following command:
    ./lenya.sh servlet-debug
  • In Eclipse, choose the menu item Run > Open Debug Dialog.
  • Add a Remote Java Application entry. The default connection properties (localhost at port 8000) are OK.
  • If you have custom projects, add them in the Source tab.
  • Click the Debug button to connect the Eclipse debugger to your Lenya application.

Copyright © 1999-2011 The Apache Software Foundation. All rights reserved.

Apache Lenya, Apache, and the Apache feather logo are trademarks of The Apache Software Foundation.