You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by bd...@apache.org on 2006/06/27 19:22:00 UTC
svn commit: r417531 [1/2] - in
/cocoon/whiteboard/example-apps/bricks-archetype: ./ src/main/webapp/
src/main/webapp/admin/ src/main/webapp/admin/document-editor/
src/main/webapp/admin/document-editor/flow/
src/main/webapp/admin/document-editor/forms/ ...
Author: bdelacretaz
Date: Tue Jun 27 10:21:58 2006
New Revision: 417531
URL: http://svn.apache.org/viewvc?rev=417531&view=rev
Log:
webapp stuff copied from old bricks-cms example, only partially adapted for now
Added:
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml (with props)
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml (with props)
Removed:
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/welcome.xml
Modified:
cocoon/whiteboard/example-apps/bricks-archetype/pom.xml
cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/sitemap.xmap
Modified: cocoon/whiteboard/example-apps/bricks-archetype/pom.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/pom.xml?rev=417531&r1=417530&r2=417531&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/pom.xml (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/pom.xml Tue Jun 27 10:21:58 2006
@@ -31,7 +31,7 @@
<artifactId>cocoon-bricks</artifactId>
<packaging>war</packaging>
- <name>Core Webapp</name>
+ <name>Cocoon Bricks Archetype Prototype</name>
<build>
<plugins>
@@ -67,6 +67,11 @@
<groupId>org.apache.cocoon</groupId>
<artifactId>cocoon-core</artifactId>
<version>2.2.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.cocoon</groupId>
+ <artifactId>cocoon-template-impl</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
</dependency>
</dependencies>
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ homepage of the document editor
+ $Id$
+-->
+
+<page>
+ <metadata>
+ <title>bricks-cms document-editor homepage</title>
+ </metadata>
+
+ <content>
+ <p>
+ Here you can
+ <a href="search">search</a> for existing documents, or
+ <a href="create">create</a> new ones.
+ </p>
+ </content>
+</page>
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/document-editor-homepage.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js Tue Jun 27 10:21:58 2006
@@ -0,0 +1,98 @@
+/*
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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 editor flowscript
+
+cocoon.load("context://bricks-cms/common/component-manager.js");
+cocoon.load("resource://org/apache/cocoon/forms/flow/javascript/Form.js");
+cocoon.load("context://bricks-cms/admin/document-editor/flow/example-text.js");
+
+var DOC_CLASS = Packages.org.apache.cocoon.apps.bricks.cms.data.BricksDocument;
+
+// called by the handleForm to run the document editor form
+function form_editDocument(form) {
+
+ var docId = cocoon.parameters.docId;
+ var formDisplayPipeline = cocoon.parameters.formDisplayURI;
+ var nextURI = cocoon.parameters.nextURI;
+ var objectStore = get_objectStore();
+ var document = null;
+ var createDocument = (docId=="NEW_DOCUMENT");
+
+ if(createDocument) {
+ // create new document
+ document = objectStore.createNew(DOC_CLASS);
+ document.title = "(new document)";
+ document.content = get_exampleText();
+
+ } else {
+ // retrieve document for editing, fail it not found
+ var forEditing = true;
+ document = getDocument(objectStore,docId,forEditing);
+ }
+
+ if(document == null) {
+ throw new java.lang.Exception("BricksDocument having id '" + docId + "' not found");
+ }
+
+ // create form
+ form.createBinding("forms/document-binding.xml");
+ form.load(document);
+
+ // edit form and save data to document object
+ form.showForm(formDisplayPipeline);
+ form.save(document);
+
+ // save document to database
+ objectStore.store(document);
+
+ // if creating, add ID of new document at the end of the URI
+ if(createDocument) {
+ nextURI += document.id;
+ }
+
+ // display modified document, with an external redirect to show its URL
+ cocoon.redirectTo(nextURI,true);
+}
+
+// display document
+function viewDocument() {
+ var docId = cocoon.parameters.docId;
+ var displayURI = cocoon.parameters.displayURI;
+
+ var forEditing = false;
+ var document = getDocument(get_objectStore(),docId,false);
+
+ if(document == null) {
+ throw new java.lang.Exception("BricksDocument having id '" + docId + "' not found");
+ }
+
+ var wikiXMLizable = get_wikiParser().parse(document.content);
+
+ cocoon.sendPage(
+ displayURI,
+ {
+ "document":document,
+ "wikiText":wikiXMLizable
+ }
+ );
+}
+
+// retrieve document by ID
+function getDocument(objectStore,docId,forEditing) {
+ var key = objectStore.getTemplateObject(DOC_CLASS,docId);
+ return objectStore.queryByKey(key,forEditing);
+}
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/document-editor.js
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js Tue Jun 27 10:21:58 2006
@@ -0,0 +1,52 @@
+/*
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+*/
+
+// get example text to use when creating a new document
+function get_exampleText() {
+ var txt = ""
+ + "h1. Textile structured text example\n"
+ + "\n"
+ + "h2. Basics\n"
+ + "\n"
+ + "As in most wiki syntaxes, a blank line separates paragraphs.\n"
+ + "\n"
+ + "This is our second paragraph.\n"
+ + "\n"
+ + "h2. Lists\n"
+ + "\n"
+ + "Lists can also be used, either bulleted:\n"
+ + "* one\n"
+ + "* two\n"
+ + "* two and a half\n"
+ + "* three, last item of the bulleted list\n"
+ + "\n"
+ + "or numbered:\n"
+ + "# Item one\n"
+ + "# Item two\n"
+ + "# Item three\n"
+ + "\n"
+ + "h2. Formatting\n"
+ + "\n"
+ + "Simple formatting like _emphasis_ and *strong* can be used, there are also ??citations and more??.\n"
+ + "\n"
+ + "bq. Blockquotes are also supported.\n"
+ + "\n"
+ + "h2. Links\n"
+ + "\n"
+ + "Links are entered by specifying the link text and URL, like \"textile\":http://textism.com/tools/textile/ or \"Cocoon\":http://cocoon.apache.org .\n"
+ ;
+ return txt;
+}
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/example-text.js
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js Tue Jun 27 10:21:58 2006
@@ -0,0 +1,34 @@
+/*
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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 search flowscript
+
+cocoon.load("context://bricks-cms/common/component-manager.js");
+
+// search documents
+function searchDocuments() {
+ var displayURI = cocoon.parameters.displayURI;
+
+ var objectStore = get_objectStore();
+ var queryParameters = objectStore.createParameters();
+ // TODO here we would set query parameters from our request
+ var resultSet = objectStore.runQuery(queryParameters);
+
+ cocoon.sendPage(
+ displayURI,
+ { "data" : resultSet }
+ );
+}
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/flow/search.js
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ CForms binding used to edit a BricksDocument
+ $Id$
+-->
+
+<fb:context
+ id="form"
+ xmlns:fb="http://apache.org/cocoon/forms/1.0#binding"
+ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+ path="/">
+
+ <!-- map Form widgets to the corresponding fields in the java beans -->
+ <fb:value id="id" path="id" direction="load"/>
+ <fb:value id="title" path="title"/>
+ <fb:value id="content" path="content"/>
+ <fb:value id="created" path="created" direction="load"/>
+ <fb:value id="lastModified" path="lastModified" direction="load"/>
+ </fb:context>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-binding.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,69 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ CForms model used to edit a BricksDocument
+ $Id$
+-->
+
+<fd:form
+ id="form"
+ xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ >
+
+ <fd:widgets>
+
+ <fd:output id="id" readonly="true" required="true">
+ <fd:label>
+ <i18n:text>document-id-label</i18n:text>
+ </fd:label>
+ <fd:datatype base="integer"/>
+ </fd:output>
+
+ <fd:field id="title" required="true">
+ <fd:label>
+ <i18n:text>document-title-label</i18n:text>
+ </fd:label>
+ <fd:datatype base="string"/>
+ </fd:field>
+
+ <fd:field id="content" required="true">
+ <fd:label>
+ <i18n:text>document-content-label</i18n:text>
+ </fd:label>
+ <fd:datatype base="string"/>
+ </fd:field>
+
+ <fd:output id="created">
+ <fd:label>
+ <i18n:text>document-created-label</i18n:text>
+ </fd:label>
+ <fd:datatype base="date"/>
+ </fd:output>
+
+ <fd:output id="lastModified">
+ <fd:label>
+ <i18n:text>document-last-modified-label</i18n:text>
+ </fd:label>
+ <fd:datatype base="date"/>
+ </fd:output>
+
+ </fd:widgets>
+
+</fd:form>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-model.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ CForms template used to edit BricksDocument objects
+ $Id$
+-->
+
+<page
+ xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+ xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ >
+
+ <jx:import uri="resource://org/apache/cocoon/forms/generation/jx-macros.xml"/>
+
+ <metadata>
+ <title>
+ <i18n:text>document-editor-form-title</i18n:text>
+ </title>
+ <menu>
+ <item>
+ <a href="../search">cancel</a>
+ </item>
+ </menu>
+ </metadata>
+
+ <content>
+
+ <ft:form-template action="#{$continuation/id}.continue" method="POST">
+
+ <div id="documentEntryForm">
+
+ <table width="100%">
+ <tr>
+ <td>
+ <span class="fieldName"><i18n:text>document-id-label</i18n:text></span>
+ :
+ <ft:widget id="id"/>
+ <br/>
+ <input type="submit" i18n:attr="value" name="save-button" value="save-button-label"/>
+ </td>
+ <td>
+ <span class="fieldName"><ft:widget-label id="created"/></span>: <ft:widget id="created"/>
+ <br/>
+ <span class="fieldName"><ft:widget-label id="lastModified"/></span>: <ft:widget id="lastModified"/>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <span class="fieldName"><ft:widget-label id="title"/></span>
+ :
+ </td>
+ <td>
+ <ft:widget id="title">
+ <fi:styling size="40" style="width:100%;"/>
+ </ft:widget>
+ </td>
+ </tr>
+
+ <tr>
+ <td>
+ <span class="fieldName"><ft:widget-label id="content"/></span>
+ :
+ </td>
+ <td>
+ <ft:widget id="content">
+ <fi:styling type="textarea" rows="25" cols="60" style="width:100%;"/>
+ </ft:widget>
+ </td>
+ </tr>
+
+ </table>
+ </div>
+ <div class="note">
+ Textile syntax (TODO indicate exactly which constructs are supported)
+ can be used in the content field,
+ see <a target="_new" href="http://textism.com/tools/textile/">http://textism.com/tools/textile/</a>
+ for examples.
+ </div>
+ </ft:form-template>
+ </content>
+
+</page>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/forms/document-template.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap Tue Jun 27 10:21:58 2006
@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="iso-8859-1"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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-editor sitemap for the bricks-cms project
+
+ $Id$
+-->
+<map:sitemap
+ xmlns:map="http://apache.org/cocoon/sitemap/1.0"
+ >
+
+ <map:views>
+ <map:view name="data" from-label="data">
+ <map:serialize type="xml"/>
+ </map:view>
+ </map:views>
+
+ <map:flow language="javascript">
+ <map:script src="flow/document-editor.js"/>
+ <map:script src="flow/search.js"/>
+ </map:flow>
+
+ <map:resources>
+ <!-- reusable pipeline part, for our layout -->
+ <map:resource name="layout">
+ <map:transform src="../xslt/page-to-html.xsl"/>
+ <map:transform type="i18n"/>
+ <map:serialize type="xhtml"/>
+ </map:resource>
+ </map:resources>
+
+ <map:pipelines>
+
+ <map:pipeline>
+ <!-- handle continuations -->
+ <map:match pattern="*.continue">
+ <map:call continuation="{1}"/>
+ </map:match>
+ <map:match pattern="**/*.continue">
+ <map:call continuation="{2}"/>
+ </map:match>
+
+ <!-- page for / -->
+ <map:match pattern="">
+ <map:generate src="document-editor-homepage.xml"/>
+ <map:call resource="layout"/>
+ </map:match>
+
+ <!-- create a document -->
+ <map:match pattern="create">
+ <map:call function="handleForm">
+ <map:parameter name="function" value="form_editDocument"/>
+ <map:parameter name="docId" value="NEW_DOCUMENT"/>
+ <map:parameter name="bindingURI" value="forms/document-binding.xml"/>
+ <map:parameter name="formDisplayURI" value="document-form-display"/>
+ <map:parameter name="nextURI" value="view/"/>
+
+ <!-- TODO after 2.1.7 this parameter will need to be named "definitionURI" -->
+ <map:parameter name="form-definition" value="forms/document-model.xml"/>
+
+ </map:call>
+ </map:match>
+
+ <!-- edit a document -->
+ <map:match pattern="edit/*">
+ <map:call function="handleForm">
+ <map:parameter name="function" value="form_editDocument"/>
+ <map:parameter name="docId" value="{1}"/>
+ <map:parameter name="bindingURI" value="forms/document-binding.xml"/>
+ <map:parameter name="formDisplayURI" value="document-form-display"/>
+ <map:parameter name="nextURI" value="../view/{1}"/>
+
+ <!-- TODO after 2.1.7 this parameter will need to be named "definitionURI" -->
+ <map:parameter name="form-definition" value="forms/document-model.xml"/>
+
+ </map:call>
+ </map:match>
+
+ <!-- view a document -->
+ <map:match pattern="view/*">
+ <map:call function="viewDocument">
+ <map:parameter name="docId" value="{1}"/>
+ <map:parameter name="displayURI" value="document-display"/>
+ </map:call>
+ </map:match>
+
+ <!-- search for documents -->
+ <map:match pattern="search">
+ <map:call function="searchDocuments">
+ <map:parameter name="displayURI" value="search-results-display"/>
+ </map:call>
+ </map:match>
+ </map:pipeline>
+
+ <!-- internal pipelines, for forms and data display -->
+ <map:pipeline internal-only="true">
+ <map:match pattern="*-form-display">
+ <map:generate type="jx" src="forms/{1}-template.xml"/>
+ <map:transform type="i18n"/>
+ <map:transform src="../xslt/page-to-html.xsl"/>
+ <map:transform src="context://bricks-cms/common/forms/form-styling.xsl">
+ <map:parameter name="resources-uri" value="admin-resources"/>
+ </map:transform>
+ <map:transform type="i18n"/>
+ <map:serialize type="xhtml"/>
+ </map:match>
+
+ <!-- generic data display using JXTemplates, with optional XSLT filter -->
+ <map:match pattern="*-display">
+ <!-- dump data using JXTemplates -->
+ <map:generate label="data" type="jx" src="view/{1}.jx.xml"/>
+
+ <!-- if we have an XSLT filter having the appropriate name, apply it -->
+ <map:act type="resource-exists">
+ <map:parameter name="url" value="../xslt/{1}-to-page.xsl"/>
+ <map:transform src="../xslt/{../1}-to-page.xsl"/>
+ </map:act>
+
+ <!-- and use our standard layout -->
+ <map:call resource="layout"/>
+ </map:match>
+
+ </map:pipeline>
+
+ </map:pipelines>
+
+</map:sitemap>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/sitemap.xmap
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ JXTemplate used to display a BricksDocument, converts directly to a <page>
+ $Id$
+-->
+
+<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <metadata>
+ <title>#{document/title}</title>
+ <menu>
+ <item>
+ <a href="../edit/#{document/id}">edit</a>
+ </item>
+ <item>
+ <a href="../search">search</a>
+ </item>
+ </menu>
+ </metadata>
+
+ <content>
+ <page>
+ <div class="content">
+ #{wikiText}
+ </div>
+ <div class="note">
+ created: #{document/created}
+ <br/>
+ last modified:#{document/lastModified}
+ </div>
+ </page>
+ </content>
+</page>
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/document.jx.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ JXTemplate used to dump the results of a query on BricksDocuments in XML
+ $Id$
+-->
+
+<search-results xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <jx:forEach select="#{data}">
+ <document id="#{id}">
+ <title>#{title}</title>
+ <created>#{created}</created>
+ <last-modified>#{lastModified}</last-modified>
+ </document>
+ </jx:forEach>
+</search-results>
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/document-editor/view/search-results.jx.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap Tue Jun 27 10:21:58 2006
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ admin sitemap for the bricks-cms project
+
+ $Id$
+-->
+<map:sitemap
+ xmlns:map="http://apache.org/cocoon/sitemap/1.0"
+ >
+
+ <map:resources>
+ <map:resource name="layout">
+ <map:transform src="xslt/page-to-html.xsl"/>
+ <map:transform type="i18n"/>
+ <map:serialize type="xhtml"/>
+ </map:resource>
+ </map:resources>
+
+ <map:pipelines>
+
+ <map:pipeline>
+ <map:match pattern="">
+ <map:redirect-to uri="homepage"/>
+ </map:match>
+
+ <!-- publish our local homepage -->
+ <map:match pattern="homepage">
+ <map:generate src="static-content/pages/admin-homepage.xml"/>
+ <map:call resource="layout"/>
+ </map:match>
+
+ <!--
+ serve static images, CSS, etc
+ accept any path before admin-resources to make it easier
+ -->
+ <map:match pattern="**/admin-resources/**">
+ <map:read src="static-content/resources/{2}"/>
+ </map:match>
+
+ <!-- mount sub-sitemaps, one level down from this directory -->
+ <map:match pattern="*/**">
+ <map:mount
+ check-reload="yes"
+ src="{1}/"
+ uri-prefix="{1}/"
+ />
+ </map:match>
+
+ </map:pipeline>
+
+ </map:pipelines>
+
+</map:sitemap>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/sitemap.xmap
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml Tue Jun 27 10:21:58 2006
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ homepage of the bricks-cms admin
+ $Id$
+-->
+<page>
+ <metadata>
+ <title>bricks-cms archetype prototype admin homepage</title>
+ </metadata>
+
+ <content>
+ <div class="warning">
+ This is an incomplete port of the Cocoon 2.1.x bricks-cms application,
+ most things do not work yet!
+ </div>
+
+ <h2>What is bricks-cms?</h2>
+ <p>
+ Bricks-cms is NOT a real CMS, it's only an example application meant to
+ demonstrate how to work with database and java components in Cocoon, and how
+ to implement <a href="http://en.wikipedia.org/wiki/CRUD">CRUD</a> applications.
+ </p>
+ <p>
+ It was called "cms" because a content management system is a good use case
+ for Cocoon.
+ </p>
+ <p>
+ But it's no competition for the "real" Cocoon-based CMSes out there - if you're looking
+ for a CMS there are several serious systems based on Cocoon, but this one is only really a toy.
+ </p>
+ <p>
+ The <a href="http://wiki.apache.org/cocoon/BricksCms">BricksCms wiki page</a> contains
+ up-to-date information about this example application.
+ </p>
+
+ <h2>What's available</h2>
+ <p>
+ A few <a href="../test/">tests</a> are available.
+ </p>
+ <p>
+ To access the actual application, run the
+ <a href="document-editor/">document-editor</a>.
+ </p>
+ </content>
+</page>
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/pages/admin-homepage.xml
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css Tue Jun 27 10:21:58 2006
@@ -0,0 +1,95 @@
+/*
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+*/
+
+/** CSS stylesheet for the bricks-cms example application */
+
+body {
+ font-family: Georgia, Verdana, Sans-Serif;
+}
+
+h1 {
+ font-size:140%;
+ border-bottom: solid blue 1px;
+ font-weight:bold;
+}
+
+h2 {
+ font-size:120%;
+ font-weight:bold;
+}
+
+h3 {
+ font-size:120%;
+ font-weight:normal;
+}
+
+.pageTitle {
+ font-size:140%;
+ font-variant: small-caps;
+ text-align: right;
+ border-bottom: solid gray 1px;
+}
+
+.note {
+ font-size:80%;
+ font-style:italic;
+}
+
+#menu {
+ border: solid #CCCCCC;
+ border-width: 0 0 1px 0;
+ text-align: right;
+ font-size: 80%;
+ border-right: solid #CCCCCC 1px;
+}
+
+.menuItem {
+ display: inline;
+ padding: 0 0.4em;
+ border-left: solid #CCCCCC 1px;
+}
+
+td {
+ vertical-align: top;
+}
+
+thead tr
+{
+ font-size: 80%;
+ color: #FFCC00;
+ background-color:#333333;
+ padding: 2px;
+}
+
+.fieldName {
+ font-style: italic;
+}
+
+.evenRow
+{
+ background-color: #FFFFCC;
+}
+
+#footer {
+ border-top: solid #CCCCCC 1px;
+ text-align:right;
+ font-size:80%;
+}
+
+.warning {
+ color:white;
+ background-color:red;
+}
\ No newline at end of file
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/static-content/resources/css/bricks-cms.css
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl Tue Jun 27 10:21:58 2006
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ Convert a <page> document to HTML
+ $Id$
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+ xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+ xmlns:jx="http://apache.org/cocoon/templates/jx/1.0"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+ >
+
+ <xsl:param name="footerText" select="'This is bricks-cms, an example Cocoon application'"/>
+ <xsl:variable name="title" select="page/metadata/title"/>
+
+ <xsl:template match="/">
+ <html>
+ <head>
+ <title>
+ <xsl:value-of select="$title"/>
+ </title>
+ <link rel="stylesheet" type="text/css" href="x/admin-resources/css/bricks-cms.css"/>
+ </head>
+
+ <body>
+ <xsl:apply-templates select="page/metadata/menu"/>
+ <h1 class="pageTitle">
+ <xsl:value-of select="$title"/>
+ </h1>
+ <xsl:apply-templates select="page/content" mode="copy-content"/>
+ <div id="footer">
+ <xsl:value-of select="$footerText"/>
+ </div>
+ </body>
+ </html>
+ </xsl:template>
+
+ <!-- assume content is XHTML, and also copy other namespaces like ft, fi, etc. -->
+ <xsl:template match="*|ft:*|fi:*|i18n:*" mode="copy-content">
+ <xsl:copy>
+ <xsl:copy-of select="@*"/>
+ <xsl:apply-templates mode="copy-content"/>
+ </xsl:copy>
+ </xsl:template>
+
+ <!-- generate the page menu, if any -->
+ <xsl:template match="metadata/menu">
+ <div id="menu">
+ <xsl:apply-templates mode="copy-content"/>
+ </div>
+ </xsl:template>
+
+ <xsl:template match="menu/item" mode="copy-content">
+ <div class="menuItem">
+ <xsl:apply-templates mode="copy-content"/>
+ </div>
+ </xsl:template>
+
+ <!-- parsed wiki text, no special processing for now, but do not copy the element -->
+ <xsl:template match="parsed-text" mode="copy-content">
+ <xsl:apply-templates mode="copy-content"/>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/page-to-html.xsl
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl Tue Jun 27 10:21:58 2006
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!--
+ Convert search results (output by a JXTemplate) to one of our <page>
+ $Id$
+-->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+>
+
+ <xsl:param name="docUrlPrefix" select="'view/'"/>
+
+ <xsl:template match="/">
+ <page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+ <metadata>
+ <title><i18n:text>search-results-page-title</i18n:text></title>
+ <menu>
+ <item>
+ <a href="create">create document</a>
+ </item>
+ <item>
+ <a href="../">menu</a>
+ </item>
+ </menu>
+ </metadata>
+
+ <content>
+ <table width="100%">
+ <thead>
+ <tr>
+ <td>Id</td>
+ <td>Title</td>
+ <td>Created</td>
+ <td>Last Modified</td>
+ </tr>
+ </thead>
+ <tbody>
+ <xsl:apply-templates/>
+ </tbody>
+ </table>
+ </content>
+ </page>
+ </xsl:template>
+
+ <xsl:template match="document">
+ <tr>
+ <xsl:if test="(position() mod 2) = 0">
+ <xsl:attribute name="class">evenRow</xsl:attribute>
+ </xsl:if>
+
+ <td>
+ <a href="{concat($docUrlPrefix,@id)}">
+ <xsl:value-of select="@id"/>
+ </a>
+ </td>
+ <td><xsl:value-of select="title"/></td>
+ <td><xsl:value-of select="created"/></td>
+ <td><xsl:value-of select="last-modified"/></td>
+ </tr>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/admin/xslt/search-results-to-page.xsl
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js Tue Jun 27 10:21:58 2006
@@ -0,0 +1,42 @@
+/*
+ Copyright 2005 The Apache Software Foundation
+
+ Licensed 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.
+*/
+
+// flowscript utilities for accessing the ApplicationComponentManager
+
+var CM_ATTRIBUTE = Packages.org.apache.cocoon.apps.bricks.cms.componentmanager.ComponentManagerInitializer.COMPONENT_MANAGER_ATTRIBUTE;
+
+// get component manager
+function get_cm() {
+ var cm = cocoon.context.getAttribute(CM_ATTRIBUTE);
+ if(cm==null) {
+ throw "Could not get component manager from content attribute '" + CM_ATTRIBUTE + "'";
+ }
+ return cm;
+}
+
+// get the object store via the component manager
+function get_objectStore() {
+ var cm = get_cm();
+ var objectStore = cm.getService(Packages.org.apache.cocoon.apps.bricks.cms.objectstore.ObjectStore);
+ return objectStore;
+}
+
+// get the wiki parser via the component manager
+function get_wikiParser() {
+ var cm = get_cm();
+ var wikiParser = cm.getService(Packages.org.apache.cocoon.apps.bricks.cms.wikiparser.TextParser);
+ return wikiParser;
+}
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/component-manager.js
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl Tue Jun 27 10:21:58 2006
@@ -0,0 +1,59 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!-- CForms styling, copied from the Cocoon source tree -->
+
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+ <!--+ 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="forms-field-styling.xsl"/>
+ <xsl:include href="forms-page-styling.xsl"/>
+
+ <xsl:template match="/">
+ <html>
+ <xsl:apply-templates select="html/*"/>
+ </html>
+ </xsl:template>
+
+ <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:stylesheet>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/form-styling.xsl
------------------------------------------------------------------------------
svn:keywords = Id
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl Tue Jun 27 10:21:58 2006
@@ -0,0 +1,528 @@
+<?xml version="1.0"?>
+<!--
+ Copyright 1999-2005 The Apache Software Foundation
+
+ Licensed 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.
+-->
+
+<!-- CForms styling, copied from the Cocoon source tree -->
+
+<xsl:stylesheet version="1.0"
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"
+ exclude-result-prefixes="fi">
+ <!--+
+ | This stylesheet is designed to be included by 'forms-samples-styling.xsl'.
+ | Version CVS $Id$
+ +-->
+
+ <!-- Location of the resources directory, where JS libs and icons are stored -->
+ <xsl:param name="resources-uri">resources</xsl:param>
+
+ <xsl:template match="head" mode="forms-field">
+ <!-- [olange] deprecated and moved to the various form templates
+ (use style/add-stylesheet and style/add-script instead)
+ <script src="{$resources-uri}/forms-lib.js" type="text/javascript"/>
+ <link rel="stylesheet" type="text/css" href="{$resources-uri}/forms.css"/> -->
+ </xsl:template>
+
+ <xsl:template match="body" mode="forms-field">
+ <xsl:copy-of select="@*"/>
+<!-- <xsl:attribute name="onload">forms_onload(); <xsl:value-of select="@onload"/></xsl:attribute> -->
+ </xsl:template>
+
+ <!--+
+ | Generic fi:field : produce an <input>
+ +-->
+ <xsl:template match="fi:field">
+ <input name="{@id}" id="{@id}" value="{fi:value}" title="{fi:hint}" type="text">
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | Common stuff like fi:validation-message, @required.
+ +-->
+ <xsl:template match="fi:*" mode="common">
+ <!-- validation message -->
+ <xsl:apply-templates select="fi:validation-message"/>
+ <!-- required mark -->
+ <xsl:if test="@required='true'">
+ <span class="forms-field-required"> * </span>
+ </xsl:if>
+ </xsl:template>
+
+ <!--+
+ | Handling the common styling. You may only add attributes to the output
+ | in this template as later processing might add attributes too, for
+ | example @checked or @selected
+ +-->
+ <xsl:template match="fi:*" mode="styling">
+ <xsl:apply-templates select="fi:styling/@*" mode="styling"/>
+
+ <!--+
+ | @listbox-size needs to be handled separately as even if it is not
+ | specified some output (@size) must be generated.
+ +-->
+ <xsl:if test="self::fi:field[fi:selection-list][fi:styling/@list-type = 'listbox'] or
+ self::fi:multivaluefield[not(fi:styling/@list-type = 'checkbox')]">
+ <xsl:variable name="size">
+ <xsl:value-of select="fi:styling/@listbox-size"/>
+ <xsl:if test="not(fi:styling/@listbox-size)">5</xsl:if>
+ </xsl:variable>
+ <xsl:attribute name="size">
+ <xsl:value-of select="$size"/>
+ </xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="fi:styling/@*" mode="styling" priority="-1">
+ <!-- NOTE: lowered priority to accomodate Saxon ambiguous rules conflicts reporting [olange] -->
+ <xsl:copy-of select="."/>
+ </xsl:template>
+
+ <xsl:template match="fi:styling/@submit-on-change" mode="styling">
+ <xsl:if test=". = 'true'">
+ <xsl:attribute name="onchange">forms_submitForm(this)</xsl:attribute>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="fi:styling/@list-type | fi:styling/@list-orientation |
+ fi:styling/@listbox-size | fi:styling/@format | fi:styling/@layout"
+ mode="styling">
+ <!--+
+ | Ignore marker attributes so they don't go into the resuling HTML.
+ +-->
+ </xsl:template>
+
+ <xsl:template match="fi:styling/@type" mode="styling">
+ <!--+
+ | Do we have a duplicate semantic usage of @type?
+ | @type is only a marker for the stylesheet in general, but some of the
+ | types must/should be in the HTML output too.
+ +-->
+ <xsl:variable name="validHTMLTypes"
+ select="'text hidden textarea checkbox radio password image reset submit'"/>
+ <xsl:if test="normalize-space(.) and
+ contains(concat(' ', $validHTMLTypes, ' '), concat(' ', ., ' '))">
+ <xsl:copy-of select="."/>
+ </xsl:if>
+ </xsl:template>
+
+ <!--+
+ |
+ +-->
+ <xsl:template match="fi:validation-message">
+ <a href="#" class="forms-validation-message" onclick="alert('{normalize-space(.)}');return false;"> ! </a>
+ </xsl:template>
+
+ <!--+
+ | Hidden fi:field : produce input with type='hidden'
+ +-->
+ <xsl:template match="fi:field[fi:styling/@type='hidden']" priority="2">
+ <input type="hidden" name="{@id}" id="{@id}" value="{fi:value}">
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ </xsl:template>
+
+ <!--+
+ | fi:field with a selection list and @list-type 'radio' : produce
+ | radio-buttons oriented according to @list-orientation
+ | ("horizontal" or "vertical" - default)
+ +-->
+ <xsl:template match="fi:field[fi:selection-list][fi:styling/@list-type='radio']" priority="2">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="value" select="fi:value"/>
+ <xsl:variable name="vertical" select="string(fi:styling/@list-orientation) != 'horizontal'"/>
+ <xsl:choose>
+ <xsl:when test="$vertical">
+ <table cellpadding="0" cellspacing="0" border="0" title="{fi:hint}">
+ <xsl:for-each select="fi:selection-list/fi:item">
+ <tr>
+ <td>
+ <input type="radio" id="{generate-id()}" name="{$id}" value="{@value}">
+ <xsl:if test="@value = $value">
+ <xsl:attribute name="checked">checked</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ </td>
+ <td>
+ <label for="{generate-id()}"><xsl:copy-of select="fi:label/node()"/></label>
+ </td>
+ <xsl:if test="position() = 1">
+ <td rowspan="{count(../fi:item)}">
+ <xsl:apply-templates select="../.." mode="common"/>
+ </td>
+ </xsl:if>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:when>
+ <xsl:otherwise>
+ <span title="{fi:hint}">
+ <xsl:for-each select="fi:selection-list/fi:item">
+ <input type="radio" id="{generate-id()}" name="{$id}" value="{@value}">
+ <xsl:if test="@value = $value">
+ <xsl:attribute name="checked">checked</xsl:attribute>
+ </xsl:if>
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ <label for="{generate-id()}"><xsl:copy-of select="fi:label/node()"/></label>
+ </xsl:for-each>
+ </span>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--+
+ | fi:field with a selection list (not 'radio' style)
+ | Rendering depends on the attributes of fi:styling :
+ | - if @list-type is "listbox" : produce a list box with @listbox-size visible
+ | items (default 5)
+ | - otherwise, produce a dropdown menu
+ +-->
+ <xsl:template match="fi:field[fi:selection-list]" priority="1">
+ <xsl:variable name="value" select="fi:value"/>
+
+ <!-- dropdown or listbox -->
+ <select title="{fi:hint}" id="{@id}" name="{@id}">
+ <xsl:apply-templates select="." mode="styling"/>
+ <xsl:for-each select="fi:selection-list/fi:item">
+ <option value="{@value}">
+ <xsl:if test="@value = $value">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="fi:label/node()"/>
+ </option>
+ </xsl:for-each>
+ </select>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:field with a selection list and @type 'output'
+ +-->
+ <xsl:template match="fi:field[fi:selection-list][fi:styling/@type='output']" priority="3">
+ <xsl:variable name="value" select="fi:value"/>
+ <xsl:variable name="selected" select="fi:selection-list/fi:item[@value = $value]"/>
+ <xsl:choose>
+ <xsl:when test="$selected/fi:label">
+ <xsl:apply-templates select="$selected/fi:label"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--+
+ | fi:field with @type 'textarea'
+ +-->
+ <xsl:template match="fi:field[fi:styling/@type='textarea']">
+ <textarea id="{@id}" name="{@id}" title="{fi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
+ <!-- remove carriage-returns (occurs on certain versions of IE and doubles linebreaks at each submit) -->
+ <xsl:copy-of select="translate(fi:value/node(), ' ', '')"/>
+ </textarea>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:field with @type 'output' and fi:output are both rendered as text
+ +-->
+ <xsl:template match="fi:output | fi:field[fi:styling/@type='output']" priority="2">
+ <xsl:copy-of select="fi:value/node()"/>
+ </xsl:template>
+
+ <!--+
+ | Labels for form elements.
+ +-->
+ <xsl:template match="fi:*" mode="label">
+ <label for="{@id}" title="{fi:hint}">
+ <xsl:copy-of select="fi:label/node()"/>
+ </label>
+ </xsl:template>
+
+ <!--+
+ | Labels for pure outputs must not contain <label/> as there is no element to point to.
+ +-->
+ <xsl:template match="fi:output | fi:field[fi:styling/@type='output']" mode="label">
+ <xsl:copy-of select="fi:label/node()"/>
+ </xsl:template>
+
+ <!--+
+ | fi:booleanfield : produce a checkbox
+ +-->
+ <xsl:template match="fi:booleanfield">
+ <input id="{@id}" type="checkbox" value="true" name="{@id}" title="{fi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
+ <xsl:if test="fi:value = 'true'">
+ <xsl:attribute name="checked">checked</xsl:attribute>
+ </xsl:if>
+ </input>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:booleanfield with @type 'output' : rendered as text
+ +-->
+ <xsl:template match="fi:booleanfield[fi:styling/@type='output']">
+ <xsl:choose>
+ <xsl:when test="fi:value = 'true'">
+ yes
+ </xsl:when>
+ <xsl:otherwise>
+ no
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
+
+ <!--+
+ | fi:action
+ +-->
+ <xsl:template match="fi:action">
+ <input id="{@id}" type="submit" name="{@id}" title="{fi:hint}">
+ <xsl:attribute name="value"><xsl:value-of select="fi:label/node()"/></xsl:attribute>
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ </xsl:template>
+
+ <!--+
+ | fi:continuation-id : produce a hidden "continuation-id" input
+ +-->
+ <xsl:template match="fi:continuation-id">
+ <xsl:variable name="name">
+ <xsl:value-of select="@name"/>
+ <xsl:if test="not(@name)">continuation-id</xsl:if>
+ </xsl:variable>
+ <input name="{$name}" type="hidden" value="{.}"/>
+ </xsl:template>
+
+ <!--+
+ | fi:multivaluefield : produce a list of checkboxes
+ +-->
+ <xsl:template match="fi:multivaluefield[fi:styling/@list-type='checkbox']">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="values" select="fi:values/fi:value/text()"/>
+
+ <span title="{fi:hint}">
+ <xsl:for-each select="fi:selection-list/fi:item">
+ <xsl:variable name="value" select="@value"/>
+ <input id="{generate-id()}" type="checkbox" value="{@value}" name="{$id}">
+ <xsl:if test="$values[. = $value]">
+ <xsl:attribute name="checked">checked</xsl:attribute>
+ </xsl:if>
+ </input>
+ <label for="{generate-id()}"><xsl:copy-of select="fi:label/node()"/></label>
+ <br/>
+ </xsl:for-each>
+ </span>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:multivaluefield : produce a multiple-selection list
+ +-->
+ <xsl:template match="fi:multivaluefield">
+ <xsl:variable name="id" select="@id"/>
+ <xsl:variable name="values" select="fi:values/fi:value/text()"/>
+
+ <span title="{fi:hint}">
+ <select id="{@id}" name="{$id}" multiple="multiple">
+ <xsl:apply-templates select="." mode="styling"/>
+ <xsl:for-each select="fi:selection-list/fi:item">
+ <xsl:variable name="value" select="@value"/>
+ <option value="{$value}">
+ <xsl:if test="$values[. = $value]">
+ <xsl:attribute name="selected">selected</xsl:attribute>
+ </xsl:if>
+ <xsl:copy-of select="fi:label/node()"/>
+ </option>
+ </xsl:for-each>
+ </select>
+ </span>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:upload
+ +-->
+ <xsl:template match="fi:upload">
+ <xsl:choose>
+ <xsl:when test="fi:value">
+ <!-- Has a value (filename): display it with a change button -->
+ <span title="{fi:hint}">
+ [<xsl:value-of select="fi:value"/>] <input type="submit" id="{@id}" name="{@id}" value="..."/>
+ </span>
+ </xsl:when>
+ <xsl:otherwise>
+ <input type="file" id="{@id}" name="{@id}" title="{fi:hint}" accept="{@mime-types}"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <!--+
+ | fi:repeater
+ +-->
+ <xsl:template match="fi:repeater">
+ <input type="hidden" name="{@id}.size" value="{@size}"/>
+ <table border="1">
+ <tr>
+ <xsl:for-each select="fi:headings/fi:heading">
+ <th><xsl:value-of select="."/></th>
+ </xsl:for-each>
+ </tr>
+ <xsl:apply-templates select="fi:repeater-row"/>
+ </table>
+ </xsl:template>
+
+ <!--+
+ | fi:repeater-row
+ +-->
+ <xsl:template match="fi:repeater-row">
+ <tr>
+ <xsl:for-each select="*">
+ <td>
+ <xsl:apply-templates select="."/>
+ </td>
+ </xsl:for-each>
+ </tr>
+ </xsl:template>
+
+ <!--+
+ | fi:repeater-size
+ +-->
+ <xsl:template match="fi:repeater-size">
+ <input type="hidden" name="{@id}.size" value="{@size}"/>
+ </xsl:template>
+
+ <!--+
+ | fi:form-template|fi:form-generated
+ +-->
+ <xsl:template match="fi:form-template|fi:form-generated">
+ <form>
+ <xsl:copy-of select="@*"/>
+ <xsl:attribute name="onsubmit">forms_onsubmit(); <xsl:value-of select="@onsubmit"/></xsl:attribute>
+ <!-- hidden field to store the submit id -->
+ <div><input type="hidden" name="forms_submit_id"/></div>
+ <xsl:apply-templates/>
+
+ <!-- TODO: consider putting this in the xml stream from the generator? -->
+ <xsl:if test="self::fi:form-generated">
+ <input type="submit"/>
+ </xsl:if>
+ </form>
+ </xsl:template>
+
+ <!--+
+ | fi:form
+ +-->
+ <xsl:template match="fi:form">
+ <table border="1">
+ <xsl:for-each select="fi:widgets/*">
+ <tr>
+ <xsl:choose>
+ <xsl:when test="self::fi:repeater">
+ <td colspan="2">
+ <xsl:apply-templates select="."/>
+ </td>
+ </xsl:when>
+ <xsl:when test="self::fi:booleanfield">
+ <td> </td>
+ <td>
+ <xsl:apply-templates select="."/>
+ <xsl:text> </xsl:text>
+ <xsl:copy-of select="fi:label"/>
+ </td>
+ </xsl:when>
+ <xsl:otherwise>
+ <td>
+ <xsl:copy-of select="fi:label"/>
+ </td>
+ <td>
+ <xsl:apply-templates select="."/>
+ </td>
+ </xsl:otherwise>
+ </xsl:choose>
+ </tr>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
+
+ <xsl:template match="fi:aggregatefield">
+ <input id="{@id}" name="{@id}" value="{fi:value}" title="{fi:hint}">
+ <xsl:apply-templates select="." mode="styling"/>
+ </input>
+ <xsl:apply-templates select="." mode="common"/>
+ </xsl:template>
+
+ <xsl:template match="fi:messages">
+ <xsl:if test="fi:message">
+ <xsl:copy-of select="fi:label/node()"/>:
+ <ul>
+ <xsl:for-each select="fi:message">
+ <li><xsl:apply-templates/></li>
+ </xsl:for-each>
+ </ul>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="fi:validation-errors">
+ <xsl:variable name="header">
+ <xsl:choose>
+ <xsl:when test="header">
+ <xsl:copy-of select="header"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <p class="forms-validation-errors">The following errors have been detected (marked with !):</p>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="footer">
+ <xsl:choose>
+ <xsl:when test="footer">
+ <xsl:copy-of select="footer"/>
+ </xsl:when>
+ <xsl:otherwise>
+ <p class="forms-validation-errors">Please, correct them and re-submit the form.</p>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+ <xsl:variable name="frm" select="ancestor::fi:form-template"/>
+ <xsl:if test="$frm and $frm//fi:validation-message">
+ <xsl:copy-of select="$header"/>
+ <ul>
+ <xsl:for-each select="$frm//fi:validation-message">
+ <li class="forms-validation-error">
+ <xsl:if test="../fi:label">
+ <xsl:value-of select="../fi:label"/><xsl:text>: </xsl:text>
+ </xsl:if>
+ <xsl:value-of select="."/>
+ </li>
+ </xsl:for-each>
+ </ul>
+ <xsl:copy-of select="$footer"/>
+ </xsl:if>
+ </xsl:template>
+
+ <xsl:template match="@*|node()" priority="-1">
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
+
+</xsl:stylesheet>
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-field-styling.xsl
------------------------------------------------------------------------------
svn:keywords = Id