We are using apache jackrabbit to store content (html,image,pdfs) as follows:
/folder1 (nt:unstructured)
/content1(nt:unstructured)
/file(nt:folder)
/test.html(nt:file)
/test.html-contents (nt:resource)
In the UI, we want to display all content that can be sorted by name, file size, file type etc. To achieve that, I tried XPath to retrieve content nodes.
Is it possible to sort on node name? I tried some thing like
"/element(*,nt:base) order by @name ascending"
but that does not work. It works on other properties of content, but not the name. 2. Is it possible to sort on file size? Since files are child nodes of content, is there some way I can query for content based on its file size? (someway to query by jcr:data).length?)
As a workaround, I am retrieving all content via node iterator and doing in-memory sorting/pagination. I was hoping there is a better way to do this.