2 Replies Latest reply on May 29, 2013 5:59 AM by singhl1

    How to retrieve  a hierarchy from a repositorty

    singhl1 Newbie

      I have the following scenario:

       

      A modshape 3.2.0 Final repository, with a single workspace, called myWorkspace. Running in tomcat 6 with spring 3.1 and Java 6

       

      The workspace will be use to soley store files (word docs, excel, images etc.... so oly folders and binary content) under a folder structure (that the user can define), so file(s) can be under a tree of folders, I have implemented the creation fo folders and files as per https://docs.jboss.org/author/display/MODE/Storing+files+and+folders.

       

      So what I now need to do is to represent this in a pictorial form in my application, so I need to retrieve the directory structure and any jcr:content in those folders in a tree structure (similar to a file explorer window in windows) from the root folder

       

      eg

       

      FIRST FOLDER

           SECOND FOLDER

                file1.doc

                file2.xls

                THIRD FOLDER

                     image1.jpeg

      FORTH FOLDER

           file3.xls

       

      Also ordering of the data will be important, so either by date or by name (aplhabetic).

       

      Need to do this in a java class, by interogating repository, I cannot work out the most efficient way to get the data? Do i get the root node and then find nodes under that, or by SQL or any other method?

       

      The workspace will only contain folders and files, nothing else.

       

      Any help appreciated.