From bd28d29f1cefd9f6a91d8e140c2ec72ea801afde Mon Sep 17 00:00:00 2001 From: Giancarlo Panichi Date: Tue, 28 Oct 2014 16:34:14 +0000 Subject: [PATCH] Updated PeriodType git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@101093 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../OpExecution4TimeAggregation.java | 18 +++++++------ .../tr/groupby/TimeAggregationSession.java | 27 ++++++++++++++++--- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4TimeAggregation.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4TimeAggregation.java index d029154..152849e 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4TimeAggregation.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/opexecution/OpExecution4TimeAggregation.java @@ -4,6 +4,7 @@ import java.util.HashMap; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationDefinition; import org.gcube.data.analysis.tabulardata.commons.webservice.types.operations.OperationExecution; +import org.gcube.data.analysis.tabulardata.model.column.ColumnLocalId; import org.gcube.data.analysis.tabulardata.service.TabularDataService; import org.gcube.portlets.user.td.gwtservice.server.trservice.OperationDefinitionMap; import org.gcube.portlets.user.td.gwtservice.shared.OperationsId; @@ -39,19 +40,20 @@ public class OpExecution4TimeAggregation extends OpExecutionBuilder { logger.debug(timeAggregationSession.toString()); OperationDefinition operationDefinition; - - HashMap map=timeAggregationSession.getMap(); - if(map==null){ + HashMap map = timeAggregationSession.getMap(); + + if (map == null) { logger.error("In TimeAggregationSession map is null"); - throw new TDGWTServiceException("In TimeAggregationSession map is null"); - } - + throw new TDGWTServiceException( + "In TimeAggregationSession map is null"); + } + operationDefinition = OperationDefinitionMap.map( OperationsId.TimeAggregation.toString(), service); - invocation = new OperationExecution( - operationDefinition.getOperationId(), map); + invocation = new OperationExecution(timeAggregationSession.getColumn() + .getColumnId(), operationDefinition.getOperationId(), map); operationExecutionSpec.setOp(invocation); diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/groupby/TimeAggregationSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/groupby/TimeAggregationSession.java index dd68c31..86ac6d2 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/groupby/TimeAggregationSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/groupby/TimeAggregationSession.java @@ -3,6 +3,7 @@ package org.gcube.portlets.user.td.gwtservice.shared.tr.groupby; import java.io.Serializable; import java.util.HashMap; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; /** @@ -13,17 +14,27 @@ import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; */ public class TimeAggregationSession implements Serializable { - private static final long serialVersionUID = -1896235499708614266L; + private static final long serialVersionUID = 7297177399486247575L; protected TRId trId; + protected ColumnData column; protected HashMap map; public TimeAggregationSession() { } - public TimeAggregationSession(TRId trId, HashMap map) { + /** + * + * @param trId + * @param column + * @param map + */ + public TimeAggregationSession(TRId trId, ColumnData column, + HashMap map) { + super(); this.trId = trId; + this.column = column; this.map = map; } @@ -35,6 +46,14 @@ public class TimeAggregationSession implements Serializable { this.trId = trId; } + public ColumnData getColumn() { + return column; + } + + public void setColumn(ColumnData column) { + this.column = column; + } + public HashMap getMap() { return map; } @@ -45,8 +64,8 @@ public class TimeAggregationSession implements Serializable { @Override public String toString() { - return "TimeAggregationSession [trId=" + trId + ", map=" + map + "]"; + return "TimeAggregationSession [trId=" + trId + ", column=" + column + + ", map=" + map + "]"; } - }