cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r616941 - in /cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main: java/org/apache/cocoon/micro/it/ resources/COB-INF/ resources/META-INF/cocoon/spring/
Date Wed, 30 Jan 2008 23:14:26 GMT
Author: reinhard
Date: Wed Jan 30 15:14:22 2008
New Revision: 616941

URL: http://svn.apache.org/viewvc?rev=616941&view=rev
Log:
test calling a controller

Added:
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
  (with props)
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
  (with props)
Modified:
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
    cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java?rev=616941&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
Wed Jan 30 15:14:22 2008
@@ -0,0 +1,53 @@
+package org.apache.cocoon.micro.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.
+ */
+import java.util.List;
+
+import org.apache.cocoon.components.flow.Interpreter;
+import org.apache.cocoon.components.flow.WebContinuation;
+import org.apache.cocoon.environment.Redirector;
+
+public class ITController implements Interpreter {
+
+    public void callFunction(String funName, List params, Redirector redirector) throws Exception
{
+        redirector.sendStatus(201);
+    }
+
+    public void forwardTo(String uri, Object bizData, WebContinuation continuation, Redirector
redirector)
+            throws Exception {
+    }
+
+    public void handleContinuation(String continuationId, List params, Redirector redirector)
throws Exception {
+        redirector.sendStatus(202);
+    }
+
+    public String getInterpreterID() {
+        return null;
+    }
+
+    public String getScriptExtension() {
+        return null;
+    }
+
+    public void register(String source) {
+    }
+
+    public void setInterpreterID(String interpreterID) {
+    }
+
+}

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/java/org/apache/cocoon/micro/it/ITController.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html?rev=616941&r1=616940&r2=616941&view=diff
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
(original)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/overview.html
Wed Jan 30 15:14:22 2008
@@ -73,5 +73,10 @@
 		<li><a href="parameter-passing/working">Matching Matcher</a>: Passing
a named parameter from a matcher to the sitemap.</li>
 		<li><a href="parameter-passing/failing">Not-Matching Matcher</a>: Passing
null from a matcher to the sitemap.</li>
 	</ul>
+	<h2>Controller</h2>
+	<ul>
+		<li><a href="controller/invoke">Invoke a controller</a>: Invoke a controller
(the first time). (returns 201)</li>
+		<li><a href="controller/continue">Continue</a>: Continue a controller.
(returns 202)</li>
+	</ul>
   </body>
 </html>

Modified: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap?rev=616941&r1=616940&r2=616941&view=diff
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
(original)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/COB-INF/sitemap.xmap
Wed Jan 30 15:14:22 2008
@@ -20,6 +20,8 @@
   xsi:schemaLocation="http://apache.org/cocoon/sitemap/1.0 http://cocoon.apache.org/schema/sitemap/cocoon-sitemap-1.0.xsd"
   xmlns:map="http://apache.org/cocoon/sitemap/1.0">
 
+  <map:flow language="it-controller"/>
+
   <map:pipelines>
     <!-- ~~~~~~~~~~~~~~~~ map:read ~~~~~~~~~~~~~~~ -->
     <map:pipeline>
@@ -160,6 +162,16 @@
       </map:match>
     </map:pipeline>
 
+    <!-- ~~~~~~~~~~~~~~~~ controller ~~~~~~~~~~~~~~~ -->
+    <map:pipeline>
+      <map:match pattern="controller/invoke">
+        <map:call function="any-function"/>
+      </map:match>
+      <map:match pattern="controller/continue">
+        <map:call continuation="any-continuation"/>
+      </map:match>
+    </map:pipeline>
+
     <!-- ~~~~~~~~~~~~~~~~ redirect ~~~~~~~~~~~~~~~ -->
     <map:pipeline>
       <map:match pattern="redirect/www.orf.at">
@@ -204,7 +216,7 @@
           <map:serialize type="xhtml" status-code="500"/>
         </map:when>
         <map:otherwise>
-          <map:generate src="error-handling/503.xml"/>
+          <map:generate type="exception" src="error-handling/503.xml"/>
           <map:serialize type="xhtml" status-code="503"/>
         </map:otherwise>
       </map:select>

Added: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
URL: http://svn.apache.org/viewvc/cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml?rev=616941&view=auto
==============================================================================
--- cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
(added)
+++ cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
Wed Jan 30 15:14:22 2008
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You 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.
+-->
+<!-- $Id$ -->
+<beans
+  xmlns="http://www.springframework.org/schema/beans"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xmlns:p="http://www.springframework.org/schema/p"
+  xmlns:aop="http://www.springframework.org/schema/aop"
+  xmlns:context="http://www.springframework.org/schema/context"
+  xsi:schemaLocation="
+    http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
+    http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
+    http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd
+  ">
+
+  <!-- The REST controller -->
+  <bean name="org.apache.cocoon.components.flow.Interpreter/it-controller" class="org.apache.cocoon.micro.it.ITController"/>
+
+
+</beans>

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
------------------------------------------------------------------------------
    svn:keywords = Id

Propchange: cocoon/whiteboard/micro/misc/cocoon-micro-it-block/src/main/resources/META-INF/cocoon/spring/cocoon-micro-it-controller.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml



Mime
View raw message