in the way to the FWS, 50 percent ported so far

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/resource-management@81277 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-09-11 16:40:39 +00:00
parent f6ca07b08f
commit c099f1f4e8
29 changed files with 328 additions and 247 deletions

View File

@ -34,5 +34,6 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/resource-management-4.1.0-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -4,6 +4,9 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="rmp-common-library-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/rmp-common-library/rmp-common-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="resource-management"/>
</wb-module>

View File

@ -0,0 +1,2 @@
disabled=06target
eclipse.preferences.version=1

66
pom.xml
View File

@ -25,7 +25,7 @@
</scm>
<properties>
<!-- Convenience property to set the GWT version -->
<gwtVersion>2.4.0</gwtVersion>
<gwtVersion>2.5.1</gwtVersion>
<guice.version>3.0</guice.version>
<distroDirectory>distro</distroDirectory>
<!-- GWT needs at least java 1.6 -->
@ -43,19 +43,18 @@
<dependencies>
<!-- This dependency is needed and is need on TOP to use GWT UI BInder
without old Xerces version of gCore complaining -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.9.1</version>
<scope>provided</scope>
</dependency>
without old Xerces and Xalan version of gCore complaining -->
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
@ -131,29 +130,29 @@
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>rmp-common-library</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<!-- External Modules -->
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>ishealth-monitor-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>resource-sweeper-widget</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>software-upload-wizard</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<dependency>
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>activation-record-widgets</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>org.gcube.portlets.admin</groupId> -->
<!-- <artifactId>ishealth-monitor-widget</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.portlets.admin</groupId> -->
<!-- <artifactId>resource-sweeper-widget</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.portlets.admin</groupId> -->
<!-- <artifactId>software-upload-wizard</artifactId> -->
<!-- <version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
<!-- <groupId>org.gcube.portlets.admin</groupId> -->
<!-- <artifactId>activation-record-widgets</artifactId> -->
<!-- <version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version> -->
<!-- </dependency> -->
<!-- guice -->
<dependency>
<groupId>com.google.inject</groupId>
@ -242,7 +241,7 @@
<artifactId>gwt-log</artifactId>
<version>3.1.7</version>
<scope>provided</scope>
</dependency>
</dependency>
</dependencies>
<build>
@ -255,7 +254,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.4.0</version>
<version>${gwtVersion}</version>
<executions>
<execution>
<goals>
@ -267,10 +266,11 @@
<!-- Plugin configuration. There are many available options, see gwt-maven-plugin
documentation at codehaus.org -->
<configuration>
<extraJvmArgs>-Xmx512M -DGLOBUS_LOCATION=${GLOBUS_LOCATION}</extraJvmArgs>
<extraJvmArgs>-Xmx512M -DGLOBUS_LOCATION=${GLOBUS_LOCATION}
-classpath $CLASSPATH:${GLOBUS_LOCATION}</extraJvmArgs>
<runTarget>ResourceManagementPortlet.html</runTarget>
<hostedWebapp>${webappDirectory}</hostedWebapp>
<!-- <logLevel>DEBUG</logLevel> -->
<!-- <logLevel>DEBUG</logLevel> -->
</configuration>
</plugin>

View File

