cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lgaw...@apache.org
Subject svn commit: r312973 - /cocoon/trunk/tools/src/blocks-build.xsl
Date Tue, 11 Oct 2005 23:00:30 GMT
Author: lgawron
Date: Tue Oct 11 16:00:10 2005
New Revision: 312973

URL: http://svn.apache.org/viewcvs?rev=312973&view=rev
Log:
support for "compact" blocks.properties:

exclude.all.blocks=true
include.block.template=true
include.block.forms=true

the opposite also works:
include.all.blocks=true
exclude.block.bsf=true
include.block.ajax=false

Modified:
    cocoon/trunk/tools/src/blocks-build.xsl

Modified: cocoon/trunk/tools/src/blocks-build.xsl
URL: http://svn.apache.org/viewcvs/cocoon/trunk/tools/src/blocks-build.xsl?rev=312973&r1=312972&r2=312973&view=diff
==============================================================================
--- cocoon/trunk/tools/src/blocks-build.xsl (original)
+++ cocoon/trunk/tools/src/blocks-build.xsl Tue Oct 11 16:00:10 2005
@@ -72,20 +72,17 @@
       <macrodef name="test-include-block">
         <attribute name="name"/>
         <sequential>
+          <echo message="         exclude.block.@{{name}}: ${{exclude.block.@{{name}}}}"/>
+          <!-- this happens only if user did not explicitly set the property in blocks.properties
-->
           <condition property="include.block.@{{name}}">
-            <not>
-              <istrue value="${{exclude.block.@{{name}}}}"/>
-            </not>
-          </condition>
-          <condition property="internal.exclude.block.@{{name}}">
             <and>
-              <isfalse value="${{include.all.blocks}}"/>
-              <or>
-                <istrue value="${{exclude.all.blocks}}"/>
-                <isfalse value="${{include.block.@{{name}}}}"/>
-              </or>
+              <equals arg1="${{default.block.mode}}" arg2="include"/>
+              <not><istrue value="${{exclude.block.@{{name}}}}"/></not>
             </and>
           </condition>
+          <condition property="internal.exclude.block.@{{name}}">
+            <not><istrue value="${{include.block.@{{name}}}}"/></not>
+          </condition>
         </sequential>
       </macrodef>
 
@@ -456,6 +453,14 @@
     <xsl:variable name="cocoon-blocks" select="project[starts-with(@name, 'cocoon-block-')]"/>
 
     <target name="init">
+      <condition property="default.block.mode" value="include">
+        <istrue value="${{include.all.blocks}}"/>
+      </condition>
+      <condition property="default.block.mode" value="exclude">
+        <istrue value="${{exclude.all.blocks}}"/>
+      </condition>
+      <property name="default.block.mode" value="include"/>
+      <echo message="default mode: ${{default.block.mode}}"/>
       <xsl:for-each select="$cocoon-blocks">
         <xsl:variable name="block-name" select="substring-after(@name,'cocoon-block-')"/>
         <test-include-block name="{$block-name}"/>



Mime
View raw message