cancel
Showing results for 
Search instead for 
Did you mean: 

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

Liam_Lyons
Champ in-the-making
Champ in-the-making

Hello,

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: java.io.IOException: Invalid property line (cannot find a '=') in: ' second line' Caused by: java.io.IOException: Invalid property line (cannot find a '=') in: ' second line'

Any help would be appreciated

1 REPLY 1

Liam_Lyons
Champ in-the-making
Champ in-the-making

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

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.