summaryrefslogtreecommitdiffstats
path: root/sandbox/thilina/geronimo_ACE/src/main
diff options
context:
space:
mode:
authorantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-08-13 08:34:03 +0000
committerantelder <antelder@13f79535-47bb-0310-9956-ffa450edef68>2008-08-13 08:34:03 +0000
commit19ad394d57d2c63b250c5f1ed21c444a24b3f883 (patch)
treeff68d9e5f20a246b8fe50510619b199b96054333 /sandbox/thilina/geronimo_ACE/src/main
parent0dc4d7770cc75ffa198794b59edf9444cee51f85 (diff)
TUSCANY-2391: apply standalone_node_modified patch from Thilina to support Standalone nodes can be run in the Geronimo ACE
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@685477 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sandbox/thilina/geronimo_ACE/src/main')
-rw-r--r--sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java21
-rw-r--r--sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml101
-rw-r--r--sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp10
3 files changed, 78 insertions, 54 deletions
diff --git a/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java b/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java
index 219420c000..4808434c2d 100644
--- a/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java
+++ b/sandbox/thilina/geronimo_ACE/src/main/java/org/apache/tuscany/geronimoace/GeronimoACE.java
@@ -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 @@ public class GeronimoACE extends GenericPortlet {
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 @@ public class GeronimoACE extends GenericPortlet {
}
}
if (location != null){
- manageStandaloneNode(location);
+ manageStandaloneNode(location, nodeName, composite);
}
response.setPortletMode(PortletMode.VIEW); // by changing portlet mode, doview methos is called again.
diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml b/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml
index 376fe17d75..bfb6edd2c6 100644
--- a/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml
+++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/WEB-INF/geronimo-web.xml
@@ -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>
diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp
index 6e8ec83af8..120d7583eb 100644
--- a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp
+++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Standalone.jsp
@@ -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>