ref 9056:TabMan - Improve resource management in TabMan
https://support.d4science.org/issues/9056 Improve resources management git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@150915 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
840e07ee3a
commit
a4f31ec3e6
|
@ -12,7 +12,6 @@ import org.gcube.data.analysis.tabulardata.model.resources.SDMXResource;
|
||||||
import org.gcube.data.analysis.tabulardata.model.resources.StringResource;
|
import org.gcube.data.analysis.tabulardata.model.resources.StringResource;
|
||||||
import org.gcube.data.analysis.tabulardata.model.resources.TableResource;
|
import org.gcube.data.analysis.tabulardata.model.resources.TableResource;
|
||||||
import org.gcube.data.analysis.tabulardata.model.resources.Thumbnail;
|
import org.gcube.data.analysis.tabulardata.model.resources.Thumbnail;
|
||||||
import org.gcube.data.analysis.tabulardata.model.resources.WebResource;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.uriresolver.UriResolverTDClient;
|
import org.gcube.portlets.user.td.gwtservice.server.uriresolver.UriResolverTDClient;
|
||||||
import org.gcube.portlets.user.td.gwtservice.server.util.ServiceCredentials;
|
import org.gcube.portlets.user.td.gwtservice.server.util.ServiceCredentials;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
|
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
|
||||||
|
@ -23,7 +22,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDType;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SDMXResourceTD;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.SDMXResourceTD;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.StringResourceTD;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.StringResourceTD;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.TableResourceTD;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.TableResourceTD;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.WebResourceTD;
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.uriresolver.ApplicationType;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.uriresolver.ApplicationType;
|
||||||
|
@ -120,17 +118,11 @@ public class ResourceTDCreator {
|
||||||
SDMXResource sdmxResource = (SDMXResource) resource;
|
SDMXResource sdmxResource = (SDMXResource) resource;
|
||||||
SDMXResourceTD sdmxResourceTD = new SDMXResourceTD(sdmxResource.getName(),
|
SDMXResourceTD sdmxResourceTD = new SDMXResourceTD(sdmxResource.getName(),
|
||||||
sdmxResource.getAgency(), sdmxResource.getPrimaryMeasure(),
|
sdmxResource.getAgency(), sdmxResource.getPrimaryMeasure(),
|
||||||
sdmxResource.getStringValue(), sdmxResource.getType().name(),
|
sdmxResource.getResourceURL().toString(),sdmxResource.getRegistryURL().toString(), sdmxResource.getStringValue(),
|
||||||
sdmxResource.getVersion());
|
sdmxResource.getType().name(), sdmxResource.getVersion());
|
||||||
return sdmxResourceTD;
|
return sdmxResourceTD;
|
||||||
} else {
|
} else {
|
||||||
if (resourceClass == WebResource.class) {
|
|
||||||
WebResource webResource = (WebResource) resource;
|
|
||||||
WebResourceTD webResourceTD = new WebResourceTD(webResource.getStringValue());
|
|
||||||
return webResourceTD;
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,8 +29,6 @@ public class ResourceTypeMap {
|
||||||
return ResourceType.MAP;
|
return ResourceType.MAP;
|
||||||
case SDMX:
|
case SDMX:
|
||||||
return ResourceType.SDMX;
|
return ResourceType.SDMX;
|
||||||
case WEB:
|
|
||||||
return ResourceType.WEB;
|
|
||||||
case GENERIC_FILE:
|
case GENERIC_FILE:
|
||||||
return ResourceType.GENERIC_FILE;
|
return ResourceType.GENERIC_FILE;
|
||||||
case GENERIC_TABLE:
|
case GENERIC_TABLE:
|
||||||
|
@ -56,8 +54,6 @@ public class ResourceTypeMap {
|
||||||
return ResourceTDType.MAP;
|
return ResourceTDType.MAP;
|
||||||
case SDMX:
|
case SDMX:
|
||||||
return ResourceTDType.SDMX;
|
return ResourceTDType.SDMX;
|
||||||
case WEB:
|
|
||||||
return ResourceTDType.WEB;
|
|
||||||
case GENERIC_FILE:
|
case GENERIC_FILE:
|
||||||
return ResourceTDType.GENERIC_FILE;
|
return ResourceTDType.GENERIC_FILE;
|
||||||
case GENERIC_TABLE:
|
case GENERIC_TABLE:
|
||||||
|
|
|
@ -8,7 +8,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.resources;
|
||||||
*/
|
*/
|
||||||
public enum ResourceTDType {
|
public enum ResourceTDType {
|
||||||
|
|
||||||
CHART("Chart"), GUESSER("Guesser"), MAP("Map"), CODELIST("Codelist"), CSV("CSV"), SDMX("SDMX"), WEB("WEB"), JSON(
|
CHART("Chart"), GUESSER("Guesser"), MAP("Map"), CODELIST("Codelist"), CSV("CSV"), SDMX("SDMX"), JSON(
|
||||||
"JSON"), GENERIC_FILE("Generic File"), GENERIC_TABLE("Generic Table");
|
"JSON"), GENERIC_FILE("Generic File"), GENERIC_TABLE("Generic Table");
|
||||||
|
|
||||||
private ResourceTDType(final String id) {
|
private ResourceTDType(final String id) {
|
||||||
|
|
|
@ -7,26 +7,31 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.resources;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SDMXResourceTD extends ResourceTD {
|
public class SDMXResourceTD extends ResourceTD {
|
||||||
|
|
||||||
private static final long serialVersionUID = -3075957767979840537L;
|
private static final long serialVersionUID = -3075957767979840537L;
|
||||||
|
|
||||||
private String name;
|
private String name;
|
||||||
private String agency;
|
private String agency;
|
||||||
private String primaryMeasure;
|
private String primaryMeasure;
|
||||||
|
private String resourceUrl;
|
||||||
|
private String registryUrl;
|
||||||
private String type;
|
private String type;
|
||||||
private String version;
|
private String version;
|
||||||
|
|
||||||
public SDMXResourceTD() {
|
public SDMXResourceTD() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public SDMXResourceTD(String name, String agency, String primaryMeasure, String stringValue, String type, String version) {
|
public SDMXResourceTD(String name, String agency, String primaryMeasure, String resourceUrl, String registryUrl,
|
||||||
|
String stringValue, String type, String version) {
|
||||||
super(stringValue);
|
super(stringValue);
|
||||||
this.name =name;
|
this.name = name;
|
||||||
this.agency = agency;
|
this.agency = agency;
|
||||||
this.primaryMeasure = primaryMeasure;
|
this.primaryMeasure = primaryMeasure;
|
||||||
this.type=type;
|
this.resourceUrl = resourceUrl;
|
||||||
this.version=version;
|
this.registryUrl = registryUrl;
|
||||||
|
this.type = type;
|
||||||
|
this.version = version;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
|
@ -53,6 +58,22 @@ public class SDMXResourceTD extends ResourceTD {
|
||||||
this.primaryMeasure = primaryMeasure;
|
this.primaryMeasure = primaryMeasure;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getResourceUrl() {
|
||||||
|
return resourceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setResourceUrl(String resourceUrl) {
|
||||||
|
this.resourceUrl = resourceUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRegistryUrl() {
|
||||||
|
return registryUrl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRegistryUrl(String registryUrl) {
|
||||||
|
this.registryUrl = registryUrl;
|
||||||
|
}
|
||||||
|
|
||||||
public String getType() {
|
public String getType() {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
@ -71,10 +92,9 @@ public class SDMXResourceTD extends ResourceTD {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "SDMXResourceTD [name=" + name + ", agency=" + agency + ", primaryMeasure=" + primaryMeasure + ", type="
|
return "SDMXResourceTD [name=" + name + ", agency=" + agency + ", primaryMeasure=" + primaryMeasure
|
||||||
+ type + ", version=" + version + ", getStringValue()=" + getStringValue() + "]";
|
+ ", resourceUrl=" + resourceUrl + ", registryUrl=" + registryUrl + ", type=" + type + ", version="
|
||||||
|
+ version + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
package org.gcube.portlets.user.td.gwtservice.shared.tr.resources;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @author Giancarlo Panichi
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class WebResourceTD extends ResourceTD {
|
|
||||||
|
|
||||||
private static final long serialVersionUID = 8895032679636897620L;
|
|
||||||
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
public WebResourceTD() {
|
|
||||||
super();
|
|
||||||
}
|
|
||||||
|
|
||||||
public WebResourceTD(String value) {
|
|
||||||
super(value);
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setValue(String value) {
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "WebResourceTD [value=" + value + ", getStringValue()=" + getStringValue() + "]";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue