4 Replies Latest reply on Dec 4, 2017 9:42 AM by khayes RSS
    khayes Apprentice

    How to retrieve part of a tree

    Hi,

    does anyone know if are there any in built File Repository services that will return just part of a given directory structure.

     

    I have a custom file repository thing (for each customer). Within the repository I have a folder for each asset owned by the customer. Each asset folder has a number of sub folders.

    I have a mash up that has a tree widget. I would like to populate the tree with just the selected assets folders & files. Is there a built in way to do this, or would I have to write my own?

     

    Thanks,

    K

      • Re: How to retrieve part of a tree
        carlesc Heavyweight Champ

        You should use ListDirectories services recursively, it's how we do for the exact same situation as yours.

          • Re: How to retrieve part of a tree
            khayes Apprentice

            Hi Carles,

            thanks for the quick response. I took your advice, but am having problems getting the result to display in the tree widget. I wonder if you can see anything obvious? I use the same service to populate a grid widget (for debug) and a tree widget. The service is just a wrapper service around ListDirectories and I believe the data returned is correct.

             

            var printerPath = "/Printers/"+PrinterID;

             

            var params = {

            path: printerPath /* STRING */,

            nameMask: undefined /* STRING */

            };

            // result: INFOTABLE dataShape: "FileSystemDirectory"

            var result = me.ListDirectories(params);

             

            I think I have the tree widget configured correctly, but don't see any data.

            Can you see anything obvious that I am doing wrong. I have so much trouble with tree widgets.

            Thanks,

            K