cancel
Showing results for 
Search instead for 
Did you mean: 

How to use input when path contains space at the end

Dominic_Bérubé
Champ on-the-rise
Champ on-the-rise

I'm trying to use call from the Automation service, but I have some problem when the Path of my Document finish with space e.g.:

'/default-domain/workspaces/MyWorkspace/MyFolder/MyDocument '

when I call the service, I use :

{"input":"docs:/default-domain/workspaces/MyWorkspace/MyFolder/MyDocument , /default-domain/workspaces/MyWorkspace/MyFolder/AnotherDocument", "params":{}, "context":{}}

I tried to put single quotes (') and double quote ("), but still the same error

1 ACCEPTED ANSWER

bstefanescu_
Champ on-the-rise
Champ on-the-rise

You cannot.

The default "docs" resolver (on the server side) is trimming the doc paths in the list.

The only way to do this is to override the default resolver for "docs" which is:

org.nuxeo.ecm.automation.server.jaxrs.io.resolvers.DocumentsInputResolver

You can do this by creating a regular Nuxeo component and call the following code in the activate method:

JsonRequestReader.addInputResolver(new MyDocumentsInputResolver());

where MyDocumentsInputResolver is your custom resolver for the "docs" input. (which should implement the logic to accept trailing spaces in the path entries)

View answer in original post

3 REPLIES 3

bstefanescu_
Champ on-the-rise
Champ on-the-rise

You cannot.

The default "docs" resolver (on the server side) is trimming the doc paths in the list.

The only way to do this is to override the default resolver for "docs" which is:

org.nuxeo.ecm.automation.server.jaxrs.io.resolvers.DocumentsInputResolver

You can do this by creating a regular Nuxeo component and call the following code in the activate method:

JsonRequestReader.addInputResolver(new MyDocumentsInputResolver());

where MyDocumentsInputResolver is your custom resolver for the "docs" input. (which should implement the logic to accept trailing spaces in the path entries)

Dominic_Bérubé
Champ on-the-rise
Champ on-the-rise

Ok, but how do I create a regular Nuxeo component, can you give me an example or point me to the doc.

Thanks!

Dom

Wojciech_Sulejm
Star Contributor
Star Contributor

As far as components are concerned you can learn more here: http://doc.nuxeo.com/x/0gBu

here: http://doc.nuxeo.com/x/dABu

and here: http://explorer.nuxeo.org/nuxeo/site/distribution/current/listComponents

Please note however that what you asked here is a separate question. In such situations we recommend creating a new question instead of attaching it to another one. This will help other community users navigate through this system and find the answers they are looking for.