Updated Resource

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@113654 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-03-18 17:26:30 +00:00
parent 7bd02e8ba1
commit 988697e0ec
2 changed files with 17 additions and 35 deletions

View File

@ -18,7 +18,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDDescr
import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDType; import org.gcube.portlets.user.td.gwtservice.shared.tr.resources.ResourceTDType;
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.widgetcommonevent.shared.mime.MimeTypeSupport;
import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD; import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
@ -101,18 +100,13 @@ public class ResourceTDCreator {
if (resourceClass == InternalURI.class) { if (resourceClass == InternalURI.class) {
InternalURI internalURI = (InternalURI) resource; InternalURI internalURI = (InternalURI) resource;
String url = internalURI.getUrl().toString(); String url = internalURI.getUri().toString();
MimeTypeSupport mimeTypeSupport = MimeTypeSupport
.getMimeTypeSupportFromMimeName(internalURI.getMimeType()
.getValue());
Thumbnail thumbnail = internalURI.getThumbnail(); Thumbnail thumbnail = internalURI.getThumbnail();
MimeTypeSupport mimeTypeThumbnail = MimeTypeSupport
.getMimeTypeSupportFromMimeName(thumbnail.getMimeType() ThumbnailTD thumbnailTD = new ThumbnailTD(thumbnail.getUri()
.getValue()); .toString(),thumbnail.getMimeType());
ThumbnailTD thumbnailTD = new ThumbnailTD(thumbnail.getUrl() return new InternalURITD(url,
.toString(), mimeTypeThumbnail); internalURI.getMimeType(), thumbnailTD);
return new InternalURITD(internalURI.getFileId(), url,
mimeTypeSupport, thumbnailTD);
} else { } else {
if (resourceClass == StringResource.class) { if (resourceClass == StringResource.class) {
StringResource stringResource = (StringResource) resource; StringResource stringResource = (StringResource) resource;

View File

@ -1,6 +1,5 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.resources; package org.gcube.portlets.user.td.gwtservice.shared.tr.resources;
import org.gcube.portlets.user.td.widgetcommonevent.shared.mime.MimeTypeSupport;
import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD; import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD;
/** /**
@ -12,11 +11,9 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD
public class InternalURITD extends ResourceTD { public class InternalURITD extends ResourceTD {
private static final long serialVersionUID = -3230438212164027113L; private static final long serialVersionUID = -3230438212164027113L;
private String fileId;
private String url; private String url;
private MimeTypeSupport mimeTypeSupport; private String mimeType;
private ThumbnailTD thumbnailTD; private ThumbnailTD thumbnailTD;
@ -29,12 +26,11 @@ public class InternalURITD extends ResourceTD {
* @param fileId * @param fileId
* @param url * @param url
*/ */
public InternalURITD(String fileId, String url, public InternalURITD(String url,
MimeTypeSupport mimeTypeSupport, ThumbnailTD thumbnailTD) { String mimeType, ThumbnailTD thumbnailTD) {
super(url); super(url);
this.fileId = fileId;
this.url = url; this.url = url;
this.mimeTypeSupport=mimeTypeSupport; this.mimeType=mimeType;
this.thumbnailTD=thumbnailTD; this.thumbnailTD=thumbnailTD;
} }
@ -43,14 +39,6 @@ public class InternalURITD extends ResourceTD {
return url; return url;
} }
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getUrl() { public String getUrl() {
return url; return url;
} }
@ -59,12 +47,12 @@ public class InternalURITD extends ResourceTD {
this.url = url; this.url = url;
} }
public MimeTypeSupport getMimeTypeSupport() { public String getMimeType() {
return mimeTypeSupport; return mimeType;
} }
public void setMimeTypeSupport(MimeTypeSupport mimeTypeSupport) { public void setMimeType(String mimeType) {
this.mimeTypeSupport = mimeTypeSupport; this.mimeType = mimeType;
} }
public ThumbnailTD getThumbnailTD() { public ThumbnailTD getThumbnailTD() {
@ -77,12 +65,12 @@ public class InternalURITD extends ResourceTD {
@Override @Override
public String toString() { public String toString() {
return "InternalURITD [fileId=" + fileId + ", url=" + url return "InternalURITD [url=" + url + ", mimeType=" + mimeType
+ ", mimeTypeSupport=" + mimeTypeSupport + ", thumbnailTD=" + ", thumbnailTD=" + thumbnailTD + "]";
+ thumbnailTD + "]";
} }
} }