cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a way to derive a WebDAV path from a DocumentModel?

Steven_Huwig1
Star Contributor
Star Contributor

As part of an operation, I need to retrieve the path to a document's file:content for a remote system to access via WebDAV.

However, the path as retrieved by getPathAsString() and getFilePath() do not match the path to the document as observed via WebDAV.

public void run(DocumentModel input) throws ClientException {
        // ...
        LOG.info(input.getPathAsString());
        BlobHolder x = input.getAdapter(BlobHolder.class);
        LOG.info(x.getFilePath());
       // ...
}

yields

/default-domain/workspaces/Publisher Content/Testing/foo bar
/default-domain/workspaces/Publisher Content/Testing/foo bar/document.pdf

But the observed path to the document is at

http://localhost:8080/nuxeo/site/dav/Publisher Content/Testing/document.pdf

(i.e. no /foo bar/ component).

In an automation operation, where should I be looking to derive a path for a DocumentModel that another system will later be able to access underneath http://example.com/nuxeo/site/dav ?

1 ACCEPTED ANSWER

Florent_Guillau
World-Class Innovator
World-Class Innovator

The WebDAV "path" is basically the the same doc.getPathAsString(), namely the sequence of doc.getName() for the doc objects (that are folderish) leading to the document, except that:

  • the first parts may be skipped depending on the WebDAV virtual roots in effect,
  • the last part, for the document, is not its doc.getName() but the filename of the doc's blob.

See org.nuxeo.ecm.platform.wi.backend.SimpleBackend.getDisplayName for the code.

View answer in original post

2 REPLIES 2

Florent_Guillau
World-Class Innovator
World-Class Innovator

The WebDAV "path" is basically the the same doc.getPathAsString(), namely the sequence of doc.getName() for the doc objects (that are folderish) leading to the document, except that:

  • the first parts may be skipped depending on the WebDAV virtual roots in effect,
  • the last part, for the document, is not its doc.getName() but the filename of the doc's blob.

See org.nuxeo.ecm.platform.wi.backend.SimpleBackend.getDisplayName for the code.

This is exactly the pointer I needed. Thanks.

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.