-
Type: Improvement
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: CSV Importer, Java Client
Expected with org.nuxeo.client.NuxeoClient:
String workId = client.operation(CSVImportOperation.ID)
.param(...)
.input(...)
.execute();
CSVImportStatus workStatus = client.operation(CSVImportStatusOperation.ID).input(workId).execute();
But the command returns null.
Current solution is to implement the deserialization following https://doc.nuxeo.com/client-java/3.2/advanced-usage/:
public static class CSVImportStatusJSONObject extends Entity { public static final String ENTITY_TYPE = "org.nuxeo.ecm.csv.core.CSVImportStatus"; public CSVImportStatusJSONObject() { super(ENTITY_TYPE); } public CSVImportStatusWithConstructor getValue() { return value; } public void setValue(CSVImportStatusWithConstructor value) { this.value = value; } CSVImportStatusWithConstructor value; } public static class CSVImportStatusWithConstructor extends CSVImportStatus { @JsonCreator public CSVImportStatusWithConstructor(@JsonProperty("state") State state) { super(state); } } NuxeoClient client = new NuxeoClient.Builder().registerEntity(CSVImportStatusJSONObject.ENTITY_TYPE, CSVImportStatusJSONObject.class).connect(); String workId = client.operation(CSVImportOperation.ID) .param(...) .input(...) .execute(); CSVImportStatus workStatus = client.operation(CSVImportStatusOperation.ID) .input(workId).<CSVImportStatusJSONObject>execute().value;
A CSV writer is needed.
Worth to improve in the mean time:
- it would be useful if the operation also returned back the work ID
- a pretty toString() method
- org.nuxeo.ecm.csv.core.CSVImportStatus.State#ERROR is missing a getter compared to isComplete(), isRunning(), isScheduled()
- same with the other CSV operations: CSVImportResult, ... and primitive types: String, ...
- depends on
-
JAVACLIENT-213 Add String primitive JSON parsing to Java client
- Resolved