You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2006/02/20 12:14:18 UTC

svn commit: r379086 - in /cocoon/branches/BRANCH_2_1_X: gump.xml lib/jars.xml lib/optional/dojo-rsrc-20060207.jar src/blocks/ajax/dojo/ src/blocks/ajax/dojo/build.xml src/webapp/samples/common/style/xsl/html/simple-page2html.xsl src/webapp/sitemap.xmap

Author: sylvain
Date: Mon Feb 20 03:14:05 2006
New Revision: 379086

URL: http://svn.apache.org/viewcvs?rev=379086&view=rev
Log:
Migration of Ajax stuff to Dojo, orderable repeater and inline-edit styling

Added:
    cocoon/branches/BRANCH_2_1_X/lib/optional/dojo-rsrc-20060207.jar   (with props)
    cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/
    cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml   (with props)
Modified:
    cocoon/branches/BRANCH_2_1_X/gump.xml
    cocoon/branches/BRANCH_2_1_X/lib/jars.xml
    cocoon/branches/BRANCH_2_1_X/src/webapp/samples/common/style/xsl/html/simple-page2html.xsl
    cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap

Modified: cocoon/branches/BRANCH_2_1_X/gump.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/gump.xml?rev=379086&r1=379085&r2=379086&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/gump.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/gump.xml Mon Feb 20 03:14:05 2006
@@ -1654,6 +1654,9 @@
     </ant>
 
     <depend project="cocoon" inherit="all"/>
+    <depend project="dojo-rsrc"/>
+
+    <library name="dojo-rsrc"/>
 
     <work nested="build/cocoon-@@DATE@@/blocks/forms/ajax"/>
     <work nested="tools/anttasks"/>

Modified: cocoon/branches/BRANCH_2_1_X/lib/jars.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/lib/jars.xml?rev=379086&r1=379085&r2=379086&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/lib/jars.xml (original)
+++ cocoon/branches/BRANCH_2_1_X/lib/jars.xml Mon Feb 20 03:14:05 2006
@@ -1252,4 +1252,14 @@
     <homepage>http://jdbi.codehaus.org/</homepage>
   </file>
 
+  <file>
+    <title>Dojo</title>
+    <description>
+      Dojo Ajax toolkit, packaged as resources in /org/apache/cocoon/dojo/resources
+    </description>
+    <used-by>Ajax block</used-by>
+    <lib>optional/dojo-rsrc-20060207.jar</lib>
+    <homepage>http://dojotoolkit.org/</homepage>
+  </file>
+
 </jars>

Added: cocoon/branches/BRANCH_2_1_X/lib/optional/dojo-rsrc-20060207.jar
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/lib/optional/dojo-rsrc-20060207.jar?rev=379086&view=auto
==============================================================================
Binary file - no diff available.

