Updated PeriodDataType

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111678 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2015-02-04 17:09:59 +00:00
parent 086ae47577
commit 408e40c2e0
6 changed files with 56 additions and 36 deletions

View File

@ -334,7 +334,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<TimeFormat> listTimeFormat = period.getAcceptedFormats();
for (TimeFormat timeF : listTimeFormat) {
TimeDataFormat timeDataFormat = new TimeDataFormat(
timeF.getExample(), timeF.getRegExpr());
timeF.getId(), timeF.getExample(), timeF.getRegExpr());
timeDataFormats.add(timeDataFormat);
}
@ -343,7 +343,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
periodDataTypes.add(periodDataType);
}
logger.debug("PeriodDataTypes: "+periodDataTypes);
return periodDataTypes;
} catch (TDGWTServiceException e) {
@ -382,14 +382,15 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
List<TimeFormat> listTimeFormat = period.getAcceptedFormats();
for (TimeFormat timeF : listTimeFormat) {
TimeDataFormat timeDataFormat = new TimeDataFormat(
timeF.getExample(), timeF.getRegExpr());
timeF.getId(), timeF.getExample(), timeF.getRegExpr());
timeDataFormats.add(timeDataFormat);
}
PeriodDataType periodDT = new PeriodDataType(
period.name(), period.getName(), timeDataFormats);
hierarchicalPeriodDataTypes.add(periodDT);
}
logger.debug("hierarchicalPeriodDataTypes: "+hierarchicalPeriodDataTypes);
return hierarchicalPeriodDataTypes;
} catch (TDGWTServiceException e) {

View File

@ -108,7 +108,7 @@ public class OpExecution4ChangeColumnType extends OpExecutionBuilder {
TRId trId = col.getTrId();
logger.debug("trID: " + trId);
long tabId;
if(trId.isViewTable()){
if (trId.isViewTable()) {
tabId = new Long(trId.getReferenceTargetTableId());
} else {
tabId = new Long(trId.getTableId());
@ -160,9 +160,11 @@ public class OpExecution4ChangeColumnType extends OpExecutionBuilder {
operationDefinition = OperationDefinitionMap.map(
OperationsId.ChangeToTimeDimensionColumn.toString(),
service);
map.put(Constants.PARAMETER_PERIOD_FORMAT, changeColumnTypeSession
.getTimeDimensionType().toString());
.getPeriodDataType().getLabel());
map.put(Constants.PARAMETER_PERIOD_INPUT_FORMAT_ID, changeColumnTypeSession
.getTimeDataFormat().getId());
invocation = new OperationExecution(changeColumnTypeSession
.getColumnData().getColumnId(),
operationDefinition.getOperationId(), map);

View File

@ -59,7 +59,7 @@ public class PeriodTypeMap {
List<TimeFormat> listTimeFormat = periodType.getAcceptedFormats();
for (TimeFormat timeF : listTimeFormat) {
TimeDataFormat timeDataFormat = new TimeDataFormat(
timeF.getExample(), timeF.getRegExpr());
null, timeF.getExample(), timeF.getRegExpr());
timeDataFormats.add(timeDataFormat);
}
PeriodDataType periodDataType = new PeriodDataType(

View File

@ -76,6 +76,8 @@ public class Constants {
public static final String PARAMETER_COLUMN_MAPPING = "mapping";
public static final String PARAMETER_PERIOD_FORMAT = "periodFormat";
public static final String PARAMETER_PERIOD_INPUT_FORMAT_ID = "inputFormatId";
public static final String PARAMETER_EXPRESSION = "expression";
public static final String PARAMETER_TABLE_TYPE = "tableType";

View File

@ -4,30 +4,36 @@ import java.io.Serializable;
/**
*
* @author giancarlo
* email: <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
* @author giancarlo email: <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TimeDataFormat implements Serializable {
private static final long serialVersionUID = 6790236931169590842L;
private String id;
private String example;
private String regexp;
public TimeDataFormat(){
}
public TimeDataFormat(String example, String regexp) {
public TimeDataFormat() {
}
public TimeDataFormat(String id, String example, String regexp) {
super();
this.id=id;
this.example = example;
this.regexp = regexp;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getExample() {
return example;
@ -47,12 +53,8 @@ public class TimeDataFormat implements Serializable {
@Override
public String toString() {
return "TimeDataFormat [example=" + example + ", regexp=" + regexp
+ "]";
return "TimeDataFormat [id=" + id + ", example=" + example
+ ", regexp=" + regexp + "]";
}
}

View File

@ -4,6 +4,7 @@ import java.io.Serializable;
import org.gcube.portlets.user.td.gwtservice.shared.tr.ColumnData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.PeriodDataType;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TimeDataFormat;
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.mapping.ColumnMappingList;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnTypeCode;
@ -13,17 +14,18 @@ public class ChangeColumnTypeSession implements Serializable {
private static final long serialVersionUID = 7154832921853261421L;
protected ColumnData columnData;
protected ColumnTypeCode columnTypeCode;
protected ColumnDataType columnDataType;
protected ColumnTypeCode columnTypeCodeTarget;
protected ColumnDataType columnDataTypeTarget;
protected String locale;
private ColumnData columnData;
private ColumnTypeCode columnTypeCode;
private ColumnDataType columnDataType;
private ColumnTypeCode columnTypeCodeTarget;
private ColumnDataType columnDataTypeTarget;
private String locale;
protected PeriodDataType timeDimensionType;
protected ColumnData codelistColumnReference;
private PeriodDataType timeDimensionType;
private TimeDataFormat timeDataFormat;
private ColumnData codelistColumnReference;
protected ColumnMappingList columnMappingList;
private ColumnMappingList columnMappingList;
public ChangeColumnTypeSession() {
@ -112,13 +114,21 @@ public class ChangeColumnTypeSession implements Serializable {
this.codelistColumnReference = codelistColumnReference;
}
public PeriodDataType getTimeDimensionType() {
public PeriodDataType getPeriodDataType() {
return timeDimensionType;
}
public void setTimeDimensionType(PeriodDataType timeDimensionType) {
public void setPeriodDataType(PeriodDataType timeDimensionType) {
this.timeDimensionType = timeDimensionType;
}
public TimeDataFormat getTimeDataFormat() {
return timeDataFormat;
}
public void setTimeDataFormat(TimeDataFormat timeDataFormat) {
this.timeDataFormat = timeDataFormat;
}
public String getLocale() {
return locale;
@ -144,8 +154,11 @@ public class ChangeColumnTypeSession implements Serializable {
+ columnTypeCodeTarget + ", columnDataTypeTarget="
+ columnDataTypeTarget + ", locale=" + locale
+ ", timeDimensionType=" + timeDimensionType
+ ", timeDataFormat=" + timeDataFormat
+ ", codelistColumnReference=" + codelistColumnReference
+ ", columnMappingList=" + columnMappingList + "]";
}
}