Java Automation Client - Carriage return is interpreted as a new property


I'm writing a Java migration program from Nuxeo 7.2 to 8.3

When I try to copy a note with multiple lines I get an error because Nuxeo interprets a carriage return in the note content as a new property.

Document note = (Document) session2.newRequest(“Document.Fetch”).set(“value”, “/default-domain/workspaces/note”).setHeader(

                Constants.HEADER_NX_SCHEMAS, "*").execute();

note.set(“note:note”, “first line \n second line”);

note = (Document) session2.newRequest(“Document.Update”).setHeader(Constants.HEADER_NX_SCHEMAS, “*“).setInput(note).set(“properties”, note).execute();

Here is a piece the error I get :

Exception in thread “main” org.nuxeo.ecm.automation.client.RemoteException: Failed to invoke operation: Document.Update Caused by: org.nuxeo.ecm.automation.client.RemoteThrowable:

chain Name: Document.Update Exception: TypeAdaptException Caught error: Invalid property line (cannot find a '=') in: ' second line' Caused by: Invalid property line (cannot find a '=') in: ' second line'

Any help would be appreciated

0 votes

1 answers



I managed to do it by adding \\ at the end of a line.

0 votes