From d2fd4ea8dc92487bc7a29d19a4552706cd45c445 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 31 Jul 2014 10:23:31 +0000 Subject: [PATCH] Workspace publicLink change git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99149 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/storage/FilesStorage.java | 13 ++++++--- .../td/gwtservice/shared/tr/TabResource.java | 29 +++++++++++++++++-- 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java index e33272f..71c57fb 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/storage/FilesStorage.java @@ -88,10 +88,10 @@ public class FilesStorage { InputStream is = null; try { - + org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi); Handler.activateProtocol(); URL smsHome = null; - smsHome = new URL(wi.getPublicLink(false)); + smsHome = new URL(gcubeItem.getPublicLink()); logger.debug("smsHome: [host:" + smsHome.getHost() + " path:" + smsHome.getPath() + " ref:" + smsHome.getRef() + " userinfo:" + smsHome.getUserInfo() + " ]"); @@ -101,6 +101,7 @@ public class FilesStorage { } catch (Exception e) { logger.error("Error retrieving file from storage", e); + e.printStackTrace(); throw new TDGWTServiceException( "Error retrieving file from storage: " + e.getLocalizedMessage(), e); @@ -120,6 +121,7 @@ public class FilesStorage { logger.error( "Error trasferring file from storage: " + e.getLocalizedMessage(), e); + e.printStackTrace(); throw new TDGWTServiceException( "Error trasferring file from storage: " + e.getLocalizedMessage(), e); @@ -141,10 +143,10 @@ public class FilesStorage { InputStream is = null; try { - + org.gcube.common.homelibrary.home.workspace.folder.items.File gcubeItem = ((org.gcube.common.homelibrary.home.workspace.folder.items.File) wi); Handler.activateProtocol(); URL smsHome = null; - smsHome = new URL(null, wi.getPublicLink(false), + smsHome = new URL(null, gcubeItem.getPublicLink(), new URLStreamHandler() { @Override @@ -165,6 +167,7 @@ public class FilesStorage { } catch (Exception e) { logger.error("Error retrieving file from storage", e); + e.printStackTrace(); throw new TDGWTServiceException( "Error retrieving file from storage: " + e.getLocalizedMessage(), e); @@ -209,6 +212,7 @@ public class FilesStorage { } catch (Exception e) { logger.error("Error retrieving file from storage", e); + e.printStackTrace(); throw new TDGWTServiceException( "Error retrieving file from storage: " + e.getLocalizedMessage(), e); @@ -268,6 +272,7 @@ public class FilesStorage { } catch (Exception e) { logger.error("Error creating item on workspace", e); + e.printStackTrace(); throw new TDGWTServiceException( "Error creating item on workspace: " + e.getLocalizedMessage(), e); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/TabResource.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/TabResource.java index 14cadbe..098b988 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/TabResource.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/TabResource.java @@ -22,6 +22,8 @@ public class TabResource implements Serializable { protected String agency; protected String date; protected String right; + protected String validFrom; + protected String validUntilTo; protected Contacts owner; protected boolean valid; protected boolean finalized; @@ -30,12 +32,14 @@ public class TabResource implements Serializable { } public TabResource(String id, String name, String description, - String agency, String date, String right, TRId trId) { + String agency, String date, String right, String validFrom, String validUntilTo, TRId trId) { this.id = id; this.name = name; this.description = description; this.agency = agency; this.date = date; + this.validFrom = validFrom; + this.validUntilTo = validUntilTo; this.right = right; this.trId = trId; } @@ -136,12 +140,31 @@ public class TabResource implements Serializable { this.finalized = finalized; } + public String getValidFrom() { + return validFrom; + } + + public void setValidFrom(String validFrom) { + this.validFrom = validFrom; + } + + public String getValidUntilTo() { + return validUntilTo; + } + + public void setValidUntilTo(String validUntilTo) { + this.validUntilTo = validUntilTo; + } + @Override public String toString() { return "TabResource [trId=" + trId + ", id=" + id + ", name=" + name + ", description=" + description + ", agency=" + agency - + ", date=" + date + ", right=" + right + ", owner=" + owner - + ", valid=" + valid + ", finalized=" + finalized + "]"; + + ", date=" + date + ", right=" + right + ", validFrom=" + + validFrom + ", validUntilTo=" + validUntilTo + ", owner=" + + owner + ", valid=" + valid + ", finalized=" + finalized + "]"; } + + }