Modules. Table of contents

Similar documents
Frequently Asked Questions

Seamless Content Management with OpenOffice and Cocoon

Manakin Workshop. Manakin Workshop DSpace User Group, February Scott Phillips Texas A&M University

Plugin Infrastructure

OpenOffice Documents with Lenya

Interactive XML Visualization - using XSLT 2.0 on the Browser. Phil Fearon - Saxonica

7.1 Introduction. extensible Markup Language Developed from SGML A meta-markup language Deficiencies of HTML and SGML

Plugins Index. Table of contents. 1 Plugins Index Released Plugins Whiteboard Plugins...8

AIM. 10 September

Forrest Sitemap Reference

Searching Publications How-To

Copyright 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley. Chapter 7 XML

How To Validate An Xml File Against A Schema Using Xmlspy

How to be a Forrest developer

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

Developers guide Toolbox PSC Developing and customising

How To Define Schema Location In Xml File Using Xmlspy

Or : How to avoid my stupid mistakes

Evaluation of Web Application Development Frameworks and Object-Relational Mappers: A Case Study

Delivery Options: Attend face-to-face in the classroom or via remote-live attendance.

JNDI environment references

SDMX self-learning package XML based technologies used in SDMX-IT TEST

Mulberry Classes Guide to Using the Oxygen XML Editor (v20.0)

NetBeans IDE Field Guide

XML. Objectives. Duration. Audience. Pre-Requisites

DOWNLOAD OR READ : XML AND XSL TWO 1 HOUR CRASH COURSES QUICK GLANCE PDF EBOOK EPUB MOBI

Shankersinh Vaghela Bapu Institue of Technology

EMC Documentum Composer

CIW 1D CIW JavaScript Specialist.

Oxygen XML Developer plugin

Oracle Developer Day

2010 Martin v. Löwis. Data-centric XML. Other Schema Languages

Introducing Manakin: Overview & Architecture. Scott Phillips, Cody Green, Alexey Maslov, Adam Mikeal, and John Leggett

Adobe Experience Manager

Some more XML applications and XML-related standards (XLink, XPointer, XForms)

XML. Jonathan Geisler. April 18, 2008

Tutorial - Creating a project template

CSI 3140 WWW Structures, Techniques and Standards. Representing Web Data: XML

GeoNetwork opensource

Java EE 7: Back-End Server Application Development

An Introduction to XML Pipelines

The Firebird Documentation Project

Schema For Namespace Already Contains Type

XML Applications. Introduction Jaana Holvikivi 1

Session 8. Reading and Reference. en.wikipedia.org/wiki/list_of_http_headers. en.wikipedia.org/wiki/http_status_codes

Release notes for version 3.7

<put document name here> 1/13

New EuroVO registry. architecture and status as of May Menelaus Perdikeas, ESAC Neuropublic.

Oracle SOA Suite 10g: Services Orchestration

Magnolia. Content Management Suite. Slide 1

Source Control. Deployment. What usync Does. usync Versions

Comp 336/436 - Markup Languages. Fall Semester Week 4. Dr Nick Hayward

Chapter 2 XML, XML Schema, XSLT, and XPath

Multi-Channel Publishing for AllFusion Gen

Java CAPS Creating a Simple Web Service from a JCD

IT2353 WEB TECHNOLOGY Question Bank UNIT I 1. What is the difference between node and host? 2. What is the purpose of routers? 3. Define protocol. 4.

XML Tools in Visual Studio Working with XML Data XML Editor XML Schema Designer Security Considerations when Working with XML Data Debugging XSLT

MarkLogic Server. Information Studio Developer s Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Maven in the wild. An introduction to Maven

B. Assets are shared-by-copy by default; convert the library into *.jar and configure it as a shared library on the server runtime.

SECTION II: JAVA SERVLETS

Introducing live graphics gems to educational material

Configuration Export and Import

D WSMO Data Grounding Component

Maven POM project modelversion groupid artifactid packaging version name

XMLUI Modularity in DSpace 1.5 & 2.0

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

Setting Up the Development Environment

