new icons for resources, integrated (hybrid) the Service Endpoint Editor, still need test

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/admin/resource-management@82060 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-09-26 17:09:57 +00:00
parent 1d14179522
commit 9d01f03174
19 changed files with 201 additions and 151 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/resource-management-5.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/resource-management-5.0.1-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -36,5 +36,5 @@
</classpathentry>
<classpathentry kind="lib" path="/Applications/eclipse 4.3/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="lib" path="/Applications/eclipse 4.3/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/validation-api-1.0.0.GA.jar" sourcepath="/Applications/eclipse 4.3/plugins/com.google.gwt.eclipse.sdkbundle_2.5.1/gwt-2.5.1/validation-api-1.0.0.GA-sources.jar"/>
<classpathentry kind="output" path="target/resource-management-5.0.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/resource-management-5.0.1-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,5 @@
eclipse.preferences.version=1
jarsExcludedFromWebInfLib=
lastWarOutDir=/Users/massi/Documents/workspace/resource-management/target/resource-management-5.0.0-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/resource-management/target/resource-management-5.0.1-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

68
pom.xml
View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.admin</groupId>
<artifactId>resource-management</artifactId>
<version>5.0.0-SNAPSHOT</version>
<version>5.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<name>gCube Resource Management Portlet</name>
<description>
@ -39,7 +39,17 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId>
<version>LATEST</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- This dependency is needed and is need on TOP to use GWT UI BInder
@ -47,19 +57,17 @@
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-servlet</artifactId>
<version>${gwtVersion}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>xalan</groupId>
<artifactId>xalan</artifactId>
<version>2.7.1</version>
<!-- <version>2.7.1</version> -->
</dependency>
<dependency>
<groupId>com.sencha.gxt</groupId>
@ -77,34 +85,63 @@
<artifactId>rmp-common-library</artifactId>
<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
</dependency>
<!-- FWS DEPS -->
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-scope-maps</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.resourcemanagement</groupId>
<artifactId>resourcemanager-client</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.resources</groupId>
<artifactId>registry-publisher</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.resourcemanagement</groupId>
<artifactId>ghn-manager-client</artifactId>
<version>[1.1.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.resourcemanagement</groupId>
<artifactId>ghnmanager-stubs</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>aslcore</artifactId>
<version>[3.2.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>home-library</artifactId>
<version>[4.3.0-SNAPSHOT, 5.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>home-library-jcr</artifactId>
<version>[1.3.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.applicationsupportlayer</groupId>
<artifactId>accesslogger</artifactId>
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>gcube-widgets</artifactId>
<version>[1.4.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -116,7 +153,6 @@
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>custom-portal-handler</artifactId>
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>provided</scope>
</dependency>
<!-- External Modules -->
@ -157,7 +193,6 @@
<dependency>
<groupId>net.customware.gwt.dispatch</groupId>
<artifactId>gwt-dispatch</artifactId>
<version>1.2.0</version>
<scope>provided</scope>
</dependency>
<!-- Liferay, Servlets Etc -->
@ -176,57 +211,48 @@
<dependency>
<groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId>
<version>2.0</version>
<scope>provided</scope>
</dependency>
<!-- Apache commons -->
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.4.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
<version>1.2.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
<scope>provided</scope>
</dependency>
<!-- Logging -->
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.16</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.6.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.allen-sauer.gwt.log</groupId>
<artifactId>gwt-log</artifactId>
<version>3.1.7</version>
<scope>provided</scope>
</dependency>
</dependencies>

View File

@ -495,9 +495,20 @@ public class ResourceManagementPortlet implements EntryPoint {
OpCommands.doOpenGenericResourceForm();
};
};
createGR.setIconStyle("genericresource-icon");
createMnu.add(createGR);
// Create Service Endpoint (former Runtime Resource)
MenuItem createSE = new MenuItem("Service Endpoint") {
protected void onClick(final ComponentEvent be) {
super.onClick(be);
OpCommands.doOpenServiceEndpointForm();
};
};
createSE.setIconStyle("runtimeresource-icon");
createMnu.add(createSE);
// Create activation record from plugins
MenuItem createARTM = new MenuItem("Activation Record for Tree Manager") {
protected void onClick(final ComponentEvent be) {

View File

@ -34,6 +34,7 @@ import com.extjs.gxt.ui.client.data.ModelData;
import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.event.MessageBoxEvent;
import com.extjs.gxt.ui.client.widget.MessageBox;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -163,6 +164,17 @@ public class OpCommands {
}
}
/*************************************************************
* SERVICE ENDPOINT
************************************************************/
public static final void doOpenServiceEndpointForm() {
if (SupportedOperations.GENERIC_RESOURCE_CREATE.isAllowed(StatusHandler.getStatus().getCredentials())) {
loadServiceEndopointEditor(null);
} else {
MessageBox.alert("Service Endpoint Creation", "You are not allowed to execute this operation", null);
}
}
/*************************************************************
* GENERIC RESOURCE
@ -175,6 +187,8 @@ public class OpCommands {
}
}
public static final void doCreateGenericResource(
final String id,
final String name,
@ -287,4 +301,32 @@ public class OpCommands {
});
}
}
/**
* Redirect to Service Endpoint Editor
* @param idToEdit
*/
public static void loadServiceEndopointEditor(String idToEdit) {
String location = Window.Location.getHref();
String res2EditParam = "";
if (idToEdit != null) {
res2EditParam = "&rid=" + idToEdit;
}
if (location.endsWith("/") || location.endsWith("#")) { //standalone
location = com.google.gwt.user.client.Window.Location.getProtocol() +"//"+ com.google.gwt.user.client.Window.Location.getHost() +
"/runtime-resource?pid=126&lifecycle=0&state=maximized&modes=view&doAsId=10136&refererPlid=10139&authzToken=101334249"
+ "&curscope="+StatusHandler.getStatus().getCurrentScope()+res2EditParam;
}
else { //portal
location += "/../runtime-resource?pid=126&lifecycle=0&state=maximized&modes=view&doAsId=10136&refererPlid=10139&authzToken=101334249"
+ "&curscope="+StatusHandler.getStatus().getCurrentScope()+res2EditParam;
}
Window.open(location, "_blank", "");
}
}

View File

@ -23,10 +23,8 @@ import org.gcube.portlets.admin.resourcemanagement.client.forms.genericresources
import org.gcube.portlets.admin.resourcemanagement.client.remote.ProxyRegistry;
import org.gcube.portlets.admin.resourcemanagement.client.utils.Commands;
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.resourcemanagement.support.client.utils.StatusHandler;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
import org.gcube.resourcemanagement.support.shared.operations.SupportedOperations;
@ -637,7 +635,7 @@ public class ContextMenuFactory {
for (ModelData e : container.getSelection()) {
idToEdit = e.get("ID");
}
loadRuntimeResourcePortlet(idToEdit);
OpCommands.loadServiceEndopointEditor(idToEdit);
}
};
// Checks the permissions on the operation
@ -687,37 +685,6 @@ public class ContextMenuFactory {
return delete;
}
String location;
/**
* Redirect to Runtime Resource Portlet
* @param idToEdit
*/
public void loadRuntimeResourcePortlet(String idToEdit){
getUrl();
// Window.alert(location);
if (location.endsWith("/") || location.endsWith("#")) { //standalone
location = com.google.gwt.user.client.Window.Location.getProtocol() +"//"+ com.google.gwt.user.client.Window.Location.getHost() + "/runtime-resource?pid=126&lifecycle=0&state=maximized&modes=view&doAsId=10136&refererPlid=10139&rid="+idToEdit+"&authzToken=101334249&curscope="+StatusHandler.getStatus().getCurrentScope();
//GWT.log("OPEN " + location);
getURL(location);
}
else { //portal
getUrl();
location += "/../runtime-resource?pid=126&lifecycle=0&state=maximized&modes=view&doAsId=10136&refererPlid=10139&rid="+idToEdit+"&authzToken=101334249&curscope="+StatusHandler.getStatus().getCurrentScope();
Window.open(location, "_self", "");
}
}
public static native void getURL(String url)/*-{
$wnd.open(url,'target=_blank')
}-*/;
/**
* Get URL from browser
*/
public native void getUrl()/*-{
this.@org.gcube.portlets.admin.resourcemanagement.client.views.resourcedetails.ContextMenuFactory::location = $wnd.location.href;
}-*/;
}

View File

@ -20,6 +20,7 @@ import static com.google.gwt.query.client.GQuery.$;
import java.util.ArrayList;
import org.gcube.portlets.admin.resourcemanagement.client.utils.FWSTranslate;
import org.gcube.resourcemanagement.support.client.views.ResourceTypeDecorator;
import com.extjs.gxt.ui.client.core.El;
import com.extjs.gxt.ui.client.event.ComponentEvent;
@ -41,13 +42,11 @@ import com.google.gwt.user.client.ui.AbstractImagePrototype;
* A selectable icon (post-it styled) and text added to the pinned resources (TaskbarWindow).
*/
public class TaskbarButton extends Component implements IconSupport {
private String type;
private ResourceTypeDecorator type;
private String text;
private AbstractImagePrototype icon;
private El iconEl;
private ArrayList<Integer> extractedColors = new ArrayList<Integer>();
/**
* Creates a new shortcut.
*/
@ -61,17 +60,28 @@ public class TaskbarButton extends Component implements IconSupport {
* @param id the shortcut id
* @param text the shortcut text
*/
public TaskbarButton(final String id, final String type, final String text) {
public TaskbarButton(final String id, final ResourceTypeDecorator type, final String text) {
setId(id);
setText(text);
this.type = type;
//for IE
final Timer t2 = new Timer() {
@Override
public void run() {
getElement().getFirstChildElement().getStyle().setOpacity(0.8);
}
};
//need to make sure the element is attached to the DOM
Timer t = new Timer() {
@Override
public void run() {
$(getElement().getFirstChildElement()).animate("opacity:'0.9'", 500);
$(getElement().getFirstChildElement()).animate("opacity:'0.8'", 500);
t2.schedule(500);
}
};
t.schedule(100);
}
@ -154,8 +164,8 @@ public class TaskbarButton extends Component implements IconSupport {
final El a = el().createChild("<div class=\"iosItem\" style=\"background-color: "+ getExaBackgroundColor() + "; opacity: 0;\"><a href='#'></a></div>");
iconEl = a.createChild(FWSTranslate.getFWSNameFromLabel(type));
final El a = el().createChild("<div class=\"iosItem\" style=\"background-color: "+ getExaBackgroundColor(type) + "; opacity: 0;\"><a href='#'></a></div>");
iconEl = a.createChild(FWSTranslate.getFWSNameFromLabel(type.toString()));
El txt = a.createChild("<div style=\""+fontStyle+"\" align=\"center\"></div>");
if (txt != null) {
@ -169,35 +179,24 @@ public class TaskbarButton extends Component implements IconSupport {
}
}
private String getExaBackgroundColor() {
//pick a random color
int no = Random.nextInt(7);
while (extractedColors.contains(no)) {
no = Random.nextInt(7);
}
extractedColors.add(no);
if (extractedColors.size() > 6)
extractedColors = new ArrayList<Integer>();
switch (no) {
case 0:
return "#bebee4";
case 1:
return "#CAEBFA";
case 2:
return "#a8f2b5";
case 3:
return "#fe99ad";
case 4:
return "#ffd395";
case 5:
return "#ffea97";
case 6:
return "#d4d4d4";
private String getExaBackgroundColor(ResourceTypeDecorator type) {
switch (type) {
case Collection:
return "#aa84c1"; //violet
case RunningInstance:
return "#8aacd2"; //blue
case GenericResource:
return "#79bd84"; //green
case GHN:
return "#a4d03b"; //ramarro
case RuntimeResource:
return "#e4df00"; //yellow
case Service:
return "#fea500"; //orange
case WSResource:
return "#f6634f"; //red
default:
return "#a8f2b5";
return "#CAEBFA"; //azur
}
}
}

View File

@ -16,8 +16,6 @@
package org.gcube.portlets.admin.resourcemanagement.client.widgets.taskbar;
import static com.google.gwt.query.client.GQuery.$;
import org.gcube.portlets.admin.resourcemanagement.client.remote.ProxyRegistry;
import org.gcube.portlets.admin.resourcemanagement.client.utils.Callbacks;
import org.gcube.portlets.admin.resourcemanagement.client.utils.Commands;
@ -28,7 +26,6 @@ import org.gcube.resourcemanagement.support.shared.util.Configuration;
import com.extjs.gxt.ui.client.event.ComponentEvent;
import com.extjs.gxt.ui.client.widget.menu.Menu;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
import com.google.gwt.core.client.GWT;
/**
* @author Massimiliano Assante (ISTI-CNR)
@ -66,7 +63,7 @@ public class TaskbarItem {
private void initUI(final String title, final String id,final String buttonIcon) {
this.detachButton = new TaskbarButton("btn" + id, ""+type, title) {
this.detachButton = new TaskbarButton("btn" + id, type, title) {
protected void onClick(final com.extjs.gxt.ui.client.event.ComponentEvent ce) {
relatedWidget.doMinimize();
}

View File

@ -16,6 +16,8 @@
package org.gcube.portlets.admin.resourcemanagement.client.widgets.taskbar;
import java.util.ArrayList;
import org.gcube.portlets.admin.resourcemanagement.client.widgets.console.ConsoleMessageBroker;
import org.gcube.resourcemanagement.support.shared.util.Configuration;
@ -34,6 +36,8 @@ public class TaskbarWindow extends Window {
private TaskbarItem relatedItem = null;
private boolean isMinimized = false;
public static ArrayList<Integer> extractedColors = new ArrayList<Integer>();
protected TaskbarWindow(final TaskbarItem relatedItem) {
super();
this.setModal(false);

View File

@ -10,7 +10,7 @@
}
.iosItem {
color: #4c68a6;
color: #FDFDF6;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light",
"Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
@ -20,6 +20,7 @@
margin-top: 10px;
padding: 5px;
width: 120px;
height: 100px;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
@ -239,33 +240,42 @@
background-image: url(images/icons/about.png) !important;
}
.resources-icon {
background-image: url(images/icons/world.png) !important;
}
.wsresources-icon {
background-image: url(images/icons/ws-resource.png) !important;
}
.ghn-icon {
background-image: url(images/icons/hostingNode.png) !important;
}
.defaultleaf-icon {
background-image: url(images/icons/grid.png) !important;
}
.resources-icon {
background-image: url(images/icons/world.png) !important;
}
/* RESOURCES */
.collection-icon {
background-image: url(images/icons/collection2.png) !important;
background-image: url(images/resource-icons/violet.png) !important;
}
.runninginstance-icon {
background-image: url(images/resource-icons/blue.png) !important;
}
.genericresource-icon {
background-image: url(images/icons/GenericResource.png) !important;
background-image: url(images/resource-icons/green.png) !important;
}
.runtimeresource-icon {
background-image: url(images/icons/serviceEndpoint.png) !important;
.ghn-icon {
background-image: url(images/resource-icons/ramarro.png) !important;
}
.runtimeresource-icon {
background-image: url(images/resource-icons/yellow.png) !important;
}
.service-icon {
background-image: url(images/resource-icons/orange.png) !important;
}
.wsresources-icon {
background-image: url(images/resource-icons/red.png) !important;
}
/* END RESOURCES */
.pluginCM-icon {
background-image: url(images/icons/pluginCM.png) !important;
@ -283,13 +293,7 @@
background-image: url(images/icons/table_multiple.png) !important;
}
.runninginstance-icon {
background-image: url(images/icons/gcoreEndpoint.png) !important;
}
.service-icon {
background-image: url(images/icons/software.png) !important;
}
.empty-icon {
background-image: url(images/icons/error.png) !important;

View File

@ -2,7 +2,7 @@
# The user and its credentials
# Possible values for credentials:
# [USER,ADMIN,DEBUG]
USER_CREDENTIALS = ADMIN
USER_CREDENTIALS = DEBUG
# Defines the modality in which the portlet is running
# possible values [STANDALONE,PORTAL,NOTDEFINED]
@ -11,7 +11,7 @@ RUNNING_MODE = STANDALONE
DEFAULT_USER = massimiliano.assante
# The scope that will be used as default
DEFAULT_SCOPE =/gcube/devsec
DEFAULT_SCOPE =/gcube
# the target of update notification (if in singleton mode)
# mails MUST be separated by ;
USERMAIL_TO = m.assante@gmail.com

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB