diff --git a/.classpath b/.classpath
index b17e3fb..fb11949 100644
--- a/.classpath
+++ b/.classpath
@@ -1,12 +1,12 @@
-
+
-
+
@@ -20,11 +20,13 @@
+
+
@@ -39,5 +41,5 @@
-
+
diff --git a/.project b/.project
index f074d24..b7c8bf0 100644
--- a/.project
+++ b/.project
@@ -45,6 +45,16 @@
+
+ com.gwtplugins.gdt.eclipse.core.webAppProjectValidator
+
+
+
+
+ com.gwtplugins.gwt.eclipse.core.gwtProjectValidator
+
+
+
org.eclipse.m2e.core.maven2Nature
@@ -56,5 +66,6 @@
org.eclipse.wst.jsdt.core.jsNature
com.google.gwt.eclipse.core.gwtNature
com.liferay.ide.core.liferayNature
+ com.gwtplugins.gwt.eclipse.core.gwtNature
diff --git a/.settings/com.gwtplugins.gdt.eclipse.core.prefs b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
new file mode 100644
index 0000000..41ad7dd
--- /dev/null
+++ b/.settings/com.gwtplugins.gdt.eclipse.core.prefs
@@ -0,0 +1,4 @@
+eclipse.preferences.version=1
+lastWarOutDir=/Users/massi/Documents/workspace/resource-management/target/resource-management-6.7.0-SNAPSHOT
+warSrcDir=src/main/webapp
+warSrcDirIsOutput=false
diff --git a/.settings/org.eclipse.jdt.core.prefs b/.settings/org.eclipse.jdt.core.prefs
index b257af7..a5c7673 100644
--- a/.settings/org.eclipse.jdt.core.prefs
+++ b/.settings/org.eclipse.jdt.core.prefs
@@ -5,4 +5,5 @@ org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
diff --git a/.settings/org.eclipse.wst.common.component b/.settings/org.eclipse.wst.common.component
index c7cf8a6..9abfccb 100644
--- a/.settings/org.eclipse.wst.common.component
+++ b/.settings/org.eclipse.wst.common.component
@@ -1,12 +1,9 @@
-
+
-
- uses
-
diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml
index ff39cb9..f5730be 100644
--- a/.settings/org.eclipse.wst.common.project.facet.core.xml
+++ b/.settings/org.eclipse.wst.common.project.facet.core.xml
@@ -6,4 +6,5 @@
+
diff --git a/pom.xml b/pom.xml
index 183724a..862ef9c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -12,7 +12,7 @@
org.gcube.portlets.admin
resource-management
- 6.6.1-SNAPSHOT
+ 6.7.0-SNAPSHOT
war
gCube Resource Management Portlet
@@ -103,7 +103,7 @@
org.gcube.portlets.admin
rmp-common-library
- [2.7.0-SNAPSHOT, 3.0.0-SNAPSHOT)
+ [2.8.3-SNAPSHOT, 3.0.0-SNAPSHOT)
@@ -124,7 +124,7 @@
org.gcube.core
common-scope-maps
- compile
+ provided
org.gcube.resourcemanagement
diff --git a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java b/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java
index 84383c7..a8abb04 100644
--- a/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java
+++ b/src/main/java/org/gcube/portlets/admin/resourcemanagement/server/ServiceProxyImpl.java
@@ -21,16 +21,12 @@ import static org.gcube.resources.discovery.icclient.ICFactory.client;
import java.io.File;
import java.io.StringReader;
import java.security.InvalidParameterException;
-import java.security.NoSuchAlgorithmException;
-import java.security.spec.InvalidKeySpecException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Vector;
-import javax.crypto.SecretKeyFactory;
-import javax.crypto.spec.PBEKeySpec;
import javax.servlet.http.HttpSession;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
@@ -38,9 +34,11 @@ import javax.xml.parsers.DocumentBuilderFactory;
import org.gcube.common.resources.gcore.utils.XPathHelper;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.common.scope.impl.ScopeBean;
+import org.gcube.common.scope.impl.ScopeBean.Type;
import org.gcube.portlets.admin.resourcemanagement.client.remote.ServiceProxy;
import org.gcube.portlets.admin.resourcemanagement.server.gcube.services.StatusHandler;
import org.gcube.portlets.admin.resourcemanagement.server.gcube.services.configuration.ConfigurationLoader;
+import org.gcube.portlets.admin.resourcemanagement.shared.utils.BCrypt;
import org.gcube.resourcemanagement.support.client.utils.CurrentStatus;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
import org.gcube.resourcemanagement.support.server.gcube.CacheManager;
@@ -68,9 +66,7 @@ import org.gcube.vremanagement.resourcemanager.client.RMReportingLibrary;
import org.w3c.dom.Node;
import org.xml.sax.InputSource;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.server.rpc.RemoteServiceServlet;
-import org.gcube.portlets.admin.resourcemanagement.shared.utils.BCrypt;
/**
* @author Daniele Strollo
@@ -168,10 +164,16 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
checker.validate(resType != null && resType.trim().length() > 0, new Exception("Invalid parameter type"));
checker.validate(resourceIDs != null && resourceIDs.size() > 0, new Exception("Invalid parameter type"));
checker.validate(scope != null && scope.trim().length() > 0, new Exception("Invalid parameter type"));
+
AllowedResourceTypes type = AllowedResourceTypes.valueOf(resType);
ScopeBean targetScope = new ScopeBean(scope);
ScopeBean sourceScope = new ScopeBean(status.getCurrentScope());
+ //new check
+ if (sourceScope.type() == Type.INFRASTRUCTURE && targetScope.type() == Type.VRE ) {
+ throw new Exception("Because adding a VRE Context from the Root VO is not allowed.");
+ }
+
String reportID = ManagementUtils.addToExistingScope(type,
resourceIDs.toArray(new String[]{}),
@@ -211,13 +213,18 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
AllowedResourceTypes type = AllowedResourceTypes.valueOf(resType);
ScopeBean targetScope = new ScopeBean(scope);
ScopeBean sourceScope = new ScopeBean(status.getCurrentScope());
-
+
+ //new check
+ if (sourceScope.type() == Type.INFRASTRUCTURE && targetScope.type() == Type.VRE ) {
+ throw new Exception("Because removing a VRE Context from the Root VO is not allowed.");
+ }
+
String reportID = ManagementUtils.removeFromExistingScope(type,
resourceIDs.toArray(new String[]{}),
sourceScope,
targetScope);
-
-
+
+
RMReportingLibrary manager =
ResourceFactory.createResourceManager(type).getReportResourceManager(targetScope.toString());
@@ -265,14 +272,14 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
Map scopes = ScopeManager.getAvailableScopes();
for (ScopeBean scope : scopes.values())
retval.add(scope.toString());
-
+
return retval;
} catch (Exception e) {
retval.add("/gcube");
retval.add("/gcube/devsec");
e.printStackTrace();
}
-
+
return retval;
}
@@ -354,12 +361,12 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
if (results != null && results.size() > 0) {
ResourceDescriptor retval = new ResourceDescriptor();
-
+
List currValue = null;
DocumentBuilder docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Node node = docBuilder.parse(new InputSource(new StringReader(results.get(0)))).getDocumentElement();
XPathHelper helper = new XPathHelper(node);
-
+
currValue = helper.evaluate("/Resource/ID/text()");
if (currValue != null && currValue.size() > 0) {
retval.setID(currValue.get(0));
@@ -529,6 +536,6 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
ServerConsole.info(LOG_PREFIX, "FAILED ATTEMPT SUPER USER MODE FROM IP: " + ipAddressCaller);
return matched;
}
-
-
+
+
}