You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by an...@apache.org on 2008/08/13 10:34:04 UTC

svn commit: r685477 - in /tuscany/sandbox/thilina/geronimo_ACE: pom.xml src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java src/main/webapp/WEB-INF/geronimo-web.xml src/main/webapp/pages/Standalone.jsp

Author: antelder
Date: Wed Aug 13 01:34:03 2008
New Revision: 685477

URL: http://svn.apache.org/viewvc?rev=685477&view=rev
Log:
TUSCANY-2391: apply standalone_node_modified patch from Thilina to support Standalone nodes can be run in the Geronimo ACE 

Modified:
    tuscany/sandbox/thilina/geronimo_ACE/pom.xml
    tuscany/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java
    tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml
    tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp

Modified: tuscany/sandbox/thilina/geronimo_ACE/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/thilina/geronimo_ACE/pom.xml?rev=685477&r1=685476&r2=685477&view=diff
==============================================================================
--- tuscany/sandbox/thilina/geronimo_ACE/pom.xml (original)
+++ tuscany/sandbox/thilina/geronimo_ACE/pom.xml Wed Aug 13 01:34:03 2008
@@ -26,8 +26,56 @@
     <version>1.0-SNAPSHOT</version>
     <name>geronimo-ace</name>
     <url>http://maven.apache.org</url>
+    <repositories>
+      <repository>
+           <id>apache.snapshots</id>
+           <name>Apache SNAPSHOT Repository</name>
+           <url>http://people.apache.org/repo/m2-snapshot-repository</url>
+           <releases>
+               <enabled>false</enabled>
+           </releases>
+           <snapshots>
+               <enabled>true</enabled>
+           </snapshots>
+       </repository>
+   </repositories>
+
     <dependencies>
         <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-embedded</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-implementation-java-runtime</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-binding-ws-axis2</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-host-tomcat</artifactId>
+            <version>1.4-SNAPSHOT</version>
+            <scope>runtime</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.apache.tuscany.sca</groupId>
+            <artifactId>tuscany-node2-impl</artifactId>
+            <version>1.4-SNAPSHOT</version>
+        </dependency>
+        
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
             <version>3.8.1</version>

Modified: tuscany/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java
URL: http://svn.apache.org/viewvc/tuscany/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java?rev=685477&r1=685476&r2=685477&view=diff
==============================================================================
--- tuscany/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java (original)
+++ tuscany/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java Wed Aug 13 01:34:03 2008
@@ -19,6 +19,11 @@
 
 package org.apache.tuscany.geronimoace;
 
+import org.apache.tuscany.sca.host.embedded.SCADomain;
+import org.apache.tuscany.sca.node.SCAContribution;
+import org.apache.tuscany.sca.node.SCANode2;
+import org.apache.tuscany.sca.node.SCANode2Factory;
+
 import javax.portlet.*;
 import java.io.IOException;
 
@@ -31,14 +36,24 @@
         super.init(config);
     }
 
