You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by je...@apache.org on 2006/12/17 22:12:24 UTC

svn commit: r488048 - in /cocoon/branches/BRANCH_2_1_X/src/blocks/naming: conf/ samples/ samples/flow/ samples/forms/ samples/i18n/ samples/resources/ samples/screens/ samples/styles/ samples/xslt/

Author: jeremy
Date: Sun Dec 17 13:12:23 2006
New Revision: 488048

URL: http://svn.apache.org/viewvc?view=rev&rev=488048
Log:
adding ldap sample

Added:
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/addressbook.xconf
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/naming.xsamples
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/AddressbookManager.js
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/flow.js
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-binding.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-model.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-template.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/addressbook.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/contact.ldif
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/directory.ldif
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/slapd.conf
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/departments.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/error.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/people.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/person.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/sitemap.xmap
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/addressbook.css
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/welcome.xml
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/forms.xsl
    cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/page2html.xsl

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/addressbook.xconf
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/addressbook.xconf?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/addressbook.xconf (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/addressbook.xconf Sun Dec 17 13:12:23 2006
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xconf xpath="/cocoon" unless="component[@role='org.apache.cocoon.components.naming.EntryManager']">
+	<component role="org.apache.cocoon.components.naming.EntryManager" class="org.apache.cocoon.components.naming.LDAPEntryManager" logger="flow.ldap">
+		<parameter name="ldap-host" value="ldap://localhost:389"/>
+		<parameter name="ldap-base" value="ou=addressbook,dc=ldap,dc=cocoongt,dc=org"/>
+		<parameter name="ldap-user" value="dc=ldap,dc=cocoongt,dc=org"/>
+		<parameter name="ldap-pass" value="secret"/>
+	</component>
+</xconf>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/naming.xsamples
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/naming.xsamples?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/naming.xsamples (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/conf/naming.xsamples Sun Dec 17 13:12:23 2006
@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+
+<xsamples xpath="/samples" unless="group[@name='Naming']">
+
+  <group name="Naming">
+    <sample name="Naming Block" href="naming/">
+      LDAP AddressBook Sample from CocoonGT 2006.
+    </sample>
+  </group>
+
+</xsamples>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/AddressbookManager.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/AddressbookManager.js?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/AddressbookManager.js (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/AddressbookManager.js Sun Dec 17 13:12:23 2006
@@ -0,0 +1,215 @@
+/*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+
+/* 
+	AddressbookManager Object
+	
+	A collection of static functions to access an LDAP-based Addressbook from FlowScript
+	
+	NB. This is sample code
+	It makes various simplifications and has certain important limitations
+		it currently cannot delete individual attributes
+		it only reads the first value from attributes
+		it contains very little error-checking or handling
+		there is no result paging or sorting
+
+*/
+
+importClass(Packages.java.util.HashMap);
+importClass(Packages.java.util.ArrayList);
+
+
+var AddressbookManager = {
+	binding: { /* binding between the display model and the LDAP Attributes */
+		firstname  : "givenName",
+		lastname   : "sn",
+		email      : "mail",
+		deptName   : "physicalDeliveryOfficeName",
+		address1   : "postalAddress",
+		address2   : "l",
+		address3   : "st",
+		postcode   : "postalCode",
+		ophone     : "telephoneNumber",
+		fphone     : "facsimileTelephoneNumber",
+		pager      : "pager",
+		mphone     : "mobile",
+		hphone     : "homePhone",
+		dept       : "ou"
+	}
+}
+
+/*
+	Map a Person-LDAP record to a JavaScript Object to use in the display layer
+	This maintains a separation between the structure of the LDAP records and the 
+	display code and style.
+	
+	@param uid the unique ID for this person
+	@param person the LDAP record of the Person
+	@return the Javascript Object representing the Person
+*/
+AddressbookManager.bindPerson = function(uid, person) {
+	var result = {uid: uid}, val; // add a synthetic UID property for convenience
+	for (var key in this.binding) {
+		val = person.get(this.binding[key]);
+		if (val) result[key] = val.get(0); // simplification, only handling single values
+	}
+	return result;
+}
+
+/*
+	Map a JavaScript Object to use in the display layer to a Person-LDAP record
+	This performs the reverse of AddressbookManager.bindPerson.
+	
+	TODO: How do attributes get deleted?
+	
+	@param person the Javascript Object representing the Person
+	@return the LDAP record of the Person
+*/
+AddressbookManager.unbindPerson = function(person) {
+	var attributes = new HashMap(), name, val;
+	for (var key in person) {
+		name = this.binding[key];
+		val = person[key];
+		if (name && val) attributes.put(name, this.singleAttribute(val)); // copy populated values
+	}
+	return attributes;
+}
+
+/*
+	Create a new CForms Model from the binding data
+	
+	@return the new model
+*/
+AddressbookManager.getNewModel = function() {
+	var model = {};
+	for (var key in this.binding) model[key] = "";
+	return model;
+}
+
+/* 
+	Add a new Person to the Addressbook.
+	
+	TODO: handle errors like duplicate entries properly.
+	
+	@param entrymanager the LDAP Component
+	@param model the Javascript Object representing the Person
+	@param ou the organisationalUnit (department) to add this person to
+	@return the UID of the new Person
+*/
+AddressbookManager.addPerson = function(entrymanager, model, ou) {
+	model.dept = ou.substring(3); // strip the identifier ('ou=')
+	var uid = "cn=" + model.firstname + " " + model.lastname + "," + ou;
+	var attributes = this.unbindPerson(model), classes = new ArrayList();
+	classes.add("top");
+	classes.add("person");
+	classes.add("organizationalPerson");
+	classes.add("inetOrgPerson");
+	attributes.put("objectClass", classes);
+	entrymanager.create(uid, attributes);
+	return uid;
+}
+
+/*
+	Get a list of departments in the addressbook
+	
+	@param entrymanager the LDAP Component
+	@return a JavaScript Array of organisationalUnits
+*/
+AddressbookManager.getDepartments = function(entrymanager) {
+	var matchAttrs = new HashMap(), departments = [];
+	matchAttrs.put("objectClass", this.singleAttribute("organizationalUnit"));
+	var results = entrymanager.find("", matchAttrs);
+	var it = results.keySet().iterator();
+	while (it.hasNext()) departments[departments.length] = it.next();
+	return departments;
+}
+
+/*
+	Get a list of people from a department in the addressbook
+	
+	TODO: Sort and Page results
+	
+	@param entrymanager the LDAP Component
+	@param department the organisationalUnit to look in
+	@return a JavaScript Array of JavaScript Person Objects
+*/
+AddressbookManager.getPeople = function(entrymanager, department) {
+	var matchAttrs = new HashMap(), people = [];
+	department = department ? department : "";
+	matchAttrs.put("objectClass", this.singleAttribute("inetOrgPerson"));
+	var results = entrymanager.find(department, matchAttrs);
+	var it = results.keySet().iterator(), key;
+	while (it.hasNext()) {
+		key = it.next();
+		people[people.length] = this.bindPerson(key + "," + department, results.get(key));
+	}
+	return people;
+}
+
+/*
+	Get a single person from the addressbook
+	
+	@param entrymanager the LDAP Component
+	@param uid the UID of the person
+	@return a JavaScript person Object
+*/
+AddressbookManager.getPerson = function(entrymanager, uid) {
+	uid = uid ? uid : "";
+	var result = entrymanager.get(uid);
+	return this.bindPerson(uid, result);
+}
+
+/*
+	Update a single person who already exists in the addressbook
+	
+	@param entrymanager the LDAP Component
+	@param model the Javascript Object representing the Person
+	@return a JavaScript person Object
+*/
+AddressbookManager.updatePerson = function(entrymanager, model) {
+	var uid = model.uid;
+	var attributes = this.unbindPerson(model);
+	entrymanager.modify(uid, EntryManager.REPLACE_ATTRIBUTE, attributes);
+}
+
+/*
+	Remove a single person from the addressbook
+	
+	@param entrymanager the LDAP Component
+	@param uid the UID of the person
+	@return the department they were in
+*/
+AddressbookManager.deletePerson = function(entrymanager, uid) {
+	var person = this.getPerson(entrymanager, uid);
+	var department = "ou=" + person["dept"];
+	entrymanager.remove(uid);
+	return department;
+}
+
+/*
+	convenience function to wrap a value in a List
+	the naming API takes Attributes as Lists, as Attributes may have many values
+	
+	@param value the value to wrap
+	@return an ArrayList with a single value
+*/
+AddressbookManager.singleAttribute = function(value) {
+	var attribute = new ArrayList();
+	attribute.add(value);
+	return attribute;
+}

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/flow.js
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/flow.js?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/flow.js (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/flow/flow.js Sun Dec 17 13:12:23 2006
@@ -0,0 +1,157 @@
+/*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+// webapp flow for an LDAP Addressbook
+
+cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
+cocoon.load("flow/AddressbookManager.js");
+
+importClass(Packages.org.apache.cocoon.components.naming.EntryManager);
+
+/*
+
+External Function
+Add a Person to the Addressbook
+
+*/
+function addNewPerson(form) {
+	var department = cocoon.parameters["dn"];
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	var model = AddressbookManager.getNewModel();
+	try {
+		form.load(model);
+		form.showForm(cocoon.parameters["screen"]);
+		form.save(model);
+		if ("done".equals(form.submitId)) {
+			var uid = AddressbookManager.addPerson(entrymanager, model, department);
+			cocoon.redirectTo("person.html?dn=" + uid);
+		} else if ("cancel".equals(form.submitId)) {
+			cocoon.redirectTo("people.html?dn=" + department);
+		}
+	} catch (e) {
+		cocoon.log.error(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+
+/*
+
+External Function
+Update a Person's existing attributes in the Addressbook
+
+*/
+function updatePerson(form) {
+	var uid = cocoon.parameters["dn"];
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	try {
+		var model = AddressbookManager.getPerson(entrymanager, uid);
+		form.load(model);
+		form.showForm(cocoon.parameters["screen"]);
+		form.save(model);
+		if ("done".equals(form.submitId))
+			AddressbookManager.updatePerson(entrymanager, model);
+		cocoon.redirectTo("person.html?dn=" + uid);
+	} catch (e) {
+		cocoon.log.error(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+
+/*
+
+External Function
+Retrieves a Person from the Addressbook using their UID
+
+*/
+function getPerson() {
+	var uid = cocoon.parameters["dn"];
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	try {
+		var person = AddressbookManager.getPerson(entrymanager, uid);
+		cocoon.sendPage(cocoon.parameters["screen"], {person: person});
+	} catch (e) {
+		print(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+
+/*
+
+External Function
+Deletes a Person from the Addressbook using their UID
+TODO: add a confirmation screen
+
+*/
+function deletePerson() {
+	var uid = cocoon.parameters["dn"];
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	try {
+		var department = AddressbookManager.deletePerson(entrymanager, uid);
+		cocoon.redirectTo("people.html?dn=" + department);
+	} catch (e) {
+		print(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+
+/*
+
+External Function
+Retrieves all People in the specified Department from the Addressbook
+
+*/
+function getPeople() {
+	var department = cocoon.parameters["dn"];
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	try {
+		var people = AddressbookManager.getPeople(entrymanager, department);
+		cocoon.sendPage(cocoon.parameters["screen"], {people: people, department: department});
+	} catch (e) {
+		print(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+
+/*
+
+External Function
+Retrieves all Departments from the Addressbook
+
+*/
+function getDepartments() {
+	var entrymanager = cocoon.getComponent(EntryManager.ROLE);
+	try {
+		var departments = AddressbookManager.getDepartments(entrymanager);
+		cocoon.sendPage(cocoon.parameters["screen"], {departments: departments});
+	} catch (e) {
+		print(e);
+		throw(e);
+	} finally {
+		cocoon.releaseComponent(entrymanager);
+	}
+}
+

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-binding.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-binding.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-binding.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-binding.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" path="/">
+	<fb:value id="firstname" path="firstname"/>
+	<fb:value id="lastname" path="lastname"/>
+	<fb:value id="email" path="email"/>
+	<fb:value id="deptName" path="deptName"/>
+	<fb:value id="address1" path="address1"/>
+	<fb:value id="address2" path="address2"/>
+	<fb:value id="address3" path="address3"/>
+	<fb:value id="postcode" path="postcode"/>
+	<fb:value id="ophone" path="ophone"/>
+	<fb:value id="fphone" path="fphone"/>
+	<fb:value id="hphone" path="hphone"/>
+	<fb:value id="mphone" path="mphone"/>
+	<fb:value id="pager" path="pager"/>
+</fb:context>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-model.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-model.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-model.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-model.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<fd:form xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
	<fd:widgets>

    <fd:messages id="messages">
 
      <fd:label><i18n:text i18n:catalogue="local">message.label</i18n:text></fd:label>
    </fd:messages>

		<fd:field id="firstname" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.firstname</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">firstname.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">firstname.help</i18n:text></fd:help>
			<fd:datatype base="string">
				<fd:validation>
					<fd:length min="2" max="50"/>
				</fd:validation>
			</fd:datatype>
		</fd:field>

		<fd:field id="lastname" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.lastname</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">lastname.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">lastname.help</i18n:text></fd:help>
			<fd:datatype base="string">
				<fd:validation>
					<fd:length min="2" max="50"/>
				</fd:validation>
			</fd:datatype>
		</fd:field>

		<fd:field
  id="email" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.email</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">email.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">email.help</i18n:text></fd:help>
			<fd:datatype base="string">
				<fd:validation>
					<fd:email/>
				</fd:validation>
			</fd:datatype>
		</fd:field>

		<fd:field id="deptName" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.deptName</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">deptName.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">deptName.help</i18n:text></fd:help>
			<fd:datatype base="string">
				<fd:validation>
					<fd:length min="2" max="50"/>
				</fd:validation>
			</fd:datatype>
		</fd:field>
		
		<fd:field id="address1" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.address1</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:ca
 talogue="local">address1.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">address1.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="address2" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.address2</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">address2.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">address2.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="address3" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.address3</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">address3.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">address3.help</i18n:text></fd:help>
			<fd:datatype base="s
 tring"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="postcode" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.postcode</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">postcode.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">postcode.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="ophone" required="true">
			<fd:label><i18n:text i18n:catalogue="local">field.ophone</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">ophone.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">ophone.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="fphone" required="false">
			<fd:label><i18n:text 
 i18n:catalogue="local">field.fphone</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">fphone.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">fphone.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="mphone" required="false">
			<fd:label><i18n:text i18n:catalogue="local">field.mphone</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">mphone.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">mphone.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="hphone" required="false">
			<fd:label><i18n:text i18n:catalogue="local">field.hphone</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">hphone.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:ca
 talogue="local">hphone.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>
		
		<fd:field id="pager" required="false">
			<fd:label><i18n:text i18n:catalogue="local">field.pager</i18n:text>: </fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">pager.hint</i18n:text></fd:hint>
			<fd:help><i18n:text i18n:catalogue="local">pager.help</i18n:text></fd:help>
			<fd:datatype base="string"/>
			<fd:validation>
				<fd:length min="2" max="50"/>
			</fd:validation>
		</fd:field>

		<fd:submit id="cancel" action-command="cancel" validate="false">
			<fd:label>Cancel</fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">cancel.hint</i18n:text></fd:hint>
		</fd:submit> 

		<fd:submit id="done" action-command="done" validate="true">
			<fd:label>Send</fd:label>
			<fd:hint><i18n:text i18n:catalogue="local">submit.hint</i18n:text></fd:hint>
		</fd:submit> 



	</fd:widgets>
</fd:form>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-template.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-template.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-template.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/forms/person-template.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document xmlns:ft="http://apache.org/cocoon/forms/1.0#template" xmlns:fi="http://apache.org/cocoon/forms/1.0#instance" xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+	<header>
+		<title><i18n:text i18n:catalogue="local">new.person.title</i18n:text></title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<abstract>new person page using <code>document-v12.dtd</code>.</abstract>
+	</header>
+	<body>
+		<section>
+			<title><i18n:text i18n:catalogue="local">new.person.title</i18n:text></title>
+			<p><i18n:text i18n:catalogue="local">new.person.note</i18n:text></p>
+		</section>
+		<section>
+			<ft:form-template action="" method="post" accept-charset="UTF-8">
+				<ft:continuation-id/>
+				<fi:group>
+					<fi:styling type="fieldset" layout="columns"/>
+					<fi:label><i18n:text i18n:catalogue="local">person.name.label</i18n:text></fi:label>
+					<fi:hint><i18n:text i18n:catalogue="local">person.name.hint</i18n:text></fi:hint>
+					<fi:items>
+						<ft:widget id="firstname"/>						
+						<ft:widget id="lastname"/>						
+						<ft:widget id="email"/>						
+					</fi:items>
+				</fi:group>
+				<br/>
+				<fi:group>
+					<fi:styling type="fieldset" layout="columns"/>
+					<fi:label><i18n:text i18n:catalogue="local">person.address.label</i18n:text></fi:label>
+					<fi:hint><i18n:text i18n:catalogue="local">person.address.hint</i18n:text></fi:hint>
+					<fi:items>
+						<ft:widget id="deptName"/>						
+						<ft:widget id="address1"/>						
+						<ft:widget id="address2"/>						
+						<ft:widget id="address3"/>						
+						<ft:widget id="postcode"/>						
+					</fi:items>
+				</fi:group>
+				<br/>
+				<fi:group>
+					<fi:styling type="fieldset" layout="columns"/>
+					<fi:label><i18n:text i18n:catalogue="local">person.phone.label</i18n:text></fi:label>
+					<fi:hint><i18n:text i18n:catalogue="local">person.phone.hint</i18n:text></fi:hint>
+					<fi:items>
+						<ft:widget id="ophone"/>						
+						<ft:widget id="fphone"/>						
+						<ft:widget id="mphone"/>						
+						<ft:widget id="hphone"/>						
+						<ft:widget id="pager"/>						
+					</fi:items>
+				</fi:group>
+				<p class="form-buttons"><ft:widget id="done"/> <ft:widget id="cancel"/> <input type="reset" value="Reset" /></p>
+				<p>
+					<span class="forms-field-required">*</span> <i18n:text i18n:catalogue="local">required.note</i18n:text><br/>
+					<span class="forms-validation-message">!</span> <i18n:text i18n:catalogue="local">error.note</i18n:text><br/>
+					<forms-help-image/> <i18n:text i18n:catalogue="local">help.note</i18n:text>
+				</p>
+			</ft:form-template>
+		</section>
+	</body>
+</document>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/addressbook.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/addressbook.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/addressbook.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/i18n/addressbook.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<catalogue xml:lang="en">
+	<!-- titles -->
+	<message key="person.title">Addressbook : Person</message>
+	<message key="new.person.title">Addressbook : Edit Person</message>
+	<message key="new.person.note">Fill in this form to add or edit a person in the address book</message>
+	<message key="people.title">Addressbook : People</message>
+	<message key="departments.title">Addressbook : Departments</message>
+	<message key="more.departments.title">more departments</message>
+	<message key="department.title">Department</message>
+	<!-- fields -->
+	<message key="field.uid">ID</message>
+	<message key="field.fullname">Name</message>
+	<message key="field.firstname">First Name</message>
+	<message key="field.lastname">Last Name</message>
+	<message key="field.email">Email Address</message>
+	<message key="field.deptName">Department</message>
+	<message key="field.address">Postal Address</message>
+	<message key="field.address1">Address Line 1</message>
+	<message key="field.address2">Address Line 2</message>
+	<message key="field.address3">Address Line 3</message>
+	<message key="field.postcode">Post Code</message>
+	<message key="field.ophone">Office Phone</message>
+	<message key="field.fphone">Fax</message>
+	<message key="field.mphone">Mobile Phone</message>
+	<message key="field.hphone">Home Phone</message>
+	<message key="field.pager">Pager</message>
+	<!-- labels -->
+	<message key="person.name.label">Name</message>
+	<message key="person.address.label">Address</message>
+	<message key="person.phone.label">Phone Numbers</message>
+	<message key="required.note">This field is required</message>
+	<message key="error.note">This field has an error</message>
+	<message key="help.note">Help for this field</message>
+	<!-- actions -->
+	<message key="add.person.title">Add a new person to this department</message>
+	<message key="update.person.title">Edit this person's details</message>
+	<message key="delete.person.title">Delete this person</message>
+	<!-- departments -->
+	<message key="ou=muppets">Muppets</message>
+	<message key="ou=directors">Directors</message>
+
+</catalogue>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/contact.ldif
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/contact.ldif?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/contact.ldif (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/contact.ldif Sun Dec 17 13:12:23 2006
@@ -0,0 +1,66 @@
+# sample data to fill the addressbook
+
+dn: cn=Joe Bloggs, ou=directors, ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+cn: Joe Bloggs
+gn: Joe
+sn: Bloggs
+mail: joe@bloggs.net
+physicalDeliveryOfficeName: Cocoon GetTogether LDAP, Directors Department
+postalAddress: PO BOX 88888
+l: Castle Blogg
+st: Bloggtown
+postalCode: 000000
+telephoneNumber: 1234
+mobile: 56789012
+homePhone: 34567890
+ou: directors
+
+
+dn: cn=Rossputin McDonald, ou=muppets, ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+cn: Rossputin McDonald
+gn: Rossputin
+sn: McDonald
+mail: rossputin@example.org
+physicalDeliveryOfficeName: Cocoon GetTogether LDAP, Muppet Department
+postalAddress: PO BOX 55555
+l: Newbury
+st: Berkshire
+postalCode: JX23 88W
+telephoneNumber: 666
+facsimileTelephoneNumber: 666
+pager: 666
+mobile: 666
+homePhone: 666
+ou: muppets
+
+
+dn: cn=Jeremy Quinn, ou=muppets, ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: person
+objectClass: organizationalPerson
+objectClass: inetOrgPerson
+cn: Jeremy Quinn
+gn: Jeremy
+sn: Quinn
+mail: jeremy@example.org
+physicalDeliveryOfficeName: Cocoon GetTogether LDAP, Muppet Department
+postalAddress: PO BOX 115
+l: Brixton
+st: London
+postalCode: FW3 NN6
+telephoneNumber: 1234567
+facsimileTelephoneNumber: 8901234
+pager: 56789
+mobile: 012345678
+homePhone: 90123456
+ou: muppets
+
+

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/directory.ldif
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/directory.ldif?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/directory.ldif (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/directory.ldif Sun Dec 17 13:12:23 2006
@@ -0,0 +1,23 @@
+# directory structure of the addressbook, with 2 sample departments
+
+dn: dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: dcObject
+objectClass: organization
+dc: cocoongt
+o: Cocoon GetTogether LDAP
+
+dn: ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: organizationalUnit
+ou: addressbook
+
+dn: ou=muppets, ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: organizationalUnit
+ou: muppets
+
+dn: ou=directors, ou=addressbook, dc=ldap, dc=cocoongt, dc=org
+objectClass: top
+objectClass: organizationalUnit
+ou: directors

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/slapd.conf
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/slapd.conf?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/slapd.conf (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/resources/slapd.conf Sun Dec 17 13:12:23 2006
@@ -0,0 +1,23 @@
+##
+# slapd.conf file for Addressbook Sample
+##
+
+include /etc/openldap/schema/core.schema
+include /etc/openldap/schema/cosine.schema
+include /etc/openldap/schema/nis.schema
+include /etc/openldap/schema/inetorgperson.schema
+include /etc/openldap/schema/misc.schema
+include /etc/openldap/schema/samba.schema
+include /etc/openldap/schema/apple.schema
+pidfile /var/run/slapd.pid
+argsfile /var/run/slapd.args
+allows bind_v2
+schemacheck off
+
+database bdb
+directory /var/db/openldap/openldap-data/
+suffix "dc=ldap,dc=cocoongt,dc=org"
+rootdn "dc=ldap,dc=cocoongt,dc=org"
+
+# MD5 hash of 'secret'
+rootpw {SSHA}G0ul9DgKDPWKoQnxIQV6VNvuIu8Bfboz

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/departments.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/departments.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/departments.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/departments.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document
+	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+	>
+	<header>
+		<title><i18n:text i18n:catalogue="local">departments.title</i18n:text></title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<subtitle>A list of departments in the Addressbook</subtitle>
+		<abstract>LDAP Entries</abstract>
+	</header>
+
+	<body>
+		<section>
+			<title><i18n:text i18n:catalogue="local">departments.title</i18n:text></title>
+			<jx:choose>
+				<jx:when test="${departments!=null}">
+					<table>
+						<jx:forEach var="department" items="${departments}">
+							<tr>
+								<td><a href="people.html?dn=${department}"><i18n:text i18n:catalogue="local">${department}</i18n:text></a></td>
+								<td class="plain">${department}</td>
+							</tr>
+						</jx:forEach>
+					</table>
+				</jx:when>
+				<jx:otherwise>
+					<i18n:text i18n:catalogue="local">departments.none</i18n:text>
+				</jx:otherwise>
+			</jx:choose>
+		</section>
+	</body>
+</document>
+

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/error.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/error.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/error.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/error.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document xmlns:t="http://apache.org/cocoon/templates/jx/1.0"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+	<header>
+		<title>Error</title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<abstract>Status page using <code>document-v12.dtd</code>.</abstract>
+	</header>
+	<body>
+		<section>
+			<title>Error</title>
+			<p><i18n:text i18n:catalogue="local">#{message}</i18n:text></p>
+			<hr/>
+			<p>An error has occurred, please try again.</p>
+		</section>
+	</body>
+</document>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/people.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/people.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/people.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/people.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document
+	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+	>
+
+	<header>
+		<title><i18n:text i18n:catalogue="local">people.title</i18n:text></title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<subtitle>A list of people in the Addressbook</subtitle>
+		<abstract>LDAP Entries</abstract>
+	</header>
+
+	<body>
+		<section>
+			<title><i18n:text i18n:catalogue="local">people.title</i18n:text></title>
+			<p><i18n:text i18n:catalogue="local">department.title</i18n:text>: <b><i18n:text i18n:catalogue="local">${department}</i18n:text></b> (<a href="index.html"><i18n:text i18n:catalogue="local">more.departments.title</i18n:text></a>)</p>
+			<jx:choose>
+				<jx:when test="${people!=null}">
+					<table class="people">
+						<jx:forEach var="person" items="${people}">
+							<tr>
+								<th><a href="person.html?dn=${person.uid}">${person.firstname} ${person.lastname}</a></th>
+								<td><a href="mailto:${person.email}">${person.email}</a></td>
+								<td class="plain">${person.uid}</td>
+							</tr>
+						</jx:forEach>
+					</table>
+				</jx:when>
+				<jx:otherwise>
+					<i18n:text i18n:catalogue="local">people.none</i18n:text>
+				</jx:otherwise>
+			</jx:choose>
+			<p><a href="newperson.html?dn=${department}"><i18n:text i18n:catalogue="local">add.person.title</i18n:text></a></p>
+		</section>
+	</body>
+</document>
+

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/person.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/person.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/person.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/screens/person.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,91 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document
+	xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+	xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+	>
+
+	<header>
+		<title><i18n:text i18n:catalogue="local">person.title</i18n:text></title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<subtitle>A person in the Addressbook</subtitle>
+		<abstract>LDAP Entry</abstract>
+	</header>
+
+	<body>
+		<section>
+			<title><i18n:text i18n:catalogue="local">person.title</i18n:text></title>
+			<jx:choose>
+				<jx:when test="${person!=null}">
+					<p><i18n:text i18n:catalogue="local">department.title</i18n:text>: <b><a href="people.html?dn=ou=${person.dept}"><i18n:text i18n:catalogue="local">ou=${person.dept}</i18n:text></a></b></p>
+					<table class="person">
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.fullname</i18n:text></th>
+							<td><b>${person.firstname} ${person.lastname}</b></td>
+							<td class="plain">${person.uid}</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.email</i18n:text></th>
+							<td><a href="mailto:${person.email}">${person.email}</a></td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.address</i18n:text></th>
+							<td>
+								${person.deptName}<br />
+								${person.address1}<br />
+								${person.address2}<br />
+								${person.address3}<br />
+								${person.postcode}
+							</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.ophone</i18n:text></th>
+							<td>${person.ophone}</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.fphone</i18n:text></th>
+							<td>${person.fphone}</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.mphone</i18n:text></th>
+							<td>${person.mphone}</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.hphone</i18n:text></th>
+							<td>${person.hphone}</td>
+						</tr>
+						<tr valign="top">
+							<th><i18n:text i18n:catalogue="local">field.pager</i18n:text></th>
+							<td>${person.pager}</td>
+						</tr>
+					</table>
+				</jx:when>
+				<jx:otherwise>
+					<i18n:text i18n:catalogue="local">person.none</i18n:text>
+				</jx:otherwise>
+			</jx:choose>
+			<p>
+				<a href="updateperson.html?dn=${person.uid}"><i18n:text i18n:catalogue="local">update.person.title</i18n:text></a>
+			|
+				<a href="delete.html?dn=${person.uid}"><i18n:text i18n:catalogue="local">delete.person.title</i18n:text></a>
+			</p>
+		</section>
+	</body>
+</document>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/sitemap.xmap?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/sitemap.xmap (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/sitemap.xmap Sun Dec 17 13:12:23 2006
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+
+  <map:components>
+    <map:transformers>
+    	<map:transformer logger="sitemap.transformer.i18n" name="i18n" pool-grow="4" pool-max="32" pool-min="8" src="org.apache.cocoon.transformation.I18nTransformer">
+            <catalogues default="local">
+              <catalogue id="local" name="addressbook" location="i18n"/>
+              <catalogue id="forms" name="messages" location="resource://org/apache/cocoon/forms/system/i18n"/>
+            </catalogues>
+            <cache-at-startup>true</cache-at-startup>
+            <untranslated-text>TODO: Finish the translations</untranslated-text>
+        </map:transformer>
+     </map:transformers>
+	 <map:pipes default="noncaching"/>
+  </map:components>
+
+	<map:flow language="javascript">
+		<map:script src="flow/flow.js"/>
+	</map:flow>
+
+	<map:pipelines>
+		
+		<map:pipeline internal-only="true">
+		    <map:act type="locale">
+		    
+                <!-- render JX Templates -->
+                <map:match pattern="screen/*">
+                    <map:generate type="jx" src="screens/{1}.xml"/>
+                    <map:transform type="i18n">
+                        <map:parameter name="locale" value="{../locale}"/>
+                    </map:transform>
+                    <map:transform src="xslt/page2html.xsl"/>
+                    <map:serialize/>
+                </map:match>
+                
+                <!-- render Cocoon Forms -->
+                <map:match pattern="form/*">
+                    <map:generate src="forms/{1}-template.xml"/>
+                    <map:transform type="forms">
+                        <map:parameter name="locale" value="{../locale}"/>
+                    </map:transform>
+                    <map:transform src="xslt/page2html.xsl"/>
+                    <map:transform src="xslt/forms.xsl">
+                        <map:parameter name="resources-uri" value="{request:contextPath}/_cocoon/resources"/>
+                    </map:transform>
+                    <map:transform type="i18n">
+                        <map:parameter name="locale" value="{../locale}"/>
+                    </map:transform>
+                    <map:serialize/>
+                </map:match>
+                
+            </map:act>
+		</map:pipeline>
+
+		<map:pipeline>
+
+			<!-- handle CForms Continuations -->
+			<map:match type="request-parameter" pattern="continuation-id">
+				<map:call continuation="{1}"/>
+			</map:match>
+
+            <!-- CSS stylesheets -->
+            <map:match pattern="styles/**.css">
+                <map:read src="styles/{1}.css" mime-type="text/css"/>
+            </map:match>
+
+			<!-- home page redirects to the welcome page -->
+            <map:match pattern="">
+                <map:redirect-to uri="cocoon:/welcome"/>
+            </map:match>
+            
+            <map:match pattern="welcome">
+                <map:generate src="welcome.xml"/>
+                <map:transform src="xslt/page2html.xsl"/>
+                <map:serialize/>
+            </map:match>
+
+			<!-- gets a single user, using flowscript -->
+			<map:match pattern="person.html">
+				<map:call function="getPerson">
+					<map:parameter name="screen" value="screen/person"/>
+					<map:parameter name="dn" value="{request-param:dn}"/><!-- the person's uid eg. cn=Jeremy Quinn,ou=muppets -->
+				</map:call>
+			</map:match>
+
+			<!-- gets all users in a department, using flowscript -->
+			<map:match pattern="people.html">
+				<map:call function="getPeople">
+					<map:parameter name="screen" value="screen/people"/>
+					<map:parameter name="dn" value="{request-param:dn}"/><!-- the department eg. ou=muppets  -->
+				</map:call>
+			</map:match>
+
+			<!-- gets all departments, using flowscript -->
+			<map:match pattern="index.html">
+				<map:call function="getDepartments">
+					<map:parameter name="screen" value="screen/departments"/>
+				</map:call>
+			</map:match>
+
+			<!-- make a new user, using flowscript and cforms -->
+			<map:match pattern="newperson.html">
+				<map:call function="handleForm">
+					<map:parameter name="function" value="addNewPerson"/>
+					<map:parameter name="form-definition" value="forms/person-model.xml"/>
+					<map:parameter name="bindingURI" value="forms/person-binding.xml"/>
+					<map:parameter name="screen" value="form/person"/>
+					<map:parameter name="dn" value="{request-param:dn}"/><!-- the department eg. ou=muppets  -->
+				</map:call>
+			</map:match>
+
+			<!-- update a user, using flowscript and cforms -->
+			<map:match pattern="updateperson.html">
+				<map:call function="handleForm">
+					<map:parameter name="function" value="updatePerson"/>
+					<map:parameter name="form-definition" value="forms/person-model.xml"/>
+					<map:parameter name="bindingURI" value="forms/person-binding.xml"/>
+					<map:parameter name="screen" value="form/person"/>
+					<map:parameter name="dn" value="{request-param:dn}"/><!-- the person's uid eg. cn=Jeremy Quinn,ou=muppets -->
+				</map:call>
+			</map:match>
+
+			<!-- deletes a single user, using flowscript -->
+			<map:match pattern="delete.html">
+				<map:call function="deletePerson">
+					<map:parameter name="dn" value="{request-param:dn}"/><!-- the person's uid eg. cn=Jeremy Quinn,ou=muppets -->
+				</map:call>
+			</map:match>
+
+		</map:pipeline>
+	</map:pipelines>
+</map:sitemap>

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/addressbook.css
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/addressbook.css?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/addressbook.css (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/styles/addressbook.css Sun Dec 17 13:12:23 2006
@@ -0,0 +1,56 @@
+/*
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+*/
+
+
+/* styles for addressbook sample */
+
+body {
+	font-family: gill sans, Verdana, sans serif;
+}
+
+.person th, .people th, td.label {
+	text-align: right;
+	color: #666;
+	padding-right: 10px;
+}
+
+#screen, #screen table {
+	padding: 10px 20px 0 20px;
+}
+
+form img {
+	border: 0;
+}
+
+.heading1 {
+	font-size: 20px;
+}
+
+a {
+	text-decoration: none;
+}
+
+legend {
+	font-weight: bold;
+	padding: 0 6px 0 6px;
+}
+
+.plain {
+	color: #666;
+	font-family: monospace;
+	padding: 0 0 0 20px;
+}
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/welcome.xml
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/welcome.xml?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/welcome.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/welcome.xml Sun Dec 17 13:12:23 2006
@@ -0,0 +1,63 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<document>
+	<header>
+		<title>Addressbook : Introduction</title>
+		<authors>
+			<person name="Jeremy Quinn" email="jeremy@apache.org"/>
+		</authors>
+		<subtitle>An introduction to the Addressbook</subtitle>
+		<abstract>Using LDAP Entries</abstract>
+	</header>
+
+	<body>
+		<section>
+			<title>Addressbook : Introduction</title>
+            <p>Welcome to the Addressbook sample.</p>
+            <p>Donated by Ross McDonald and Jeremy Quinn from their presentation at <a href="http://wiki.apache.org/cocoon/GT2006Notes">CocoonGT 2006</a>.</p>
+            <p>Please run through the setup section below then give the sample a try <a href="index.html">here</a>.</p>
+        </section>
+        <section>
+            <title>Setup</title>
+            <p>In order for this sample to work, LDAP needs setting up on this machine.</p>
+            <p>You will need to do the following setup in a terminal, using the configuration files in samples/resources in this block.</p>
+            
+            <p>NB. These instructions are only tested on MacOSX 'Tiger' where OpenLDAP is pre-installed as standard</p>
+
+            <p>Copy the provided OpenLDAP config file :<br/>
+                <code>$ cd src/blocks/naming/samples/resources</code><br/>
+                <code>$ sudo cp slapd.conf /etc/openldap/slapd.conf</code>
+            </p>
+            
+            <p>Start OpenLDAP :<br/>
+                <code>$ sudo /usr/libexec/slapd</code>
+            </p>
+
+            <p>Configure the Addressbook directory :<br/>
+                <code>$ sudo ldapadd -x -D "dc=ldap,dc=cocoongt,dc=org" -W -f directory.ldif</code>
+            </p>
+
+            <p>Add some sample data to the Addressbook :<br/>
+                <code>$ sudo ldapadd -x -D "dc=ldap,dc=cocoongt,dc=org" -W -f contact.ldif</code>
+            </p>
+
+            <p>When these operations ask for the LDAP password, enter 'secret'</p>
+		</section>
+	</body>
+</document>
+

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/forms.xsl
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/forms.xsl?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/forms.xsl (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/forms.xsl Sun Dec 17 13:12:23 2006
@@ -0,0 +1 @@
+<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<xsl:stylesheet
  version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">

	<!--
	
		this is a modified copy of 
 the stylesheet "forms-samples-styling.xsl" that comes with CForms
	
	-->



  <!--+ Include styling stylesheets, one for the widgets, the other one for the
      | page. As 'forms-advanced-field-styling.xsl' is a specialization of
      | 'forms-field-styling.xsl' the latter one is imported there. If you don't
      | want advanced styling of widgets, change it here!
      | See xsl:include as composition and xsl:import as extension/inheritance.
      +-->
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-page-styling.xsl"/>
  <xsl:include href="resource://org/apache/cocoon/forms/resources/forms-advanced-field-styling.xsl"/>

	<xsl:param name="resources-uri">resources</xsl:param>

  <xsl:template match="head">
    <head>
      <xsl:apply-templates/>
      <xsl:apply-templates select="." mode="forms-page"/>
      <xsl:apply-templates select="." mode="forms-field"/>
    </head>
  </xsl:template>

  <xsl:template match="body">
    <body>
      <!--+ !!! If
  template with mode 'forms-page' adds text or elements
          |        template with mode 'forms-field' can no longer add attributes!!!
          +-->
      <xsl:apply-templates select="." mode="forms-page"/>
      <xsl:apply-templates select="." mode="forms-field"/>
      <xsl:apply-templates/>
    </body>
  </xsl:template>

	<xsl:template match="forms-help-image">
		<img src="{$resources-uri}/forms/img/help.gif" alt="helppopup"/>
	</xsl:template>

  <xsl:template match="fi:output" mode="label">
    <xsl:param name="id" select="@id"/>
    <label for="{$id}" title="{fi:hint}">
      <xsl:copy-of select="fi:label/node()"/>
    </label>
  </xsl:template>



</xsl:stylesheet>
\ No newline at end of file

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/page2html.xsl
URL: http://svn.apache.org/viewvc/cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/page2html.xsl?view=auto&rev=488048
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/page2html.xsl (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/naming/samples/xslt/page2html.xsl Sun Dec 17 13:12:23 2006
@@ -0,0 +1,107 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+	<xsl:template match="/">
+		<html lang="en">
+			<head>
+				<title><xsl:apply-templates select="document/header/title/node()"/></title>
+				<link rel="stylesheet" type="text/css" href="styles/addressbook.css" />
+				<link rel="schema.DC" href="http://purl.org/dc/elements/1.1/" />
+				<meta name="DC.title" lang="en" content="{/document/header/title}" />
+				<meta name="DC.type" scheme="DCMIType" content="Text" />
+				<meta name="DC.format" scheme="IMT" content="text/html" />
+				<meta name="DC.language" scheme="RFC1766" content="en" />
+				<meta name="DC.coverage" content="CocoonGT 2006" />
+				<meta name="DC.rights" content="© Apache.org" />
+				<meta name="DC.publisher" content="CocoonGT 2006" />
+			</head>
+			<body>
+				<xsl:apply-templates select="/document"/>
+			</body>
+		</html>
+	</xsl:template>
+
+	<xsl:template match="/document">
+		<div id="screen"><xsl:apply-templates select="body"/></div>
+	</xsl:template>
+
+	<xsl:template match="section">
+		<xsl:choose> <!-- stupid test for the hierarchy depth -->
+			<xsl:when test="../../../section">
+				<h3 class="heading3"><xsl:apply-templates select="title/node()"/></h3>
+			</xsl:when>
+			<xsl:when test="../../section">
+				<h2 class="heading2"><xsl:apply-templates select="title/node()"/></h2>
+			</xsl:when>
+			<xsl:when test="../section">
+				<h1 class="heading1"><xsl:apply-templates select="title/node()"/></h1>
+			</xsl:when>
+			<xsl:otherwise>
+				<h1 class="heading1"><xsl:apply-templates select="title/node()"/></h1>
+			</xsl:otherwise>
+		</xsl:choose>
+		<xsl:apply-templates select="*[name()!='title']"/>
+	</xsl:template>
+
+	<xsl:template match="header"/>
+
+	<xsl:template match="title"/>
+
+	<xsl:template match="body">
+		<xsl:apply-templates/>
+	</xsl:template>
+
+	<xsl:template match="link">
+		<a href="{@href}">
+			<xsl:apply-templates/>
+		</a>
+	</xsl:template>
+	
+	<xsl:template match="navigation/link|member-navigation/link">
+		<a href="{@href}">
+			<xsl:choose>
+				<xsl:when test="@title">
+					<xsl:attribute name="title"><xsl:value-of select="@title"/></xsl:attribute>
+				</xsl:when>
+				<xsl:otherwise>
+					<xsl:attribute name="title"><xsl:value-of select="."/></xsl:attribute>
+				</xsl:otherwise>
+			</xsl:choose>
+			<xsl:apply-templates/>
+		</a><br />
+	</xsl:template>
+
+	<xsl:template match="anchor">
+		<a name="{@id}"></a>
+	</xsl:template>
+
+	<xsl:template match="img">
+		<img src="{@src}" alt="{@alt}" />
+	</xsl:template>
+
+	<xsl:template match="content">
+		<xsl:apply-templates/> 
+	</xsl:template>
+
+	<!-- Catches all unrecognised elements as they are -->
+	<xsl:template match="*|@*|node()|text()">
+		<xsl:copy><xsl:apply-templates select="*|@*|node()|text()"/></xsl:copy>
+	</xsl:template>
+
+</xsl:stylesheet>