git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/service-endpoint-editor@81599 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-09-17 10:30:58 +00:00
parent 031d90e57f
commit cf10d3f49c
7 changed files with 117 additions and 51 deletions

View File

@ -43,6 +43,7 @@ import org.gcube.portlets.admin.sepeditor.shared.FilledRuntimeResource;
import org.gcube.portlets.admin.sepeditor.shared.InitInfo;
import org.gcube.portlets.admin.sepeditor.shared.Property;
import org.gcube.portlets.admin.sepeditor.shared.RRAccessPoint;
import org.gcube.resourcemanagement.support.server.managers.scope.ScopeManager;
import org.gcube.resources.discovery.client.api.DiscoveryClient;
import org.gcube.resources.discovery.client.queries.api.SimpleQuery;
import org.apache.log4j.Logger;
@ -292,13 +293,16 @@ public class RuntimeResourceCreatorServiceImpl extends RemoteServiceServlet impl
return null;
}
}
/**
*
* @return
*/
public ArrayList<String> getAvailableScopes() {
ArrayList<String> retval = new ArrayList<String>();
String currentScope = getASLSession().getScopeName();
System.out.println("currentScope: " + currentScope);
try {
Map<String, ScopeBean> scopes = readScopes(this.getScopeDataPath());
Map<String, ScopeBean> scopes = ScopeManager.readScopes(this.getScopeDataPath());
for (ScopeBean scope : scopes.values()) {
if (scope.toString().startsWith(currentScope))
retval.add(scope.toString());
@ -313,35 +317,7 @@ public class RuntimeResourceCreatorServiceImpl extends RemoteServiceServlet impl
return retval;
}
public static Map<String, ScopeBean> readScopes(String confFile) throws Exception {
if (confFile == null) {
throw new NullPointerException("the scope file has not been defined");
}
Map<String, ScopeBean> toReturn = new HashMap<String, ScopeBean>();
String scopeXML = fileToString(confFile);
Document scopeDocument = getDocumentGivenXML(scopeXML);
NodeList voElements = scopeDocument.getElementsByTagName("vo");
for (int i = 0; i < voElements.getLength(); i++) {
NodeList voDetails = voElements.item(i).getChildNodes();
String voString = voDetails.item(5).getFirstChild().getNodeValue();
// String voName = voDetails.item(1).getFirstChild().getNodeValue();
ScopeBean vo = new ScopeBean(voString);
toReturn.put(vo.toString(), vo);
try {
for (String vre : getVREFromVO(vo)) {
// This operation overrides the vo map
toReturn.put(vre.toString(), new ScopeBean(vo.toString()+"/"+vre));
}
} catch (ISException e) {
_log.error("Exception raised while loading VREs for VO : " + vo, e);
}
}
return toReturn;
}
private String getScopeDataPath() {
String startDirectory = getServletFSPath();
@ -388,25 +364,6 @@ public class RuntimeResourceCreatorServiceImpl extends RemoteServiceServlet impl
return document;
}
protected static List<String> getVREFromVO(final ScopeBean vo) throws Exception {
_log.debug("Starting Retrieving VREs for VO : " + vo);
List<String> toReturn = new ArrayList<String>();
ScopeProvider.instance.set(vo.toString());
SimpleQuery query = queryFor(GenericResource.class);
query.addCondition("$resource/Profile/SecondaryType/text() eq 'VRE'");
DiscoveryClient<GenericResource> client = clientFor(GenericResource.class);
List<GenericResource> gRes = client.submit(query);
for (GenericResource res : gRes) {
_log.debug("Found: " + res.profile().name());
toReturn.add(res.profile().name());
}
return toReturn;
}
}

View File

@ -1,3 +1,5 @@
@import url(d4scienceOrg.css);
.wizardTextBox {
background-color: white;
border-color: #999;

View File

@ -11,8 +11,8 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link type="text/css" rel="stylesheet" href="RuntimeResourceCreator.css">
<link rel="stylesheet" type="text/css" href="gxt/css/gxt-all.css" />
<link type="text/css" rel="stylesheet" href="RuntimeResourceCreator.css">
<!-- -->
<!-- Any title is fine -->
<!-- -->

View File

@ -0,0 +1,107 @@
#wrapper {
font: 11px/1.5 "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana,
sans-serif;
margin: 0 auto;
width: 92% !important;
}
.x-menubar {
background: #FFF url(images/bg-pattern.png) repeat;
}
.x-panel {
border-color: transparent;
}
.x-panel-body,.x-panel-body-noheader {
border-color: transparent;
}
.x-border-layout-ct {
background-color: transparent;
border-color: transparent;
}
.x-toolbar {
border-color: #226599;
background: #FFF url(images/bg-pattern.png) repeat;
}
.x-panel-mc {
padding-top: 5px;
background: #FFF url(images/bg-pattern.png) repeat;
border-color: #226599;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
}
.x-panel-bc {
}
.ext-el-mask-msg {
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
border-width: 2px;
background-color: #FFF;
}
.ext-el-mask-msg div {
border-color: transparent;
background-color: transparent;
}
.loading-indicator {
background-position: 5px 50%;
background-image: url("images/loader.gif");
}
.x-panel-header {
background-color: #d0def0;
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #DFEAF8 0%, #d0def0 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #DFEAF8),
color-stop(1, #d0def0));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #DFEAF8 0%, #d0def0 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #DFEAF8 0%, #d0def0 100%);
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #DFEAF8 0%, #052045 100%);
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.x-toolbar .xtb-sep {
background-image: none !important;
background-color: transparent;
}
.x-accordion-hd {
background-position: 0 0px;
}
.x-status-text {
color: #226599;
font-weight: bold !important;
}
.x-status-text-panel {
border-color: transparent;
}
.x-component {
color: #226599;
}
.x-btn button {
color: #226599;
font-weight: bold !important;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB