Howto use FolderService.list

Do you want to create a native client or integrate with third party applications: webservices are the solution.

Moderator: car031

Locked
real_skydiver
Posts: 13
Joined: Sat Feb 19, 2011 8:36 pm

Howto use FolderService.list

Post by real_skydiver » Wed Feb 23, 2011 10:53 am

Hi there,

how can I use 'FolderService.list' if I don't know the root folder id? In my databse it is 5. If I use this (along with the proper sid) I get a nice list of folders with their id, parent id and name. Is it always '5'? Or is there a way to figure that id out?

Another question - 'AuthService.getGroups' delivers only the id, how can I get the name of that group?

Thanks!

agaspa
Posts: 514
Joined: Tue Apr 20, 2010 8:24 am

Re: Howto use FolderService.list

Post by agaspa » Thu Feb 24, 2011 9:47 am

By default the root document folder in logicaldoc is 5.
By aware however that FolderService.list will return all the folders children of the folder you request, no matter the level.
We are introducing a new method that will be available shortly called FolderService.listChildren which will return only the children folder of the first level
About the groups you're right, actually there is no way to get the name of a group.
In version 6.0.2 there will be a new web-service called Security that will better manage security-related operations

real_skydiver
Posts: 13
Joined: Sat Feb 19, 2011 8:36 pm

Re: Howto use FolderService.list

Post by real_skydiver » Thu Feb 24, 2011 2:33 pm

Ok, my first demo app is done (see attached image). However, I found one 'feature' that I would declare as a bug: FolderService.list returns all folders, regardless of the security set. In my installation, I have several folders that only a certain user has access to (all other groups are removed from the security/access list). That works great in the browser: if I log on as a 'unprivileged' user the folders are simply not there. But using FolderService.list returns all folders for that 'unprivileged' user. It is not a good idea to burden security issues onto the client, that always should be the responsibility of the server.
Attachments
FolderTree.jpg
First Demo-App, using Auth- and Folder-Service
FolderTree.jpg (18.95 KiB) Viewed 17702 times

real_skydiver
Posts: 13
Joined: Sat Feb 19, 2011 8:36 pm

Re: Howto use FolderService.list

Post by real_skydiver » Thu Feb 24, 2011 2:34 pm

Oh, btw., if anyone is interested in the source ... ;)

agaspa
Posts: 514
Joined: Tue Apr 20, 2010 8:24 am

Re: Howto use FolderService.list

Post by agaspa » Thu Feb 24, 2011 3:53 pm

Hi skydiver,
thank you for reporting, I will pass it to our technical department for testing and if they found positive we will to correct ASAP the problem.

In the future, if you encounter bugs or you have new feature requests for extensions of web-services I recommend you to activate an account in the LogicalDOC Issue Tracking System.

Best regards
Alex

agaspa
Posts: 514
Joined: Tue Apr 20, 2010 8:24 am

Re: Howto use FolderService.list

Post by agaspa » Thu Feb 24, 2011 4:10 pm

Ok Enrico,
I reported the problem and they gave me an answer.

The method in question returns all children, regardless of their level, but in order to be efficient returns all children, without checking the read permissions.
This is to have an efficient and fast method to create a tree.

In the next version of logicaldoc 6.0.2 there will be a new method even more efficient listChildren which will list only children at first level checking the read permissions.

Our engineers have confirmed however that this is not an error but merely an omission in the description of the method, this is because the possibility to read or write documents in a folder is checked when I try to execute these operations.

real_skydiver
Posts: 13
Joined: Sat Feb 19, 2011 8:36 pm

Re: Howto use FolderService.list

Post by real_skydiver » Thu Feb 24, 2011 4:11 pm

Hi Alex,

I wasn't really sure if it's a bug or intended.

Best regards,
Enrico

real_skydiver
Posts: 13
Joined: Sat Feb 19, 2011 8:36 pm

Re: Howto use FolderService.list

Post by real_skydiver » Thu Feb 24, 2011 5:32 pm

Hi Alex,

I don't want to start a discussion about this - since it will be 'fixed' with that new 'listChildren' methode. I just want to throw onto the table, that the idea
but in order to be efficient returns all children
is totally awkward, because actually the opposite is true. In order to write a application that reflects the access permissions - and everything else would not be acceptable by customers – you have to call ‘isReadable’ for every folder. Considering the SOAP-delay – that has a huge negative performance impact.

Just my two cents ;)

Best regards,
Enrico

shrikant
Posts: 18
Joined: Fri Apr 10, 2015 11:56 am

Re: Howto use FolderService.list

Post by shrikant » Tue Apr 14, 2015 11:18 am

Hi All

Could we find the user's group and permitted folder id on basis of sid.

Regards
Shrikant

Locked

Who is online

Users browsing this forum: No registered users and 1 guest