Improved the Domain Manager widgets to use HTML divs for presentation and iframes for script isolation. This provides better control and performance of the layout while preserving isolation between the scripts of the individual widgets.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@681295 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
f47f670749
commit
34f92700da
13 changed files with 375 additions and 279 deletions
|
@ -23,7 +23,44 @@
|
|||
<script type="text/javascript" src="../cloud-gadget/cloud-gadget.js"></script>
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="cloudComposite">
|
||||
|
||||
<form name="cloudCompositeForm">
|
||||
<div id="composites" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="startNode()" value="Start" />
|
||||
<input type="button" onClick="stopNode()" value="Stop" />
|
||||
|
||||
<input type="button" onClick="deleteNode()" value="Delete" />
|
||||
</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><td>e.g. http://yourhost:8080</td></tr>
|
||||
<tr><td>Composite namespace:</td><td><input type="text" name="compositeNamespace" size="50"/></td></td><td>e.g. http://your/namespace</td></tr>
|
||||
<tr><td>Composite name:</td><td><input type="text" name="compositeName" size="50"/></td></td><td>e.g. yourcomposite</td></tr>
|
||||
<tr><td>Contribution URI:</td><td><input type="text" name="contributionURI" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
|
||||
</table>
|
||||
<input type="button" onClick="addNode()" value="Add" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
|
||||
//@Reference
|
||||
var cloudComposite = new Reference("cloudComposite");
|
||||
|
@ -112,7 +149,7 @@
|
|||
composites += '</tr>';
|
||||
}
|
||||
composites += '</table>';
|
||||
document.getElementById("composites").innerHTML = composites;
|
||||
gadget.getElementById("composites").innerHTML = composites;
|
||||
|
||||
processCollection.get("", getProcessesResponse);
|
||||
}
|
||||
|
@ -129,7 +166,7 @@
|
|||
}
|
||||
|
||||
for (var i = 0; i < nodeNames.length; i++) {
|
||||
var element = document.getElementById('status_' + nodeNames[i]);
|
||||
var element = gadget.getElementById('status_' + nodeNames[i]);
|
||||
var nodeName = nodeNames[i];
|
||||
if (nodeStatus[nodeName] == null) {
|
||||
element.innerHTML = '<span>stopped</span>';
|
||||
|
@ -141,7 +178,7 @@
|
|||
}
|
||||
|
||||
function deleteNode() {
|
||||
var composites = array(document.cloudCompositeForm.composites);
|
||||
var composites = array(gadget.cloudCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
var id = composites[i].value;
|
||||
|
@ -155,11 +192,11 @@
|
|||
}
|
||||
|
||||
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 nodeName = gadget.newNodeForm.nodeName.value;
|
||||
var nodeURI = gadget.newNodeForm.nodeURI.value;
|
||||
var compositeNamespace = gadget.newNodeForm.compositeNamespace.value;
|
||||
var compositeName = gadget.newNodeForm.compositeName.value;
|
||||
var contributionURI = gadget.newNodeForm.contributionURI.value;
|
||||
var id = 'composite:' +
|
||||
'http://tuscany.apache.org/cloud' + ';' +
|
||||
'http://tuscany.apache.org/cloud' + ';' +
|
||||
|
@ -190,16 +227,16 @@
|
|||
}
|
||||
|
||||
function addNodeResponse() {
|
||||
document.newNodeForm.nodeName.value = "";
|
||||
document.newNodeForm.nodeURI.value = "";
|
||||
document.newNodeForm.compositeNamespace.value = "";
|
||||
document.newNodeForm.compositeName.value = "";
|
||||
document.newNodeForm.contributionURI.value = "";
|
||||
gadget.newNodeForm.nodeName.value = "";
|
||||
gadget.newNodeForm.nodeURI.value = "";
|
||||
gadget.newNodeForm.compositeNamespace.value = "";
|
||||
gadget.newNodeForm.compositeName.value = "";
|
||||
gadget.newNodeForm.contributionURI.value = "";
|
||||
getNodes();
|
||||
}
|
||||
|
||||
function startNode() {
|
||||
var composites = array(document.cloudCompositeForm.composites);
|
||||
var composites = array(gadget.cloudCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
var id = nodeNames[i];
|
||||
|
@ -215,7 +252,7 @@
|
|||
function startNodeResponse() {
|
||||
processCollection.get("", getProcessesResponse);
|
||||
|
||||
var composites = array(document.cloudCompositeForm.composites);
|
||||
var composites = array(gadget.cloudCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
composites[i].checked = false;
|
||||
|
@ -224,7 +261,7 @@
|
|||
}
|
||||
|
||||
function stopNode() {
|
||||
var composites = array(document.cloudCompositeForm.composites);
|
||||
var composites = array(gadget.cloudCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
var id = nodeNames[i];
|
||||
|
@ -236,7 +273,7 @@
|
|||
function stopNodeResponse() {
|
||||
processCollection.get("", getProcessesResponse);
|
||||
|
||||
var composites = array(document.cloudCompositeForm.composites);
|
||||
var composites = array(gadget.cloudCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
composites[i].checked = false;
|
||||
|
@ -271,7 +308,7 @@
|
|||
}
|
||||
|
||||
function suggestCompositeNames() {
|
||||
var inputns = document.newNodeForm.compositeNamespace.value;
|
||||
var inputns = gadget.newNodeForm.compositeNamespace.value;
|
||||
var names = new Array();
|
||||
for (var uri in deployedComposites) {
|
||||
var qname = compositeName(uri);
|
||||
|
@ -286,8 +323,8 @@
|
|||
}
|
||||
|
||||
function suggestContributionURIs() {
|
||||
var inputns = document.newNodeForm.compositeNamespace.value;
|
||||
var inputname = document.newNodeForm.compositeName.value;
|
||||
var inputns = gadget.newNodeForm.compositeNamespace.value;
|
||||
var inputname = gadget.newNodeForm.compositeName.value;
|
||||
var uris = new Array();
|
||||
for (var uri in deployedComposites) {
|
||||
var qname = compositeName(uri);
|
||||
|
@ -302,53 +339,11 @@
|
|||
return array(uris);
|
||||
}
|
||||
|
||||
function init() {
|
||||
getNodes();
|
||||
getComposites();
|
||||
suggest(document.newNodeForm.compositeNamespace, suggestCompositeNamespaces);
|
||||
suggest(document.newNodeForm.compositeName, suggestCompositeNames);
|
||||
suggest(document.newNodeForm.contributionURI, suggestContributionURIs);
|
||||
}
|
||||
|
||||
getNodes();
|
||||
getComposites();
|
||||
suggest(gadget.newNodeForm.compositeNamespace, suggestCompositeNamespaces);
|
||||
suggest(gadget.newNodeForm.compositeName, suggestCompositeNames);
|
||||
suggest(gadget.newNodeForm.contributionURI, suggestContributionURIs);
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<div id="cloudComposite">
|
||||
|
||||
Here is the list of SCA nodes configured in your SCA domain cloud.
|
||||
<br><br>
|
||||
|
||||
<form name="cloudCompositeForm">
|
||||
<div id="composites" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="startNode()" value="Start" />
|
||||
<input type="button" onClick="stopNode()" value="Stop" />
|
||||
|
||||
<input type="button" onClick="deleteNode()" value="Delete" />
|
||||
</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><td>e.g. http://yourhost:8080</td></tr>
|
||||
<tr><td>Composite namespace:</td><td><input type="text" name="compositeNamespace" size="50"/></td></td><td>e.g. http://your/namespace</td></tr>
|
||||
<tr><td>Composite name:</td><td><input type="text" name="compositeName" size="50"/></td></td><td>e.g. yourcomposite</td></tr>
|
||||
<tr><td>Contribution URI:</td><td><input type="text" name="contributionURI" size="50"/></td></td><td>e.g. yourcontrib, http://yourcontrib</td></tr>
|
||||
</table>
|
||||
<input type="button" onClick="addNode()" value="Add" />
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -20,19 +20,37 @@
|
|||
<head>
|
||||
<title>SCA Domain - Cloud</title>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 0px; width: 100%;"></iframe>
|
||||
<br><br>
|
||||
<div id="toolbarGadgetDiv"></div>
|
||||
<br>
|
||||
|
||||
<span class=hd1>
|
||||
SCA Domain<br><br>
|
||||
Cloud</b> <a href="/cloud/"><img src="icons/feed-icon.png" border="0"></a>
|
||||
</span>
|
||||
<br>
|
||||
Here is the list of SCA nodes configured in your SCA domain cloud.
|
||||
<br><br>
|
||||
|
||||
<iframe id="cloudGadget" src="cloud-gadget.html" style="left: 0px; width: 100%; height: 100%;"></iframe>
|
||||
<div id="cloudGadgetDiv"></div>
|
||||
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
|
||||
<iframe id="cloudGadget" src="cloud-gadget.html"></iframe>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function ongadget(win, doc) {
|
||||
if (doc == content(toolbarGadget)) {
|
||||
toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
} else if (doc == content(cloudGadget)) {
|
||||
cloudGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
}
|
||||
return document;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -23,7 +23,39 @@
|
|||
<script type="text/javascript" src="../composite-gadget/composite-gadget.js"></script>
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="domainComposite">
|
||||
|
||||
<form name="domainCompositeForm">
|
||||
<div id="composites" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="deleteComposite()" value="Delete" />
|
||||
</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>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
|
||||
//@Reference
|
||||
var domainComposite = new Reference("domainComposite");
|
||||
|
@ -88,12 +120,12 @@
|
|||
composites += '</tr>';
|
||||
}
|
||||
composites += '</table>';
|
||||
document.getElementById("composites").innerHTML = composites;
|
||||
gadget.getElementById("composites").innerHTML = composites;
|
||||
}
|
||||
}
|
||||
|
||||
function deleteComposite() {
|
||||
var composites = array(document.domainCompositeForm.composites);
|
||||
var composites = array(gadget.domainCompositeForm.composites);
|
||||
for (var i = 0; i < composites.length; i++) {
|
||||
if (composites[i].checked) {
|
||||
var id = composites[i].value;
|
||||
|
@ -108,9 +140,9 @@
|
|||
|
||||
function addComposite() {
|
||||
var id = 'composite:' +
|
||||
document.newCompositeForm.contributionURI.value + ';' +
|
||||
document.newCompositeForm.compositeNamespace.value + ';' +
|
||||
document.newCompositeForm.compositeName.value;
|
||||
gadget.newCompositeForm.contributionURI.value + ';' +
|
||||
gadget.newCompositeForm.compositeNamespace.value + ';' +
|
||||
gadget.newCompositeForm.compositeName.value;
|
||||
var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
|
||||
'<title>' + id +'</title>' +
|
||||
'<id>' + id + '</id>' +
|
||||
|
@ -119,9 +151,9 @@
|
|||
}
|
||||
|
||||
function addCompositeResponse() {
|
||||
document.newCompositeForm.compositeNamespace.value = "";
|
||||
document.newCompositeForm.compositeName.value = "";
|
||||
document.newCompositeForm.contributionURI.value = "";
|
||||
gadget.newCompositeForm.compositeNamespace.value = "";
|
||||
gadget.newCompositeForm.compositeName.value = "";
|
||||
gadget.newCompositeForm.contributionURI.value = "";
|
||||
getComposites();
|
||||
}
|
||||
|
||||
|
@ -172,7 +204,7 @@
|
|||
}
|
||||
|
||||
function suggestCompositeNames() {
|
||||
var inputns = document.newCompositeForm.compositeNamespace.value;
|
||||
var inputns = gadget.newCompositeForm.compositeNamespace.value;
|
||||
var names = new Array();
|
||||
for (var uri in contributedComposites) {
|
||||
var qname = compositeName(uri);
|
||||
|
@ -187,8 +219,8 @@
|
|||
}
|
||||
|
||||
function suggestContributionURIs() {
|
||||
var inputns = document.newCompositeForm.compositeNamespace.value;
|
||||
var inputname = document.newCompositeForm.compositeName.value;
|
||||
var inputns = gadget.newCompositeForm.compositeNamespace.value;
|
||||
var inputname = gadget.newCompositeForm.compositeName.value;
|
||||
var uris = new Array();
|
||||
for (var uri in contributedComposites) {
|
||||
var qname = compositeName(uri);
|
||||
|
@ -203,47 +235,11 @@
|
|||
return array(uris);
|
||||
}
|
||||
|
||||
function init() {
|
||||
getComposites();
|
||||
getContributions();
|
||||
suggest(document.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
|
||||
suggest(document.newCompositeForm.compositeName, suggestCompositeNames);
|
||||
suggest(document.newCompositeForm.contributionURI, suggestContributionURIs);
|
||||
}
|
||||
getComposites();
|
||||
getContributions();
|
||||
suggest(gadget.newCompositeForm.compositeNamespace, suggestCompositeNamespaces);
|
||||
suggest(gadget.newCompositeForm.compositeName, suggestCompositeNames);
|
||||
suggest(gadget.newCompositeForm.contributionURI, suggestContributionURIs);
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<div id="domainComposite">
|
||||
|
||||
Here is the list of SCA composites currently included as top-level composites in your SCA domain.
|
||||
<br><br>
|
||||
|
||||
<form name="domainCompositeForm">
|
||||
<div id="composites" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="deleteComposite()" value="Delete" />
|
||||
</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>
|
||||
|
|
|
@ -20,19 +20,37 @@
|
|||
<head>
|
||||
<title>SCA Domain - Domain Composite</title>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 0px; width: 100%;"></iframe>
|
||||
<br><br>
|
||||
<div id="toolbarGadgetDiv"></div>
|
||||
<br>
|
||||
|
||||
<span class=hd1>
|
||||
SCA Domain<br><br>
|
||||
Domain Composite <a href="/composite/"><img src="icons/feed-icon.png" border="0"></a>
|
||||
</span>
|
||||
<br>
|
||||
Here is the list of SCA composites currently included as top-level composites in your SCA domain.
|
||||
<br><br>
|
||||
|
||||
<iframe id="compositeGadget" src="composite-gadget.html" style="left: 0px; width: 100%; height: 100%;"></iframe>
|
||||
<div id="compositeGadgetDiv"></div>
|
||||
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
|
||||
<iframe id="compositeGadget" src="composite-gadget.html"></iframe>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function ongadget(win, doc) {
|
||||
if (doc == content(toolbarGadget)) {
|
||||
toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
} else if (doc == content(compositeGadget)) {
|
||||
compositeGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
}
|
||||
return document;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -23,63 +23,12 @@
|
|||
<script type="text/javascript" src="../files-gadget/files-gadget.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() {
|
||||
getFiles();
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<body>
|
||||
<div id="fileServer">
|
||||
|
||||
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" ></div>
|
||||
<br/>
|
||||
|
@ -103,4 +52,51 @@
|
|||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
|
||||
//@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>";
|
||||
gadget.getElementById("files").innerHTML = list;
|
||||
}
|
||||
}
|
||||
|
||||
function deleteFile() {
|
||||
var list = array(gadget.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() {
|
||||
gadget.uploadFileForm.submit();
|
||||
}
|
||||
|
||||
getFiles();
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -20,19 +20,37 @@
|
|||
<head>
|
||||
<title>SCA Domain - Contribution File Server</title>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 0px; width: 100%;"></iframe>
|
||||
<br><br>
|
||||
<div id="toolbarGadgetDiv"></div>
|
||||
<br>
|
||||
|
||||
<span class=hd1>
|
||||
SCA Domain<br><br>
|
||||
File Server <a href="/feed/files/"><img src="icons/feed-icon.png" border="0"></a>
|
||||
</span>
|
||||
<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>
|
||||
|
||||
<iframe id="filesGadget" src="files-gadget.html" style="left: 0px; width: 100%; height: 100%;"></iframe>
|
||||
<div id="filesGadgetDiv"></div>
|
||||
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
|
||||
<iframe id="filesGadget" src="files-gadget.html"></iframe>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function ongadget(win, doc) {
|
||||
if (doc == content(toolbarGadget)) {
|
||||
toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
} else if (doc == content(filesGadget)) {
|
||||
filesGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
}
|
||||
return document;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -23,17 +23,10 @@
|
|||
<script type="text/javascript" src="../home-gadget/home-gadget.js"></script>
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function init() {
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<body>
|
||||
<div id="home">
|
||||
|
||||
<form>
|
||||
|
@ -42,10 +35,11 @@
|
|||
<tr><td></td><td align="center"><input type="button" name="search" value="Search" /></td></tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<br><br><br><br><br><br><br>
|
||||
<center>This page is under construction, searching the domain is not implemented yet.</center>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -20,20 +20,38 @@
|
|||
<head>
|
||||
<title>SCA Domain - Home</title>
|
||||
|
||||
<script type="text/javascript" src="../home/home.js"></script>
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 0px; width: 100%;"></iframe>
|
||||
<br><br>
|
||||
<div id="toolbarGadgetDiv"></div>
|
||||
<br>
|
||||
|
||||
<span class=hd1>
|
||||
SCA Domain
|
||||
</span>
|
||||
<br><br><br><br><br><br>
|
||||
|
||||
<iframe id="homeGadget" src="home-gadget.html" style="left: 0px; width: 100%; height: 100%;"></iframe>
|
||||
<div id="homeGadgetDiv"></div>
|
||||
|
||||
<br><br><br><br><br><br><br>
|
||||
<center>This page is under construction, searching the domain is not implemented yet.</center>
|
||||
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="visibility: hidden;"></iframe>
|
||||
<iframe id="homeGadget" src="home-gadget.html" style="visibility: hidden;"></iframe>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function ongadget(win, doc) {
|
||||
if (doc == content(toolbarGadget)) {
|
||||
toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
} else if (doc == content(homeGadget)) {
|
||||
homeGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
}
|
||||
return document;
|
||||
}
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
*/
|
||||
|
||||
body {
|
||||
white-space: nowrap; overflow: hidden;
|
||||
white-space: nowrap; margin: 2px;
|
||||
}
|
||||
|
||||
table {
|
||||
|
@ -37,7 +37,7 @@ td {
|
|||
}
|
||||
|
||||
iframe {
|
||||
border: 0px; margin: 0px; padding: 0px; position: absolute; overflow: hidden;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
input {
|
||||
|
|
|
@ -22,26 +22,25 @@
|
|||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
|
||||
function init() {
|
||||
var tools = new Array();
|
||||
tools[0] = new Tool("Contributions", "../workspace");
|
||||
tools[1] = new Tool("Composites", "../composite");
|
||||
tools[2] = new Tool("Cloud", "../cloud");
|
||||
tools[3] = new Tool("Files", "../files");
|
||||
|
||||
var home = new Tool("Home", "../home");
|
||||
|
||||
document.getElementById('toolbar').innerHTML = toolbar(home, tools);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<body>
|
||||
<div id="toolbar"></div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
|
||||
var tools = new Array();
|
||||
tools[0] = new Tool("Contributions", "../workspace");
|
||||
tools[1] = new Tool("Composites", "../composite");
|
||||
tools[2] = new Tool("Cloud", "../cloud");
|
||||
tools[3] = new Tool("Files", "../files");
|
||||
|
||||
var home = new Tool("Home", "../home");
|
||||
|
||||
gadget.getElementById('toolbar').innerHTML = toolbar(home, tools);
|
||||
|
||||
</script>
|
||||
</html>
|
||||
|
|
|
@ -184,3 +184,33 @@ function array(obj) {
|
|||
return a;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Utility function thats dumps a Javascript object to the console
|
||||
*/
|
||||
function dump(o) {
|
||||
for (f in o) {
|
||||
try {
|
||||
console.log(f + '=' + o[f]);
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
function content(win) {
|
||||
if (win.document != 'undefined' && win.document != null) {
|
||||
return win.document;
|
||||
} else if (win.contentDocument != 'undefined' && win.contentDocument != null) {
|
||||
return win.contentDocument;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
function gadget(win, doc) {
|
||||
if (win.parent.ongadget != null && win.parent.ongadget != 'undefined') {
|
||||
return win.parent.ongadget(win, doc);
|
||||
} else {
|
||||
return doc;
|
||||
}
|
||||
}
|
||||
|
|
@ -23,11 +23,42 @@
|
|||
<script type="text/javascript" src="../workspace-gadget/workspace-gadget.js"></script>
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<script language="JavaScript">
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="workspace">
|
||||
|
||||
<form name="workspaceForm">
|
||||
<div id="contributions" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="deleteContribution()" value="Delete" />
|
||||
</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><td>e.g. yourcontrib, http://yourcontrib</td></tr>
|
||||
<tr><td>Location:</td><td><input type="text" name="contributionLocation" size="50"/></td></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>
|
||||
|
||||
<script type="text/javascript">
|
||||
var gadget = gadget(window, document);
|
||||
|
||||
//@Reference
|
||||
var workspace = new Reference("workspace");
|
||||
|
||||
|
||||
function getContributions() {
|
||||
workspace.get("", getContributionsResponse);
|
||||
}
|
||||
|
@ -49,7 +80,7 @@
|
|||
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) {
|
||||
|
@ -79,10 +110,10 @@
|
|||
contributions += '</tr>';
|
||||
}
|
||||
contributions += '</table>';
|
||||
document.getElementById("contributions").innerHTML = contributions;
|
||||
gadget.getElementById('contributions').innerHTML = contributions;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
var suggestedContributions = new Array();
|
||||
|
||||
function getSuggestedContributions() {
|
||||
|
@ -100,9 +131,9 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deleteContribution() {
|
||||
var contributions = array(document.workspaceForm.contributions);
|
||||
var contributions = array(gadget.workspaceForm.contributions);
|
||||
for (var i=0; i < contributions.length; i++) {
|
||||
if (contributions[i].checked) {
|
||||
var id = contributions[i].value;
|
||||
|
@ -110,28 +141,28 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deleteContributionResponse() {
|
||||
getContributions();
|
||||
}
|
||||
|
||||
|
||||
function addContribution() {
|
||||
var id = document.newContributionForm.contributionID.value;
|
||||
var location = document.newContributionForm.contributionLocation.value;
|
||||
var id = gadget.newContributionForm.contributionID.value;
|
||||
var location = gadget.newContributionForm.contributionLocation.value;
|
||||
var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' +
|
||||
'<title>Contribution - ' + id +'</title>' +
|
||||
'<id>' + id + '</id>' +
|
||||
'<link href="' + location + '" />' +
|
||||
'</entry>';
|
||||
'<id>' + id + '</id>' +
|
||||
'<link href="' + location + '" />' +
|
||||
'</entry>';
|
||||
workspace.post(entry, addContributionResponse);
|
||||
}
|
||||
|
||||
|
||||
function addContributionResponse() {
|
||||
document.newContributionForm.contributionID.value = "";
|
||||
document.newContributionForm.contributionLocation.value = "";
|
||||
gadget.newContributionForm.contributionID.value = "";
|
||||
gadget.newContributionForm.contributionLocation.value = "";
|
||||
getContributions();
|
||||
}
|
||||
|
||||
|
||||
function suggestContributionIDs() {
|
||||
var ids = new Array();
|
||||
for (var i=0; i<suggestedContributions.length; i++) {
|
||||
|
@ -141,13 +172,13 @@
|
|||
}
|
||||
return array(ids);
|
||||
}
|
||||
|
||||
|
||||
function suggestContributionLocations() {
|
||||
var locations = new Array();
|
||||
for (var i=0; i<suggestedContributions.length; i++) {
|
||||
var uri = suggestedContributions[i];
|
||||
var id = uri.substring(0, uri.indexOf(':'));
|
||||
if (id == document.newContributionForm.contributionID.value) {
|
||||
if (id == gadget.newContributionForm.contributionID.value) {
|
||||
var location = uri.substring(uri.indexOf(':') +1);
|
||||
locations[location] = location;
|
||||
}
|
||||
|
@ -155,45 +186,10 @@
|
|||
return array(locations);
|
||||
}
|
||||
|
||||
function init() {
|
||||
getContributions();
|
||||
getSuggestedContributions();
|
||||
suggest(document.newContributionForm.contributionID, suggestContributionIDs);
|
||||
suggest(document.newContributionForm.contributionLocation, suggestContributionLocations);
|
||||
}
|
||||
getContributions();
|
||||
getSuggestedContributions();
|
||||
suggest(gadget.newContributionForm.contributionID, suggestContributionIDs);
|
||||
suggest(gadget.newContributionForm.contributionLocation, suggestContributionLocations);
|
||||
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body onload="init()">
|
||||
<div id="workspace">
|
||||
|
||||
Here is the list of SCA contributions currently available in your SCA domain.
|
||||
<br><br>
|
||||
|
||||
<form name="workspaceForm">
|
||||
<div id="contributions" ></div>
|
||||
<br>
|
||||
<input type="button" onClick="deleteContribution()" value="Delete" />
|
||||
</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><td>e.g. yourcontrib, http://yourcontrib</td></tr>
|
||||
<tr><td>Location:</td><td><input type="text" name="contributionLocation" size="50"/></td></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>
|
||||
|
|
|
@ -20,18 +20,36 @@
|
|||
<head>
|
||||
<title>SCA Domain - Contributions</title>
|
||||
|
||||
<script type="text/javascript" src="utils.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="manager.css">
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html" style="top: 0px; left: 0px; width: 100%;"></iframe>
|
||||
<br><br>
|
||||
<div id="toolbarGadgetDiv"></div>
|
||||
<br>
|
||||
|
||||
<span class=hd1>
|
||||
SCA Domain<br><br>
|
||||
Contributions</b> <a href="/workspace/"><img src="icons/feed-icon.png" border="0"></a> </span>
|
||||
<br>
|
||||
Here is the list of SCA contributions currently available in your SCA domain.
|
||||
<br><br>
|
||||
|
||||
<iframe id="workspaceGadget" src="workspace-gadget.html" style="left: 0px; width: 100%; height: 100%;"></iframe>
|
||||
<div id="workspaceGadgetDiv"></div>
|
||||
|
||||
<iframe id="toolbarGadget" src="toolbar-gadget.html"></iframe>
|
||||
<iframe id="workspaceGadget" src="workspace-gadget.html"></iframe>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
function ongadget(win, doc) {
|
||||
if (doc == content(toolbarGadget)) {
|
||||
toolbarGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
} else if (doc == content(workspaceGadget)) {
|
||||
workspaceGadgetDiv.innerHTML = doc.body.innerHTML;
|
||||
}
|
||||
return document;
|
||||
}
|
||||
</script>
|
||||
</html>
|
||||
|
|
Loading…
Add table
Reference in a new issue