-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Cannot Reproduce
-
Affects Version/s: Android 2.0
-
Fix Version/s: None
-
Component/s: Android SDK
When i create a document with quote in dc:title property, the following error occurs.
this example is based on the title "Boissy l'Aillerie"
10-20 22:45:08.153: E/NuxeoGardenProvider(13661): near "Aillerie": syntax error (code 1): , while compiling: INSERT INTO NuxeoPendingUpdates (KEY,OPERATIONID,OPTYPE,PARAMS,HEADERS,CTX,DEPS,INPUT_TYPE,INPUT_REF,INPUT_BIN ) VALUES ('71164ae5b1f3b731f9f6ffbd1716d6f9','Document.Create','Create','{"type":"Garden","properties":"dc:title=Boissy-l'Aillerie\n"}','{"X-NXDocumentProperties":"*"}','{}','[]','document','doc:3999f29a-b487-45d6-a049-4f41ef2fd386','false'); 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): android.database.sqlite.SQLiteException: near "Aillerie": syntax error (code 1): , while compiling: INSERT INTO NuxeoPendingUpdates (KEY,OPERATIONID,OPTYPE,PARAMS,HEADERS,CTX,DEPS,INPUT_TYPE,INPUT_REF,INPUT_BIN ) VALUES ('71164ae5b1f3b731f9f6ffbd1716d6f9','Document.Create','Create','{"type":"Garden","properties":"dc:title=Boissy-l'Aillerie\n"}','{"X-NXDocumentProperties":"*"}','{}','[]','document','doc:3999f29a-b487-45d6-a049-4f41ef2fd386','false'); 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteConnection.nativePrepareStatement(Native Method) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteConnection.acquirePreparedStatement(SQLiteConnection.java:1090) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteConnection.prepare(SQLiteConnection.java:663) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteSession.prepare(SQLiteSession.java:588) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteProgram.<init>(SQLiteProgram.java:58) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteStatement.<init>(SQLiteStatement.java:31) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteDatabase.executeSql(SQLiteDatabase.java:1769) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.database.sqlite.SQLiteDatabase.execSQL(SQLiteDatabase.java:1700) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.nuxeo.android.cache.sql.DeferedUpdateTableWrapper.storeRequest(DeferedUpdateTableWrapper.java:111) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.nuxeo.ecm.automation.client.android.AndroidDeferredUpdateManager.storePendingRequest(AndroidDeferredUpdateManager.java:194) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.nuxeo.ecm.automation.client.android.AndroidDeferredUpdateManager.execDeferredUpdate(AndroidDeferredUpdateManager.java:75) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.garden.provider.nuxeo.NuxeoGardenProvider.createNuxeoGarden(NuxeoGardenProvider.java:232) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.garden.provider.nuxeo.NuxeoGardenProvider.synchronize(NuxeoGardenProvider.java:177) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.garden.provider.nuxeo.NuxeoGardenProvider.getMyNuxeoGardens(NuxeoGardenProvider.java:146) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.garden.provider.nuxeo.NuxeoGardenProvider.getMyGardens(NuxeoGardenProvider.java:92) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.garden.GardenManager.getMyGardens(GardenManager.java:158) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.ui.SplashScreenActivity$9.doInBackground(SplashScreenActivity.java:356) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at org.gots.ui.SplashScreenActivity$9.doInBackground(SplashScreenActivity.java:342) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.os.AsyncTask$2.call(AsyncTask.java:287) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at java.util.concurrent.FutureTask.run(FutureTask.java:234) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:230) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1080) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:573) 10-20 22:45:08.153: E/NuxeoGardenProvider(13661): at java.lang.Thread.run(Thread.java:856)
This is my code extract
PropertyMap properties = new PropertyMap(); properties.set("dc:title", localGarden.getLocality()); OperationRequest createOperation = NuxeoManager.getInstance().getSession().newRequest("Document.Create").setHeader( Constants.HEADER_NX_SCHEMAS, "*").setInput(root).set("type", "Garden").set("properties", properties);