-    public void manageStandaloneNode(String loc){
-        System.out.println("location :" + loc);
+    public void manageStandaloneNode(String loc, String nodeName, String composite){
+
+        SCANode2Factory factory = org.apache.tuscany.sca.node.SCANode2Factory.newInstance();
+        
+        SCAContribution contribution = new SCAContribution(nodeName, "file:"+loc);
+        SCANode2 node = factory.createSCANode(composite, new SCAContribution[] {contribution});
+        node.start();
+
     }
 
     public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException {
         isHome = true;
         String task = request.getParameter("task");                  // getting request parameters task and domain name
         String location = request.getParameter("contributionLocation");
+        String nodeName = request.getParameter("nodeName");
+        String composite = request.getParameter("composite");
+
+
         if (task != null) {
             if (task.equals("composites")) {       // if the request is for Composites,forwarding to Composites.html
                 viewUrl = "/pages/Composite.jsp";
@@ -57,7 +72,7 @@
             }
         }
         if (location != null){
-            manageStandaloneNode(location);
+            manageStandaloneNode(location, nodeName, composite);
         }
 
         response.setPortletMode(PortletMode.VIEW); // by changing portlet mode, doview methos is called again.

Modified: tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml
URL: http://svn.apache.org/viewvc/tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml?rev=685477&r1=685476&r2=685477&view=diff
==============================================================================
--- tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml (original)
+++ tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml Wed Aug 13 01:34:03 2008
@@ -1,50 +1,51 @@
-<!--
-  ~ 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.
-  -->
-
-
-<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2">
-    <environment>
-        <moduleId>
-            <groupId>org.apache.tuscany.geronimoace</groupId>
-            <artifactId>geronimo-ace</artifactId>
-            <version>1.0-SNAPSHOT</version>
-            <type>war</type>
-        </moduleId>
-
-        <dependencies>
-            <dependency> <!-- Put a dependancy on the hosting portal (pluto) -->
-                <groupId>org.apache.geronimo.plugins</groupId>
-                <artifactId>pluto-support</artifactId>
-            </dependency>
-        </dependencies>
-    </environment>
-
-    <!-- This is where the files are accessed from. (aka - portletContext) -->
-    <context-root>/GeronimoACE</context-root>
-
-    <!-- Start off a ACEGBean, this is the lifecycle for the portlet -->
-    <gbean name="PlutoTest" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
-        <attribute name="pageTitle">Tuscany ACE</attribute>
-        <attribute name="portletContext">/GeronimoACE</attribute>
-        <attribute name="portletList">[GeronimoACE]</attribute>
-        <reference name="PortalContainerServices">
-            <name>PlutoPortalServices</name>
-        </reference>
-    </gbean>
-</web-app>
+<!--
+  ~ 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.
+  -->
+
+
+<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.2">
+    <environment>
+        <moduleId>
+            <groupId>org.apache.tuscany.geronimoace</groupId>
+            <artifactId>geronimo-ace</artifactId>
+            <version>1.0-SNAPSHOT</version>
+            <type>war</type>
+        </moduleId>
+
+        <dependencies>
+            <dependency> <!-- Put a dependancy on the hosting portal (pluto) -->
+                <groupId>org.apache.geronimo.plugins</groupId>
+                <artifactId>pluto-support</artifactId>
+            </dependency>
+
+            </dependencies>
+    </environment>
+
+    <!-- This is where the files are accessed from. (aka - portletContext) -->
+    <context-root>/GeronimoACE</context-root>
+
+    <!-- Start off a ACEGBean, this is the lifecycle for the portlet -->
+    <gbean name="PlutoTest" class="org.apache.geronimo.pluto.AdminConsoleExtensionGBean">
+        <attribute name="pageTitle">Tuscany ACE</attribute>
+        <attribute name="portletContext">/GeronimoACE</attribute>
+        <attribute name="portletList">[GeronimoACE]</attribute>
+        <reference name="PortalContainerServices">
+            <name>PlutoPortalServices</name>
+        </reference>
+    </gbean>
+</web-app>

Modified: tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp
URL: http://svn.apache.org/viewvc/tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp?rev=685477&r1=685476&r2=685477&view=diff
==============================================================================
--- tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp (original)
+++ tuscany/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp Wed Aug 13 01:34:03 2008
@@ -6,9 +6,17 @@
   <form id="form1" name="form1" method="post" action="<portlet:actionURL/>">
           <table>
               <tr>
-                  <td>Location:</td>
+                  <td>Contribution Location :</td>
                   <td><input type="text" name="contributionLocation" size="100"/></td>
               </tr>
+              <tr>
+                  <td>Name of the node :</td>
+                  <td><input type="text" name="nodeName" size="100"/></td>
+              </tr>
+              <tr>
+                  <td>Composite :</td>
+                  <td><input type="text" name="composite" size="100"/></td>
+              </tr>
           </table>
           <input type="submit" name="addStandaloneNode" value="start"/>
    </form>