cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dani...@apache.org
Subject svn commit: r348241 - in /cocoon/trunk/src: java/org/apache/cocoon/components/blocks/BlockManager.java test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap
Date Tue, 22 Nov 2005 20:29:41 GMT
Author: danielf
Date: Tue Nov 22 12:29:33 2005
New Revision: 348241

URL: http://svn.apache.org/viewcvs?rev=348241&view=rev
Log:
Using CocoonServiceManager instead of CoreServiceManager for the exposed components of a block,
otherwise default types for a sitemap component and mime types must be defined within the
sitemap
of the block. Default types does however not work for components imported from other blocks,
not obvious
how to solve this. The current component architecture tests for specific classes for the parent
containers.
The architecture must be improved and we might need some new interfaces.

Also wrote some testing code, the test3 block imports most of its components from test1, which
it extends.

Modified:
    cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockManager.java
    cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap
    cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap

Modified: cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockManager.java
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockManager.java?rev=348241&r1=348240&r2=348241&view=diff
==============================================================================
--- cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockManager.java (original)
+++ cocoon/trunk/src/java/org/apache/cocoon/components/blocks/BlockManager.java Tue Nov 22
12:29:33 2005
@@ -36,6 +36,7 @@
 import org.apache.cocoon.Processor;
 import org.apache.cocoon.components.ContextHelper;
 import org.apache.cocoon.components.LifecycleHelper;
+import org.apache.cocoon.components.container.CocoonServiceManager;
 import org.apache.cocoon.components.container.ComponentContext;
 import org.apache.cocoon.core.container.CoreServiceManager;
 import org.apache.cocoon.environment.Environment;
@@ -104,7 +105,7 @@
             DefaultConfiguration componentConf =
                 new DefaultConfiguration("components", confLocation);
             componentConf.addAll(this.blockWiring.getComponentConfiguration());
-            this.serviceManager = new CoreServiceManager(sourceResolverSM);
+            this.serviceManager = new CocoonServiceManager(sourceResolverSM);
             LifecycleHelper.setupComponent(this.serviceManager,
                     this.getLogger(),
                     newContext,

Modified: cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap?rev=348241&r1=348240&r2=348241&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap
(original)
+++ cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test1/block-sitemap.xmap
Tue Nov 22 12:29:33 2005
@@ -23,13 +23,6 @@
     <!--map:classpath>
       <class-dir src="COB-INF/classes"/>
     </map:classpath-->
-    <map:generators default="file"/>
-    <map:transformers default="xslt"/>
-    <map:serializers default="xml">
-      <map:serializer mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
-    </map:serializers>
-    <map:matchers default="wildcard"/>
-    <map:pipes default="noncaching"/>
   </map:components>
 
   <map:pipelines>

Modified: cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap
URL: http://svn.apache.org/viewcvs/cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap?rev=348241&r1=348240&r2=348241&view=diff
==============================================================================
--- cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap
(original)
+++ cocoon/trunk/src/test/org/apache/cocoon/test/components/blocks/test3/block-sitemap.xmap
Tue Nov 22 12:29:33 2005
@@ -20,23 +20,10 @@
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
 
   <map:components>
-
-    <source-factories>
-      <component-instance class="org.apache.cocoon.components.source.impl.BlockSourceFactory"
name="block"/>
-    </source-factories>
-
     <input-modules>
       <component-instance name="block-property"  class="org.apache.cocoon.components.modules.input.BlockPropertyModule"/>
     </input-modules>
 
-    <map:generators default="file">
-      <map:generator name="file" src="org.apache.cocoon.generation.FileGenerator"/>
-    </map:generators>
-
-    <map:transformers default="xslt">
-      <map:transformer name="xslt" src="org.apache.cocoon.transformation.TraxTransformer"/>
-    </map:transformers>
-
     <map:serializers default="xml">
       <map:serializer mime-type="text/xml" name="xml" src="org.apache.cocoon.serialization.XMLSerializer"/>
     </map:serializers>
@@ -44,33 +31,24 @@
     <map:readers default="resource">
       <map:reader name="resource" src="org.apache.cocoon.reading.ResourceReader"/>
     </map:readers>
-
-    <map:matchers default="wildcard">
-      <map:matcher name="wildcard" src="org.apache.cocoon.matching.WildcardURIMatcher"/>
-    </map:matchers>
-
-    <map:pipes default="noncaching">
-      <map:pipe name="noncaching" src="org.apache.cocoon.components.pipeline.impl.NonCachingProcessingPipeline">
-      </map:pipe>
-    </map:pipes>
   </map:components>
 
   <map:pipelines>
-    <map:pipeline>
+    <map:pipeline type="noncaching">
 
-      <map:match pattern="test">
-        <map:generate src="test.xml"/>
+      <map:match type="wildcard" pattern="test">
+        <map:generate type="file" src="test.xml"/>
         <map:serialize/>
       </map:match>
 
-      <map:match pattern="test4">
-        <map:generate src="block:super:/test"/>
+      <map:match type="wildcard" pattern="test4">
+        <map:generate type="file" src="block:super:/test"/>
         <map:serialize/>
       </map:match>
 
-      <map:match pattern="prop">
-        <map:generate src="test.xml"/>
-        <map:transform src="block-properties.xsl">
+      <map:match type="wildcard" pattern="prop">
+        <map:generate type="file" src="test.xml"/>
+        <map:transform type="xslt" src="block-properties.xsl">
           <map:parameter name="foo" value="{block-property:foo}"/>
           <map:parameter name="bar" value="{block-property:bar}"/>
           <map:parameter name="baz" value="{block-property:baz}"/>
@@ -78,7 +56,7 @@
         <map:serialize/>
       </map:match>
 
-      <map:match pattern="**">
+      <map:match type="wildcard" pattern="**">
         <map:read src="block:super:/{1}"/>
       </map:match>
 



Mime
View raw message