From 1e3e438a401e587062e6ea80c1d30508e7f903a3 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Mon, 2 Dec 2013 14:18:05 +0000 Subject: [PATCH] Minor updated git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@86426 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gwtservice/client/rpc/TDGWTService.java | 4 +- .../client/rpc/TDGWTServiceAsync.java | 4 +- .../gwtservice/server/TDGWTServiceImpl.java | 134 +++++++++++++----- .../shared/csv/CSVExportMonitor.java | 8 +- .../shared/tr/metadata/TRAgencyMetadata.java | 43 ++++++ .../tr/metadata/TRCreationDateMetadata.java | 44 ++++++ .../tr/metadata/TRDescriptionsMetadata.java | 2 + .../shared/tr/metadata/TRNamesMetadata.java | 2 + .../shared/tr/metadata/TRRightsMetadata.java | 43 ++++++ .../metadata/TabDescriptionsMetadata.java | 49 +++++++ .../metadata/TabExportMetadata.java} | 6 +- .../metadata/TabGenericMapMetadata.java} | 6 +- .../metadata/TabImportMetadata.java} | 6 +- .../shared/tr/table/metadata/TabMetadata.java | 18 +++ .../tr/table/metadata/TabNamesMetadata.java | 48 +++++++ .../metadata/TabVersionMetadata.java} | 6 +- 16 files changed, 371 insertions(+), 52 deletions(-) create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRAgencyMetadata.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRCreationDateMetadata.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRRightsMetadata.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabDescriptionsMetadata.java rename src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/{metadata/TRExportMetadata.java => table/metadata/TabExportMetadata.java} (83%) rename src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/{metadata/TRGenericMapMetadata.java => table/metadata/TabGenericMapMetadata.java} (77%) rename src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/{metadata/TRImportMetadata.java => table/metadata/TabImportMetadata.java} (81%) create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabMetadata.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabNamesMetadata.java rename src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/{metadata/TRVersionMetadata.java => table/metadata/TabVersionMetadata.java} (75%) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java index 09276af..c2fd641 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTService.java @@ -21,8 +21,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.open.TDOpenSession; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset; @@ -95,7 +95,7 @@ public interface TDGWTService extends RemoteService { * @return * @throws TDGWTServiceException */ - public ArrayList getTableMetadata(TRId trId) throws TDGWTServiceException; + public ArrayList getTableMetadata(TRId trId) throws TDGWTServiceException; // Open diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java index 42a52c5..144b57e 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/client/rpc/TDGWTServiceAsync.java @@ -20,8 +20,8 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.open.TDOpenSession; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset; @@ -52,7 +52,7 @@ public interface TDGWTServiceAsync { void getLastTable(TRId trId, AsyncCallback callback); - void getTableMetadata(TRId trId, AsyncCallback> callback); + void getTableMetadata(TRId trId, AsyncCallback> callback); void getColumns(AsyncCallback> callback); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java index b604a6f..cf1a4f8 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/TDGWTServiceImpl.java @@ -85,15 +85,21 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId; import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource; import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData; +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRAgencyMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRCreationDateMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRDescriptionsMetadata; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRExportMetadata; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRGenericMapMetadata; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRImportMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText; import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRNamesMetadata; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRVersionMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRRightsMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.open.TDOpenSession; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabDescriptionsMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabExportMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabGenericMapMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabImportMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabNamesMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabVersionMetadata; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist; import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset; @@ -208,8 +214,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements List cols = table.getColumns(); int i = 0; for (Column c : cols) { - if (c.getColumnType() instanceof IdColumnType ) { - + if (c.getColumnType() instanceof IdColumnType) { + } else { ColumnData cData = new ColumnData(); cData.setId(Integer.toString(i)); @@ -235,7 +241,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug("ColumnLabel no label in en"); } else { cData.setLabel(cl.getValue()); - logger.debug("Column Set Label: "+cl.getValue()); + logger.debug("Column Set Label: " + cl.getValue()); } } cData.setTrId(trId); @@ -433,8 +439,8 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements String.valueOf(tableId.getValue())); } - TabResource t = new TabResource(String.valueOf(i), nameTR, descriptionTR, agencyTR, - dateS, rightsTR, trId); + TabResource t = new TabResource(String.valueOf(i), nameTR, + descriptionTR, agencyTR, dateS, rightsTR, trId); return t; } @@ -764,8 +770,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements case FAILED: if (task.getResult() != null) { logger.debug("Task exception:" - + task.getErrorCause()); - importMonitor.setError(task.getErrorCause()); + + task.getErrorMessage()); + importMonitor.setError(new Throwable(task + .getErrorMessage())); } else { logger.debug("Task exception: Error In Import"); importMonitor.setError(new Throwable( @@ -1111,8 +1118,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements case FAILED: if (task.getResult() != null) { logger.debug("Task exception:" - + task.getErrorCause()); - importMonitor.setError(task.getErrorCause()); + + task.getErrorMessage()); + importMonitor.setError(new Throwable(task + .getErrorMessage())); } else { logger.debug("Task exception: Error In Import"); importMonitor.setError(new Throwable( @@ -1264,10 +1272,71 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements .getTabularResource(new TabularResourceId(Long.valueOf(trId .getId()))); - Collection cMeta = tr.getAllMetadata(); + Collection trMetas = tr.getAllMetadata(); ArrayList listTRMetadata = new ArrayList(); + for (TabularResourceMetadata trMetadata : trMetas) { + if (trMetadata instanceof DescriptionMetadata) { + TRDescriptionsMetadata trDescriptionsMetadata = new TRDescriptionsMetadata(); + ArrayList listTRLocalizedText = new ArrayList(); + List lLocalizedText = ((DescriptionsMetadata) trMetadata) + .getTexts(); + int i = 0; + for (LocalizedText lt : lLocalizedText) { + TRLocalizedText trLocalizedText = new TRLocalizedText(); + trLocalizedText.setId(i); + trLocalizedText.setValue(lt.getValue()); + trLocalizedText.setLocaleCode(lt.getLocale()); + listTRLocalizedText.add(trLocalizedText); + i++; + } + trDescriptionsMetadata + .setListTRLocalizedText(listTRLocalizedText); + listTRMetadata.add(trDescriptionsMetadata); + } else { + if (trMetadata instanceof NamesMetadata) { + TRNamesMetadata trNamesMetadata = new TRNamesMetadata(); + ArrayList listTRLocalizedText = new ArrayList(); + List lLocalizedText = ((NamesMetadata) trMetadata) + .getTexts(); + int i = 0; + for (LocalizedText lt : lLocalizedText) { + TRLocalizedText trLocalizedText = new TRLocalizedText(); + trLocalizedText.setId(i); + trLocalizedText.setValue(lt.getValue()); + trLocalizedText.setLocaleCode(lt.getLocale()); + listTRLocalizedText.add(trLocalizedText); + i++; + } + trNamesMetadata + .setListTRLocalizedText(listTRLocalizedText); + listTRMetadata.add(trNamesMetadata); + } else { + if (trMetadata instanceof AgencyMetadata) { + TRAgencyMetadata trAgencyMetadata = new TRAgencyMetadata(); + trAgencyMetadata.setValue(((AgencyMetadata)trMetadata).getValue()); + listTRMetadata.add(trAgencyMetadata); + } else { + if (trMetadata instanceof CreationDateMetadata) { + TRCreationDateMetadata trCreationDateMetadata = new TRCreationDateMetadata(); + trCreationDateMetadata.setDate(sdf + .format(((CreationDateMetadata)trMetadata).getValue())); + listTRMetadata.add(trCreationDateMetadata); + } else { + if (trMetadata instanceof RightsMetadata) { + TRRightsMetadata trRightsMetadata = new TRRightsMetadata(); + trRightsMetadata.setValue(((RightsMetadata)trMetadata).getValue()); + listTRMetadata.add(trRightsMetadata); + } else { + + } + } + } + } + } + } + return listTRMetadata; } catch (Exception e) { @@ -1283,7 +1352,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements * {@inheritDoc} */ @Override - public ArrayList getTableMetadata(TRId trId) + public ArrayList getTableMetadata(TRId trId) throws TDGWTServiceException { try { session = this.getThreadLocalRequest().getSession(); @@ -1296,11 +1365,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements Collection cMeta = table.getAllMetadata(); - ArrayList listTRMetadata = new ArrayList(); + ArrayList listTabMetadata = new ArrayList(); for (TableMetadata tMetadata : cMeta) { if (tMetadata instanceof DescriptionsMetadata) { - TRDescriptionsMetadata trDescriptionsMetadata = new TRDescriptionsMetadata(); + TabDescriptionsMetadata trDescriptionsMetadata = new TabDescriptionsMetadata(); ArrayList listTRLocalizedText = new ArrayList(); List lLocalizedText = ((DescriptionsMetadata) tMetadata) .getTexts(); @@ -1315,11 +1384,11 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } trDescriptionsMetadata .setListTRLocalizedText(listTRLocalizedText); - listTRMetadata.add(trDescriptionsMetadata); + listTabMetadata.add(trDescriptionsMetadata); } else { if (tMetadata instanceof NamesMetadata) { - TRNamesMetadata trNamesMetadata = new TRNamesMetadata(); + TabNamesMetadata trNamesMetadata = new TabNamesMetadata(); ArrayList listTRLocalizedText = new ArrayList(); List lLocalizedText = ((NamesMetadata) tMetadata) .getTexts(); @@ -1334,18 +1403,18 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } trNamesMetadata .setListTRLocalizedText(listTRLocalizedText); - listTRMetadata.add(trNamesMetadata); + listTabMetadata.add(trNamesMetadata); } else { if (tMetadata instanceof VersionMetadata) { - TRVersionMetadata trVersionMetadata = new TRVersionMetadata(); + TabVersionMetadata trVersionMetadata = new TabVersionMetadata(); trVersionMetadata .setVersion(((VersionMetadata) tMetadata) .getVersion()); - listTRMetadata.add(trVersionMetadata); + listTabMetadata.add(trVersionMetadata); } else { if (tMetadata instanceof ExportMetadata) { - TRExportMetadata trExportMetadata = new TRExportMetadata(); + TabExportMetadata trExportMetadata = new TabExportMetadata(); trExportMetadata .setDestinationType(((ExportMetadata) tMetadata) .getDestinationType()); @@ -1355,10 +1424,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements trExportMetadata .setUrl(((ExportMetadata) tMetadata) .getUri()); - listTRMetadata.add(trExportMetadata); + listTabMetadata.add(trExportMetadata); } else { if (tMetadata instanceof ImportMetadata) { - TRImportMetadata trImportMetadata = new TRImportMetadata(); + TabImportMetadata trImportMetadata = new TabImportMetadata(); trImportMetadata .setSourceType(((ImportMetadata) tMetadata) .getSourceType()); @@ -1369,14 +1438,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements trImportMetadata .setUrl(((ImportMetadata) tMetadata) .getUri()); - listTRMetadata.add(trImportMetadata); + listTabMetadata.add(trImportMetadata); } else { if (tMetadata instanceof GenericMapMetadata) { - TRGenericMapMetadata trGenericMapMetadata = new TRGenericMapMetadata(); + TabGenericMapMetadata trGenericMapMetadata = new TabGenericMapMetadata(); trGenericMapMetadata .setMetadataMap(((GenericMapMetadata) tMetadata) .getMetadataMap()); - listTRMetadata + listTabMetadata .add(trGenericMapMetadata); } else { @@ -1389,7 +1458,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements } } - return listTRMetadata; + return listTabMetadata; } catch (Exception e) { logger.error( @@ -1521,8 +1590,9 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements case FAILED: if (task.getResult() != null) { logger.debug("Task exception:" - + task.getErrorCause()); - exportMonitor.setError(task.getErrorCause()); + + task.getErrorMessage()); + exportMonitor.setError(new Throwable(task + .getErrorMessage())); } else { logger.debug("Task exception: Error In Export"); exportMonitor.setError(new Throwable( @@ -1540,7 +1610,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements logger.debug("ExportMetadata: " + exportMetadata); exportMonitor.setTrId(SessionUtil.getTRId(session)); - TRExportMetadata trExportMetadata = new TRExportMetadata(); + TabExportMetadata trExportMetadata = new TabExportMetadata(); trExportMetadata.setUrl(exportMetadata.getUri()); trExportMetadata.setDestinationType(exportMetadata .getDestinationType()); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java index 0e84303..fd4e0d4 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java @@ -7,7 +7,7 @@ import java.io.Serializable; import org.gcube.portlets.user.td.gwtservice.shared.task.State; import org.gcube.portlets.user.td.gwtservice.shared.tr.TRId; -import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRExportMetadata; +import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabExportMetadata; /** * @@ -24,7 +24,7 @@ private static final long serialVersionUID = -5998841163159590481L; protected String statusDescription; protected Throwable error; protected TRId trId; - protected TRExportMetadata trExportMetadata; + protected TabExportMetadata trExportMetadata; public float getProgress(){ @@ -51,11 +51,11 @@ private static final long serialVersionUID = -5998841163159590481L; this.status = State.values()[status]; } - public TRExportMetadata getTrExportMetadata() { + public TabExportMetadata getTrExportMetadata() { return trExportMetadata; } - public void setTrExportMetadata(TRExportMetadata trExportMetadata) { + public void setTrExportMetadata(TabExportMetadata trExportMetadata) { this.trExportMetadata = trExportMetadata; } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRAgencyMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRAgencyMetadata.java new file mode 100644 index 0000000..99ea6de --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRAgencyMetadata.java @@ -0,0 +1,43 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; + + + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class TRAgencyMetadata implements TRMetadata { + + private static final long serialVersionUID = -7693467120874749946L; + String id="AgencyMetadata"; + String title="Agency"; + + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return "TRAgencyMetadata [value=" + value + "]"; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getTitle() { + return title; + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRCreationDateMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRCreationDateMetadata.java new file mode 100644 index 0000000..cc66a7f --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRCreationDateMetadata.java @@ -0,0 +1,44 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; + + + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class TRCreationDateMetadata implements TRMetadata { + + + private static final long serialVersionUID = -431795849858460198L; + String id="CreationDateMetadata"; + String title="Creation Date"; + + private String date; + + public String getDate() { + return date; + } + + public void setDate(String date) { + this.date = date; + } + + @Override + public String toString() { + return "TRCreationDateMetadata [date=" + date + "]"; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getTitle() { + return title; + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRDescriptionsMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRDescriptionsMetadata.java index a571f3d..dd90e1b 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRDescriptionsMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRDescriptionsMetadata.java @@ -2,6 +2,8 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; import java.util.ArrayList; +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText; + /** * diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRNamesMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRNamesMetadata.java index 39264dc..7ba8dc5 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRNamesMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRNamesMetadata.java @@ -2,6 +2,8 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; import java.util.ArrayList; +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText; + /** * diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRRightsMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRRightsMetadata.java new file mode 100644 index 0000000..ec60357 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRRightsMetadata.java @@ -0,0 +1,43 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; + + + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class TRRightsMetadata implements TRMetadata { + + private static final long serialVersionUID = -7693467120874749946L; + String id="RightsMetadata"; + String title="Rights"; + + private String value; + + public String getValue() { + return value; + } + + public void setValue(String value) { + this.value = value; + } + + @Override + public String toString() { + return "TRRightsMetadata [value=" + value + "]"; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getTitle() { + return title; + } + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabDescriptionsMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabDescriptionsMetadata.java new file mode 100644 index 0000000..7867a28 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabDescriptionsMetadata.java @@ -0,0 +1,49 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; + +import java.util.ArrayList; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText; + + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class TabDescriptionsMetadata implements TabMetadata { + private static final long serialVersionUID = -2663624208642658528L; + + + String id="DescriptionsMetadata"; + String title="Descriptions"; + + ArrayList listTabLocalizedText; + + public ArrayList getListTRLocalizedText() { + return listTabLocalizedText; + } + + public void setListTRLocalizedText(ArrayList listTRLocalizedText) { + this.listTabLocalizedText = listTRLocalizedText; + } + + @Override + public String toString() { + return "TabDescriptionsMetadata [listTabLocalizedText=" + listTabLocalizedText + + "]"; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getTitle() { + return title; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRExportMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabExportMetadata.java similarity index 83% rename from src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRExportMetadata.java rename to src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabExportMetadata.java index 083194f..4673d49 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRExportMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabExportMetadata.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; @@ -8,7 +8,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class TRExportMetadata implements TRMetadata { +public class TabExportMetadata implements TabMetadata { private static final long serialVersionUID = -2663624208642658528L; String id="ExportMetadata"; @@ -38,7 +38,7 @@ public class TRExportMetadata implements TRMetadata { } @Override public String toString() { - return "TRExportMetadata [destinationType=" + destinationType + return "TabExportMetadata [destinationType=" + destinationType + ", url=" + url + ", exportDate=" + exportDate + "]"; } @Override diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRGenericMapMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabGenericMapMetadata.java similarity index 77% rename from src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRGenericMapMetadata.java rename to src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabGenericMapMetadata.java index 7130ed2..a6aa05f 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRGenericMapMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabGenericMapMetadata.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; import java.util.HashMap; @@ -9,7 +9,7 @@ import java.util.HashMap; * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class TRGenericMapMetadata implements TRMetadata { +public class TabGenericMapMetadata implements TabMetadata { private static final long serialVersionUID = -2663624208642658528L; String id="GenericMapMetadata"; @@ -27,7 +27,7 @@ public class TRGenericMapMetadata implements TRMetadata { @Override public String toString() { - return "TRGenericMapMetadata [metadataMap=" + metadataMap + "]"; + return "TabGenericMapMetadata [metadataMap=" + metadataMap + "]"; } @Override diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRImportMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabImportMetadata.java similarity index 81% rename from src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRImportMetadata.java rename to src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabImportMetadata.java index 38873cc..10708d9 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRImportMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabImportMetadata.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; /** @@ -7,7 +7,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class TRImportMetadata implements TRMetadata { +public class TabImportMetadata implements TabMetadata { private static final long serialVersionUID = -2663624208642658528L; String id="ImportMetadata"; @@ -43,7 +43,7 @@ public class TRImportMetadata implements TRMetadata { @Override public String toString() { - return "TRImportMetadata [sourceType=" + sourceType + ", url=" + url + return "TabImportMetadata [sourceType=" + sourceType + ", url=" + url + ", importDate=" + importDate + "]"; } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabMetadata.java new file mode 100644 index 0000000..cc48dd1 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabMetadata.java @@ -0,0 +1,18 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; + +import java.io.Serializable; + + +/** + * + * @author "Giancarlo Panichi" + * g.panichi@isti.cnr.it + * + */ +public interface TabMetadata extends Serializable { + + public String getId(); + public String getTitle(); + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabNamesMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabNamesMetadata.java new file mode 100644 index 0000000..c4f226c --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabNamesMetadata.java @@ -0,0 +1,48 @@ +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; + +import java.util.ArrayList; + +import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText; + + +/** + * + * @author "Giancarlo Panichi" g.panichi@isti.cnr.it + * + */ +public class TabNamesMetadata implements TabMetadata { + + private static final long serialVersionUID = 7635332011036656032L; + + String id="NamesMetadata"; + String title="Names"; + + ArrayList listTabLocalizedText; + + public ArrayList getListTRLocalizedText() { + return listTabLocalizedText; + } + + public void setListTRLocalizedText(ArrayList listTRLocalizedText) { + this.listTabLocalizedText = listTRLocalizedText; + } + + @Override + public String toString() { + return "TabNamesMetadata [listTabLocalizedText=" + listTabLocalizedText + "]"; + } + + @Override + public String getId() { + return id; + } + + @Override + public String getTitle() { + return title; + } + + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRVersionMetadata.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabVersionMetadata.java similarity index 75% rename from src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRVersionMetadata.java rename to src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabVersionMetadata.java index 9fba299..6546c43 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/metadata/TRVersionMetadata.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/table/metadata/TabVersionMetadata.java @@ -1,4 +1,4 @@ -package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; +package org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata; @@ -8,7 +8,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata; * href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it * */ -public class TRVersionMetadata implements TRMetadata { +public class TabVersionMetadata implements TabMetadata { private static final long serialVersionUID = 5208229342328376604L; @@ -28,7 +28,7 @@ public class TRVersionMetadata implements TRMetadata { @Override public String toString() { - return "TRVersionMetadata [version=" + version + "]"; + return "TabVersionMetadata [version=" + version + "]"; } @Override