@ -17,10 +17,10 @@
package org.gcube.portlets.admin.resourcemanagement.client;
import org.gcube.portlets.admin.client.forms.ActivationRecordVMForm;
import org.gcube.portlets.admin.client.forms.GenericResourceCMForm;
import org.gcube.portlets.admin.client.forms.GenericResourceTreeManagerForm;
import org.gcube.portlets.admin.ishealthmonitor.client.dialog.ISMonitor;
//import org.gcube.portlets.admin.client.forms.ActivationRecordVMForm;
//import org.gcube.portlets.admin.client.forms.GenericResourceCMForm;
//import org.gcube.portlets.admin.client.forms.GenericResourceTreeManagerForm;
//import org.gcube.portlets.admin.ishealthmonitor.client.dialog.ISMonitor;
import org.gcube.portlets.admin.resourcemanagement.client.forms.genericresources.DeployVirtualCollection;
import org.gcube.portlets.admin.resourcemanagement.client.remote.ProxyRegistry;
import org.gcube.portlets.admin.resourcemanagement.client.utils.Commands;
@ -35,7 +35,7 @@ import org.gcube.portlets.admin.resourcemanagement.client.widgets.panels.MainPan
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.UIIdentifiers;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.WidgetsRegistry;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.viewport.MainContainer;
import org.gcube.portlets.admin.resourcesweeper.client.dialog.SweeperDialog;
//import org.gcube.portlets.admin.resourcesweeper.client.dialog.SweeperDialog;
import org.gcube.resourcemanagement.support.client.Resource_support;
import org.gcube.resourcemanagement.support.client.events.SetScopeEvent;
import org.gcube.resourcemanagement.support.client.events.SetScopeEventHandler;
@ -139,7 +139,7 @@ public class ResourceManagementPortlet implements EntryPoint {
// the menu and statusbar can be built.
buildMenu();
buildStatusBar();
Commands.mask("Loading scopes", UIIdentifiers.MAIN_CONTAINER_VIEWPORT_ID);
Commands.mask("Loading infrastructure scopes", UIIdentifiers.MAIN_CONTAINER_VIEWPORT_ID);
Commands.doGetAvailableScopes(this);
if (StatusHandler.getStatus().getCurrentScope() != null) {
@ -165,7 +165,7 @@ public class ResourceManagementPortlet implements EntryPoint {
viewport.setLayout(bl);
WidgetsRegistry.registerWidget(UIIdentifiers.MAIN_CONTAINER_VIEWPORT_ID, viewport);
MainPanel northPanel = new MainPanel(53, "Main App", LayoutRegion.NORTH) {
MainPanel northPanel = new MainPanel(60, "Main App", LayoutRegion.NORTH) {
@Override
public void init() {
ConsoleMessageBroker.log(this, "Initializing north panel");
@ -189,11 +189,11 @@ public class ResourceManagementPortlet implements EntryPoint {
}
};
MainPanel westPanel = new MainPanel(200, "ResourceNavigation", LayoutRegion.WEST) {
MainPanel westPanel = new MainPanel(200, "Resources", LayoutRegion.WEST) {
@Override
public void init() {
ConsoleMessageBroker.log(this, "Initializing west panel");
this.setCollapsible(true);
this.setCollapsible(false);
this.setMargins(new Margins(5, 0, 5, 5));
Text widget = new Text();
widget.setId("res-details-widget-fake");
@ -439,16 +439,16 @@ public class ResourceManagementPortlet implements EntryPoint {
MenuItem testIS = new MenuItem("Check IS Health") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
GWT.runAsync(ISMonitor.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
ISMonitor.pingIS();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
// super.onClick(be);
// GWT.runAsync(ISMonitor.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// ISMonitor.pingIS();
// }
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
// });
};
};
testIS.setIconStyle("is-icon");
@ -460,22 +460,22 @@ public class ResourceManagementPortlet implements EntryPoint {
MenuItem cleanGHN = new MenuItem("Resource Sweeper") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
if (SupportedOperations.SWEEP_GHN.isAllowed(StatusHandler.getStatus().getCredentials())) {
GWT.runAsync(SweeperDialog.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
new SweeperDialog(currentScope);
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
}
else
MessageBox.alert("Resource Sweeper", "You are not allowed to execute this operation", null);
// super.onClick(be);
// if (SupportedOperations.SWEEP_GHN.isAllowed(StatusHandler.getStatus().getCredentials())) {
// GWT.runAsync(SweeperDialog.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// String currentScope = StatusHandler.getStatus().getCurrentScope();
// new SweeperDialog(currentScope);
// }
//
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
// });
// }
// else
// MessageBox.alert("Resource Sweeper", "You are not allowed to execute this operation", null);
};
};
@ -499,22 +499,22 @@ public class ResourceManagementPortlet implements EntryPoint {
// Create activation record from plugins
MenuItem createARTM = new MenuItem("Activation Record for Tree Manager") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
GWT.runAsync(GenericResourceTreeManagerForm.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
new GenericResourceTreeManagerForm(currentScope).show();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
} else {
MessageBox.alert("Activation Record for TM", "You are not allowed to execute this operation", null);
}
// super.onClick(be);
// if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
// GWT.runAsync(GenericResourceTreeManagerForm.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// String currentScope = StatusHandler.getStatus().getCurrentScope();
// new GenericResourceTreeManagerForm(currentScope).show();
// }
//
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
// });
// } else {
// MessageBox.alert("Activation Record for TM", "You are not allowed to execute this operation", null);
// }
};
};
createARTM.setIconStyle("pluginTM-icon");
@ -523,23 +523,23 @@ public class ResourceManagementPortlet implements EntryPoint {
// Create activation record from plugins
MenuItem createACM = new MenuItem("Activation Record for Content Manager") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
GWT.runAsync(GenericResourceCMForm.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
new GenericResourceCMForm(currentScope).show();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
} else {
MessageBox.alert("Activation Record for CM", "You are not allowed to execute this operation", null);
}
// super.onClick(be);
// if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
// GWT.runAsync(GenericResourceCMForm.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// String currentScope = StatusHandler.getStatus().getCurrentScope();
// new GenericResourceCMForm(currentScope).show();
// }
//
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
// });
//
// } else {
// MessageBox.alert("Activation Record for CM", "You are not allowed to execute this operation", null);
// }
};
};
createACM.setIconStyle("pluginCM-icon");
@ -548,24 +548,24 @@ public class ResourceManagementPortlet implements EntryPoint {
// Create activation record from VM
MenuItem createVM = new MenuItem("Activation Record for View Manager") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
//MessageBox.alert("Activation Record for VM", "Operation not implemented yet.", null);
GWT.runAsync(ActivationRecordVMForm.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
new ActivationRecordVMForm(currentScope).show();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
} else {
MessageBox.alert("Activation Record for VM", "You are not allowed to execute this operation", null);
}
// super.onClick(be);
// if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
// //MessageBox.alert("Activation Record for VM", "Operation not implemented yet.", null);
//
// GWT.runAsync(ActivationRecordVMForm.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// String currentScope = StatusHandler.getStatus().getCurrentScope();
// new ActivationRecordVMForm(currentScope).show();
// }
//
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
// });
// } else {
// MessageBox.alert("Activation Record for VM", "You are not allowed to execute this operation", null);
// }
};
};
createVM.setIconStyle("pluginVM-icon");

View File

@ -207,7 +207,7 @@ public class Commands {
StatusHandler.getStatus().setCurrentScope(scope);
StatusHandler.getStatus().setCurrentResourceType(resourceType);
Commands.mask(
"Getting Profile Details for " + resourceType + ": " + resourceID,
"Getting Profile Details for " + FWSTranslate.getFWSNameFromLabel(resourceType) + ": " + resourceID,
WidgetsRegistry.getPanel(UIIdentifiers.RESOURCE_DETAIL_GRID_PANEL).getContainer()
);
ProxyRegistry.getProxyInstance().getResourceByID(

View File

@ -0,0 +1,23 @@
package org.gcube.portlets.admin.resourcemanagement.client.utils;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
/**
* Simply return the correspondant Feather Weight Stack label to the gCore Label
* @author Massimiliano Assante (ISTI-CNR)
*
*/
public class FWSTranslate {
/**
*
* @param gCoreLabel
* @return the Feather Weight Stack label if present, the same label otherwise
*/
public static String getFWSNameFromLabel(String gCoreLabel) {
ResourceTypeDecorator[] toCheck = ResourceTypeDecorator.values();
for (int i = 0; i < toCheck.length; i++) {
if (gCoreLabel.compareTo(toCheck[i].name()) == 0)
return toCheck[i].getFWSName();
}
return gCoreLabel;
}
}

View File

@ -25,7 +25,7 @@ import org.gcube.portlets.admin.resourcemanagement.client.utils.OpCommands;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.console.ConsoleMessageBroker;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.UIIdentifiers;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.registry.WidgetsRegistry;
import org.gcube.portlets.admin.software_upload_wizard.client.AppController;
//import org.gcube.portlets.admin.software_upload_wizard.client.AppController;
import org.gcube.resourcemanagement.support.client.utils.StatusHandler;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
import org.gcube.resourcemanagement.support.shared.operations.SupportedOperations;
@ -108,7 +108,8 @@ public class ResourceDetailsPanel {
*/
public final void init() {
this.rootPanel = new ContentPanel(new FitLayout());
this.rootPanel.setHeading("Resource Details");
// this.rootPanel.setHeading("Resource Details");
this.rootPanel.setHeaderVisible(false);
this.widget.setId("res-details-widget-fake");
this.widget.setStyleName("x-panel-cube-background");
@ -322,24 +323,24 @@ public class ResourceDetailsPanel {
this.getToolBar().add(new SeparatorToolItem());
ToolButton doAddSoftware = new ToolButton("add-software-icon") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
GWT.runAsync(AppController.class, new RunAsyncCallback() {
@Override
public void onSuccess() {
String currentScope = StatusHandler.getStatus().getCurrentScope();
HandlerManager eventBus = new HandlerManager(null);
AppController appViewer = new AppController(eventBus, currentScope);
//AppController appViewer = new AppController(eventBus);
appViewer.go();
}
public void onFailure(Throwable reason) {
Window.alert("There are networks problem, please check your connection.");
}
});
// super.onClick(be);
//
//
// GWT.runAsync(AppController.class, new RunAsyncCallback() {
// @Override
// public void onSuccess() {
// String currentScope = StatusHandler.getStatus().getCurrentScope();
// HandlerManager eventBus = new HandlerManager(null);
// AppController appViewer = new AppController(eventBus, currentScope);
// //AppController appViewer = new AppController(eventBus);
// appViewer.go();
// }
//
// public void onFailure(Throwable reason) {
// Window.alert("There are networks problem, please check your connection.");
// }
//
// });
};
};
@ -352,7 +353,7 @@ public class ResourceDetailsPanel {
public final void setGrid(final Grid<ModelData> grid, final boolean groupingEnabled) {
// Sets the grid container title
this.rootPanel.setHeading("Resource Details (" + StatusHandler.getStatus().getCurrentResourceType() + ")");
//this.rootPanel.setHeading("Resource Details (" + StatusHandler.getStatus().getCurrentResourceType() + ")");
this.initToolbar();

View File

@ -115,7 +115,8 @@ public class ResourcesTreePanel {
try {
icon = ResourceTypeDecorator.valueOf(type).getIcon();
label = ResourceTypeDecorator.valueOf(type).getLabel();
label = ResourceTypeDecorator.valueOf(type).getFWSName();
//label = ResourceTypeDecorator.valueOf(type).getLabel();
} catch (java.lang.IllegalArgumentException e) {
label = type;
icon = null;

View File

@ -37,6 +37,7 @@ public abstract class MainPanel {
};
};
this.setSplit(true);
container.setHeaderVisible(false);
}
public MainPanel(final int size, final LayoutRegion position) {
@ -78,6 +79,7 @@ public abstract class MainPanel {
public final void setSplit(final boolean split) {
this.layout.setSplit(split);
}
public final void add(final Widget w, final boolean removeOthers) {
if (removeOthers) {

View File

@ -16,6 +16,8 @@
package org.gcube.portlets.admin.resourcemanagement.client.widgets.taskbar;
import org.gcube.portlets.admin.resourcemanagement.client.utils.FWSTranslate;
import com.extjs.gxt.ui.client.core.El;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.event.Events;
@ -150,7 +152,7 @@ public class TaskbarButton extends Component implements IconSupport {
String fontStyle = "font-family:'Reenie Beanie',arial,sans-serif; font-size:20px; padding: 5px; overflow-x: hidden; overflow-y: hidden;";
setElement(DOM.createElement("dt"), target, index);
El a = el().createChild("<div style=\""+ style +"\"><a href='#'></a></div>");
iconEl = a.createChild("<h2>"+type+"</h2>");
iconEl = a.createChild("<h2>"+FWSTranslate.getFWSNameFromLabel(type)+"</h2>");
El txt = a.createChild("<div style=\""+fontStyle+"\" align=\"center\"></div>");
String toShow = "";
if (text.length() / splitTextTo > 0) {

View File

@ -62,9 +62,8 @@ public class TaskbarItem {
return this.scope;
}
private void initUI(final String title,
final String id,
final String buttonIcon) {
private void initUI(final String title, final String id,final String buttonIcon) {
this.detachButton = new TaskbarButton("btn" + id, ""+type, title) {
protected void onClick(final com.extjs.gxt.ui.client.event.ComponentEvent ce) {
relatedWidget.doMinimize();

View File

@ -19,15 +19,13 @@ package org.gcube.portlets.admin.resourcemanagement.server;
import java.util.List;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.scope.impl.ScopeBean;
import org.gcube.resourcemanagement.support.client.utils.CurrentStatus;
import org.gcube.resourcemanagement.support.shared.util.Assertion;
import org.gcube.resourcemanagement.support.server.managers.resources.CollectionManager;
import org.gcube.resourcemanagement.support.server.managers.resources.GHNManager;
import org.gcube.resourcemanagement.support.server.managers.resources.GenericResourceManager;
import org.gcube.resourcemanagement.support.server.managers.resources.RuntimeResourceManager;
import org.gcube.resourcemanagement.support.server.managers.resources.ViewManager;
import org.gcube.resourcemanagement.support.server.managers.scope.ScopeManager;
import org.gcube.resourcemanagement.support.server.types.AllowedResourceTypes;
import org.gcube.resourcemanagement.support.server.utils.ServerConsole;
@ -61,7 +59,7 @@ public class ResourceCommands {
checker.validate(opCode.isAllowed(status.getCredentials()),
new InvalidParameterException("The current user is not allowed to execute the operation."));
GCUBEScope gscope = ScopeManager.getScope(scope);
ScopeBean gscope = new ScopeBean(scope);
/**********************************************************
* GHN
@ -182,24 +180,24 @@ public class ResourceCommands {
/**********************************************************
* VIEW
*********************************************************/
// DELETE
if (opCode.equals(SupportedOperations.VIEW_DELETE)) {
for (ResourceDescriptor resource : resources) {
checker.validate(
resource.getType().equals(AllowedResourceTypes.VIEW.name()),
new InvalidParameterException("Invalid type. " + AllowedResourceTypes.VIEW.name() + " required"));
new ViewManager(resource.getID()).delete(gscope);
}
}
// DELETE
if (opCode.equals(SupportedOperations.VIEW_FORCE_DELETE)) {
for (ResourceDescriptor resource : resources) {
checker.validate(
resource.getType().equals(AllowedResourceTypes.VIEW.name()),
new InvalidParameterException("Invalid type. " + AllowedResourceTypes.VIEW.name() + " required"));
new ViewManager(resource.getID()).forceDelete(gscope);
}
}
// // DELETE
// if (opCode.equals(SupportedOperations.VIEW_DELETE)) {
// for (ResourceDescriptor resource : resources) {
// checker.validate(
// resource.getType().equals(AllowedResourceTypes.VIEW.name()),
// new InvalidParameterException("Invalid type. " + AllowedResourceTypes.VIEW.name() + " required"));
// new ViewManager(resource.getID()).delete(gscope);
// }
// }
// // DELETE
// if (opCode.equals(SupportedOperations.VIEW_FORCE_DELETE)) {
// for (ResourceDescriptor resource : resources) {
// checker.validate(
// resource.getType().equals(AllowedResourceTypes.VIEW.name()),
// new InvalidParameterException("Invalid type. " + AllowedResourceTypes.VIEW.name() + " required"));
// new ViewManager(resource.getID()).forceDelete(gscope);
// }
// }
/**********************************************************
* RUNNING INSTANCE

View File

@ -32,6 +32,7 @@ import org.gcube.common.core.informationsystem.client.QueryParameter;
import org.gcube.common.core.informationsystem.client.XMLResult;
import org.gcube.common.core.informationsystem.client.queries.GCUBEGenericQuery;
import org.gcube.common.core.scope.GCUBEScope;
import org.gcube.common.scope.impl.ScopeBean;
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;
@ -55,6 +56,7 @@ import org.gcube.resourcemanagement.support.shared.types.UserGroup;
import org.gcube.resourcemanagement.support.shared.types.datamodel.CompleteResourceProfile;
import org.gcube.resourcemanagement.support.shared.types.datamodel.ResourceDescriptor;
import org.gcube.resourcemanagement.support.shared.util.Assertion;
import org.gcube.vremanagement.resourcemanager.client.RMReportingLibrary;
import org.gcube.vremanagement.resourcemanager.stubs.reporting.ReportingPortType;
import com.google.gwt.core.client.GWT;
@ -158,16 +160,16 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
checker.validate(scope != null && scope.trim().length() > 0, new Exception("Invalid parameter type"));
AllowedResourceTypes type = AllowedResourceTypes.valueOf(resType);
GCUBEScope targetScope = ScopeManager.getScope(scope);
GCUBEScope sourceScope = ScopeManager.getScope(status.getCurrentScope());
ScopeBean targetScope = new ScopeBean(scope);
ScopeBean sourceScope = new ScopeBean(status.getCurrentScope());
String reportID = ManagementUtils.addToExistingScope(type,
resourceIDs.toArray(new String[]{}),
sourceScope,
targetScope);
ReportingPortType manager =
ResourceFactory.createResourceManager(type).getReportResourceManager(targetScope);
RMReportingLibrary manager =
ResourceFactory.createResourceManager(type).getReportResourceManager(targetScope.toString());
String xmlReport = manager.getReport(reportID);
String mappingPath = this.getXML2HTMLMapping();
@ -197,8 +199,8 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
checker.validate(scope != null && scope.trim().length() > 0, new Exception("Invalid parameter type"));
AllowedResourceTypes type = AllowedResourceTypes.valueOf(resType);
GCUBEScope targetScope = ScopeManager.getScope(scope);
GCUBEScope sourceScope = ScopeManager.getScope(status.getCurrentScope());
ScopeBean targetScope = new ScopeBean(scope);
ScopeBean sourceScope = new ScopeBean(status.getCurrentScope());
return new Tuple<String>(ManagementUtils.removeFromExistingScope(type,
resourceIDs.toArray(new String[]{}),
@ -208,7 +210,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
public final String deploy(final List<String> ghnsID, final List<String> servicesID) throws Exception {
try {
GCUBEScope sourceScope = ScopeManager.getScope(this.getCurrentStatus().getCurrentScope());
ScopeBean sourceScope = new ScopeBean(this.getCurrentStatus().getCurrentScope());
String[] param1 = ghnsID.toArray(new String[0]);
String[] param2 = servicesID.toArray(new String[0]);
return ManagementUtils.deploy(sourceScope, param1, param2);
@ -221,8 +223,8 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
public final Tuple<String> checkDeployStatus(final String scope, final String deployID) throws Exception {
if (SupportedOperations.SERVICE_GET_REPORT.isAllowed(this.getCurrentStatus().getCredentials())) {
GCUBEScope sourceScope = ScopeManager.getScope(scope);
ReportingPortType manager =
ResourceFactory.createResourceManager(AllowedResourceTypes.Service).getReportResourceManager(sourceScope);
RMReportingLibrary manager =
ResourceFactory.createResourceManager(AllowedResourceTypes.Service).getReportResourceManager(sourceScope.toString());
String xmlReport = manager.getReport(deployID);
String mappingPath = this.getXML2HTMLMapping();
String htmlReport = ISClientRequester.XML2HTML(xmlReport, mappingPath);
@ -273,7 +275,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
public final HashMap<String, ArrayList<String>> getResourceTypeTree(final String scope) throws Exception {
try {
GCUBEScope gscope = ScopeManager.getScope(scope);
ScopeBean gscope = new ScopeBean(scope);
HashMap<String, ArrayList<String>> results = ISClientRequester.getResourcesTree(getCacheManager(this.getCurrentStatus()), gscope);
return results;
} catch (Exception e) {
@ -289,7 +291,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
getCacheManager(this.getCurrentStatus()),
type,
id,
ScopeManager.getScope(scope)
new ScopeBean(scope)
);
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);
@ -302,7 +304,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
try {
return ISClientRequester.getResourcesByType(
getCacheManager(this.getCurrentStatus()),
ScopeManager.getScope(scope), type, null);
new ScopeBean(scope), type, null);
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);
return null;
@ -380,13 +382,13 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
if (scope == null || type == null) {
return null;
}
return ISClientRequester.getResourceModels(ScopeManager.getScope(scope), type, subType, additionalMaps);
return ISClientRequester.getResourceModels(new ScopeBean(scope), type, subType, additionalMaps);
}
public final List<String> getWSResources(final String scope) {
try {
return ISClientRequester.getWSResources(ScopeManager.getScope(scope));
return ISClientRequester.getWSResources(new ScopeBean(scope));
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);
return null;
@ -397,7 +399,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
try {
return ISClientRequester.getResourcesByType(
getCacheManager(this.getCurrentStatus()),
ScopeManager.getScope(scope), type, subtype);
new ScopeBean(scope), type, subtype);
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);
return null;
@ -406,16 +408,14 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
public final CompleteResourceProfile getResourceByID(final String scope, final String type, final String resID) {
try {
CompleteResourceProfile profile = ISClientRequester.getResourceByID(
this.getXML2HTMLMapping(),
ScopeManager.getScope(scope),
type,
resID);
CompleteResourceProfile profile = ISClientRequester.getResourceByID(this.getXML2HTMLMapping(), new ScopeBean(scope), type, resID);
System.out.println("CompleteResourceProfile getResourceByID(final String scope, final String type, final String resID)");
return profile;
} catch (Exception e) {
ServerConsole.error(LOG_PREFIX, e);
return null;
}
}
public final String createGenericResource(
@ -433,7 +433,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
return GenericResourceManager.create(
ID,
ScopeManager.getScope(this.getCurrentStatus().getCurrentScope()),
new ScopeBean(this.getCurrentStatus().getCurrentScope()),
name,
description,
body,
@ -453,7 +453,7 @@ public class ServiceProxyImpl extends RemoteServiceServlet implements ServicePro
SupportedOperations.GENERIC_RESOURCE_EDIT.isAllowed(this.getCurrentStatus().getCredentials()),
new InvalidPermissionsException("The user is not allowed to execute the following operation"));
GCUBEScope sourceScope = ScopeManager.getScope(this.getCurrentStatus().getCurrentScope());
ScopeBean sourceScope = new ScopeBean(this.getCurrentStatus().getCurrentScope());
GenericResourceManager resource = new GenericResourceManager(ID);
resource.update(name, description, body, subType, sourceScope);
}

View File

@ -8,15 +8,13 @@
<inherits name='com.extjs.gxt.ui.GXT' />
<!-- inherits Software Uplad Widget -->
<inherits
name='org.gcube.portlets.admin.software_upload_wizard.SoftwareUploadWizard' />
<!-- <inherits name='org.gcube.portlets.admin.software_upload_wizard.SoftwareUploadWizard' /> -->
<!-- inherits Resource Sweeper Widget -->
<inherits name='org.gcube.portlets.admin.resourcesweeper.Resource_sweeper' />
<!-- <inherits name='org.gcube.portlets.admin.resourcesweeper.Resource_sweeper' /> -->
<inherits name='org.gcube.portlets.admin.Activation_record_widgets' />
<!-- <inherits name='org.gcube.portlets.admin.Activation_record_widgets' /> -->
<!-- inherits IS Health Monitor Widget -->
<inherits
name='org.gcube.portlets.admin.ishealthmonitor.Resource_ishealth_monitor' />
<!-- <inherits name='org.gcube.portlets.admin.ishealthmonitor.Resource_ishealth_monitor' /> -->
<inherits name='org.gcube.resourcemanagement.support.Resource_support' />
<entry-point

View File

@ -1,6 +1,6 @@
/* Comment import to style regular, uncomment if deploying on openbio or d4science.org */
/*@import url(openbio.css);*/
/*@import url(d4scienceOrg.css);*/
@import url(d4scienceOrg.css);
/* Fix the scrollbar background style*/
.x-progress-text div {
@ -52,6 +52,10 @@
.taskbar-pattern {
background-image: url(images/pattern.gif);
background-repeat: repeat;
border: 2px solid #A9BFD3;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.taskbar-button {
@ -228,7 +232,7 @@
}
.ghn-icon {
background-image: url(images/icons/server.png) !important;
background-image: url(images/icons/hostingNode.png) !important;
}
.defaultleaf-icon {
@ -236,15 +240,15 @@
}
.collection-icon {
background-image: url(images/icons/folder_database.png) !important;
background-image: url(images/icons/collection2.png) !important;
}
.genericresource-icon {
background-image: url(images/icons/plugin.png) !important;
background-image: url(images/icons/GenericResource.png) !important;
}
.runtimeresource-icon {
background-image: url(images/icons/application_cascade.png) !important;
background-image: url(images/icons/serviceEndpoint.png) !important;
}
.pluginCM-icon {
@ -264,11 +268,11 @@
}
.runninginstance-icon {
background-image: url(images/icons/cog_go.png) !important;
background-image: url(images/icons/gcoreEndpoint.png) !important;
}
.service-icon {
background-image: url(images/icons/cog.png) !important;
background-image: url(images/icons/software.png) !important;
}
.empty-icon {

View File

@ -16,51 +16,51 @@
</servlet-mapping>
<!-- Sweeper -->
<servlet>
<servlet-name>sweeperServlet</servlet-name>
<servlet-class>org.gcube.portlets.admin.resourcesweeper.server.SweeperServiceImpl</servlet-class>
</servlet>
<!-- <servlet> -->
<!-- <servlet-name>sweeperServlet</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.admin.resourcesweeper.server.SweeperServiceImpl</servlet-class> -->
<!-- </servlet> -->
<servlet-mapping>
<servlet-name>sweeperServlet</servlet-name>
<url-pattern>/resourcemanagementportlet/sweeper</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>sweeperServlet</servlet-name> -->
<!-- <url-pattern>/resourcemanagementportlet/sweeper</url-pattern> -->
<!-- </servlet-mapping> -->
<!-- SUW -->
<filter>
<filter-name>guiceFilter</filter-name>
<filter-class>com.google.inject.servlet.GuiceFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>guiceFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.gcube.portlets.admin.software_upload_wizard.server.BootstrapListener</listener-class>
</listener>
<!-- <filter> -->
<!-- <filter-name>guiceFilter</filter-name> -->
<!-- <filter-class>com.google.inject.servlet.GuiceFilter</filter-class> -->
<!-- </filter> -->
<!-- <filter-mapping> -->
<!-- <filter-name>guiceFilter</filter-name> -->
<!-- <url-pattern>/*</url-pattern> -->
<!-- </filter-mapping> -->
<!-- <listener> -->
<!-- <listener-class>org.gcube.portlets.admin.software_upload_wizard.server.BootstrapListener</listener-class> -->
<!-- </listener> -->
<!-- IS Health -->
<servlet>
<servlet-name>isHealthServlet</servlet-name>
<servlet-class>org.gcube.portlets.admin.ishealthmonitor.server.ISMonitorServiceImpl</servlet-class>
</servlet>
<!-- <servlet> -->
<!-- <servlet-name>isHealthServlet</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.admin.ishealthmonitor.server.ISMonitorServiceImpl</servlet-class> -->
<!-- </servlet> -->
<servlet-mapping>
<servlet-name>isHealthServlet</servlet-name>
<url-pattern>/resourcemanagementportlet/ishealth</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>isHealthServlet</servlet-name> -->
<!-- <url-pattern>/resourcemanagementportlet/ishealth</url-pattern> -->
<!-- </servlet-mapping> -->
<!-- Activation Record Widgets -->
<servlet>
<servlet-name>arServlet</servlet-name>
<servlet-class>org.gcube.portlets.admin.server.ARServiceImpl</servlet-class>
</servlet>
<!-- <servlet> -->
<!-- <servlet-name>arServlet</servlet-name> -->
<!-- <servlet-class>org.gcube.portlets.admin.server.ARServiceImpl</servlet-class> -->
<!-- </servlet> -->
<servlet-mapping>
<servlet-name>arServlet</servlet-name>
<url-pattern>/resourcemanagementportlet/activeservice</url-pattern>
</servlet-mapping>
<!-- <servlet-mapping> -->
<!-- <servlet-name>arServlet</servlet-name> -->
<!-- <url-pattern>/resourcemanagementportlet/activeservice</url-pattern> -->
<!-- </servlet-mapping> -->
<servlet>

View File

@ -6,12 +6,12 @@ USER_CREDENTIALS = DEBUG
# Defines the modality in which the portlet is running
# possible values [STANDALONE,PORTAL,NOTDEFINED]
RUNNING_MODE = PORTAL
RUNNING_MODE = STANDALONE
DEFAULT_USER = massimiliano.assante
# The scope that will be used as default
DEFAULT_SCOPE =/d4science.research-infrastructures.eu
DEFAULT_SCOPE =/d4science.research-infrastructures.eu/gCubeApps
# the target of update notification (if in singleton mode)
# mails MUST be separated by ;
USERMAIL_TO = m.assante@gmail.com

View File

@ -1,10 +1,58 @@
#wrapper {
font: 11px/1.5 "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, sans-serif;
font: 11px/1.5 "Lucida Grande", "Lucida Sans Unicode", Arial, Verdana,
sans-serif;
margin: 0 auto;
width: 90% !important;
width: 92% !important;
}
#bottombar {
margin: 0 auto;
width: 100% !important;
.x-menubar {
background: #FFF url(images/bg-pattern.png) repeat;
}
.x-panel-body-noheader {
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.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-header {
background: #FFF url(images/bg-pattern.png) repeat;
}
.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: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 945 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 622 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 854 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 530 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,6 +1,5 @@
package org.gcube.portlets.admin.resourcemanagement.client;
import com.google.gwt.junit.client.GWTTestCase;
/**
* GWT JUnit <b>integration</b> tests must extend GWTTestCase.
@ -12,7 +11,7 @@ import com.google.gwt.junit.client.GWTTestCase;
* See http://mojo.codehaus.org/gwt-maven-plugin/user-guide/testing.html
* for details.
*/
public class GwtTestResourceManagementPortlet extends GWTTestCase {
public class GwtTestResourceManagementPortlet {
/**
* Must refer to a valid module that sources this class.