diff options
author | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-03 06:47:39 +0000 |
---|---|---|
committer | antelder <antelder@13f79535-47bb-0310-9956-ffa450edef68> | 2008-08-03 06:47:39 +0000 |
commit | 75936da5fc97e5dc242465ee6d76f260c96fa994 (patch) | |
tree | 858e7afe7c123603c11f25dfd2a9e695a26ec785 /sandbox/thilina/geronimo_ACE/src/main | |
parent | b4815bb289ada5717bdd07640bbdba574e9c9bba (diff) |
TUSCANY-2391, apply lates patch from Thilina Buddhika
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@682109 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
6 files changed, 1329 insertions, 364 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 3eb5b82ed3..8905bf7152 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 @@ -1,78 +1,78 @@ -/* - * 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. - */ - -package org.apache.tuscany.geronimoace; - -import javax.portlet.*; -import java.io.IOException; - -public class GeronimoACE extends GenericPortlet { - private String viewUrl = "/pages/Home.jsp"; // viewUrl is set to the home page by default - boolean isHome = true; // used for navigating back to the home page. - - - public void init(PortletConfig config) throws PortletException { - super.init(config); - } - - 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 domain = request.getParameter("domainName"); - if (task != null) { - if (task.equals("composites")) { // if the request is for Composites,forwarding to Composites.html - viewUrl = "/pages/Composite.html"; - } - if (task.equals("workspace")) { // if the request is for Contributions,forwarding to workspace.html - viewUrl = "/pages/Workspace.html"; - } - if (task.equals("cloud")) { // if the request is for Clouds,forwarding to Cloud.html - viewUrl = "/pages/Cloud.html"; - } - if (task.equals("files")) { // iif the request is for Files,forwarding to Files.html - viewUrl = "/pages/Files.html"; - } - } - - response.setPortletMode(PortletMode.VIEW); // by changing portlet mode, doview methos is called again. - - - } - - public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException { - // Set the response to read HTML - response.setContentType("text/html;charset=UTF-8"); - - if (isHome) { - // dispatching to the appropriate page - PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(viewUrl); - dispatcher.include(request, response); - isHome = false; - } else { - // dispatching to the home page. - PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/pages/Home.jsp"); - dispatcher.include(request, response); - isHome = true; - } - } - -} - - - +/*
+ * 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.
+ */
+
+package org.apache.tuscany.geronimoace;
+
+import javax.portlet.*;
+import java.io.IOException;
+
+public class GeronimoACE extends GenericPortlet {
+ private String viewUrl = "/pages/Home.jsp"; // viewUrl is set to the home page by default
+ boolean isHome = true; // used for navigating back to the home page.
+
+
+ public void init(PortletConfig config) throws PortletException {
+ super.init(config);
+ }
+
+ 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 domain = request.getParameter("domainName");
+ if (task != null) {
+ if (task.equals("composites")) { // if the request is for Composites,forwarding to Composites.html
+ viewUrl = "/pages/Composite.jsp";
+ }
+ if (task.equals("workspace")) { // if the request is for Contributions,forwarding to workspace.html
+ viewUrl = "/pages/Workspace.jsp";
+ }
+ if (task.equals("cloud")) { // if the request is for Clouds,forwarding to Cloud.html
+ viewUrl = "/pages/Cloud.jsp";
+ }
+ if (task.equals("files")) { // iif the request is for Files,forwarding to Files.html
+ viewUrl = "/pages/Files.jsp";
+ }
+ }
+
+ response.setPortletMode(PortletMode.VIEW); // by changing portlet mode, doview methos is called again.
+
+
+ }
+
+ public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
+ // Set the response to read HTML
+ response.setContentType("text/html;charset=UTF-8");
+
+ if (isHome) {
+ // dispatching to the appropriate page
+ PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher(viewUrl);
+ dispatcher.include(request, response);
+ isHome = false;
+ } else {
+ // dispatching to the home page.
+ PortletRequestDispatcher dispatcher = getPortletContext().getRequestDispatcher("/pages/Home.jsp");
+ dispatcher.include(request, response);
+ isHome = true;
+ }
+ }
+
+}
+
+
+
diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Cloud.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Cloud.jsp new file mode 100644 index 0000000000..c264528092 --- /dev/null +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Cloud.jsp @@ -0,0 +1,384 @@ +<%--
+ Created by IntelliJ IDEA.
+ User: thilinamb
+ Date: Jul 30, 2008
+ Time: 3:13:19 PM
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="header.jsp" %>
+<html>
+<head><title>SCA Domain - Cloud</title>
+
+<script type="text/javascript" src="cloud.js"></script>
+<script type="text/javascript" src="utils.js"></script>
+
+<script language="JavaScript">
+
+//@Reference
+var cloudComposite = new Reference("cloudComposite");
+
+//@Reference
+var domainComposite = new Reference("domainComposite");
+
+//@Reference
+var processCollection = new Reference("processCollection");
+
+function getNodes() {
+ cloudComposite.get("", getNodesResponse);
+}
+
+function contributionURI(id) {
+ var i = id.indexOf(';');
+ return id.substring(10, i);
+}
+
+function compositeName(id) {
+ var i = id.indexOf(';');
+ return id.substring(i + 1);
+}
+
+function compositeLocalName(id) {
+ name = compositeName(id);
+ var i = name.indexOf(';');
+ return name.substring(i + 1);
+}
+
+var nodeNames;
+
+function getNodesResponse(feed) {
+ nodeNames = new Array();
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var composites = "";
+ composites += '<table width="100%">';
+ composites += '<tr><th>Node</th><th>Status</th><th>Composite</th>' +
+ '<th>Contribution</th><th>Node Config</th></tr>';
+
+ for (var i = 0; i < entries.length; i++) {
+ var nodeId = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var links = entries[i].getElementsByTagName("link");
+ var nodeLink = undefined;
+ var compositeLink = undefined;
+ var compositeId = "composite:undefined;undefined;undefined";
+ var uri = '<span style="color: red">unknown</span>';
+ var qname = undefined;
+ for (var l = 0; l < links.length; l++) {
+ var a = links[l].getAttribute('rel');
+ if (a == undefined) {
+ nodeLink = links[l].getAttribute('href');
+ } else if (a == 'related') {
+ compositeLink = links[l].getAttribute('href');
+ var c = compositeLink.indexOf('composite:');
+ compositeId = compositeLink.substring(c);
+ uri = contributionURI(compositeId);
+ qname = compositeName(compositeId);
+ }
+ }
+
+ var nodeName = compositeLocalName(nodeId);
+ nodeNames[i] = nodeName;
+
+ var content = "";
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ }
+
+ composites += '<tr>'
+ if (content.indexOf('<span id="problem"') != -1) {
+ composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
+ '<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
+ composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
+ composites += '<td>' + content + '</td>';
+ composites += '<td>' + uri + '</td>';
+ } else {
+ composites += '<td><input name="composites" type="checkbox" value="' + nodeId + '">' +
+ '<a href=\"' + nodeLink + '\">' + nodeName + '</a></td>';
+ composites += '<td><span id="status_' + nodeName + '">unknown</span></td>';
+ composites += '<td><a href=\"' + compositeLink + '\">' + qname + '</a></td>';
+ composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
+ }
+ composites += '<td><a href="/node-config/' + nodeName + '"><img src="icons/feed-icon.png" border="0"></a></td>';
+ composites += '</tr>';
+ }
+ composites += '</table>';
+ document.getElementById("composites").innerHTML = composites;
+
+ processCollection.get("", getProcessesResponse);
+ }
+}
+
+function getProcessesResponse(feed) {
+ if (feed != null) {
+ var nodeStatus = new Array();
+
+ var entries = feed.getElementsByTagName("entry");
+ for (var i = 0; i < entries.length; i++) {
+ var nodeName = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ nodeStatus[nodeName] = 'started';
+ }
+
+ for (var i = 0; i < nodeNames.length; i++) {
+ var element = document.getElementById('status_' + nodeNames[i]);
+ var nodeName = nodeNames[i];
+ if (nodeStatus[nodeName] == null) {
+ element.innerHTML = '<span>stopped</span>';
+ } else {
+ element.innerHTML = '<span><a style="color: green" href="/processes/?node=' + nodeName + '">started</a></span>';
+ }
+ }
+ }
+}
+
+function deleteNode() {
+ var composites = array(document.cloudCompositeForm.composites);
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ var id = composites[i].value;
+ cloudComposite.del(id, deleteNodeResponse);
+ }
+ }
+}
+
+function deleteNodeResponse() {
+ getNodes();
+}
+
+function addNode() {
+ var nodeName = document.newNodeForm.nodeName.value;
+ var nodeURI = document.newNodeForm.nodeURI.value;
+ var compositeNamespace = document.newNodeForm.compositeNamespace.value;
+ var compositeName = document.newNodeForm.compositeName.value;
+ var contributionURI = document.newNodeForm.contributionURI.value;
+ var id = 'composite:' +
+ 'http://tuscany.apache.org/cloud' + ';' +
+ 'http://tuscany.apache.org/cloud' + ';' +
+ nodeName;
+
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom">\n' +
+ '<id>' + id + '</id>\n' +
+ '<content type="text/xml">\n' +
+ '<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"\n' +
+ ' xmlns:t="http://tuscany.apache.org/xmlns/sca/1.0"\n' +
+ ' targetNamespace="http://tuscany.apache.org/cloud"\n' +
+ ' xmlns:c="' + compositeNamespace + '"\n' +
+ ' name="' + nodeName + '">\n' +
+ '\n' +
+ ' <component name="' + nodeName + '">\n' +
+ ' <t:implementation.node uri="' + contributionURI + '" composite="c:' + compositeName + '"/>\n' +
+ ' <service name="Node">\n' +
+ ' <binding.ws uri="' + nodeURI + '"/>\n' +
+ ' <t:binding.http uri="' + nodeURI + '"/>\n' +
+ ' <t:binding.jsonrpc uri="' + nodeURI + '"/>\n' +
+ ' <t:binding.atom uri="' + nodeURI + '"/>\n' +
+ ' </service>\n' +
+ ' </component>\n' +
+ '</composite>' +
+ '</content>' +
+ '</entry>';
+ cloudComposite.post(entry, addNodeResponse);
+}
+
+function addNodeResponse() {
+ document.newNodeForm.nodeName.value = "";
+ document.newNodeForm.nodeURI.value = "";
+ document.newNodeForm.compositeNamespace.value = "";
+ document.newNodeForm.compositeName.value = "";
+ document.newNodeForm.contributionURI.value = "";
+ getNodes();
+}
+
+function startNode() {
+ var composites = array(document.cloudCompositeForm.composites);
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ var id = nodeNames[i];
+
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ '<id>' + id + '</id>' +
+ '</entry>';
+ processCollection.post(entry, startNodeResponse);
+ }
+ }
+}
+
+function startNodeResponse() {
+ processCollection.get("", getProcessesResponse);
+
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ composites[i].checked = false;
+ }
+ }
+}
+
+function stopNode() {
+ var composites = array(document.cloudCompositeForm.composites);
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ var id = nodeNames[i];
+ processCollection.del(id, stopNodeResponse);
+ }
+ }
+}
+
+function stopNodeResponse() {
+ processCollection.get("", getProcessesResponse);
+
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ composites[i].checked = false;
+ }
+ }
+}
+
+var deployedComposites = new Array();
+
+function getComposites() {
+ domainComposite.get("", getCompositesResponse);
+}
+
+function getCompositesResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ for (var i = 0; i < entries.length; i++) {
+ var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ deployedComposites[id] = id;
+ }
+ }
+}
+
+function suggestCompositeNamespaces() {
+ var namespaces = new Array();
+ for (var uri in deployedComposites) {
+ var qname = compositeName(uri);
+ var ns = qname.substring(0, qname.indexOf(';'));
+ namespaces[ns] = ns;
+ }
+ return array(namespaces);
+}
+
+function suggestCompositeNames() {
+ var inputns = document.newNodeForm.compositeNamespace.value;
+ var names = new Array();
+ for (var uri in deployedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if (ns == inputns || inputns == "") {
+ names[name] = name;
+ }
+ }
+ return array(names);
+}
+
+function suggestContributionURIs() {
+ var inputns = document.newNodeForm.compositeNamespace.value;
+ var inputname = document.newNodeForm.compositeName.value;
+ var uris = new Array();
+ for (var uri in deployedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
+ var curi = contributionURI(uri);
+ uris[curi] = curi;
+ }
+ }
+ return array(uris);
+}
+
+function init() {
+ toolbar();
+ getNodes();
+ getComposites();
+ suggest(document.newNodeForm.compositeNamespace, suggestCompositeNamespaces);
+ suggest(document.newNodeForm.compositeName, suggestCompositeNames);
+ suggest(document.newNodeForm.contributionURI, suggestContributionURIs);
+}
+
+</script>
+
+<link rel="stylesheet" type="text/css" href="/pages/manager.css">
+</head>
+<body onload="init()">
+<div id="toolbar"></div>
+
+<div id="cloudComposite">
+ <br>
+ <span class=hd1>
+ SCA Domain<br><br>
+ <b>Cloud</b>
+ </span>
+ <br><br>
+ Here is the list of SCA nodes configured in your SCA domain cloud.
+ <br><br>
+
+ <form name="cloudCompositeForm">
+ <div id="composites">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <th>Node</th>
+ <th>Status</th>
+ <th>Composite</th>
+ <th>Contribution</th>
+ <th>Node Config</th>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <br/>
+ <input type="button" value="Start" onclick="startNode()"/>
+ <input type="button" value="Stop" onclick="stopNode()"/>
+ <input type="button" value="Delete" onclick="deleteNode()"/>
+ </form>
+
+ <br><br>
+
+ <form name="newNodeForm">
+ <table width="100%">
+ <tr>
+ <th>Add a Node</th>
+ </tr>
+ <tr>
+ <td>Add a node to the cloud. The node will run the SCA components declared in the specified composite.
+ </td>
+ </tr>
+ </table>
+ <br>
+ <table>
+ <tr>
+ <td>Node name:</td>
+ <td><input type="text" name="nodeName" size="50"/></td>
+ <td>e.g. YourNode</td>
+ </tr>
+ <tr>
+ <td>Node URI:</td>
+ <td><input type="text" name="nodeURI" size="50"/></td>
+ <td>e.g. http://yourhost:8080</td>
+ </tr>
+ <tr>
+ <td>Composite namespace:</td>
+ <td><input type="text" name="compositeNamespace" size="50"/></td>
+ <td>e.g. http://your/namespace</td>
+ </tr>
+ <tr>
+ <td>Composite name:</td>
+ <td><input type="text" name="compositeName" size="50"/></td>
+ <td>e.g. yourcomposite</td>
+ </tr>
+ <tr>
+ <td>Contribution URI:</td>
+ <td><input type="text" name="contributionURI" size="50"/></td>
+ <td>e.g. yourcontrib, http://yourcontrib</td>
+ </tr>
+ </table>
+ <input type="button" onClick="addNode()" value="Add"/>
+ </form>
+
+</div>
+</body>
+</html>
\ No newline at end of file diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.html b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.html index f616f61bd6..164ea2e6b4 100644 --- a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.html +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.html @@ -1,286 +1,291 @@ -<!-- - * 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. ---> -<html> -<head> -<title>SCA Domain - Domain Composite</title> - -<script type="text/javascript" src="composite.js"></script> -<script type="text/javascript" src="utils.js"></script> - -<script language="JavaScript"> - -//@Reference -var domainComposite = new Reference("domainComposite"); - -//@Reference -var workspace = new Reference("workspace"); - -function getComposites() { - domainComposite.get("", getCompositesResponse); -} - -function contributionURI(id) { - var i = id.indexOf(';'); - return id.substring(10, i); -} - -function compositeName(id) { - var i = id.indexOf(';'); - return id.substring(i + 1); -} - -function getCompositesResponse(feed) { - if (feed != null) { - var entries = feed.getElementsByTagName("entry"); - var composites = ""; - composites += '<table width="100%">'; - composites += '<tr><th>Composite</th>' + - '<th>Contribution</th>' + - '<th>Components</th>' + - '</tr>'; - //'<th>Composite Configuration</th>' + - - for (var i = 0; i < entries.length; i++) { - var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue; - var link = entries[i].getElementsByTagName("link")[0].getAttribute("href"); - var uri = contributionURI(id); - var qname = compositeName(id); - - var content = ""; - if (entries[i].getElementsByTagName("content")[0].firstChild != null) { - content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue; - } - var components = ''; - var bs = content.indexOf('<span id="components">'); - if (bs != -1) { - var es = content.indexOf('</span>', bs); - components = content.substring(bs, es + 7); - } else { - bs = content.indexOf('<span id="problem"'); - if (bs != -1) { - var es = content.indexOf('</span>', bs); - components = content.substring(bs, es + 7); - } - } - - composites += '<tr>' - composites += '<td><input name="composites" type="checkbox" value="' + id + '">'; - composites += '<a href=\"' + link + '\">' + qname + '</a></td>'; - composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>'; - composites += '<td class=tdw>' + components + '</td>'; - //composites += '<td><a href="/composite-config/?composite=' + id + '"><img src="icons/feed-icon.png" border="0"></a></td>'; - composites += '</tr>'; - } - composites += '</table>'; - document.getElementById("composites").innerHTML = composites; - } -} - -function deleteComposite() { - var composites = array(document.domainCompositeForm.composites); - for (var i = 0; i < composites.length; i++) { - if (composites[i].checked) { - var id = composites[i].value; - domainComposite.del(id, deleteCompositeResponse); - } - } -} - -function deleteCompositeResponse() { - getComposites(); -} - -function addComposite() { - var id = 'composite:' + - document.newCompositeForm.contributionURI.value + ';' + - document.newCompositeForm.compositeNamespace.value + ';' + - document.newCompositeForm.compositeName.value; - var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' + - '<title>' + id + '</title>' + - '<id>' + id + '</id>' + - '</entry>'; - domainComposite.post(entry, addCompositeResponse); -} - -function addCompositeResponse() { - document.newCompositeForm.compositeNamespace.value = ""; - document.newCompositeForm.compositeName.value = ""; - document.newCompositeForm.contributionURI.value = ""; - getComposites(); -} - -var contributedComposites = new Array(); - -function getContributions() { - workspace.get("", getContributionsResponse); -} - -function getContributionsResponse(feed) { - if (feed != null) { - contributedComposites = new Array(); - var entries = feed.getElementsByTagName("entry"); - for (var i = 0; i < entries.length; i++) { - if (entries[i].getElementsByTagName("content")[0].firstChild != null) { - var content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue; - var bs = content.indexOf('<span id="deployables">'); - if (bs != -1) { - var es = content.indexOf('</span>', bs); - content = content.substring(bs, es + 7); - for (; ;) { - var bc = content.indexOf('composite:'); - if (bc == -1) { - break; - } - var ec = content.indexOf('">', bc); - if (ec == -1) { - break; - } - var uri = content.substring(bc, ec); - contributedComposites[uri] = uri; - content = content.substring(ec + 1); - } - } - } - } - } -} - -function suggestCompositeNamespaces() { - var namespaces = new Array(); - for (var uri in contributedComposites) { - var qname = compositeName(uri); - var ns = qname.substring(0, qname.indexOf(';')); - namespaces[ns] = ns; - } - return array(namespaces); -} - -function suggestCompositeNames() { - var inputns = document.newCompositeForm.compositeNamespace.value; - var names = new Array(); - for (var uri in contributedComposites) { - var qname = compositeName(uri); - var sc = qname.indexOf(';'); - var ns = qname.substring(0, sc); - var name = qname.substring(sc + 1); - if (ns == inputns || inputns == "") { - names[name] = name; - } - } - return array(names); -} - -function suggestContributionURIs() { - var inputns = document.newCompositeForm.compositeNamespace.value; - var inputname = document.newCompositeForm.compositeName.value; - var uris = new Array(); - for (var uri in contributedComposites) { - var qname = compositeName(uri); - var sc = qname.indexOf(';'); - var ns = qname.substring(0, sc); - var name = qname.substring(sc + 1); - if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) { - var curi = contributionURI(uri); - uris[curi] = curi; - } - } - return array(uris); -} - -function init() { - toolbar(); - getComposites(); - getContributions(); - suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces); - suggest(document.newCompositeForm.compositeName, suggestCompositeNames); - suggest(document.newCompositeForm.contributionURI, suggestContributionURIs); -} - -</script> - -<link rel="stylesheet" type="text/css" href="manager.css"> -</head> - -<body onload="init()"> -<div id="toolbar"></div> - -<div id="domainComposite"> - <br> - <span class=hd1> - SCA Domain<br><br> - <b>Domain Composite</b> - </span> - <br><br> - Here is the list of SCA composites currently included as top-level composites in your SCA domain. - - <br><br> - - - <form name="domainCompositeForm"> - <form name="domainCompositeForm"> - <div id="composites"> - <table width="100%"> - <tbody> - <tr> - <th>Composite</th> - <th>Contribution</th> - <th>Components</th> - </tr> - </tbody> - </table> - </div> - <br/> - <input type="button" value="Delete" onclick="deleteComposite()"/> - </form> - - <br><br> - - <form name="newCompositeForm"> - <table width="100%"> - <tr> - <th>Add Composite</th> - </tr> - <tr> - <td>Add an SCA composite describing your SCA service components.</td> - </tr> - </table> - <br> - <table> - <tr> - <td>Composite namespace:</td> - <td><input type="text" name="compositeNamespace" size="50"/></td> - <td>e.g. http://your/namespace</td> - </tr> - <tr> - <td>Composite name:</td> - <td><input type="text" name="compositeName" size="50"/></td> - <td>e.g. yourcomposite</td> - </tr> - <tr> - <td>Contribution URI:</td> - <td><input type="text" name="contributionURI" size="50"/></td> - <td>e.g. yourcontrib, http://yourcontrib</td> - </tr> - </table> - <input type="button" onClick="addComposite()" value="Add"/> - </form> - -</div> -</body> -</html> +<!--
+ * 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.
+-->
+<html>
+<head>
+<title>SCA Domain - Domain Composite</title>
+
+<script type="text/javascript" src="composite.js"></script>
+<script type="text/javascript" src="utils.js"></script>
+
+<script language="JavaScript">
+
+//@Reference
+var domainComposite = new Reference("domainComposite");
+
+//@Reference
+var workspace = new Reference("workspace");
+
+function getComposites() {
+ domainComposite.get("", getCompositesResponse);
+}
+
+function contributionURI(id) {
+ var i = id.indexOf(';');
+ return id.substring(10, i);
+}
+
+function compositeName(id) {
+ var i = id.indexOf(';');
+ return id.substring(i + 1);
+}
+
+function getCompositesResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var composites = "";
+ composites += '<table width="100%">';
+ composites += '<tr><th>Composite</th>' +
+ '<th>Contribution</th>' +
+ '<th>Components</th>' +
+ '</tr>';
+ //'<th>Composite Configuration</th>' +
+
+ for (var i = 0; i < entries.length; i++) {
+ var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var link = entries[i].getElementsByTagName("link")[0].getAttribute("href");
+ var uri = contributionURI(id);
+ var qname = compositeName(id);
+
+ var content = "";
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ }
+ var components = '';
+ var bs = content.indexOf('<span id="components">'); http://localhost:8080/console/portal//Tuscany ACE/__pm0x3GeronimoACE0x2GeronimoACE!353877598|0_view
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ components = content.substring(bs, es + 7);
+ } else {
+ bs = content.indexOf('<span id="problem"');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ components = content.substring(bs, es + 7);
+ }
+ }
+
+ composites += '<tr>'
+ composites += '<td><input name="composites" type="checkbox" value="' + id + '">';
+ composites += '<a href=\"' + link + '\">' + qname + '</a></td>';
+ composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
+ composites += '<td class=tdw>' + components + '</td>';
+ //composites += '<td><a href="/composite-config/?composite=' + id + '"><img src="icons/feed-icon.png" border="0"></a></td>';
+ composites += '</tr>';
+ }
+ composites += '</table>';
+ document.getElementById("composites").innerHTML = composites;
+ }
+}
+
+function deleteComposite() {
+ Console.Out.WriteLine("This will generate an exception.");
+ var composites = array(document.domainCompositeForm.composites);
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ var id = composites[i].value;
+ domainComposite.del(id, deleteCompositeResponse);
+ }
+ }
+}
+
+function deleteCompositeResponse() {
+
+ getComposites();
+}
+
+function addComposite() {
+ var id = 'composite:' +
+ document.newCompositeForm.contributionURI.value + ';' +
+ document.newCompositeForm.compositeNamespace.value + ';' +
+ document.newCompositeForm.compositeName.value;
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ '<title>' + id + '</title>' +
+ '<id>' + id + '</id>' +
+ '</entry>';
+ domainComposite.post(entry, addCompositeResponse);
+}
+
+function addCompositeResponse() {
+ document.newCompositeForm.compositeNamespace.value = "";
+ document.newCompositeForm.compositeName.value = "";
+ document.newCompositeForm.contributionURI.value = "";
+ getComposites();
+}
+
+var contributedComposites = new Array();
+
+function getContributions() {
+ workspace.get("", getContributionsResponse);
+}
+
+function getContributionsResponse(feed) {
+ if (feed != null) {
+ contributedComposites = new Array();
+ var entries = feed.getElementsByTagName("entry");
+ for (var i = 0; i < entries.length; i++) {
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ var content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ var bs = content.indexOf('<span id="deployables">');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ content = content.substring(bs, es + 7);
+ for (; ;) {
+ var bc = content.indexOf('composite:');
+ if (bc == -1) {
+ break;
+ }
+ var ec = content.indexOf('">', bc);
+ if (ec == -1) {
+ break;
+ }
+ var uri = content.substring(bc, ec);
+ contributedComposites[uri] = uri;
+ content = content.substring(ec + 1);
+ }
+ }
+ }
+ }
+ }
+}
+
+function suggestCompositeNamespaces() {
+ var namespaces = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var ns = qname.substring(0, qname.indexOf(';'));
+ namespaces[ns] = ns;
+ }
+ return array(namespaces);
+}
+
+function suggestCompositeNames() {
+ var inputns = document.newCompositeForm.compositeNamespace.value;
+ var names = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if (ns == inputns || inputns == "") {
+ names[name] = name;
+ }
+ }
+ return array(names);
+}
+
+function suggestContributionURIs() {
+ var inputns = document.newCompositeForm.compositeNamespace.value;
+ var inputname = document.newCompositeForm.compositeName.value;
+ var uris = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
+ var curi = contributionURI(uri);
+ uris[curi] = curi;
+ }
+ }
+ return array(uris);
+}
+ function echo(){
+
+ }
+
+function init() {
+ toolbar();
+ getComposites();
+ getContributions();
+ suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
+ suggest(document.newCompositeForm.compositeName, suggestCompositeNames);
+ suggest(document.newCompositeForm.contributionURI, suggestContributionURIs);
+}
+
+</script>
+
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body onload="init()">
+<div id="toolbar"></div>
+
+<div id="domainComposite">
+ <br>
+ <span class=hd1>
+ SCA Domain<br><br>
+ <b>Domain Composite</b>
+ </span>
+ <br><br>
+ Here is the list of SCA composites currently included as top-level composites in your SCA domain.
+
+ <br><br>
+
+
+ <form name="domainCompositeForm">
+ <form name="domainCompositeForm">
+ <div id="composites">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <th>Composite</th>
+ <th>Contribution</th>
+ <th>Components</th>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <br/>
+ <input type="button" value="Delete" onclick="deleteComposite()"/>
+ </form>
+
+ <br><br>
+
+ <form name="newCompositeForm">
+ <table width="100%">
+ <tr>
+ <th>Add Composite</th>
+ </tr>
+ <tr>
+ <td>Add an SCA composite describing your SCA service components.</td>
+ </tr>
+ </table>
+ <br>
+ <table>
+ <tr>
+ <td>Composite namespace:</td>
+ <td><input type="text" name="compositeNamespace" size="50"/></td>
+ <td>e.g. http://your/namespace</td>
+ </tr>
+ <tr>
+ <td>Composite name:</td>
+ <td><input type="text" name="compositeName" size="50"/></td>
+ <td>e.g. yourcomposite</td>
+ </tr>
+ <tr>
+ <td>Contribution URI:</td>
+ <td><input type="text" name="contributionURI" size="50"/></td>
+ <td>e.g. yourcontrib, http://yourcontrib</td>
+ </tr>
+ </table>
+ <input type="button" onClick="addComposite()" value="Add"/>
+ </form>
+
+</div>
+</body>
+</html>
diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.jsp new file mode 100644 index 0000000000..8dcc0e005c --- /dev/null +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Composite.jsp @@ -0,0 +1,282 @@ +<%--
+ Created by IntelliJ IDEA.
+ User: thilinamb
+ Date: Jul 25, 2008
+ Time: 5:52:31 PM
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="header.jsp" %>
+<html>
+<head>
+<title>SCA Domain - Domain Composite</title>
+
+<script type="text/javascript" src="composite.js"></script>
+<script type="text/javascript" src="utils.js"></script>
+
+<script language="JavaScript">
+
+//@Reference
+var domainComposite = new Reference("domainComposite");
+
+//@Reference
+var workspace = new Reference("workspace");
+
+function getComposites() {
+ domainComposite.get("", getCompositesResponse);
+}
+
+function contributionURI(id) {
+ var i = id.indexOf(';');
+ return id.substring(10, i);
+}
+
+function compositeName(id) {
+ var i = id.indexOf(';');
+ return id.substring(i + 1);
+}
+
+function getCompositesResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var composites = "";
+ composites += '<table width="100%">';
+ composites += '<tr><th>Composite</th>' +
+ '<th>Contribution</th>' +
+ '<th>Components</th>' +
+ '</tr>';
+ //'<th>Composite Configuration</th>' +
+
+ for (var i = 0; i < entries.length; i++) {
+ var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var link = entries[i].getElementsByTagName("link")[0].getAttribute("href");
+ var uri = contributionURI(id);
+ var qname = compositeName(id);
+
+ var content = "";
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ }
+ var components = '';
+ var bs = content.indexOf('<span id="components">');
+ http://localhost:8080/console/portal//Tuscany ACE/__pm0x3GeronimoACE0x2GeronimoACE!353877598|0_view
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ components = content.substring(bs, es + 7);
+ } else {
+ bs = content.indexOf('<span id="problem"');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ components = content.substring(bs, es + 7);
+ }
+ }
+
+ composites += '<tr>'
+ composites += '<td><input name="composites" type="checkbox" value="' + id + '">';
+ composites += '<a href=\"' + link + '\">' + qname + '</a></td>';
+ composites += '<td><a href="/contribution/' + uri + '">' + uri + '</a></td>';
+ composites += '<td class=tdw>' + components + '</td>';
+ //composites += '<td><a href="/composite-config/?composite=' + id + '"><img src="icons/feed-icon.png" border="0"></a></td>';
+ composites += '</tr>';
+ }
+ composites += '</table>';
+ document.getElementById("composites").innerHTML = composites;
+ }
+}
+
+function deleteComposite() {
+ Console.Out.WriteLine("Testing was Successfull !!!");
+ var composites = array(document.domainCompositeForm.composites);
+ for (var i = 0; i < composites.length; i++) {
+ if (composites[i].checked) {
+ var id = composites[i].value;
+ domainComposite.del(id, deleteCompositeResponse);
+ }
+ }
+}
+
+function deleteCompositeResponse() {
+ getComposites();
+}
+
+function addComposite() {
+ var id = 'composite:' +
+ document.newCompositeForm.contributionURI.value + ';' +
+ document.newCompositeForm.compositeNamespace.value + ';' +
+ document.newCompositeForm.compositeName.value;
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ '<title>' + id + '</title>' +
+ '<id>' + id + '</id>' +
+ '</entry>';
+ domainComposite.post(entry, addCompositeResponse);
+}
+
+function addCompositeResponse() {
+ document.newCompositeForm.compositeNamespace.value = "";
+ document.newCompositeForm.compositeName.value = "";
+ document.newCompositeForm.contributionURI.value = "";
+ getComposites();
+}
+
+var contributedComposites = new Array();
+
+function getContributions() {
+ workspace.get("", getContributionsResponse);
+}
+
+function getContributionsResponse(feed) {
+ if (feed != null) {
+ contributedComposites = new Array();
+ var entries = feed.getElementsByTagName("entry");
+ for (var i = 0; i < entries.length; i++) {
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ var content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ var bs = content.indexOf('<span id="deployables">');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ content = content.substring(bs, es + 7);
+ for (; ;) {
+ var bc = content.indexOf('composite:');
+ if (bc == -1) {
+ break;
+ }
+ var ec = content.indexOf('">', bc);
+ if (ec == -1) {
+ break;
+ }
+ var uri = content.substring(bc, ec);
+ contributedComposites[uri] = uri;
+ content = content.substring(ec + 1);
+ }
+ }
+ }
+ }
+ }
+}
+
+function suggestCompositeNamespaces() {
+ var namespaces = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var ns = qname.substring(0, qname.indexOf(';'));
+ namespaces[ns] = ns;
+ }
+ return array(namespaces);
+}
+
+function suggestCompositeNames() {
+ var inputns = document.newCompositeForm.compositeNamespace.value;
+ var names = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if (ns == inputns || inputns == "") {
+ names[name] = name;
+ }
+ }
+ return array(names);
+}
+
+function suggestContributionURIs() {
+ var inputns = document.newCompositeForm.compositeNamespace.value;
+ var inputname = document.newCompositeForm.compositeName.value;
+ var uris = new Array();
+ for (var uri in contributedComposites) {
+ var qname = compositeName(uri);
+ var sc = qname.indexOf(';');
+ var ns = qname.substring(0, sc);
+ var name = qname.substring(sc + 1);
+ if ((ns == inputns || inputns == "") && (name == inputname || inputname == "")) {
+ var curi = contributionURI(uri);
+ uris[curi] = curi;
+ }
+ }
+ return array(uris);
+}
+function echo() {
+ return "hello";
+}
+
+function init() {
+ toolbar();
+ getComposites();
+ getContributions();
+ suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
+ suggest(document.newCompositeForm.compositeName, suggestCompositeNames);
+ suggest(document.newCompositeForm.contributionURI, suggestContributionURIs);
+}
+
+</script>
+
+<link rel="stylesheet" type="text/css" href="manager.css">
+</head>
+
+<body onload="init()">
+<div id="toolbar"></div>
+
+<div id="domainComposite">
+ <br>
+ <span class=hd1>
+ SCA Domain<br><br>
+ <b>Domain Composite</b>
+ </span>
+ <br><br>
+ Here is the list of SCA composites currently included as top-level composites in your SCA domain.
+
+ <br><br>
+
+
+ <form name="domainCompositeForm" action="<portlet:actionURL/>" method="post">
+ <form name="domainCompositeForm">
+ <div id="composites">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <th>Composite</th>
+ <th>Contribution</th>
+ <th>Components</th>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <br/>
+ <input type="button" value="Delete" onclick="deleteComposite()"/>
+ </form>
+
+ <br><br>
+
+ <form name="newCompositeForm">
+ <table width="100%">
+ <tr>
+ <th>Add Composite</th>
+ </tr>
+ <tr>
+ <td>Add an SCA composite describing your SCA service components.</td>
+ </tr>
+ </table>
+ <br>
+ <table>
+ <tr>
+ <td>Composite namespace:</td>
+ <td><input type="text" name="compositeNamespace" size="50"/></td>
+ <td>e.g. http://your/namespace</td>
+ </tr>
+ <tr>
+ <td>Composite name:</td>
+ <td><input type="text" name="compositeName" size="50"/></td>
+ <td>e.g. yourcomposite</td>
+ </tr>
+ <tr>
+ <td>Contribution URI:</td>
+ <td><input type="text" name="contributionURI" size="50"/></td>
+ <td>e.g. yourcontrib, http://yourcontrib</td>
+ </tr>
+ </table>
+ <input type="button" onClick="addComposite()" value="Add"/>
+ </form>
+
+</div>
+</body>
+</html>
diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Files.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Files.jsp new file mode 100644 index 0000000000..0b5e76c203 --- /dev/null +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Files.jsp @@ -0,0 +1,120 @@ +<%--
+ Created by IntelliJ IDEA.
+ User: thilinamb
+ Date: Jul 30, 2008
+ Time: 3:18:21 PM
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="header.jsp" %>
+<html>
+<head>
+<head>
+ <title>SCA Domain - Contribution File Server</title>
+
+ <script type="text/javascript" src="files.js"></script>
+ <script type="text/javascript" src="utils.js"></script>
+
+ <script language="JavaScript">
+
+ //@Reference
+ var files = new Reference("files");
+
+ function getFiles() {
+ files.get("", getFilesResponse);
+ }
+
+ function getFilesResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var list = '<table width="100%"><tr><th>Files</th></tr>';
+ for (var i = 0; i < entries.length; i++) {
+ var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
+ list += '<tr><td><input name="files" type="checkbox" value="' + id + '">' +
+ '<a href=\"' + location + '\">' + id + '</a></td></tr>';
+ }
+ list += "</table>";
+ document.getElementById("files").innerHTML = list;
+ }
+ }
+
+ function deleteFile() {
+ var list = array(document.filesForm.files);
+ for (var i = 0; i < list.length; i++) {
+ if (list[i].checked) {
+ var id = list[i].value;
+ files.del(id, deleteFileResponse);
+ }
+ }
+ }
+
+ function deleteFileResponse() {
+ getFiles();
+ }
+
+ function uploadFile() {
+ document.uploadFileForm.submit();
+ }
+
+ function init() {
+ toolbar();
+ getFiles();
+ }
+
+ </script>
+
+ <link rel="stylesheet" type="text/css" href="/pages/manager.css">
+</head>
+<body onload="init()">
+<div id="toolbar"></div>
+
+<div id="fileServer">
+ <br>
+ <span class=hd1>
+ SCA Domain<br><br>
+ <b>File Server</b>
+ </span>
+ <br><br>
+ This is a simple ATOM-based file server useful to share files if you don't have an FTP, SVN or Maven repository.
+ <br><br>
+
+ <form name="filesForm">
+ <div id="files">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <th>Files</th>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <br/>
+ <input type="button" value="Delete" onclick="deleteFile()"/>
+ </form>
+
+ <br><br>
+
+ <form method="post" name="uploadFileForm" enctype='multipart/form-data' action='/files'>
+ <table width="100%">
+ <tr>
+ <th>Upload File</th>
+ </tr>
+ <tr>
+ <td>Upload a file to the server.</td>
+ </tr>
+ </table>
+ <br>
+ <table border="0">
+ <tr>
+ <td>File:</td>
+ <td><input type="file" name="file" size="50"/></td>
+ </tr>
+ </table>
+ <br/>
+ <input type="button" onClick="uploadFile()" value="Upload"/>
+ </form>
+
+</div>
+</body>
+</html>
\ No newline at end of file diff --git a/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Workspace.jsp b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Workspace.jsp new file mode 100644 index 0000000000..c2e3a84246 --- /dev/null +++ b/sandbox/thilina/geronimo_ACE/src/main/webapp/pages/Workspace.jsp @@ -0,0 +1,174 @@ +<%--
+ Created by IntelliJ IDEA.
+ User: thilinamb
+ Date: Jul 30, 2008
+ Time: 3:20:23 PM
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+<%@ include file="header.jsp" %>
+<html>
+<head>
+<title>SCA Domain - Contributions</title>
+
+<script type="text/javascript" src="workspace.js"></script>
+<script type="text/javascript" src="utils.js"></script>
+
+<script language="JavaScript">
+
+ //@Reference
+ var workspace = new Reference("workspace");
+
+ function getContributions() {
+ workspace.get("", getContributionsResponse);
+ }
+
+ function getContributionsResponse(feed) {
+ if (feed != null) {
+ var entries = feed.getElementsByTagName("entry");
+ var contributions = "";
+ contributions += '<table width="100%">';
+ contributions += '<tr><th>Contribution</th><th>Dependencies</td><th>Deployable Composites</th></tr>';
+ for (var i = 0; i < entries.length; i++) {
+ var id = entries[i].getElementsByTagName("id")[0].firstChild.nodeValue;
+ var location = entries[i].getElementsByTagName("link")[0].getAttribute("href");
+ var content = '';
+ if (entries[i].getElementsByTagName("content")[0].firstChild != null) {
+ content = entries[i].getElementsByTagName("content")[0].firstChild.nodeValue;
+ }
+
+ contributions += '<tr>';
+ contributions += '<td><input name="contributions" type="checkbox" value="' + id + '">' +
+ '<a href=\"' + location + '\">' + id + '</a></td>';
+
+ var dependencies = '';
+ var bs = content.indexOf('<span id="dependencies">');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ dependencies = content.substring(bs, es + 7);
+ }
+
+ var deployables = '';
+ var bs = content.indexOf('<span id="deployables">');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ deployables = content.substring(bs, es + 7);
+ }
+
+ var problems = "";
+ var bs = content.indexOf('<span id="problems" ');
+ if (bs != -1) {
+ var es = content.indexOf('</span>', bs);
+ if (dependencies.length != 0) {
+ problems = '<br>';
+ }
+ problems += content.substring(bs, es + 7);
+ }
+
+ contributions += '<td class=tdw>' + dependencies + problems + ' </td>';
+ contributions += '<td class=tdw>' + deployables + '</td>';
+ contributions += '</tr>';
+ }
+ contributions += '</table>';
+ document.getElementById("contributions").innerHTML = contributions;
+ }
+ }
+
+ function deleteContribution() {
+ var contributions = array(document.workspaceForm.contributions);
+ for (var i = 0; i < contributions.length; i++) {
+ if (contributions[i].checked) {
+ var id = contributions[i].value;
+ workspace.del(id, deleteContributionResponse);
+ }
+ }
+ }
+
+ function deleteContributionResponse() {
+ getContributions();
+ }
+
+ function addContribution() {
+ var id = document.newContributionForm.contributionID.value;
+ var location = document.newContributionForm.contributionLocation.value;
+ var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
+ '<title>Contribution - ' + id + '</title>' +
+ '<id>' + id + '</id>' +
+ '<link href="' + location + '" />' +
+ '</entry>';
+ workspace.post(entry, addContributionResponse);
+ }
+
+ function addContributionResponse() {
+ document.newContributionForm.contributionID.value = "";
+ document.newContributionForm.contributionLocation.value = "";
+ getContributions();
+ }
+
+ function init() {
+ toolbar();
+ getContributions();
+ }
+
+</script>
+
+<link rel="stylesheet" type="text/css" href="/pages/manager.css">
+</head>
+<body onload="init()">
+<div id="toolbar"></div>
+
+<div id="workspace">
+ <br>
+ <span class=hd1>
+ SCA Domain<br><br>
+ <b>Contributions</b></span>
+ <br><br>
+ Here is the list of SCA contributions currently available in your SCA domain.
+ <br><br>
+
+ <form name="workspaceForm">
+ <div id="contributions">
+ <table width="100%">
+ <tbody>
+ <tr>
+ <th>Contribution</th>
+ <th>Dependencies</th>
+ <th>Deployable Composites</th>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ <br/>
+ <input type="button" value="Delete" onclick="deleteContribution()"/>
+ </form>
+
+ <br><br>
+
+ <form name="newContributionForm">
+ <table width="100%">
+ <tr>
+ <th>Add Contribution</th>
+ </tr>
+ <tr>
+ <td>Add an SCA contribution containing your application artifacts to the SCA domain.</td>
+ </tr>
+ </table>
+ <br>
+ <table>
+ <tr>
+ <td>Contribution URI:</td>
+ <td><input type="text" name="contributionID" size="50"/></td>
+ <td>e.g. yourcontrib, http://yourcontrib</td>
+ </tr>
+ <tr>
+ <td>Location:</td>
+ <td><input type="text" name="contributionLocation" size="50"/></td>
+ <td>e.g. http://host/yourjar.jar, file:/yourdir, file:/yourjar.jar</td>
+ </tr>
+ </table>
+ <input type="button" onClick="addContribution()" value="Add"/>
+ </form>
+
+</div>
+</body>
+</html>
\ No newline at end of file |