Propchange: cocoon/branches/BRANCH_2_1_X/lib/optional/dojo-rsrc-20060207.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml?rev=379086&view=auto
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml (added)
+++ cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml Mon Feb 20 03:14:05 2006
@@ -0,0 +1,70 @@
+<!--
+  Copyright 1999-2006 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.
+-->
+<!-- Ant file to build the Dojo jar file.
+     You need to set the "dojo.home" property in a local.build.properties file in the
+     same directory as this file. This property should point to the location where the
+     Dojo sources are available (e.g. dojo.home=/home/foobar/dev/dojotoolkit.org/trunk)
+
+     @version $Id$
+-->
+
+<project name="build-dojo" default="jar">
+
+	<property file="local.build.properties"/>
+	
+    <!-- Set dojo.revision to the date if unspecified -->
+    <target name="check-dojo.revision" unless="dojo.revision">
+		<tstamp>
+	      <format property="dojo.revision" pattern="yyyyMMdd"/>
+		</tstamp>
+	</target>
+
+	<target name="check-dojo.home" unless="dojo.home">
+		<fail>
+Variable "dojo.home" is not set.
+Set it either on the command-line or in your local.build.properties.
+	    </fail>
+    </target>
+
+    <target name="init" depends="check-dojo.home, check-dojo.revision">
+		<echo>dojo.home=${dojo.home}</echo>
+	 	<echo>dojo.revision=${dojo.revision}</echo>
+	</target>
+
+	<target name="jar" depends="init">
+		<ant dir="${dojo.home}/buildscripts" target="release" inheritAll="false">
+			<property name="docless" value="true"/>
+			<property name="release_dir" location="build/org/apache/cocoon/dojo/resources"/>
+			<property name="revision" value="${dojo.revision}"/>
+			<property name="profile" value="widget"/>
+	    </ant>
+	
+	    <delete>
+		  <!-- remove demos, useless files and js sources (they're all packed in dojo.js) -->
+		  <fileset dir="build/org/apache/cocoon/dojo/resources"
+			       includes="CHANGELOG, README, build.txt, dojo.js.uncompressed.js"/>
+		  <fileset dir="build/org/apache/cocoon/dojo/resources/demos"/>
+	      <!--
+	      <fileset dir="build/org/apache/cocoon/dojo/resources/src"
+				   includes="*.js, **/*.js"/>
+	      -->
+		</delete>
+
+	    <jar destfile="dojo-rsrc-${dojo.revision}.jar" basedir="build"/>
+	
+	    <echo>You can now replace the dojo lib in "lib/optional" with dojo-rsrc-${dojo.revision}.jar</echo>
+    </target>
+</project>

Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/branches/BRANCH_2_1_X/src/blocks/ajax/dojo/build.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/samples/common/style/xsl/html/simple-page2html.xsl
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/samples/common/style/xsl/html/simple-page2html.xsl?rev=379086&r1=379085&r2=379086&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/samples/common/style/xsl/html/simple-page2html.xsl (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/samples/common/style/xsl/html/simple-page2html.xsl Mon Feb 20 03:14:05 2006
@@ -31,11 +31,11 @@
        <title><xsl:value-of select="title"/></title>
        <link rel="stylesheet" href="{$contextPath}/styles/main.css" title="Default Style"/>
        <!-- copy local CSS, if any -->
-       <xsl:copy-of select="style"/>
+       <xsl:copy-of select="*[not(name() = 'content')]"/>
      </head>
      <body>
        <xsl:call-template name="resources"/>
-       <xsl:apply-templates/>
+       <xsl:apply-templates select="content"/>
      </body>
    </html>
   </xsl:template>

Modified: cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap?rev=379086&r1=379085&r2=379086&view=diff
==============================================================================
--- cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap (original)
+++ cocoon/branches/BRANCH_2_1_X/src/webapp/sitemap.xmap Mon Feb 20 03:14:05 2006
@@ -566,6 +566,38 @@
     </map:match>
 
     <!--+
+        | Cocoon-provided client-side resources.
+        | Some block's jar files (e.g. Ajax & Forms) include client-side resources
+        | such as JavaScript, CSS and images. The system-level pattern below
+        | fetches these resources, while allowing them to be overridden if needed
+        | in the webapp's "resources" directory.
+        |
+        | Defining this pattern in the root sitemap avoids duplicating it in subsitemaps,
+        | which reduces copy/pasting in application code and allows better client-side
+        | caching by giving each resource a single URL.
+        |
+        | Furthermore, some Cocoon code such as the Forms-provided XSLs assume that
+        | resources are available at that URL.
+        |
+        | The absolute path for these resources is "{request:contextPath}/_cocoon/resources"
+        +-->
+    <map:match pattern="_cocoon/resources/*/**">
+	  <map:select type="resource-exists">
+		<map:when test="resources/{1}/{2}">
+		  <map:read src="resources/{1}/{2}"/>
+		</map:when>
+		<!-- For Cocoon development, read directly from source directories
+                <map:when test="../../src/blocks/{1}/java/org/apache/cocoon/{1}/resources/{2}">
+                  <map:read src="../../src/blocks/{1}/java/org/apache/cocoon/{1}/resources/{2}"/>
+	        </map:when>
+		-->
+		<map:otherwise>
+		  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
+		</map:otherwise>
+	  </map:select>
+	</map:match>
+
+    <!--+
         | The default matching is also capable of matching more than a
         | single request by the use of 'wildcards'. There are two kinds of
         | wildcards: