forrest-svn mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thors...@apache.org
Subject svn commit: r375439 - in /forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher: ./ src/java/org/apache/forrest/dispatcher/ src/java/org/apache/forrest/dispatcher/transformation/
Date Tue, 07 Feb 2006 01:15:48 GMT
Author: thorsten
Date: Mon Feb  6 17:15:46 2006
New Revision: 375439

URL: http://svn.apache.org/viewcvs?rev=375439&view=rev
Log:
Resolved partly FOR-789. I fixed that the path will be matched but this is still not connected
to the properties system FOR-588

Modified:
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
    forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap?rev=375439&r1=375438&r2=375439&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/internal.xmap
Mon Feb  6 17:15:46 2006
@@ -138,6 +138,7 @@
           <map:parameter name="getRequestExstension" value="html" />
         </map:generate>
         <map:transform type="dispatcher">
+          <map:parameter name="request" value="{1}" />
           <map:parameter name="type" value="html" />
           <map:parameter name="hooksTransformer" value="lm://hooks-to-html.xsl" 
             />
@@ -151,6 +152,7 @@
           <map:parameter name="getRequestExstension" value="css" />
         </map:generate>
         <map:transform type="dispatcher">
+          <map:parameter name="request" value="{1}" />
           <map:parameter name="type" value="css" />
         </map:transform>
         <map:transform type="pattern" 
@@ -167,6 +169,7 @@
           <map:parameter name="getRequestExstension" value="xhtml2" />
         </map:generate>
         <map:transform type="dispatcher">
+          <map:parameter name="request" value="{1}" />
           <map:parameter name="type" value="xhtml2" />
         </map:transform>
         <map:serialize type="xml"/>

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java?rev=375439&r1=375438&r2=375439&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/ContractBeanDOMImpl.java
Mon Feb  6 17:15:46 2006
@@ -33,6 +33,7 @@
 
 import org.apache.avalon.framework.service.ServiceManager;
 import org.apache.forrest.dispatcher.lenya.xml.NamespaceHelper;
+import org.apache.forrest.dispatcher.transformation.DispatcherTransformer;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
@@ -251,8 +252,10 @@
                      */
                     // default forrest properties
                     Transformer transformer = cachedXSLT.newTransformer();
+                    String request= (String) parameterHelper.get(DispatcherTransformer.DISPATCHER_REQUEST_ATTRIBUTE);
+                    String propertyURI= "cocoon://"+request+".props";
                     Node defaultVariables = org.apache.forrest.dispatcher.util.SourceUtil
-                            .readDOM("cocoon://test-props", this.manager);
+                            .readDOM(propertyURI, this.manager);
                     transformer.setParameter("defaultVariables",
                             defaultVariables);
                     transformer.setOutputProperty(

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java?rev=375439&r1=375438&r2=375439&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/src/java/org/apache/forrest/dispatcher/transformation/DispatcherTransformer.java
Mon Feb  6 17:15:46 2006
@@ -191,10 +191,14 @@
 
     private SourceResolver m_resolver;
 
+    private String requestId;
+
     public static final String HOOKS_TRANSFORMER_PARAMETER = "hooksTransformer";
 
     public static final String PATH_PARAMETER = "path";
 
+    static public final String DISPATCHER_REQUEST_ATTRIBUTE = "request";
+
     /**
      * Constructor Set the namespace
      */
@@ -280,6 +284,15 @@
 
         this.allowMarkup = Boolean.getBoolean(parameters.getParameter(
                 DISPATCHER_ALLOW_MARKUP, null));
+        this.requestId= parameters.getParameter(
+                DISPATCHER_REQUEST_ATTRIBUTE, null);
+        if (requestId == null) {
+            String error = "dispatcherError:\n"
+                    + "You have to set the \"request\" parameter in the sitemap!";
+            getLogger().error(error);
+            throw new ProcessingException(error);
+        }
+        parameterHelper.put(DISPATCHER_REQUEST_ATTRIBUTE, requestId);
         this.requestedFormat = parameters.getParameter(
                 STRUCTURER_FORMAT_ATTRIBUTE, null);
         if (requestedFormat == null) {

Modified: forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap
URL: http://svn.apache.org/viewcvs/forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap?rev=375439&r1=375438&r2=375439&view=diff
==============================================================================
--- forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap
(original)
+++ forrest/trunk/whiteboard/plugins/org.apache.forrest.plugin.internal.dispatcher/themes.xmap
Mon Feb  6 17:15:46 2006
@@ -94,10 +94,10 @@
   </map:resources>
   <map:pipelines>
     <map:pipeline>
-      <map:match pattern="test-props">
+      <map:match pattern="**.props">
         <map:generate src="foo.xml" />
         <map:transform src="lm://transform.xml.variable.helper">
-          <map:parameter name="path" value="samples/index.html" />
+          <map:parameter name="path" value="{1}" />
         </map:transform>
         <map:serialize type="xml" />
       </map:match>



Mime
View raw message