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:
parent
81337d0945
commit
57a7a23715
21
pom.xml
21
pom.xml
|
@ -296,11 +296,8 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- Uri Resolver Manager -->
|
<!-- Uri Resolver Manager -->
|
||||||
<dependency>
|
<!-- <dependency> <groupId>org.gcube.portlets.user</groupId> <artifactId>uri-resolver-manager</artifactId>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version> </dependency> -->
|
||||||
<artifactId>uri-resolver-manager</artifactId>
|
|
||||||
<version>[1.0.0-SNAPSHOT,2.0.0-SNAPSHOT)</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<!-- 52n-wps-client -->
|
<!-- 52n-wps-client -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -312,16 +309,24 @@
|
||||||
<artifactId>gt-opengis</artifactId>
|
<artifactId>gt-opengis</artifactId>
|
||||||
<groupId>org.geotools</groupId>
|
<groupId>org.geotools</groupId>
|
||||||
</exclusion>
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>xerces</groupId>
|
||||||
|
<artifactId>xercesImpl</artifactId>
|
||||||
|
</exclusion>
|
||||||
</exclusions>
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.n52.wps</groupId>
|
<groupId>org.n52.wps</groupId>
|
||||||
<artifactId>52n-wps-r</artifactId>
|
<artifactId>52n-wps-r</artifactId>
|
||||||
<version>(0.0.1,5.0.0)</version>
|
<version>(0.0.1,5.0.0)</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>xerces</groupId>
|
||||||
|
<artifactId>xercesImpl</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- LOGGING -->
|
<!-- LOGGING -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||||
|
@ -548,7 +553,7 @@
|
||||||
</repository>
|
</repository>
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -309,6 +309,7 @@ public class ProjectManager {
|
||||||
public void onSuccess(Void result) {
|
public void onSuccess(Void result) {
|
||||||
monitor.hide();
|
monitor.hide();
|
||||||
UtilsGXT3.info("Save", "Project saved!");
|
UtilsGXT3.info("Save", "Project saved!");
|
||||||
|
fireProjectStatusExplorerRefreshEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue