diff --git a/src/main/java/org/gcube/portlets/admin/sepeditor/server/RuntimeResourceCreatorServiceImpl.java b/src/main/java/org/gcube/portlets/admin/sepeditor/server/RuntimeResourceCreatorServiceImpl.java index 5c42f74..1a5d317 100644 --- a/src/main/java/org/gcube/portlets/admin/sepeditor/server/RuntimeResourceCreatorServiceImpl.java +++ b/src/main/java/org/gcube/portlets/admin/sepeditor/server/RuntimeResourceCreatorServiceImpl.java @@ -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 getAvailableScopes() { ArrayList retval = new ArrayList(); String currentScope = getASLSession().getScopeName(); System.out.println("currentScope: " + currentScope); try { - Map scopes = readScopes(this.getScopeDataPath()); + Map 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 readScopes(String confFile) throws Exception { - if (confFile == null) { - throw new NullPointerException("the scope file has not been defined"); - } - Map toReturn = new HashMap(); - 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 getVREFromVO(final ScopeBean vo) throws Exception { - _log.debug("Starting Retrieving VREs for VO : " + vo); - List toReturn = new ArrayList(); - - ScopeProvider.instance.set(vo.toString()); - SimpleQuery query = queryFor(GenericResource.class); - query.addCondition("$resource/Profile/SecondaryType/text() eq 'VRE'"); - - DiscoveryClient client = clientFor(GenericResource.class); - - List gRes = client.submit(query); - - for (GenericResource res : gRes) { - _log.debug("Found: " + res.profile().name()); - toReturn.add(res.profile().name()); - } - return toReturn; - } - } diff --git a/src/main/webapp/RuntimeResourceCreator.css b/src/main/webapp/RuntimeResourceCreator.css index b43a5d6..050faaa 100644 --- a/src/main/webapp/RuntimeResourceCreator.css +++ b/src/main/webapp/RuntimeResourceCreator.css @@ -1,3 +1,5 @@ +@import url(d4scienceOrg.css); + .wizardTextBox { background-color: white; border-color: #999; diff --git a/src/main/webapp/RuntimeResourceCreator.html b/src/main/webapp/RuntimeResourceCreator.html index 9259e32..75feb15 100644 --- a/src/main/webapp/RuntimeResourceCreator.html +++ b/src/main/webapp/RuntimeResourceCreator.html @@ -11,8 +11,8 @@ - + diff --git a/src/main/webapp/d4scienceOrg.css b/src/main/webapp/d4scienceOrg.css new file mode 100644 index 0000000..96db352 --- /dev/null +++ b/src/main/webapp/d4scienceOrg.css @@ -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; +} \ No newline at end of file diff --git a/src/main/webapp/images/bg-pattern.png b/src/main/webapp/images/bg-pattern.png new file mode 100644 index 0000000..d9ca94b Binary files /dev/null and b/src/main/webapp/images/bg-pattern.png differ diff --git a/src/main/webapp/images/bg_custom.png b/src/main/webapp/images/bg_custom.png new file mode 100644 index 0000000..ec909f3 Binary files /dev/null and b/src/main/webapp/images/bg_custom.png differ diff --git a/src/main/webapp/images/loader.gif b/src/main/webapp/images/loader.gif new file mode 100644 index 0000000..2e7de3e Binary files /dev/null and b/src/main/webapp/images/loader.gif differ