By completing this practical, the students will learn how to accomplish the following tasks:

EMC Documentum Composer

SAS AppDev Studio TM 3.4 Eclipse Plug-ins. Migration Guide

CS6501 IP Unit IV Page 1

XML for Java Developers G Session 8 - Main Theme XML Information Rendering (Part II) Dr. Jean-Claude Franchitti

A Web-based XML Schema Visualizer José Paulo Leal & Ricardo Queirós CRACS INESCPORTO LA

Perl Validation Xml Against Schema Eclipse Plugin

Moving from Studio to Atelier Bill McCormick

EMC Documentum Composer

XMLmind XML Editor - Easy Profiling

UNIT - V. 1. What is the concept behind JAX-RPC technology? (NOV/DEC 2011)

BRA BIHAR UNIVERSITY, MUZAFFARPUR DIRECTORATE OF DISTANCE EDUCATION

Standards in Flux Norman Walsh MarkLogic Corporation 14 Feb 2011

BatchDO 2.1 README 04/20/2012

Govt. of Karnataka, Department of Technical Education Diploma in Computer Science & Engineering. Fifth Semester. Subject: Web Programming

What Does Xml Data Has Failed Schema Validation Mean

Oxygen Xsd From Xml File Visual Studio Generate Sample

SQA Advanced Unit Specification: general information

IT6503 WEB PROGRAMMING. Unit-I

HYPERION SYSTEM 9 BI+ GETTING STARTED GUIDE APPLICATION BUILDER J2EE RELEASE 9.2

Siebel CRM Integration to Oracle FLEXCUBE Universal Banking Implementation Guide. Version 1.0 (Siebel CRM Version 8.2), Rev.

Cocoon Flow. Tuomo Lesonen T WWW Applications

JAVA CREATE XML DOCUMENT EXAMPLE

Business Rules Sample Application Changes

Comparing Open Source Digital Library Software

Oracle WebLogic Server

Oracle Java CAPS Database Binding Component User's Guide

XML APIs Testing Using Advance Data Driven Techniques (ADDT) Shakil Ahmad August 15, 2003

CIS-CAT Pro Dashboard Documentation

ByggSøk plan Project Structure And Build Process

JSF Tools Reference Guide. Version: M5

Sun Sun Certified Web Component Developer for J2EE 5 Version 4.0

Transcription:

Table of contents 1 Introduction 2 2 Implementing a module.. 2 3 The Module Descriptor File..3 4 Implementing Usecases in Modules. 3 4.1 Declaring the Usecase.. 3 4.2 Calling the Module Sitemap..3 4.3 Adding Menu Items4

1 Introduction Modules are packages providing a certain set of resources or functionality. Examples: a resource type (e.g., docbook module) a repository implementation (e.g., jdbc module) a collection of XSLTs (e.g., content2svg module) Some modules are included in the Lenya distribution: lucene - search functionality sitetree - manage documents in a tree-like structure jcr - store content in a JCR ( http://www.jcp.org/en/jsr/detail?id=170) repository (experimental) xhtml - XHTML-based resource type links - resource type to manage link lists lenyadoc - adds the lenyadoc:// protocol 2 Implementing a module All resources of a module are located in a single directory. The following is an example directory structure, all files are optional and depend on the nature of the module. mymodule/ config/ configuration files module.xml module descriptor cocoon-xconf/ patches for cocoon.xconf components.xconf usecases/ mymodule.jx usecase view resources/ images/ image files css/ CSS files schemas/ XML schemas (RNG, XSD, ) samples/ Samples (in case of resource type modules) java/ src/ Java source files test/ Java test classes lib/ Java libraries xslt/ XSLT stylesheets sitemap.xmap main module sitemap To add a module to your Lenya installation, declare it in local.build.properties: modules.root.dirs=src/modules:src/webapp/lenya/pubs/default/modules:/home/john/modules/mymodule When the module is deployed, the following steps are executed: the module files are copied to context://lenya/modules Java sources are compiled, libraries are installed cocoon.xconf is patched Page 2

3 The Module Descriptor File Each module must be described using a module descriptor XML file module.xml, located in the config directory of the module. The descriptor is validated when the module is deployed, so be careful! :) A typical module descriptor looks like this: <module xmlns="http://apache.org/lenya/module/1.0"> <id>org.myproject.lenya.modules.myeditor</id> <depends module="org.apache.lenya.modules.usecase"/> <depends module="org.apache.lenya.modules.webdav"/> <export package="org.myproject.lenya.modules.myeditor.api"/> <package>org.myproject.lenya.modules</package> <version>0.1-dev</version> <name>my Own Editor</name> <lenya-version>2.0-dev</lenya-version> <description> This is my own editor. For more information, visit http://myproject.org/editor. </description> </module> The id must start with the package of the module. It is not allowed to deploy two modules with the same ID. If your module uses code from other modules, you have to add a <depends> for each of these modules. The <export package=""/> statement(s) declare public packages, which means that these packages are accessible from other modules. You should aim for long-term stability of all interfaces and classes in exported packages, since they represent the Java API of your module. 4 Implementing Usecases in Modules 4.1 Declaring the Usecase For example, imagine you implement a newsletter module, containing a send usecase. To declare usecases, add a patch file for cocoon.xconf, for instance newsletter/config/cocoonxconf/usecases.xconf: <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'newsletter.send']"> <component-instance name="newsletter.send" logger="lenya.usecases.newsletter.send" class="org.myproject.lenya.newsletter.usecases.send"> <view template="modules/newsletter/usecases/send.jx" menu="false"/> </component-instance> </xconf> As you can see in the view declaration, the JX templates are typically stored in the <module>/ usecases directory. The Java source files go into the <module>/java/src directory, they are compiled automatically by the Lenya build process. 4.2 Calling the Module Sitemap The following URL syntax is used to make a call to a module sitemap: Page 3

cocoon://modules/<module>/** The module sitemap is located at newsletter/sitemap.xmap. To request the latest newsletter and display it on the confirmation screen using the CInclude approach (for more information, see documentation about the usecase framework), you could for instance use the URI cocoon:// modules/newsletter/latestnewsletter.xml: <page:page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0" xmlns:page="http://apache.org/cocoon/lenya/cms-page/1.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:i18n="http://apache.org/cocoon/i18n/2.1" xmlns:cinclude="http://apache.org/cocoon/include/1.0" > <page:body> <h1><i18n:text>send Newsletter</i18n:text></h1> <form> <jx:import uri="templates/messages.jx"/> <cinclude:includexml> <cinclude:src>cocoon://modules/newsletter/latestnewsletter.xml</cinclude:src> </cinclude:includexml> <input name="submit" type="submit" value="send Newsletter"/> </form> </page:body> </page:page> Another useful option is to use a module URL as the usecase view, e.g. to export some XML. Note that the attribute uri is used instead of template. The usecase class DummyUsecase can be used because no Java code shall be executed. <xconf xpath="/cocoon/usecases" unless="/cocoon/usecases/component-instance[@name = 'newsletter.download']"> <component-instance name="newsletter.send" logger="lenya.usecases.newsletter.send" class="org.apache.lenya.cms.usecase.dummyusecase"> <view uri="cocoon://modules/newsletter/downloadnewsletter.xml"/> </component-instance> </xconf> 4.3 Adding Menu Items A module can provide menu items which are added to the publication menu. To insert the menu items of a module, you have to add the module declaration to publication.xml: <publication> <module name="newsletter"/> </publication> If there is a menus.xmap sitemap in the module's root directory, a request of the form <area>.xml is sent into this sitemap. The matching pipeline could look like this: <map:match pattern="**"> <map:generate type="serverpages" src="config/menu.xsp"/> <map:serialize type="xml"/> Page 4

</map:match> The server page <module>/config/menu.xsp delivers a menu XML which includes the items to be inserted: <xsp:page > <menu> <menus> <menu i18n:attr="name" name="file"> <block admin="false"> <item uc:usecase="newsletter.send" href="?"> <i18n:text>send Newsletter</i18n:text> </item> </block> </menu> </menus> </menu> </xsp:page> Page 5