I'm trying to pass a non-scalar field from client to server through a custom data source. I've tried several approaches, and none of them work. The current symptom I have is that when the client calls addData() with the record that contains the non-scalar field, the client eventually times out with:
(-:-) 2015-01-21 19:55:46,917 [WARN ] smartGWT Datasource operation returned an error.
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,922 [WARN ] Datasource is PivotBookmarksDMI
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,927 [WARN ] Datasource operation is ADD
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,932 [WARN ] Error code is -100
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,937 [WARN ] Error message is Error on Server - Unable to Complete
ConsoleLogger.java:69
If I don't add the POJO/map to the record on the client, the server custom DMI code works fine. If I add the POJO or map to the record to the client and call addData(), then the add operation times out.
I've tried putting the data into the record on the client as a Map, or I've tried using setAttributeAsJavaObject. I still get a timeout on the server.
Here's the datasource xml file:
<DataSource
ID="PivotBookmarksDMI"
dropExtraFields="true"
serverConstructor="com.Atlantic.AtlanticScheduler.server.Pivot.PivotBookmarksDMI"
>
<fields>
<field name="code" type="text" primaryKey="true" />
<field name="path" type="text" />
<field name="description" type="text" />
<field name="colorDimensionName" type="text" required="true" />
<field name="labelDimensionName" type="text" required="true" />
<field name="rowDimensionNames" title="Row Dimensions"
multiple="true"
type="text"
required="true"
/>
</fields>
</DataSource>
Here's the server code. I never see any of the logging info in this method, which is consistent with the timeout occurring.
public class PivotBookmarksDMI extends BasicDataSource {
@Override
public DSResponse executeAdd(DSRequest req) throws Exception {
logger.info("-------Running add on PivotBookmarksDMI.");
logger.info("client supplied values are " + req.getValues());
@SuppressWarnings("unchecked")
Map<String, Object> values = req.getValues();
logger.info("got values");
return dsResponse;
}
}
I looked in the showcases (both plain and Pro/EE), and couldn't find an example. I looked on this forum and couldn't find a solution. The forum did suggest that setAttributeAsJavaObject could work, but when I used that to insert the POJO into the record, the timeout persisted.
I'm using:
SmartClient Version: v9.1p_2014-11-01/PowerEdition Deployment (built 2014-11-01)
Chrome 40.0.2214.69 beta (64-bit)
What's the correct approach to solve this problem?
(-:-) 2015-01-21 19:55:46,917 [WARN ] smartGWT Datasource operation returned an error.
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,922 [WARN ] Datasource is PivotBookmarksDMI
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,927 [WARN ] Datasource operation is ADD
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,932 [WARN ] Error code is -100
ConsoleLogger.java:69 (-:-) 2015-01-21 19:55:46,937 [WARN ] Error message is Error on Server - Unable to Complete
ConsoleLogger.java:69
If I don't add the POJO/map to the record on the client, the server custom DMI code works fine. If I add the POJO or map to the record to the client and call addData(), then the add operation times out.
I've tried putting the data into the record on the client as a Map, or I've tried using setAttributeAsJavaObject. I still get a timeout on the server.
Here's the datasource xml file:
<DataSource
ID="PivotBookmarksDMI"
dropExtraFields="true"
serverConstructor="com.Atlantic.AtlanticScheduler.server.Pivot.PivotBookmarksDMI"
>
<fields>
<field name="code" type="text" primaryKey="true" />
<field name="path" type="text" />
<field name="description" type="text" />
<field name="colorDimensionName" type="text" required="true" />
<field name="labelDimensionName" type="text" required="true" />
<field name="rowDimensionNames" title="Row Dimensions"
multiple="true"
type="text"
required="true"
/>
</fields>
</DataSource>
Here's the server code. I never see any of the logging info in this method, which is consistent with the timeout occurring.
public class PivotBookmarksDMI extends BasicDataSource {
@Override
public DSResponse executeAdd(DSRequest req) throws Exception {
logger.info("-------Running add on PivotBookmarksDMI.");
logger.info("client supplied values are " + req.getValues());
@SuppressWarnings("unchecked")
Map<String, Object> values = req.getValues();
logger.info("got values");
return dsResponse;
}
}
I looked in the showcases (both plain and Pro/EE), and couldn't find an example. I looked on this forum and couldn't find a solution. The forum did suggest that setAttributeAsJavaObject could work, but when I used that to insert the POJO into the record, the timeout persisted.
I'm using:
SmartClient Version: v9.1p_2014-11-01/PowerEdition Deployment (built 2014-11-01)
Chrome 40.0.2214.69 beta (64-bit)
What's the correct approach to solve this problem?