Added ValueDataFormat
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@111753 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5541f36f7f
commit
df30048e76
|
@ -4,6 +4,7 @@
|
||||||
package org.gcube.portlets.user.td.gwtservice.client.rpc;
|
package org.gcube.portlets.user.td.gwtservice.client.rpc;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
||||||
|
@ -40,6 +41,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.PeriodDataType;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
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.TableData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ValueDataFormat;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForReplaceBatchColumnSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForReplaceBatchColumnSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
||||||
|
@ -73,6 +75,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
|
|
||||||
import com.google.gwt.user.client.rpc.RemoteService;
|
import com.google.gwt.user.client.rpc.RemoteService;
|
||||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
|
@ -151,6 +154,28 @@ public interface TDGWTService extends RemoteService {
|
||||||
public ArrayList<PeriodDataType> getHierarchicalRelationshipForPeriodDataTypes(PeriodDataType periodDataType)
|
public ArrayList<PeriodDataType> getHierarchicalRelationshipForPeriodDataTypes(PeriodDataType periodDataType)
|
||||||
throws TDGWTServiceException;
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
|
//ValueDataFormats
|
||||||
|
/**
|
||||||
|
* Retrieve ValueDataFormat for all ColumnDataType
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
public HashMap<ColumnDataType, ArrayList<ValueDataFormat>> getValueDataFormats()
|
||||||
|
throws TDGWTServiceException;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieve ValueDataFormat for specific ColumnDataType
|
||||||
|
*
|
||||||
|
* @param columnDataType
|
||||||
|
* @return
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
public ArrayList<ValueDataFormat> getValueDataFormatsOfColumnDataType(
|
||||||
|
ColumnDataType columnDataType) throws TDGWTServiceException;
|
||||||
|
|
||||||
// TabularResource
|
// TabularResource
|
||||||
/**
|
/**
|
||||||
* Get current TRId
|
* Get current TRId
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
package org.gcube.portlets.user.td.gwtservice.client.rpc;
|
package org.gcube.portlets.user.td.gwtservice.client.rpc;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.chart.ChartTopRatingSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.codelisthelper.CodelistMappingSession;
|
||||||
|
@ -39,6 +40,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.PeriodDataType;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.RefColumn;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
|
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.TableData;
|
||||||
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.ValueDataFormat;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.Occurrences;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForReplaceBatchColumnSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.OccurrencesForReplaceBatchColumnSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.tr.batch.ReplaceBatchColumnSession;
|
||||||
|
@ -72,6 +74,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.union.UnionSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
import org.gcube.portlets.user.td.gwtservice.shared.uriresolver.UriResolverSession;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
import org.gcube.portlets.user.td.gwtservice.shared.user.UserInfo;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||||
|
import org.gcube.portlets.user.td.widgetcommonevent.shared.tr.column.ColumnDataType;
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||||
|
@ -91,17 +94,26 @@ public interface TDGWTServiceAsync {
|
||||||
void hello(AsyncCallback<UserInfo> callback);
|
void hello(AsyncCallback<UserInfo> callback);
|
||||||
|
|
||||||
void pendingTasksRetrieve(AsyncCallback<Integer> callback);
|
void pendingTasksRetrieve(AsyncCallback<Integer> callback);
|
||||||
|
|
||||||
void restoreUISession(AsyncCallback<TRId> callback);
|
void restoreUISession(AsyncCallback<TRId> callback);
|
||||||
|
|
||||||
void getUriFromResolver(UriResolverSession uriResolverSession,
|
void getUriFromResolver(UriResolverSession uriResolverSession,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
//PeriodDataType
|
// PeriodDataType
|
||||||
void getPeriodDataTypes(AsyncCallback<ArrayList<PeriodDataType>> callback);
|
void getPeriodDataTypes(AsyncCallback<ArrayList<PeriodDataType>> callback);
|
||||||
|
|
||||||
void getHierarchicalRelationshipForPeriodDataTypes(PeriodDataType periodDataType, AsyncCallback<ArrayList<PeriodDataType>> callback);
|
void getHierarchicalRelationshipForPeriodDataTypes(
|
||||||
|
PeriodDataType periodDataType,
|
||||||
|
AsyncCallback<ArrayList<PeriodDataType>> callback);
|
||||||
|
|
||||||
|
//
|
||||||
|
void getValueDataFormats(
|
||||||
|
AsyncCallback<HashMap<ColumnDataType, ArrayList<ValueDataFormat>>> callback);
|
||||||
|
|
||||||
|
void getValueDataFormatsOfColumnDataType(ColumnDataType columnDataType,
|
||||||
|
AsyncCallback<ArrayList<ValueDataFormat>> callback);
|
||||||
|
|
||||||
// TabularResource
|
// TabularResource
|
||||||
void getCurrentTRId(AsyncCallback<TRId> callback);
|
void getCurrentTRId(AsyncCallback<TRId> callback);
|
||||||
|
|
||||||
|
@ -123,7 +135,7 @@ public interface TDGWTServiceAsync {
|
||||||
AsyncCallback<Void> callback);
|
AsyncCallback<Void> callback);
|
||||||
|
|
||||||
void setTabResourceToFinal(TRId trId, AsyncCallback<Void> callback);
|
void setTabResourceToFinal(TRId trId, AsyncCallback<Void> callback);
|
||||||
|
|
||||||
void getTRCreationDate(TRId trId, AsyncCallback<String> callback);
|
void getTRCreationDate(TRId trId, AsyncCallback<String> callback);
|
||||||
|
|
||||||
void setTabResource(TabResource tabResource, AsyncCallback<Void> callback);
|
void setTabResource(TabResource tabResource, AsyncCallback<Void> callback);
|
||||||
|
@ -141,9 +153,10 @@ public interface TDGWTServiceAsync {
|
||||||
AsyncCallback<ArrayList<TabMetadata>> callback);
|
AsyncCallback<ArrayList<TabMetadata>> callback);
|
||||||
|
|
||||||
void getTRMetadata(TRId trId, AsyncCallback<ArrayList<TRMetadata>> callback);
|
void getTRMetadata(TRId trId, AsyncCallback<ArrayList<TRMetadata>> callback);
|
||||||
|
|
||||||
void getTimeTableId(PeriodDataType periodDataType, AsyncCallback<Long> callback);
|
void getTimeTableId(PeriodDataType periodDataType,
|
||||||
|
AsyncCallback<Long> callback);
|
||||||
|
|
||||||
void getColumns(AsyncCallback<ArrayList<ColumnData>> callback);
|
void getColumns(AsyncCallback<ArrayList<ColumnData>> callback);
|
||||||
|
|
||||||
void getColumns(TRId trId, AsyncCallback<ArrayList<ColumnData>> callback);
|
void getColumns(TRId trId, AsyncCallback<ArrayList<ColumnData>> callback);
|
||||||
|
@ -317,8 +330,9 @@ public interface TDGWTServiceAsync {
|
||||||
// Replace Operation
|
// Replace Operation
|
||||||
void startReplaceColumn(ReplaceColumnSession replaceColumnSession,
|
void startReplaceColumn(ReplaceColumnSession replaceColumnSession,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
void startReplaceByExternal(ReplaceByExternalSession replaceByExternalSession,
|
void startReplaceByExternal(
|
||||||
|
ReplaceByExternalSession replaceByExternalSession,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
// Templates
|
// Templates
|
||||||
|
@ -389,7 +403,7 @@ public interface TDGWTServiceAsync {
|
||||||
|
|
||||||
void removeResource(RemoveResourceSession removeResourceSession,
|
void removeResource(RemoveResourceSession removeResourceSession,
|
||||||
AsyncCallback<Void> callback);
|
AsyncCallback<Void> callback);
|
||||||
|
|
||||||
void saveResource(SaveResourceSession saveResourceSession,
|
void saveResource(SaveResourceSession saveResourceSession,
|
||||||
AsyncCallback<Void> callback);
|
AsyncCallback<Void> callback);
|
||||||
|
|
||||||
|
@ -401,8 +415,8 @@ public interface TDGWTServiceAsync {
|
||||||
void startStatisticalOperation(
|
void startStatisticalOperation(
|
||||||
StatisticalOperationSession statisticalOperationSession,
|
StatisticalOperationSession statisticalOperationSession,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
|
|
||||||
//Chart
|
// Chart
|
||||||
void startChartTopRating(ChartTopRatingSession chartTopRatingSession,
|
void startChartTopRating(ChartTopRatingSession chartTopRatingSession,
|
||||||
AsyncCallback<String> callback);
|
AsyncCallback<String> callback);
|
||||||
}
|
}
|
||||||
|
|
|
@ -329,7 +329,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.getAslSession(session);
|
SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
ArrayList<PeriodDataType> periodDataTypes = new ArrayList<PeriodDataType>();
|
ArrayList<PeriodDataType> periodDataTypes = new ArrayList<PeriodDataType>();
|
||||||
|
|
||||||
for (PeriodType period : PeriodType.values()) {
|
for (PeriodType period : PeriodType.values()) {
|
||||||
|
@ -338,16 +338,17 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
List<ValueFormat> listValueFormat = period.getAcceptedFormats();
|
List<ValueFormat> listValueFormat = period.getAcceptedFormats();
|
||||||
for (ValueFormat valueF : listValueFormat) {
|
for (ValueFormat valueF : listValueFormat) {
|
||||||
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
||||||
valueF.getId(), valueF.getExample(), valueF.getRegExpr());
|
valueF.getId(), valueF.getExample(),
|
||||||
|
valueF.getRegExpr());
|
||||||
valueDataFormats.add(valueDataFormat);
|
valueDataFormats.add(valueDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
PeriodDataType periodDataType = new PeriodDataType(
|
PeriodDataType periodDataType = new PeriodDataType(
|
||||||
period.name(), period.getName(), valueDataFormats);
|
period.name(), period.getName(), valueDataFormats);
|
||||||
periodDataTypes.add(periodDataType);
|
periodDataTypes.add(periodDataType);
|
||||||
|
|
||||||
}
|
}
|
||||||
logger.debug("PeriodDataTypes: "+periodDataTypes);
|
logger.debug("PeriodDataTypes: " + periodDataTypes);
|
||||||
return periodDataTypes;
|
return periodDataTypes;
|
||||||
|
|
||||||
} catch (TDGWTServiceException e) {
|
} catch (TDGWTServiceException e) {
|
||||||
|
@ -361,40 +362,41 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
+ e.getLocalizedMessage());
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ArrayList<PeriodDataType> getHierarchicalRelationshipForPeriodDataTypes(PeriodDataType periodDataType)
|
public ArrayList<PeriodDataType> getHierarchicalRelationshipForPeriodDataTypes(
|
||||||
throws TDGWTServiceException {
|
PeriodDataType periodDataType) throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.getAslSession(session);
|
SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
ArrayList<PeriodDataType> hierarchicalPeriodDataTypes = new ArrayList<PeriodDataType>();
|
ArrayList<PeriodDataType> hierarchicalPeriodDataTypes = new ArrayList<PeriodDataType>();
|
||||||
|
|
||||||
PeriodType periodType= PeriodTypeMap.map(periodDataType);
|
PeriodType periodType = PeriodTypeMap.map(periodDataType);
|
||||||
|
|
||||||
List<PeriodType> hierarchicalList=PeriodType.getHierarchicalRelation().get(periodType);
|
List<PeriodType> hierarchicalList = PeriodType
|
||||||
|
.getHierarchicalRelation().get(periodType);
|
||||||
|
|
||||||
for (PeriodType period : hierarchicalList) {
|
for (PeriodType period : hierarchicalList) {
|
||||||
ArrayList<ValueDataFormat> valueDataFormats = new ArrayList<ValueDataFormat>();
|
ArrayList<ValueDataFormat> valueDataFormats = new ArrayList<ValueDataFormat>();
|
||||||
List<ValueFormat> listValueFormat = period.getAcceptedFormats();
|
List<ValueFormat> listValueFormat = period.getAcceptedFormats();
|
||||||
for (ValueFormat valueF : listValueFormat) {
|
for (ValueFormat valueF : listValueFormat) {
|
||||||
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
||||||
valueF.getId(), valueF.getExample(), valueF.getRegExpr());
|
valueF.getId(), valueF.getExample(),
|
||||||
|
valueF.getRegExpr());
|
||||||
valueDataFormats.add(valueDataFormat);
|
valueDataFormats.add(valueDataFormat);
|
||||||
}
|
}
|
||||||
PeriodDataType periodDT = new PeriodDataType(
|
PeriodDataType periodDT = new PeriodDataType(period.name(),
|
||||||
period.name(), period.getName(), valueDataFormats);
|
period.getName(), valueDataFormats);
|
||||||
hierarchicalPeriodDataTypes.add(periodDT);
|
hierarchicalPeriodDataTypes.add(periodDT);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug("hierarchicalPeriodDataTypes: "+hierarchicalPeriodDataTypes);
|
logger.debug("hierarchicalPeriodDataTypes: "
|
||||||
|
+ hierarchicalPeriodDataTypes);
|
||||||
return hierarchicalPeriodDataTypes;
|
return hierarchicalPeriodDataTypes;
|
||||||
|
|
||||||
} catch (TDGWTServiceException e) {
|
} catch (TDGWTServiceException e) {
|
||||||
|
@ -404,36 +406,48 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error("getPeriodDataTypes(): " + e.getLocalizedMessage(), e);
|
logger.error("getPeriodDataTypes(): " + e.getLocalizedMessage(), e);
|
||||||
throw new TDGWTServiceException("Error retrieving hierarchical list of period types: "
|
throw new TDGWTServiceException(
|
||||||
+ e.getLocalizedMessage());
|
"Error retrieving hierarchical list of period types: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param columnDataType
|
* @param columnDataType
|
||||||
* @return
|
* @return
|
||||||
* @throws TDGWTServiceException
|
* @throws TDGWTServiceException
|
||||||
*/
|
*/
|
||||||
public ArrayList<ValueDataFormat> getValueDataFormats(ColumnDataType columnDataType)
|
@Override
|
||||||
|
public HashMap<ColumnDataType, ArrayList<ValueDataFormat>> getValueDataFormats()
|
||||||
throws TDGWTServiceException {
|
throws TDGWTServiceException {
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
SessionUtil.getAslSession(session);
|
SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
ArrayList<ValueDataFormat> valueDataFormats = new ArrayList<ValueDataFormat>();
|
|
||||||
|
|
||||||
Class<? extends DataType> dataType=ColumnDataTypeMap.mapToDataTypeClass(columnDataType);
|
HashMap<ColumnDataType, ArrayList<ValueDataFormat>> columnDataTypeFormats = new HashMap<ColumnDataType, ArrayList<ValueDataFormat>>();
|
||||||
|
|
||||||
for (ValueFormat valueF: DataTypeFormats.getFormatsPerDataType(dataType)) {
|
for (ColumnDataType columnDataType : ColumnDataType.values()) {
|
||||||
|
|
||||||
|
ArrayList<ValueDataFormat> valueDataFormats = new ArrayList<ValueDataFormat>();
|
||||||
|
|
||||||
|
Class<? extends DataType> dataType = ColumnDataTypeMap
|
||||||
|
.mapToDataTypeClass(columnDataType);
|
||||||
|
|
||||||
|
for (ValueFormat valueF : DataTypeFormats
|
||||||
|
.getFormatsPerDataType(dataType)) {
|
||||||
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
||||||
valueF.getId(), valueF.getExample(), valueF.getRegExpr());
|
valueF.getId(), valueF.getExample(),
|
||||||
|
valueF.getRegExpr());
|
||||||
valueDataFormats.add(valueDataFormat);
|
valueDataFormats.add(valueDataFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
columnDataTypeFormats.put(columnDataType, valueDataFormats);
|
||||||
logger.debug("ValueDataFormats: "+valueDataFormats);
|
|
||||||
return valueDataFormats;
|
}
|
||||||
|
|
||||||
|
logger.debug("getValueDataFormats(): " + columnDataTypeFormats);
|
||||||
|
return columnDataTypeFormats;
|
||||||
|
|
||||||
} catch (TDGWTServiceException e) {
|
} catch (TDGWTServiceException e) {
|
||||||
throw e;
|
throw e;
|
||||||
|
@ -442,12 +456,53 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
logger.error("getValueDataFormats(): " + e.getLocalizedMessage(), e);
|
logger.error("getValueDataFormats(): " + e.getLocalizedMessage(), e);
|
||||||
throw new TDGWTServiceException("Error retrieving value data formats: "
|
throw new TDGWTServiceException(
|
||||||
+ e.getLocalizedMessage());
|
"Error retrieving value data formats: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param columnDataType
|
||||||
|
* @return
|
||||||
|
* @throws TDGWTServiceException
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ArrayList<ValueDataFormat> getValueDataFormatsOfColumnDataType(
|
||||||
|
ColumnDataType columnDataType) throws TDGWTServiceException {
|
||||||
|
try {
|
||||||
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
|
SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
|
ArrayList<ValueDataFormat> valueDataFormats = new ArrayList<ValueDataFormat>();
|
||||||
|
|
||||||
|
Class<? extends DataType> dataType = ColumnDataTypeMap
|
||||||
|
.mapToDataTypeClass(columnDataType);
|
||||||
|
|
||||||
|
for (ValueFormat valueF : DataTypeFormats
|
||||||
|
.getFormatsPerDataType(dataType)) {
|
||||||
|
ValueDataFormat valueDataFormat = new ValueDataFormat(
|
||||||
|
valueF.getId(), valueF.getExample(),
|
||||||
|
valueF.getRegExpr());
|
||||||
|
valueDataFormats.add(valueDataFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
logger.debug("getValueDataFormatsOfColumnDataType(): ["+columnDataType+", "+ valueDataFormats+"]");
|
||||||
|
return valueDataFormats;
|
||||||
|
|
||||||
|
} catch (TDGWTServiceException e) {
|
||||||
|
throw e;
|
||||||
|
} catch (SecurityException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
throw new TDGWTServiceException(SECURITY_EXCEPTION_RIGHTS);
|
||||||
|
} catch (Throwable e) {
|
||||||
|
logger.error("getValueDataFormatsOfColumnDataType(): " + e.getLocalizedMessage(), e);
|
||||||
|
throw new TDGWTServiceException(
|
||||||
|
"Error retrieving value data formats: "
|
||||||
|
+ e.getLocalizedMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue