Java Automation Client - Carriage return is interpreted as a new property
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2016 10:59 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-25-2016 07:19 AM
I managed to do it by adding \\ at the end of a line.
