From 29584b59c7140797fcb3b966307a7676848e6bd4 Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Thu, 7 Aug 2014 16:27:11 +0000 Subject: [PATCH] Updated OperationMonitor git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@99233 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../td/gwtservice/shared/UIOperationsId.java | 87 ++++++----------- .../shared/csv/CSVExportMonitor.java | 94 ------------------- .../shared/csv/CSVImportMonitor.java | 81 ---------------- .../gwtservice/shared/task/TaskWrapper.java | 78 +++++++++++++++ .../tr/clone/CloneTabularResourceSession.java | 21 ++++- 5 files changed, 125 insertions(+), 236 deletions(-) delete mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java delete mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVImportMonitor.java create mode 100644 src/main/java/org/gcube/portlets/user/td/gwtservice/shared/task/TaskWrapper.java diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/UIOperationsId.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/UIOperationsId.java index 5df0602..f883db8 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/UIOperationsId.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/UIOperationsId.java @@ -65,63 +65,36 @@ package org.gcube.portlets.user.td.gwtservice.shared; */ public enum UIOperationsId { - CSVImport("100"), - CSVExport("101"), - CLONE("102"), - SDMXCodelistImport("200"), - SDMXCodelistExport("201"), - SDMXDatasetImport("202"), - SDMXDatasetExport("203"), - JSONImport("300"), - JSONExport("301"), - ValidateCodelist("1000"), - ValidateDataset("1001"), - ChangeTableType("1002"), - CreateDatasetView("1003"), - RemoveColumn("1004"), - AddColumn("1005"), - ColumnNameAdd("1006"), - ColumnNameRemove("1007"), - TableNameAdd("1008"), - TableNameRemove("1009"), - ChangeToAnnotationColumn("2000"), - ChangeToAttributeColumn("2001"), - ChangeToMeasureColumn("2002"), - ChangeToCodeColumn("2003"), - ChangeToCodeName("2004"), - ChangeToCodeDescription("2005"), - ChangeToDimensionColumn("2006"), - ChangeToTimeDimensionColumn("2007"), - ModifyTuplesValuesByExpression("3000"), - ModifyTuplesValuesById("3001"), - ModifyTuplesValuesByValidation("3002"), - AddRow("3004"), - Denormalize("3005"), - GroupBy("3006"), - RemoveDuplicateTuples("3007"), - Normalize("3008"), - ReplaceColumnByExpression("3101"), - ReplaceById("3102"), - FilterByExpression("3201"), - RemoveRowById("3202"), - Union("3208"), - CodelistValidation("5001"), - ColumnTypeCastCheck("5002"), - DuplicateTupleValidation("5003"), - DuplicateValuesInColumnValidator("5004"), - PeriodFormatCheck("5005"), - ExpressionValidation("5006"), - AmbiguousExternalReferenceCheck("5007"), - DimensionColumnValidator("5010"), - ValidateTable("5011"), - ValidateDataSet("5012"), - ValidateGeneric("5013"), - StatisticalOperation("10001"), - ExportToStatisticalOperation("10002"), - ImportFromStatistical("10003"), - ExtractCodelist("11001"), - GuessCodelist("11002"), - CodelistMappingImport("12001"); + CSVImport("CSV Import"), + CSVExport("CSV Export"), + Clone("Clone"), + SDMXImport("SDMX Import"), + SDMXExport("SDMX Export"), + JSONImport("JSON Import"), + JSONExport("JSON Export"), + ChangeTableType("Change Table Type"), + DeleteColumn("Delete Column"), + AddColumn("Add Column"), + ChangeColumnLabel("Change Column Label"), + ChangeColumnType("Change Column Type"), + EditRow("Edit Row"), + DeleteRow("Delete Row"), + Denormalize("Denormalize"), + GroupBy("Group By"), + MergeColumn("Merge Column"), + SplitColumn("Split Column"), + Normalize("Normalize"), + ReplaceValue("Replace Value"), + ReplaceBatch("Replace Batch"), + Filter("Filter"), + Union("Union"), + DuplicateTuples("Duplicate Tuples"), + ExtractCodelist("Extract Codelist"), + CodelistMappingImport("Codelist Mapping Import"), + ResumeTask("Resume Task"), + ResubmitTask("ResubmitTask"), + RollBack("Roll Back"), + ApplyTemplate("Apply Template"); /** * @param text 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 deleted file mode 100644 index 128c12e..0000000 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVExportMonitor.java +++ /dev/null @@ -1,94 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.gwtservice.shared.csv; - -import java.io.Serializable; - -import org.gcube.portlets.user.td.gwtservice.shared.task.State; -import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabExportMetadata; -import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class CSVExportMonitor implements Serializable { - -private static final long serialVersionUID = -5998841163159590481L; - - protected float progress; - protected State status; - protected String statusDescription; - protected Throwable error; - protected TRId trId; - protected TabExportMetadata trExportMetadata; - - - public float getProgress(){ - return progress; - }; - - public State getStatus(){ - return status; - } - - public String getStatusDescription(){ - return statusDescription; - } - - public void setProgress(float progress) { - this.progress = progress; - } - - public void setStatus(State status) { - this.status = status; - } - - public void setStatus(int status) { - this.status = State.values()[status]; - } - - public TabExportMetadata getTrExportMetadata() { - return trExportMetadata; - } - - public void setTrExportMetadata(TabExportMetadata trExportMetadata) { - this.trExportMetadata = trExportMetadata; - } - - public void setStatusDescription(String statusDescription) { - this.statusDescription = statusDescription; - } - - public Throwable getError() { - return error; - } - - public void setError(Throwable error) { - this.error = error; - } - - public TRId getTrId() { - return trId; - } - - public void setTrId(TRId trId) { - this.trId = trId; - } - - @Override - public String toString() { - return "CSVExportMonitor [progress=" + progress + ", status=" + status - + ", statusDescription=" + statusDescription + ", error=" - + error + ", trId=" + trId + ", trExportMetadata=" - + trExportMetadata + "]"; - } - - - - - -} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVImportMonitor.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVImportMonitor.java deleted file mode 100644 index 091cff6..0000000 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/csv/CSVImportMonitor.java +++ /dev/null @@ -1,81 +0,0 @@ -/** - * - */ -package org.gcube.portlets.user.td.gwtservice.shared.csv; - -import java.io.Serializable; - -import org.gcube.portlets.user.td.gwtservice.shared.task.State; -import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; - -/** - * - * @author "Giancarlo Panichi" - * g.panichi@isti.cnr.it - * - */ -public class CSVImportMonitor implements Serializable { - -private static final long serialVersionUID = -5998841163159590481L; - - protected float progress; - protected State status; - protected String statusDescription; - protected Throwable error; - protected TRId trId; - - public float getProgress(){ - return progress; - }; - - public State getStatus(){ - return status; - } - - public String getStatusDescription(){ - return statusDescription; - } - - public void setProgress(float progress) { - this.progress = progress; - } - - public void setStatus(State status) { - this.status = status; - } - - public void setStatus(int status) { - this.status = State.values()[status]; - } - - public void setStatusDescription(String statusDescription) { - this.statusDescription = statusDescription; - } - - public Throwable getError() { - return error; - } - - public void setError(Throwable error) { - this.error = error; - } - - public TRId getTrId() { - return trId; - } - - public void setTrId(TRId trId) { - this.trId = trId; - } - - - @Override - public String toString() { - return "CSVImportMonitor [progress=" + progress + ", status=" + status - + ", statusDescription=" + statusDescription + ", error=" - + error + ", trId=" + trId + "]"; - } - - - -} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/task/TaskWrapper.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/task/TaskWrapper.java new file mode 100644 index 0000000..ea62953 --- /dev/null +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/task/TaskWrapper.java @@ -0,0 +1,78 @@ +package org.gcube.portlets.user.td.gwtservice.shared.task; + +import java.io.Serializable; + + +import org.gcube.data.analysis.tabulardata.service.operation.Task; +import org.gcube.portlets.user.td.gwtservice.shared.UIOperationsId; +import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; + +/** + * + * @author "Giancarlo Panichi" + * email: g.panichi@isti.cnr.it + * + */ +public class TaskWrapper implements Serializable { + + + private static final long serialVersionUID = -3291738536272488206L; + + private Task task; + private UIOperationsId operationId; + private TRId trId; + + public TaskWrapper(){ + + } + + public TaskWrapper(Task task, UIOperationsId operationId, TRId trId) { + super(); + this.task = task; + this.operationId = operationId; + this.trId = trId; + } + + + public Task getTask() { + return task; + } + + + public void setTask(Task task) { + this.task = task; + } + + + public UIOperationsId getOperationId() { + return operationId; + } + + + public void setOperationId(UIOperationsId operationId) { + this.operationId = operationId; + } + + + public TRId getTrId() { + return trId; + } + + + public void setTrId(TRId trId) { + this.trId = trId; + } + + + @Override + public String toString() { + return "TaskWrapper [task=" + task + ", operationId=" + operationId + + ", trId=" + trId + "]"; + } + + + + + + +} diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/clone/CloneTabularResourceSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/clone/CloneTabularResourceSession.java index 78f268f..bf6ea65 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/clone/CloneTabularResourceSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/clone/CloneTabularResourceSession.java @@ -14,7 +14,8 @@ public class CloneTabularResourceSession implements Serializable { private static final long serialVersionUID = -1896235499708614266L; - protected TRId trId; + private TRId trId; + private TRId trIdClone; public CloneTabularResourceSession(){ @@ -22,6 +23,7 @@ public class CloneTabularResourceSession implements Serializable { public CloneTabularResourceSession(TRId trId){ this.trId=trId; + this.trIdClone=null; } public TRId getTrId() { @@ -32,9 +34,20 @@ public class CloneTabularResourceSession implements Serializable { this.trId = trId; } - @Override - public String toString() { - return "CloneTabularResourceSession [trId=" + trId + "]"; + + public TRId getTrIdClone() { + return trIdClone; } + public void setTrIdClone(TRId trIdClone) { + this.trIdClone = trIdClone; + } + + @Override + public String toString() { + return "CloneTabularResourceSession [trId=" + trId + ", trIdClone=" + + trIdClone + "]"; + } + + }