Why toDisplayPath shows the parent path?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2014 05:49 AM
I want to return a friendly path from a node. I try to use this:
but if nodeRef path is A/B/C, toDisplayPath returns me A/B.
What's the reason? Are there another method to obtain a full friendly path?
Thanks!
getNodeService().getPath(nodeRef).toDisplayPath(getNodeService(), getPermissionService())
but if nodeRef path is A/B/C, toDisplayPath returns me A/B.
What's the reason? Are there another method to obtain a full friendly path?
Thanks!
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-04-2014 05:56 AM
It is because the method itself returns the PATH of the nodeRef (where the nodeRef actually lies).
So for example your file test.pdf lies in Company Home/FolderA then the method getPath() should return -> Company Home/FolderA; and not Company Home/FolderA/test.pdf
In your case, if your nodeRef lies in C folder ( A/B/C ), and still the method getPath() returns A/B, then you need to verify the nodeRef once. It might be incorrect.
So for example your file test.pdf lies in Company Home/FolderA then the method getPath() should return -> Company Home/FolderA; and not Company Home/FolderA/test.pdf
In your case, if your nodeRef lies in C folder ( A/B/C ), and still the method getPath() returns A/B, then you need to verify the nodeRef once. It might be incorrect.
