diff options
Diffstat (limited to '')
-rw-r--r-- | java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html index 9e4c6c014d..a86ef512f7 100644 --- a/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html +++ b/java/sca/modules/domain-manager/src/main/resources/workspace-gadget.html @@ -29,7 +29,7 @@ <body> <div id="workspace"> - <form name="workspaceForm"> + <form id="workspaceForm"> <div id="contributions" ></div> <br> <input type="button" onClick="deleteContribution()" value="Delete" /> @@ -37,7 +37,7 @@ <br><br> - <form name="newContributionForm"> + <form id="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> @@ -54,11 +54,15 @@ </body> <script type="text/javascript"> - var gadget = gadget(window, document); - + //@Reference var workspace = new Reference("workspace"); + var gadget = gadget(window, document); + + var newContributionForm = elementByID(gadget, 'newContributionForm'); + var contributionsElement = elementByID(gadget, 'contributions'); + function getContributions() { workspace.get("", getContributionsResponse); } @@ -68,7 +72,14 @@ var entries = feed.getElementsByTagName("entry"); var contributions = ""; contributions += '<table width="100%">'; - contributions += '<tr><th>Contribution</th><th>Dependencies</td><th>Deployable Composites</th></tr>'; + contributions += '<tr><th>Contribution</th>'; + if (gadget.showDependencies) { + contributions += '<th>Dependencies</td>'; + } + if (gadget.showDeployables) { + contributions += '<th>Deployable Composites</th>'; + } + contributions += '</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"); @@ -104,13 +115,17 @@ } problems += content.substring(bs, es + 7); } - - contributions += '<td class=tdw>' + dependencies + problems + ' </td>'; - contributions += '<td class=tdw>' + deployables + '</td>'; + + if (gadget.showDependencies) { + contributions += '<td class=tdw>' + dependencies + problems + ' </td>'; + } + if (gadget.showDeployables) { + contributions += '<td class=tdw>' + deployables + '</td>'; + } contributions += '</tr>'; } contributions += '</table>'; - gadget.getElementById('contributions').innerHTML = contributions; + contributionsElement.innerHTML = contributions; } } @@ -147,8 +162,8 @@ } function addContribution() { - var id = gadget.newContributionForm.contributionID.value; - var location = gadget.newContributionForm.contributionLocation.value; + var id = newContributionForm.contributionID.value; + var location = newContributionForm.contributionLocation.value; var entry = '<entry xmlns="http://www.w3.org/2005/Atom">' + '<title>Contribution - ' + id +'</title>' + '<id>' + id + '</id>' + @@ -158,8 +173,8 @@ } function addContributionResponse() { - gadget.newContributionForm.contributionID.value = ""; - gadget.newContributionForm.contributionLocation.value = ""; + newContributionForm.contributionID.value = ""; + newContributionForm.contributionLocation.value = ""; getContributions(); } @@ -178,7 +193,7 @@ for (var i=0; i<suggestedContributions.length; i++) { var uri = suggestedContributions[i]; var id = uri.substring(0, uri.indexOf(':')); - if (id == gadget.newContributionForm.contributionID.value) { + if (id == newContributionForm.contributionID.value) { var location = uri.substring(uri.indexOf(':') +1); locations[location] = location; } @@ -188,8 +203,8 @@ getContributions(); getSuggestedContributions(); - suggest(gadget.newContributionForm.contributionID, suggestContributionIDs); - suggest(gadget.newContributionForm.contributionLocation, suggestContributionLocations); + suggest(newContributionForm.contributionID, suggestContributionIDs); + suggest(newContributionForm.contributionLocation, suggestContributionLocations); </script> </html> |