cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject svn commit: r417531 [2/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/ ...
Date Tue, 27 Jun 2006 17:22:00 GMT
Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl
(added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl
Tue Jun 27 10:21:58 2006
@@ -0,0 +1,339 @@
+<?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'.
+      +-->
+  <xsl:template match="head" mode="forms-page">
+    <!--+ 'forms-page-styling.xsl' relies on 'forms-field-styling.xsl' for the
+        | inclusion of the correct JS and CSS files. To fix it, we have to
+        | separate the page specific parts into their own files.
+        +-->
+  </xsl:template>
+
+  <xsl:template match="body" mode="forms-page"/>
+
+  <!--
+    fi:group : default is to enclose items in a div
+  -->
+  <xsl:template match="fi:group">
+    <div title="{fi:hint}">
+      <xsl:copy-of select="@*"/>
+      <xsl:apply-templates mode="group-layout" select="."/>
+    </div>
+  </xsl:template>
+
+  <!--
+    fi:group of type tabs
+  -->
+  <xsl:template match="fi:group[fi:styling/@type='tabs']">
+    <!-- find the currently selected tab.
+         Thoughts still needed here, such as autogenerating a field in the
+         forms transformer to hold this state.
+    -->
+    <xsl:variable name="active">
+      <xsl:variable name="value" select="normalize-space(fi:state/fi:*/fi:value)"/>
+      <xsl:choose>
+        <xsl:when test="$value">
+          <xsl:value-of select="$value"/>
+        </xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <!-- copy the "state-widget" attribute for use in for-each -->
+    <xsl:variable name="state-widget" select="fi:state/fi:*/@id"/>
+    <xsl:variable name="id" select="generate-id()"/>
+
+    <div id="{$id}" title="{fi:hint}">
+      <!-- add an hidden input for the state -->
+      <xsl:if test="$state-widget">
+        <input type="hidden" name="{$state-widget}" value="{$active}"/>
+      </xsl:if>
+      <!-- div containing the tabs -->
+      <div class="forms-tabArea">
+        <xsl:for-each select="fi:items/fi:*">
+          <xsl:variable name="pos" select="position() - 1"/>
+          <span id="{$id}_tab_{$pos}" onclick="forms_showTab('{$id}', {$pos}, {last()},
'{$state-widget}')">
+            <xsl:attribute name="class">
+              <xsl:text>forms-tab</xsl:text>
+              <xsl:if test="$active = $pos"> forms-activeTab</xsl:if>
+            </xsl:attribute>
+            <xsl:copy-of select="fi:label/node()"/>
+            <xsl:if test="fi:items/*//fi:validation-message">
+              <span class="forms-validation-message">&#160;!&#160;</span>
+            </xsl:if>
+          </span>
+        </xsl:for-each>
+      </div>
+      <!-- a div for each of the items -->
+      <xsl:for-each select="fi:items/fi:*">
+        <xsl:variable name="pos" select="position() - 1"/>
+        <div class="forms-tabContent" id="{$id}_items_{$pos}">
+          <xsl:if test="$active != $pos">
+            <xsl:attribute name="style">display:none</xsl:attribute>
+          </xsl:if>
+          <xsl:apply-templates select="."/>
+        </div>
+      </xsl:for-each>
+    </div>
+  </xsl:template>
+
+  <!--
+    fi:group of type choice : a popup is used instead of tabs
+  -->
+  <xsl:template match="fi:group[fi:styling/@type='choice']">
+    <!-- find the currently selected tab.
+         Thoughts still needed here, such as autogenerating a field in the formstransformer
+         to hold this state.
+    -->
+    <xsl:variable name="active">
+      <xsl:variable name="value" select="normalize-space(fi:state/fi:*/fi:value)"/>
+      <xsl:choose>
+        <xsl:when test="$value">
+          <xsl:value-of select="$value"/>
+        </xsl:when>
+        <xsl:otherwise>0</xsl:otherwise>
+      </xsl:choose>
+    </xsl:variable>
+    <!-- copy the "state-widget" attribute for use in for-each -->
+    <xsl:variable name="state-widget" select="fi:state/fi:*/@id"/>
+    <xsl:variable name="id" select="generate-id()"/>
+
+    <fieldset id="{$id}">
+      <legend title="{fi:hint}">
+        <xsl:apply-templates select="fi:label/node()"/>
+        <select name="{$state-widget}" onchange="forms_showTab('{$id}', this.selectedIndex,
{count(fi:items/*)}, '{$state-widget}')">
+          <xsl:for-each select="fi:items/fi:*">
+            <xsl:variable name="pos" select="position() - 1"/>
+            <option>
+              <xsl:attribute name="value">
+                <xsl:choose>
+                  <xsl:when test="fi:value">
+                    <xsl:value-of select="fi:value"/>
+                  </xsl:when>
+                  <xsl:otherwise>
+                    <xsl:value-of select="$pos"/>
+                  </xsl:otherwise>
+                </xsl:choose>
+              </xsl:attribute>
+              <xsl:if test="$active = $pos">
+                <xsl:attribute name="selected">selected</xsl:attribute>
+              </xsl:if>
+              <xsl:copy-of select="fi:label/node()"/>
+            </option>
+          </xsl:for-each>
+        </select>
+        <xsl:if test="fi:items/*//fi:validation-message">
+          <span class="forms-validation-message">&#160;!&#160;</span>
+        </xsl:if>
+      </legend>
+      <!-- a div for each of the items -->
+      <xsl:for-each select="fi:items/fi:*">
+        <xsl:variable name="pos" select="position() - 1"/>
+        <div id="{$id}_items_{$pos}">
+          <xsl:if test="$active != $pos">
+            <xsl:attribute name="style">display:none</xsl:attribute>
+          </xsl:if>
+          <xsl:apply-templates select="."/>
+        </div>
+      </xsl:for-each>
+    </fieldset>
+  </xsl:template>
+
+  <!--
+    fi:group of type fieldset : enclose items in a fieldset frame
+  -->
+  <xsl:template match="fi:group[fi:styling/@type='fieldset']">
+    <fieldset>
+      <xsl:apply-templates select="." mode="styling"/>
+      <legend title="{fi:hint}"><xsl:copy-of select="fi:label/node()"/></legend>
+      <xsl:apply-templates mode="group-layout" select="."/>
+    </fieldset>
+  </xsl:template>
+
+  <!--
+    Group items layout : default is no layout
+  -->
+  <xsl:template match="fi:group" mode="group-layout">
+    <xsl:apply-templates select="fi:items/*"/>
+  </xsl:template>
+
+  <!--
+    Column group items layout
+  -->
+  <xsl:template match="fi:group[fi:styling/@layout='column']" mode="group-layout">
+    <table border="0" summary="{fi:hint}">
+      <tbody>
+        <xsl:apply-templates select="fi:items/*" mode="group-column-content"/>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <!--
+    Default column layout : label above and input below
+  -->
+  <xsl:template match="fi:*" mode="group-column-content">
+    <tr>
+      <td><xsl:apply-templates select="." mode="label"/></td>
+    </tr>
+    <tr>
+      <td><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <xsl:template match="fi:action" mode="group-column-content">
+    <tr>
+      <td><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!--
+    Columns group items layout
+  -->
+  <xsl:template match="fi:group[fi:styling/@layout='columns']" mode="group-layout">
+    <table border="0" summary="{fi:hint}">
+      <tbody>
+        <xsl:apply-templates select="fi:items/*" mode="group-columns-content"/>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <!--
+    Default columns layout : label left and input right
+  -->
+  <xsl:template match="fi:*" mode="group-columns-content">
+    <tr>
+      <td><xsl:apply-templates select="." mode="label"/></td>
+      <td><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!--
+    Row group items layout
+  -->
+  <xsl:template match="fi:group[fi:styling/@layout='row']" mode="group-layout">
+    <table border="0" summary="{fi:hint}">
+      <tbody>
+        <tr>
+          <xsl:apply-templates select="fi:items/*" mode="group-row-content"/>
+        </tr>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <!--
+    Default row layout : label left and input right
+  -->
+  <xsl:template match="fi:*" mode="group-row-content">
+    <td><xsl:apply-templates select="." mode="label"/></td>
+    <td><xsl:apply-templates select="."/></td>
+  </xsl:template>
+
+  <xsl:template match="fi:action" mode="group-row-content">
+    <td><xsl:apply-templates select="."/></td>
+  </xsl:template>
+  <!--
+    Rows group items layout
+  -->
+  <xsl:template match="fi:group[fi:styling/@layout='rows']" mode="group-layout">
+    <table border="0" summary="{fi:hint}">
+      <tbody>
+        <tr>
+          <xsl:apply-templates select="fi:items/*" mode="group-rows-labels"/>
+        </tr>
+        <tr>
+          <xsl:apply-templates select="fi:items/*" mode="group-rows-content"/>
+        </tr>
+      </tbody>
+    </table>
+  </xsl:template>
+
+  <!--
+    Default rows layout : label above and input below
+  -->
+  <xsl:template match="fi:*" mode="group-rows-labels">
+    <td><xsl:apply-templates select="." mode="label"/></td>
+  </xsl:template>
+
+  <xsl:template match="fi:action" mode="group-rows-labels">
+    <td>&#160;</td>
+  </xsl:template>
+
+  <xsl:template match="fi:*" mode="group-rows-content">
+    <td><xsl:apply-templates select="."/></td>
+  </xsl:template>
+
+  <!-- boolean field : checkbox and label on a single line -->
+  <xsl:template match="fi:booleanfield" mode="group-columns-content">
+    <tr>
+      <td colspan="2">
+        <xsl:apply-templates select="."/>
+        <xsl:apply-templates select="." mode="label"/>
+      </td>
+    </tr>
+  </xsl:template>
+
+  <!-- action : on a single line -->
+  <xsl:template match="fi:action" mode="group-columns-content">
+    <tr>
+      <td colspan="2"><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!-- any other element : on a single line -->
+  <xsl:template match="*" mode="group-columns-content">
+    <tr>
+      <td colspan="2"><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!-- double-list multivaluefield : lists under the label -->
+  <xsl:template match="fi:multivaluefield[fi:styling/@list-type='double-listbox']"
+                mode="group-columns-content">
+    <tr>
+      <td colspan="2"><xsl:apply-templates select="." mode="label"/></td>
+    </tr>
+    <tr>
+      <td colspan="2"><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!-- nested group -->
+  <xsl:template match="fi:group" mode="group-columns-content">
+    <tr>
+      <td colspan="2"><xsl:apply-templates select="."/></td>
+    </tr>
+  </xsl:template>
+
+  <!--
+    The same rule exists in forms-fields-styling and forms-page-styling,
+    make sure they have different priorities, saxon complains if not
+    (or refactor, but it ain't really broke for now)
+  -->
+  <xsl:template match="@*|node()" priority="-2">
+    <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-page-styling.xsl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/common/forms/forms-page-styling.xsl
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml
(added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml
Tue Jun 27 10:21:58 2006
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+
+<!--
+   bricks-cms messages, default language.
+-->
+<catalogue>
+  <message key="i18n-transformer-test">i18n test successful!</message>
+  <message key="document-id-label">ID</message>
+  <message key="document-title-label">Title</message>
+  <message key="document-content-label">Content</message>
+  <message key="document-created-label">Date created</message>
+  <message key="document-last-modified-label">Last modified</message>
+  <message key="bricks-cms document-editor homepage">Document editor homepage</message>
+  <message key="save-button-label">Save</message>
+  <message key="search-results-page-title">Search results</message>
+  <message key="document-editor-form-title">Document editor</message>
+</catalogue>
+

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/i18n-messages/bricks-messages.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/sitemap.xmap?rev=417531&r1=417530&r2=417531&view=diff
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/sitemap.xmap (original)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/sitemap.xmap Tue Jun 27
10:21:58 2006
@@ -1,6 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
+<?xml version="1.0" encoding="iso-8859-1"?>
+
 <!--
-  Copyright 2006 The Apache Software Foundation
+  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.
@@ -14,13 +15,58 @@
   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">
+
+<!--
+  Main sitemap for the bricks-cms project
+
+  $Id: sitemap.xmap,v 1.1.1.1 2005/09/26 07:33:32 bdelacretaz Exp $
+-->
+<map:sitemap
+  xmlns:map="http://apache.org/cocoon/sitemap/1.0"
+  >
+
+  <map:components>
+    <map:transformers>
+    
+      <!-- configure the i18n transformer -->
+      <map:transformer
+        name="i18n"
+        src="org.apache.cocoon.transformation.I18nTransformer"
+        logger="bricks-cms.i18n"
+        >
+        <!-- messages are in i18n-messages/exstor-messages.xml -->
+        <catalogues default="bricks-messages">
+          <catalogue
+            id="bricks-messages"
+            name="bricks-messages"
+            location="context://bricks-cms/i18n-messages"
+            />
+        </catalogues>
+
+        <!-- don't cache, to be able to change messages without stopping cocoon -->
+        <cache-at-startup>false</cache-at-startup>
+      </map:transformer>
+    </map:transformers>
+  </map:components>
+  
   <map:pipelines>
+
     <map:pipeline>
       <map:match pattern="">
-        <map:generate src="welcome.xml"/>
-        <map:serialize type="xhtml"/>
+        <map:redirect-to uri="admin/"/>
+      </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>

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js Tue
Jun 27 10:21:58 2006
@@ -0,0 +1,44 @@
+/*
+    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.
+*/
+
+cocoon.load("context://bricks-cms/common/component-manager.js");
+
+// test database connection
+function public_db_connect() {
+    var displayUrl = cocoon.parameters.displayUrl;
+    var title = "Database connection test";
+    var message = "Testing...";
+
+    var registry = get_cm();
+    message += "Registry access ok...";
+
+    var dbConnector = registry.getService(Packages.org.apache.cocoon.apps.bricks.cms.ojb.DbConnectionProvider);
+    message += "DbConnectionProvider access ok...";
+
+    var conn = dbConnector.lookupConnection("UNUSED_PARAMETER");
+    message += "database connection ok...";
+
+    dbConnector.releaseConnection(conn);
+    message += "database connection released...";
+
+    message += "ok.";
+    var comment = "All tests successful";
+
+    cocoon.sendPage(
+        displayUrl,
+        { "title":title, "message":message, "comment":comment }
+    );
+}
\ No newline at end of file

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/db-connect.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js Tue
Jun 27 10:21:58 2006
@@ -0,0 +1,49 @@
+/*
+    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.
+*/
+
+cocoon.load("context://bricks-cms/common/component-manager.js");
+
+// test reading a document via ObjectStore
+function public_get_document() {
+    var displayUrl = cocoon.parameters.displayUrl;
+    var docId = cocoon.parameters.id;
+    var title = "Retrieve BricksDocument having id=" + docId;
+    var message = "Testing...";
+
+    var registry = get_cm();
+    message += "Registry access ok...";
+
+    var objectStore = registry.getService(Packages.org.apache.cocoon.apps.bricks.cms.objectstore.ObjectStore);
+    message += "ObjectStore access ok...";
+
+    var documentClass = Packages.org.apache.cocoon.apps.bricks.cms.data.BricksDocument;
+    var template = objectStore.getTemplateObject(documentClass,docId);
+    message += "template object ok...";
+
+    var document = objectStore.queryByKey(template,false);
+    if(document==null) {
+        throw "BricksDocument having id " + docId + " not found"
+    }
+    message += "BricksDocument having id " + docId + " retrieved, title='" + document.title
+ "', content='" + document.content + "'...";
+
+    message += "ok.";
+    var comment = "All tests successful";
+
+    cocoon.sendPage(
+        displayUrl,
+        { "title":title, "message":message, "comment":comment }
+    );
+}
\ No newline at end of file

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/get-document.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js Tue Jun 27
10:21:58 2006
@@ -0,0 +1,38 @@
+/*
+    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.
+*/
+
+cocoon.load("context://bricks-cms/common/component-manager.js");
+
+// ping the component manager, try accessing a component
+function public_ping() {
+    var displayUrl = cocoon.parameters.displayUrl;
+    var title = "Ping!";
+    var message = "Flowscript is alive";
+
+    var registry = get_cm();
+    var pingComponent = registry.getService(Packages.org.apache.cocoon.apps.bricks.cms.componentmanager.ComponentManagerPing);
+    message = pingComponent.ping();
+
+    var comment =
+        "Above this text you should see a message saying 'Hello from the ComponentManagerPing
component', "
+        + "which shows that access to components managed by Hivemind works."
+    ;
+
+    cocoon.sendPage(
+        displayUrl,
+        { "title":title, "message":message, "comment":comment }
+    );
+}
\ No newline at end of file

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/ping.js
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap (added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap Tue
Jun 27 10:21:58 2006
@@ -0,0 +1,87 @@
+<?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:flow language="javascript">
+    <map:script src="ping.js"/>
+    <map:script src="db-connect.js"/>
+    <map:script src="get-document.js"/>
+  </map:flow>
+
+  <map:resources>
+    <!-- use admin layout for tests -->
+    <map:resource name="layout">
+      <map:transform src="../admin/xslt/page-to-html.xsl"/>
+      <map:transform type="i18n"/>
+      <map:serialize type="xhtml"/>
+    </map:resource>
+  </map:resources>
+
+  <map:pipelines>
+
+    <map:pipeline internal-only="true">
+      <map:match pattern="user-message">
+        <map:generate type="jx" src="user-message.jx.xml"/>
+        <map:call resource="layout"/>
+      </map:match>
+    </map:pipeline>
+
+    <map:pipeline>
+      <map:match pattern="">
+        <map:redirect-to uri="test-homepage"/>
+      </map:match>
+
+      <map:match pattern="flowscript-test/*">
+        <map:call function="public_{1}">
+          <map:parameter name="displayUrl" value="user-message"/>
+        </map:call>
+      </map:match>
+
+      <map:match pattern="flowscript-test/*/id-*">
+        <map:call function="public_{1}">
+          <map:parameter name="displayUrl" value="user-message"/>
+          <map:parameter name="id" value="{2}"/>
+        </map:call>
+      </map:match>
+
+      <!--
+        serve static images, CSS, etc from the admin path
+         accept any path before admin-resources to make it easier
+      -->
+      <map:match pattern="**/admin-resources/**">
+        <map:read src="../admin/static-content/resources/{2}"/>
+      </map:match>
+
+      <!-- generate all other pages in the same way -->
+      <map:match pattern="*">
+        <map:generate type="jx" src="{1}.xml"/>
+        <map:call resource="layout"/>
+      </map:match>
+    </map:pipeline>
+
+  </map:pipelines>
+
+</map:sitemap>

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/sitemap.xmap
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml
(added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml
Tue Jun 27 10:21:58 2006
@@ -0,0 +1,51 @@
+<?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.
+-->
+
+<page
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1"
+>
+  <metadata>
+    <title>bricks-cms test homepage</title>
+  </metadata>
+
+  <content>
+    <ul>
+      <li>
+        <a href="flowscript-test/ping">ping</a> - tests access to a simple Hivemind
component.
+      </li>
+      <li>
+        <a href="flowscript-test/db_connect">db_connect</a> - makes a connection
to the Derby database,
+        via a java component managed by Hivemind.
+      </li>
+      <li>
+        <a href="flowscript-test/get_document/id-1">get_document/id-1</a> - attempts
to
+        retrieve document having ID 1 via OJB.
+        <p class="note">
+          Document 1 is not created automatically, for now you have to create a document
from
+          the admin document-editor page, and use the ID of the created document instead
+          of 1.
+        </p>
+      </li>
+    </ul>
+    <p>
+    	If the i18n transformer is configured correctly you should see "i18n test successful"
in bold below:
+    	<br/>
+    	<b><i18n:text>i18n-transformer-test</i18n:text></b>
+    </p>
+  </content>
+</page>
\ No newline at end of file

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/test-homepage.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Added: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml?rev=417531&view=auto
==============================================================================
--- cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml
(added)
+++ cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml
Tue Jun 27 10:21:58 2006
@@ -0,0 +1,34 @@
+<?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 user message
+-->
+  
+<page xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+  <metadata>
+    <title>bricks-cms message: #{title}</title>
+  </metadata>
+
+  <content>
+    <page>
+      <p>${message}</p>
+      <p><em>${comment}</em></p>
+    </page>
+  </content>
+</page>
\ No newline at end of file

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/example-apps/bricks-archetype/src/main/webapp/test/user-message.jx.xml
------------------------------------------------------------------------------
    svn:keywords = Id



Mime
View raw message