diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java index 169bd04..7a43fbc 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/SessionUtil.java @@ -17,7 +17,6 @@ import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portlets.user.td.gwtservice.server.file.CSVFileUploadSession; import org.gcube.portlets.user.td.gwtservice.server.file.CodelistMappingFileUploadSession; import org.gcube.portlets.user.td.gwtservice.server.trservice.TRTasksManager; -import org.gcube.portlets.user.td.gwtservice.shared.Constants; import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingMonitor; import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession; import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession; @@ -93,8 +92,8 @@ public class SessionUtil { ASLSession session; if (username == null) { logger.warn("no user found in session, using test one"); - /*throw new TDGWTSessionExpiredException("Session Expired!");*/ - + throw new TDGWTSessionExpiredException("Session Expired!"); + /* username = Constants.DEFAULT_USER; String scope = Constants.DEFAULT_SCOPE; @@ -102,7 +101,7 @@ public class SessionUtil { session = SessionManager.getInstance().getASLSession( httpSession.getId(), username); session.setScope(scope); - + */ } else { session = SessionManager.getInstance().getASLSession( httpSession.getId(), username); 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 aed2cee..3ba06e9 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 @@ -984,13 +984,14 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements AuthorizationProvider.instance.set(new AuthorizationToken( aslSession.getUsername(), aslSession.getScope())); TabularDataService service = TabularDataServiceFactory.getService(); - + logger.debug("getValidationColumns():[" + trId.toString() + " columnName: " + columnName + "]"); Table table = service.getTable(new TableId(Long.valueOf(trId .getTableId()))); - + logger.debug("getValidationColumns() on Table: "+table.toString()); + Column columnSource = table.getColumnByName(columnName); if (columnSource == null) { logger.error("Column not present on table"); @@ -1007,7 +1008,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements int i = 0; for (Column c : cols) { if (c.getColumnType() instanceof ValidationColumnType) { - logger.debug("ValidationColumn present: " + c.getLocalId()); + logger.debug("ValidationColumn present: [" +c.getColumnType()+" "+c.getLocalId()+"]"); if (c.contains(ValidationReferencesMetadata.class)) { logger.debug("ValidationReferencesMetadata present"); ValidationReferencesMetadata validationReferenceMetadata = c diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/ExpressionGenerator.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/ExpressionGenerator.java index 17949e7..3639d60 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/ExpressionGenerator.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/ExpressionGenerator.java @@ -259,7 +259,7 @@ public class ExpressionGenerator { } } catch (Throwable e) { - logger.debug("Error in genReplaceBatchOccurrencesFilter: " + logger.error("Error in genReplaceBatchOccurrencesFilter: " + e.getLocalizedMessage()); e.printStackTrace(); throw new TDGWTServiceException( diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/QueryService.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/QueryService.java index db65db7..6f81fa5 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/QueryService.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/server/trservice/QueryService.java @@ -42,86 +42,23 @@ public class QueryService { TabularDataService service, OccurrencesForReplaceBatchColumnSession occurrencesSession, Direction direction) throws TDGWTServiceException { - logger.debug("QueryOccurences"); - ColumnData column = occurrencesSession.getColumnData(); + + try { + + logger.debug("QueryOccurences"); + ColumnData column = occurrencesSession.getColumnData(); - ArrayList occurences = new ArrayList(); + ArrayList occurences = new ArrayList(); - TableId tableId = new TableId(new Long(column.getTrId().getTableId())); - ColumnLocalId columnId = new ColumnLocalId(column.getColumnId()); - QuerySelect querySelect = null; - QueryGroup queryGroup = null; + TableId tableId = new TableId(new Long(column.getTrId() + .getTableId())); + ColumnLocalId columnId = new ColumnLocalId(column.getColumnId()); + QuerySelect querySelect = null; + QueryGroup queryGroup = null; - ConditionCode conditionCode = occurrencesSession.getConditionCode(); - if (conditionCode == null) { - logger.debug("Replace Batch no validations"); - if (column.isViewColumn()) { - ColumnLocalId sourceColumnId = new ColumnLocalId(column - .getColumnViewData().getSourceTableDimensionColumnId()); - querySelect = new QuerySelect(Arrays.asList(new QueryColumn( - columnId), new QueryColumn(sourceColumnId), - new QueryColumn(columnId, Function.COUNT))); - logger.debug("Occurences querySelect:" + querySelect.toString()); - queryGroup = new QueryGroup(Arrays.asList(columnId, - sourceColumnId)); - logger.debug("Occurences queryGroup:" + queryGroup.toString()); - } else { - querySelect = new QuerySelect(Arrays.asList(new QueryColumn( - columnId), new QueryColumn(columnId, Function.COUNT))); - logger.debug("Occurences querySelect:" + querySelect.toString()); - queryGroup = new QueryGroup(Arrays.asList(columnId)); - logger.debug("Occurences queryGroup:" + queryGroup.toString()); - } - } else { - logger.debug("Replace Batch from validations"); - switch (conditionCode) { - case AllowedColumnType: - break; - case AmbigousValueOnExternalReference: - if (column.isViewColumn()) { - ColumnLocalId sourceColumnId = new ColumnLocalId(column - .getColumnViewData() - .getSourceTableDimensionColumnId()); - querySelect = new QuerySelect(Arrays.asList( - new QueryColumn(columnId), new QueryColumn( - sourceColumnId))); - logger.debug("Occurences querySelect:" - + querySelect.toString()); - } else { - querySelect = new QuerySelect( - Arrays.asList(new QueryColumn(columnId))); - logger.debug("Occurences querySelect:" - + querySelect.toString()); - } - break; - case CastValidation: - break; - case CodeNamePresence: - break; - case DuplicateTupleValidation: - break; - case DuplicateValueInColumn: - break; - case GenericTupleValidity: - break; - case GenericValidity: - break; - case MaxOneCodenameForDataLocale: - break; - case MustContainAtLeastOneDimension: - break; - case MustContainAtLeastOneMeasure: - break; - case MustHaveDataLocaleMetadataAndAtLeastOneLabel: - break; - case OnlyOneCodeColumn: - break; - case OnlyOneCodenameColumn: - break; - case ValidPeriodFormat: - break; - case MissingValueOnExternalReference: - default: + ConditionCode conditionCode = occurrencesSession.getConditionCode(); + if (conditionCode == null) { + logger.debug("Replace Batch no validations"); if (column.isViewColumn()) { ColumnLocalId sourceColumnId = new ColumnLocalId(column .getColumnViewData() @@ -146,207 +83,242 @@ public class QueryService { logger.debug("Occurences queryGroup:" + queryGroup.toString()); } - break; - } - } - - QueryOrder queryOrder = null; - switch (direction) { - case ASC: - queryOrder = new QueryOrder(columnId, QueryOrderDirection.ASCENDING); - break; - case DESC: - queryOrder = new QueryOrder(columnId, - QueryOrderDirection.DESCENDING); - break; - default: - break; - - } - - QueryPage queryPage = null;// All occurences - logger.debug("Occurences queryPage all"); - - QueryFilter queryFilter = null; - if (occurrencesSession.getShowType().compareTo( - ShowOccurrencesType.ONLYERRORS) == 0) { - if (occurrencesSession.isHasValidationColumns()) { - Expression exp = ExpressionGenerator - .genReplaceBatchOccurrencesFilter(occurrencesSession); - logger.debug("Expression: " + exp); - if (exp != null) { - queryFilter = new QueryFilter(exp); - } } else { - return occurences; - } - } - - logger.debug("Query on " + tableId.toString() + " queryPage:" - + queryPage + ", queryFilter:" + queryFilter + ", querySelect:" - + querySelect + ", queryGroup:" + queryGroup + ", queryOrder:" - + queryOrder); - - if (querySelect != null) { - logger.debug("Query Select Columns:" + querySelect.getColumns()); - } - - if (queryGroup != null) { - logger.debug("Query Group Columns: " + queryGroup.getColumns()); - } - - String serviceJson = null; - try { - if (queryOrder == null) { - if (queryFilter == null) { - if (queryGroup == null) { - logger.debug("1-QueryAsJson-->tableId:" + tableId - + ", queryPage:" + queryPage + ", querySelect:" - + querySelect); - serviceJson = service.queryAsJson(tableId, queryPage, - querySelect); - } else { - logger.debug("2-QueryAsJson-->tableId:" + tableId - + ", queryPage:" + queryPage + ", querySelect:" - + querySelect + ", queryGroup:" + queryGroup); - serviceJson = service.queryAsJson(tableId, queryPage, - querySelect, queryGroup); - } - } else { - if (queryGroup == null) { - logger.debug("3-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryFilter:" - + queryFilter + ", querySelect:" + querySelect - + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryFilter, querySelect); - } else { - logger.debug("4-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryFilter:" - + queryFilter + ", querySelect:" + querySelect - + ", queryGroup:" + queryGroup + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryFilter, querySelect, queryGroup); - } - } - } else { - if (queryFilter == null) { - if (queryGroup == null) { - logger.debug("5-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryOrder:" - + queryOrder + ", querySelect:" + querySelect - + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryOrder, querySelect); - } else { - logger.debug("6-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryOrder:" - + queryOrder + ", querySelect:" + querySelect - + ", queryGroup:" + queryGroup + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryOrder, querySelect, queryGroup); - } - } else { - if (queryGroup == null) { - logger.debug("7-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryFilter:" - + queryFilter + ", queryOrder:" + queryOrder - + ", querySelect:" + querySelect + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryFilter, queryOrder, querySelect); - - } else { - logger.debug("8-QueryAsJson-->[tableId:" + tableId - + ", queryPage:" + queryPage + ", queryFilter:" - + queryFilter + ", queryOrder:" + queryOrder - + ", querySelect:" + querySelect - + ", queryGroup:" + queryGroup + "]"); - serviceJson = service.queryAsJson(tableId, queryPage, - queryFilter, queryOrder, querySelect, - queryGroup); - } - } - } - } catch (Throwable e) { - logger.debug("Error by running the query on the server:" - + e.getLocalizedMessage()); - e.printStackTrace(); - throw new TDGWTServiceException( - "An error occurred while running query on service", e); - } - - logger.debug("Created serviceJson"); - // logger.debug(serviceJson); - - JSONArray currentRow = null; - int i = -1; - int j = -1; - int totalRows = -1; - - try { - org.json.JSONObject obj = new org.json.JSONObject(serviceJson); - org.json.JSONArray rows = obj.getJSONArray("rows"); - - totalRows = rows.length(); - logger.debug("Reading rows from json"); - Occurrences occurence = null; - for (i = 0; i < totalRows; i++) { - currentRow = rows.getJSONArray(i); - if (conditionCode == null) { + logger.debug("Replace Batch from validations"); + switch (conditionCode) { + case AllowedColumnType: + break; + case AmbigousValueOnExternalReference: if (column.isViewColumn()) { - occurence = new Occurrences( - currentRow.getString(0), - currentRow.getString(1), - currentRow.getInt(2)); + ColumnLocalId sourceColumnId = new ColumnLocalId(column + .getColumnViewData() + .getSourceTableDimensionColumnId()); + querySelect = new QuerySelect(Arrays.asList( + new QueryColumn(columnId), new QueryColumn( + sourceColumnId))); + logger.debug("Occurences querySelect:" + + querySelect.toString()); } else { - occurence = new Occurrences( - currentRow.getString(0), - currentRow.getInt(1)); + querySelect = new QuerySelect( + Arrays.asList(new QueryColumn(columnId))); + logger.debug("Occurences querySelect:" + + querySelect.toString()); } break; - } else { - switch (conditionCode) { - case AllowedColumnType: - break; - case AmbigousValueOnExternalReference: - if (column.isViewColumn()) { - occurence = new Occurrences( - currentRow.getString(0), - currentRow.getString(1), 1); - } else { - occurence = new Occurrences( - currentRow.getString(0), 1); - } - break; - case CastValidation: - break; - case CodeNamePresence: - break; - case DuplicateTupleValidation: - break; - case DuplicateValueInColumn: - break; - case GenericTupleValidity: - break; - case GenericValidity: - break; - case MaxOneCodenameForDataLocale: - break; + case CastValidation: + break; + case CodeNamePresence: + break; + case DuplicateTupleValidation: + break; + case DuplicateValueInColumn: + break; + case GenericTupleValidity: + break; + case GenericValidity: + break; + case MaxOneCodenameForDataLocale: + break; + case MustContainAtLeastOneDimension: + break; + case MustContainAtLeastOneMeasure: + break; + case MustHaveDataLocaleMetadataAndAtLeastOneLabel: + break; + case OnlyOneCodeColumn: + break; + case OnlyOneCodenameColumn: + break; + case ValidPeriodFormat: + break; + case MissingValueOnExternalReference: + default: + if (column.isViewColumn()) { + ColumnLocalId sourceColumnId = new ColumnLocalId(column + .getColumnViewData() + .getSourceTableDimensionColumnId()); + querySelect = new QuerySelect(Arrays.asList( + new QueryColumn(columnId), new QueryColumn( + sourceColumnId), new QueryColumn( + columnId, Function.COUNT))); + logger.debug("Occurences querySelect:" + + querySelect.toString()); + queryGroup = new QueryGroup(Arrays.asList(columnId, + sourceColumnId)); + logger.debug("Occurences queryGroup:" + + queryGroup.toString()); + } else { + querySelect = new QuerySelect(Arrays.asList( + new QueryColumn(columnId), new QueryColumn( + columnId, Function.COUNT))); + logger.debug("Occurences querySelect:" + + querySelect.toString()); + queryGroup = new QueryGroup(Arrays.asList(columnId)); + logger.debug("Occurences queryGroup:" + + queryGroup.toString()); + } + break; + } + } - case MustContainAtLeastOneDimension: - break; - case MustContainAtLeastOneMeasure: - break; - case MustHaveDataLocaleMetadataAndAtLeastOneLabel: - break; - case OnlyOneCodeColumn: - break; - case OnlyOneCodenameColumn: - break; - case ValidPeriodFormat: - break; - case MissingValueOnExternalReference: - default: + QueryOrder queryOrder = null; + switch (direction) { + case ASC: + queryOrder = new QueryOrder(columnId, + QueryOrderDirection.ASCENDING); + break; + case DESC: + queryOrder = new QueryOrder(columnId, + QueryOrderDirection.DESCENDING); + break; + default: + break; + + } + + QueryPage queryPage = null;// All occurences + logger.debug("Occurences queryPage all"); + + QueryFilter queryFilter = null; + if (occurrencesSession.getShowType().compareTo( + ShowOccurrencesType.ONLYERRORS) == 0) { + logger.debug("Filter on error"); + if (occurrencesSession.isHasValidationColumns()) { + Expression exp = ExpressionGenerator + .genReplaceBatchOccurrencesFilter(occurrencesSession); + logger.debug("Expression: " + exp); + if (exp != null) { + queryFilter = new QueryFilter(exp); + } else { + logger.debug("Expression generated is null"); + } + } else { + logger.debug("No validation columns"); + return occurences; + } + } else { + logger.debug("No Filter on error"); + } + + logger.debug("Query on " + tableId.toString() + " queryPage:" + + queryPage + ", queryFilter:" + queryFilter + + ", querySelect:" + querySelect + ", queryGroup:" + + queryGroup + ", queryOrder:" + queryOrder); + + if (querySelect != null) { + logger.debug("Query Select Columns:" + querySelect.getColumns()); + } + + if (queryGroup != null) { + logger.debug("Query Group Columns: " + queryGroup.getColumns()); + } + + String serviceJson = null; + try { + if (queryOrder == null) { + if (queryFilter == null) { + if (queryGroup == null) { + logger.debug("1-QueryAsJson-->tableId:" + tableId + + ", queryPage:" + queryPage + + ", querySelect:" + querySelect); + serviceJson = service.queryAsJson(tableId, + queryPage, querySelect); + } else { + logger.debug("2-QueryAsJson-->tableId:" + tableId + + ", queryPage:" + queryPage + + ", querySelect:" + querySelect + + ", queryGroup:" + queryGroup); + serviceJson = service.queryAsJson(tableId, + queryPage, querySelect, queryGroup); + } + } else { + if (queryGroup == null) { + logger.debug("3-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryFilter:" + queryFilter + + ", querySelect:" + querySelect + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryFilter, querySelect); + } else { + logger.debug("4-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryFilter:" + queryFilter + + ", querySelect:" + querySelect + + ", queryGroup:" + queryGroup + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryFilter, querySelect, + queryGroup); + } + } + } else { + if (queryFilter == null) { + if (queryGroup == null) { + logger.debug("5-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryOrder:" + queryOrder + + ", querySelect:" + querySelect + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryOrder, querySelect); + } else { + logger.debug("6-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryOrder:" + queryOrder + + ", querySelect:" + querySelect + + ", queryGroup:" + queryGroup + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryOrder, querySelect, + queryGroup); + } + } else { + if (queryGroup == null) { + logger.debug("7-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryFilter:" + queryFilter + + ", queryOrder:" + queryOrder + + ", querySelect:" + querySelect + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryFilter, queryOrder, + querySelect); + + } else { + logger.debug("8-QueryAsJson-->[tableId:" + tableId + + ", queryPage:" + queryPage + + ", queryFilter:" + queryFilter + + ", queryOrder:" + queryOrder + + ", querySelect:" + querySelect + + ", queryGroup:" + queryGroup + "]"); + serviceJson = service.queryAsJson(tableId, + queryPage, queryFilter, queryOrder, + querySelect, queryGroup); + } + } + } + } catch (Throwable e) { + logger.debug("Error by running the query on the server:" + + e.getLocalizedMessage()); + e.printStackTrace(); + throw new TDGWTServiceException( + "An error occurred while running query on service", e); + } + + logger.debug("Created serviceJson"); + // logger.debug(serviceJson); + + JSONArray currentRow = null; + int i = -1; + int j = -1; + int totalRows = -1; + + try { + org.json.JSONObject obj = new org.json.JSONObject(serviceJson); + org.json.JSONArray rows = obj.getJSONArray("rows"); + + totalRows = rows.length(); + logger.debug("Reading rows from json"); + Occurrences occurence = null; + for (i = 0; i < totalRows; i++) { + currentRow = rows.getJSONArray(i); + if (conditionCode == null) { if (column.isViewColumn()) { occurence = new Occurrences( currentRow.getString(0), @@ -357,26 +329,86 @@ public class QueryService { currentRow.getString(0), currentRow.getInt(1)); } - break; + } else { + switch (conditionCode) { + case AllowedColumnType: + break; + case AmbigousValueOnExternalReference: + if (column.isViewColumn()) { + occurence = new Occurrences( + currentRow.getString(0), + currentRow.getString(1), 1); + } else { + occurence = new Occurrences( + currentRow.getString(0), 1); + } + break; + case CastValidation: + break; + case CodeNamePresence: + break; + case DuplicateTupleValidation: + break; + case DuplicateValueInColumn: + break; + case GenericTupleValidity: + break; + case GenericValidity: + break; + case MaxOneCodenameForDataLocale: + break; + case MustContainAtLeastOneDimension: + break; + case MustContainAtLeastOneMeasure: + break; + case MustHaveDataLocaleMetadataAndAtLeastOneLabel: + break; + case OnlyOneCodeColumn: + break; + case OnlyOneCodenameColumn: + break; + case ValidPeriodFormat: + break; + case MissingValueOnExternalReference: + default: + if (column.isViewColumn()) { + occurence = new Occurrences( + currentRow.getString(0), + currentRow.getString(1), + currentRow.getInt(2)); + } else { + occurence = new Occurrences( + currentRow.getString(0), + currentRow.getInt(1)); + } + break; + + } } + // logger.debug(occurence.toString()); + occurences.add(occurence); + } - // logger.debug(occurence.toString()); - occurences.add(occurence); + } catch (JSONException e) { + + logger.error("An error occurred while parsing json document\n" + + "At Row " + i + ",Column " + j + "\nRow Content: " + + currentRow + "\nLenght rows " + totalRows, e); + e.printStackTrace(); + throw new TDGWTServiceException( + "An error occurred, while reading json of service", e); } + logger.debug("Retieved occurences: size " + occurences.size()); + return occurences; - } catch (JSONException e) { - - logger.error("An error occurred while parsing json document\n" - + "At Row " + i + ",Column " + j + "\nRow Content: " - + currentRow + "\nLenght rows " + totalRows, e); + } catch (Throwable e) { + logger.error("QueryService - error on queryOccurences():" + + e.getLocalizedMessage()); e.printStackTrace(); - throw new TDGWTServiceException( - "An error occurred, while reading json of service", e); + throw new TDGWTServiceException(e.getLocalizedMessage()); } - logger.debug("Retieved occurences: size " + occurences.size()); - return occurences; } diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java index 5f3357a..ebc29e7 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/Constants.java @@ -12,7 +12,7 @@ package org.gcube.portlets.user.td.gwtservice.shared; */ public class Constants { - public final static String VERSION = "2.1.0"; + public final static String VERSION = "2.3.0"; public final static String DEFAULT_USER = "test.user"; public final static String DEFAULT_SCOPE = "/gcube/devsec"; @@ -70,6 +70,7 @@ public class Constants { public static final String PARAMETER_ROW_ID = "rowId"; + public static final String REQUEST_PROPERTIES_INVOCATIONS = "InvocationS"; public static final String REQUEST_PROPERTIES_REFCOLUMN = "RefColumn"; public static final String REQUEST_PROPERTIES_COLUMNID = "ColumnId"; public static final String REQUEST_PROPERTIES_TASKID = "TaskId"; diff --git a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/batch/ReplaceBatchColumnSession.java b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/batch/ReplaceBatchColumnSession.java index dbf82fb..1d7015f 100644 --- a/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/batch/ReplaceBatchColumnSession.java +++ b/src/main/java/org/gcube/portlets/user/td/gwtservice/shared/tr/batch/ReplaceBatchColumnSession.java @@ -4,6 +4,7 @@ import java.io.Serializable; import java.util.ArrayList; import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData; +import org.gcube.portlets.user.td.gwtservice.shared.tr.ConditionCode; import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId; /** @@ -21,6 +22,9 @@ public class ReplaceBatchColumnSession implements Serializable { protected ArrayList replaceEntryList; protected boolean replaceDimension; + protected ConditionCode conditionCode; + protected String validationColumnColumnId; + public ReplaceBatchColumnSession() { } @@ -32,6 +36,17 @@ public class ReplaceBatchColumnSession implements Serializable { this.replaceDimension = replaceDimension; } + public ReplaceBatchColumnSession(TRId trId, ColumnData columnData, + ArrayList replaceEntryList, boolean replaceDimension, + ConditionCode conditionCode, String validationColumnColumnId) { + this.trId = trId; + this.columnData = columnData; + this.replaceEntryList = replaceEntryList; + this.replaceDimension = replaceDimension; + this.conditionCode = conditionCode; + this.validationColumnColumnId = validationColumnColumnId; + } + public TRId getTrId() { return trId; } @@ -64,11 +79,31 @@ public class ReplaceBatchColumnSession implements Serializable { this.replaceDimension = replaceDimension; } + public ConditionCode getConditionCode() { + return conditionCode; + } + + public void setConditionCode(ConditionCode conditionCode) { + this.conditionCode = conditionCode; + } + + public String getValidationColumnColumnId() { + return validationColumnColumnId; + } + + public void setValidationColumnColumnId(String validationColumnColumnId) { + this.validationColumnColumnId = validationColumnColumnId; + } + @Override public String toString() { return "ReplaceBatchColumnSession [trId=" + trId + ", columnData=" + columnData + ", replaceEntryList=" + replaceEntryList - + ", replaceDimension=" + replaceDimension + "]"; + + ", replaceDimension=" + replaceDimension + ", conditionCode=" + + conditionCode + ", validationColumnColumnId=" + + validationColumnColumnId + "]"; } + + }