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:
parent
7bd02e8ba1
commit
988697e0ec
|
@ -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.StringResourceTD;
|
||||
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.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
@ -101,18 +100,13 @@ public class ResourceTDCreator {
|
|||
if (resourceClass == InternalURI.class) {
|
||||
|
||||
InternalURI internalURI = (InternalURI) resource;
|
||||
String url = internalURI.getUrl().toString();
|
||||
MimeTypeSupport mimeTypeSupport = MimeTypeSupport
|
||||
.getMimeTypeSupportFromMimeName(internalURI.getMimeType()
|
||||
.getValue());
|
||||
String url = internalURI.getUri().toString();
|
||||
Thumbnail thumbnail = internalURI.getThumbnail();
|
||||
MimeTypeSupport mimeTypeThumbnail = MimeTypeSupport
|
||||
.getMimeTypeSupportFromMimeName(thumbnail.getMimeType()
|
||||
.getValue());
|
||||
ThumbnailTD thumbnailTD = new ThumbnailTD(thumbnail.getUrl()
|
||||
.toString(), mimeTypeThumbnail);
|
||||
return new InternalURITD(internalURI.getFileId(), url,
|
||||
mimeTypeSupport, thumbnailTD);
|
||||
|
||||
ThumbnailTD thumbnailTD = new ThumbnailTD(thumbnail.getUri()
|
||||
.toString(),thumbnail.getMimeType());
|
||||
return new InternalURITD(url,
|
||||
internalURI.getMimeType(), thumbnailTD);
|
||||
} else {
|
||||
if (resourceClass == StringResource.class) {
|
||||
StringResource stringResource = (StringResource) resource;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
|
@ -12,11 +11,9 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.thumbnail.ThumbnailTD
|
|||
public class InternalURITD extends ResourceTD {
|
||||
private static final long serialVersionUID = -3230438212164027113L;
|
||||
|
||||
private String fileId;
|
||||
|
||||
private String url;
|
||||
|
||||
private MimeTypeSupport mimeTypeSupport;
|
||||
private String mimeType;
|
||||
|
||||
private ThumbnailTD thumbnailTD;
|
||||
|
||||
|
@ -29,12 +26,11 @@ public class InternalURITD extends ResourceTD {
|
|||
* @param fileId
|
||||
* @param url
|
||||
*/
|
||||
public InternalURITD(String fileId, String url,
|
||||
MimeTypeSupport mimeTypeSupport, ThumbnailTD thumbnailTD) {
|
||||
public InternalURITD(String url,
|
||||
String mimeType, ThumbnailTD thumbnailTD) {
|
||||
super(url);
|
||||
this.fileId = fileId;
|
||||
this.url = url;
|
||||
this.mimeTypeSupport=mimeTypeSupport;
|
||||
this.mimeType=mimeType;
|
||||
this.thumbnailTD=thumbnailTD;
|
||||
}
|
||||
|
||||
|
@ -43,14 +39,6 @@ public class InternalURITD extends ResourceTD {
|
|||
return url;
|
||||
}
|
||||
|
||||
public String getFileId() {
|
||||
return fileId;
|
||||
}
|
||||
|
||||
public void setFileId(String fileId) {
|
||||
this.fileId = fileId;
|
||||
}
|
||||
|
||||
public String getUrl() {
|
||||
return url;
|
||||
}
|
||||
|
@ -59,12 +47,12 @@ public class InternalURITD extends ResourceTD {
|
|||
this.url = url;
|
||||
}
|
||||
|
||||
public MimeTypeSupport getMimeTypeSupport() {
|
||||
return mimeTypeSupport;
|
||||
public String getMimeType() {
|
||||
return mimeType;
|
||||
}
|
||||
|
||||
public void setMimeTypeSupport(MimeTypeSupport mimeTypeSupport) {
|
||||
this.mimeTypeSupport = mimeTypeSupport;
|
||||
public void setMimeType(String mimeType) {
|
||||
this.mimeType = mimeType;
|
||||
}
|
||||
|
||||
public ThumbnailTD getThumbnailTD() {
|
||||
|
@ -77,12 +65,12 @@ public class InternalURITD extends ResourceTD {
|
|||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "InternalURITD [fileId=" + fileId + ", url=" + url
|
||||
+ ", mimeTypeSupport=" + mimeTypeSupport + ", thumbnailTD="
|
||||
+ thumbnailTD + "]";
|
||||
return "InternalURITD [url=" + url + ", mimeType=" + mimeType
|
||||
+ ", thumbnailTD=" + thumbnailTD + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue