Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X
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
Solved! Go to Solution.
On your service, add this fake row:
result.AddRow({ path: yourRootThingFolderPath, parentPath: "", name: "/" });
You should use ListDirectories services recursively, it's how we do for the exact same situation as yours.
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: "/" });
Hi Carles,
thanks, you are a legend. That's sorted it now.
Cheers,
Kieron