cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

How to retrieve part of a tree

khayes1
15-Moonstone

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

ACCEPTED SOLUTION

Accepted Solutions

On your service, add this fake row:

result.AddRow({ path: yourRootThingFolderPath, parentPath: "", name: "/" });

View solution in original post

4 REPLIES 4

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

khayes1
15-Moonstone
(To:CarlesColl)

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

On your service, add this fake row:

result.AddRow({ path: yourRootThingFolderPath, parentPath: "", name: "/" });

khayes1
15-Moonstone
(To:CarlesColl)

Hi Carles,

thanks, you are a legend. That's sorted it now.

Cheers,

Kieron

Announcements


Top Tags