1452: Implement a GUI for StatMan Algorithms Importer

Task-Url: https://support.d4science.org/issues/1452

Fixed Explorer refresh on save project

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/statistical-algorithms-importer@122812 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2016-02-03 16:39:33 +00:00
parent 81337d0945
commit 57a7a23715
3 changed files with 14 additions and 85 deletions

21
pom.xml
View File

@ -296,11 +296,8 @@
</dependency>
<!-- Uri Resolver Manager -->
<dependency>
<groupId>org.gcube.portlets.user</groupId>
<artifactId>uri-resolver-manager</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
</dependency>
<!-- <dependency> <groupId>org.gcube.portlets.user</groupId> <artifactId>uri-resolver-manager</artifactId>
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> </dependency> -->
<!-- 52n-wps-client -->
<dependency>
@ -312,16 +309,24 @@
<artifactId>gt-opengis</artifactId>
<groupId>org.geotools</groupId>
</exclusion>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.n52.wps</groupId>
<artifactId>52n-wps-r</artifactId>
<version>(0.0.1,5.0.0)</version>
<exclusions>
<exclusion>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- LOGGING -->
<dependency>
<groupId>com.allen-sauer.gwt.log</groupId>
@ -548,7 +553,7 @@
</repository>
</repositories>
<dependencyManagement>
<dependencies>
<dependency>

View File

@ -309,6 +309,7 @@ public class ProjectManager {
public void onSuccess(Void result) {
monitor.hide();
UtilsGXT3.info("Save", "Project saved!");
fireProjectStatusExplorerRefreshEvent();
}
@Override

View File

@ -1,77 +0,0 @@
package org.gcube.portlets.user.statisticalalgorithmsimporter.server.uriresolver;
import java.util.HashMap;
import java.util.Map;
import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.exception.StatAlgoImporterServiceException;
import org.gcube.portlets.user.statisticalalgorithmsimporter.shared.workspace.ItemDescription;
import org.gcube.portlets.user.uriresolvermanager.UriResolverManager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* Client for retrieve link
*
*
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class UriResolverSMIClient {
private static Logger logger = LoggerFactory
.getLogger(UriResolverSMIClient.class);
public UriResolverSMIClient() {
}
public String resolve(ItemDescription itemDescription, ASLSession aslSession)
throws StatAlgoImporterServiceException {
try {
String link = "";
logger.debug("Get uri from resolver: " + itemDescription);
UriResolverManager resolver;
Map<String, String> params = new HashMap<String, String>();
if (itemDescription != null) {
resolver = new UriResolverManager(
ApplicationType.SMP_ID.toString());
params.put("smp-id", itemDescription.getId());
if (itemDescription.getName() == null) {
params.put("fileName", "");
} else {
params.put("fileName", itemDescription.getName());
}
if (itemDescription.getType() == null) {
params.put("contentType", "");
} else {
params.put("contentType", itemDescription.getType());
}
logger.debug("Uri Resolver params: " + params);
link = resolver.getLink(params, true); // true, link is shorted
// otherwise none
} else {
logger.debug("No valid ItemDescription: " + itemDescription);
throw new StatAlgoImporterServiceException(
"No valid ItemDescription: " + itemDescription);
}
logger.debug("Retrieved Link: " + link);
return link;
} catch (StatAlgoImporterServiceException e) {
throw e;
} catch (Throwable e) {
e.printStackTrace();
throw new StatAlgoImporterServiceException(
"Error retrieving uri from resolver: "
+ e.getLocalizedMessage());
}
}
}