How to handle accented paths in nxql

Hi i have accented characters in some documents titles and paths. Querying titles from an automation client based portlet works fine but not for paths. Any idea ?

0 votes

0 answers

4306 views

ANSWER

Hello,

Can you give an example and problem (logs) you encountered?

Here is an example I tried and which is working:

Document folder = (Document) session.newRequest("Document.Create").setInput(
                "/").set("type", "Folder").set("name", "TestFoldereé").set(
                "properties",
                "dc:title=TestFoldereé\ndc:description=Simple container").execute();
Document root = (Document) session.newRequest("Document.Fetch").set(
                "value", "/TestFoldereé").execute();
PaginableDocuments docs = (PaginableDocuments) session.newRequest(
                "Document.PageProvider").set("query",
                "SELECT * FROM Document WHERE ecm:path = ?").set(
                "queryParams", "/TestFoldereé").set("pageSize", "2").set("page",
                "0").execute();

I have always a non empty result. Thanks

02/03/2014

Unfortunately, i don t yet have access to the portlet running the automation client. However these automation traces (one querying for an accented title and another one for an accented path) suggest that the problem might come from the portlet : the encoding is the same in both cases.

****** Document.PageProvider ******
Chain ID: No bound to a chain
Class: DocumentPageProviderOperation
Method: 'run' | Input Type: void | Output Type: class org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl
Input: null
Context Variables | Key: request, Value: org.nuxeo.ecm.platform.ui.web.auth.NuxeoSecuredRequestWrapper@12a8e918 | Key: ChainParameters, Value: {page=0, query=SELECT * FROM Document WHERE ecm:path STARTSWITH '/default-domain/workspaces/Espaces partagés' AND ecm:currentLifeCycleState <> 'deleted'  AND ecm:mixinType = 'Downloadable' ORDER BY dc:created DESC, pageSize=20}
...
...
****** Document.PageProvider ******
Chain ID: No bound to a chain
Class: DocumentPageProviderOperation
Method: 'run' | Input Type: void | Output Type: class org.nuxeo.ecm.automation.jaxrs.io.documents.PaginableDocumentModelListImpl
Input: null
Context Variables | Key: request, Value: org.nuxeo.ecm.platform.ui.web.auth.NuxeoSecuredRequestWrapper@2f0c141e | Key: ChainParameters, Value: {page=0, query=SELECT * FROM Document WHERE dc:title =  'Espaces partagés', pageSize=20}
02/03/2014

The problem came from the portlet and had nothing to do with accented characters
02/16/2014