Hi Scott,
Is it possible to add/delete a user access to the folder or a functional group using webservices?
Thanks,
Kapil
Sorry for replying to my own post. But, I found the way to add user access to functional group. I still can't figure out the way to add the user access to a folder through EWS.
To add a user access to a functional group, You can use AddMemberToGroup operation from MemberService.
Hi, Kapil.
You can use DocumentManagement's GetNodeRights() to determine the permissions that have been set for a given Node. Based on the ACLRights in the NodeRights SDO, you can call AddNodeRight() (if the user is not there) or UpdateNodeRight() (if the user is there) to grant permissions to that Node.
Take a look at UpdateNodeRightsContext() and UpdateNodeRights() to apply NodeRights to the children of a Node. This is a chunked operation, so call UpdateNodeRightsContext() to get a context and then call UpdateNodeRights() until the operation is complete.
Scott
I do not know too much webservices but I know a fair amount of livelink and its code.
in livelink everynode has an ACL.You can basically change owner,Group,PA and assigned ACL's on this.This is docman operation for which you will need a docman service class and its methods
I see three that of interest
UpdateNodeRightRequest UpdateNodeRightsRequest
In livelink if the folder Objid is 12345 rights means what a user/group can do to it.It is a permission bitmask.Any method with rights is probably a getter or setter method.
It will help you greatly if you use the livelink GUI and pretend what you are programming in code because basically lapi or this is just an api to do domething without the interface .
The one that you found is probably adding/updating users to groups
Thanks Appu,Scott. I have a question related to CreateFolder operation of DocMan wervice -
I was able to create the folder, but I also want to add a owner to the folder in the same request. Can we achieve this? What type of key and values can be used in the metadata section shown below?
<urn1:metadata> <!--Zero or more repetitions:--> <urn1:AttributeGroups> <urn1:DisplayName>?</urn1:DisplayName> <urn1:Key>?</urn1:Key> <urn1:Type>?</urn1:Type> <!--Zero or more repetitions:--> <urn1:Values> <urn2:Description>?</urn2:Description> <urn2:Key>?</urn2:Key> </urn1:Values> </urn1:AttributeGroups> </urn1:metadata>
The owner is created by the user that actually creates the folder. You might want to impersonate the user to accomplish that.
Metadata is for Categories and Attributes, and in 10.0.0 it can include System/Additional Node Attributes.
Thanks Scott.
I am trying to create a project using CreateProject operation from Collaboration service. I am getting a null pointer exception. I have provided all the values in the request. After checking the servcer side logs, I am getting nullpointer at :
java.lang.NullPointerException at com.opentext.livelink.service.core.SDOUtil.setEnumValue(SDOUtil.java:730) at com.opentext.livelink.service.collaboration.ProjectInfo.toLLValue(ProjectInfo.java:343) at com.opentext.livelink.service.core.SDOUtil.setSDOValue(SDOUtil.java:645) at com.opentext.livelink.service.collaboration.Collaboration.createProject(Collaboration.java:259) at com.opentext.livelink.service.collaboration.Collaboration_JAXWS.createProject(Collaboration_JAXWS.java:165)
I have provided all the values in the request. Even if they might be wrong, i was not expecting a nullpointer. What I might be doing wrong?
Be sure to provide a valid value for any enumeration. I think Status might be the property causing the problem.
How can we add the permissions to the subitems? I would like to select the following option while adding access to the folder.
Use the UpdateNodeRightsContext followed by calls to UpdateNodeRights to apply permission changes to sub-items.
Can you add more info about "You might want to impersonate the user to accomplish that"
Can we change the "create by" attribute when we create a new folder ?
Hi, Lucie.
No, you can't change the "created by" user; however, you can impersonate another user, so that the "created by" user is the value you want (the impersonated user).
If Admin creates a folder, then the owner will be Admin. If Admin impersonates sgrasley, then sgrasley creates a folder, then the owner will be sgrasley.
Than’ks
Hi Lucie,
The ImpersonateUser() method is part of the Authentication service. To use this method you must currently be authenticated as an Admin user. Calling the ImpersonateUser method will return you a new authentication token for the user you want to impersonate. You can then use this token for the service you want to use as the impersonated user. Here is a quick example: // Setup the Authentication service client Authentication.AuthenticationClient authClient = new Authentication.AuthenticationClient();
// You must be an Admin user to use the impersonateUser method // Also a good idea to keep track of the admin token so we can become the admin user again // without having to reauthenticate string adminToken = authClient.AuthenticateUser("Admin", "AdminPassword"); // Set the authentication token as the admin user so we can use the ImpersonateUser method Authentication.OTAuthentication otAuth = new Authentication.OTAuthentication(); otAuth.AuthenticationToken = adminToken; // Now we can impersonate sgrasley string sgrasleyToken = authClient.ImpersonateUser(otAuth, "sgrasley"); // Setup the DocumentManagement service client DocumentManagement.DocumentManagementClient docManClient = new DocumentManagement.DocumentManagementClient(); DocumentManagement.OTAuthentication docManAuth = new DocumentManagement.OTAuthentication(); // Set the authentication token as the one we got from the ImpersonateUser call docManAuth.AuthenticationToken = sgrasleyToken; // Create a folder as sgrasley docManClient.CreateFolder(docManAuth, 2000, "sgrasley folder", null, null);
Hope that helps. Jason
Hi Jason,
I assume that the user I want to impersonate need to have permission to create folders ?
Hi Ghislain,
Hi,
I am trying to use UpdateNodeRightsContext to set the propagation, but I keep getting nullpointer even if I provide all the values.
<urn1:UpdateNodeRightsContext> <urn1:nodeID>26116</urn1:nodeID> <urn1:operation>Update</urn1:operation> - I was not sure what value to provide. What are valid values for this <!--Zero or more repetitions:--> <urn1:rights> <!--Optional:--> <urn1:Permissions> <urn1:AddItemsPermission>true</urn1:AddItemsPermission> <urn1:DeletePermission>true</urn1:DeletePermission> <urn1:DeleteVersionsPermission>true</urn1:DeleteVersionsPermission> <urn1:EditAttributesPermission>true</urn1:EditAttributesPermission> <urn1:EditPermissionsPermission>true</urn1:EditPermissionsPermission> <urn1:ModifyPermission>true</urn1:ModifyPermission> <urn1:ReservePermission>true</urn1:ReservePermission> <urn1:SeeContentsPermission>true</urn1:SeeContentsPermission> <urn1:SeePermission>true</urn1:SeePermission> </urn1:Permissions> <urn1:RightID>26106</urn1:RightID> <urn1:Type>ACL</urn1:Type>
</urn1:rights> <urn1:propagation>true</urn1:propagation>
The response is:-
<faultstring>java.lang.NullPointerException</faultstring> <detail> <ns2:exception class="java.lang.NullPointerException" note="To disable this feature, set com.sun.xml.ws.fault.SOAPFaultBuilder.disableCaptureStackTrace system property to false" xmlns:ns2="http://jax-ws.dev.java.net/"> <ns2:stackTrace> <ns2:frame class="com.sun.xml.messaging.saaj.soap.impl.ElementImpl" file="ElementImpl.java" line="474" method=" addTextNode"/> <ns2:frame class="com.sun.xml.messaging.saaj.soap.ver1_1.Fault1_1Impl" file="Fault1_1Impl.java" line="189" method="setFaultString"/> <ns2:frame class="com.opentext.livelink.service.core.ExceptionUtil" file="ExceptionUtil.java" line="130" method="throwSOAPFaultException"/> <ns2:frame class="com.opentext.livelink.service.docman.DocumentManagement_JAXWS" file="DocumentManagement_JAXWS.java" line="2050" method="updateNodeRightsContext"/>
Can you tell me what am I missing?
Thanks, Kapil
Thanks Igor. I have tried it and It works fine for "Add" operation, but If I try to do "Update" after I do a successful "Add", It throws the exact same Exception (Nullpointer in addTextNode method) as in my previous post.
Is "Update" not a valid operation for this? If yes, what I might be doing wrong? Here is my request.
<urn1:UpdateNodeRightsContext> <urn1:nodeID>434700</urn1:nodeID> <urn1:operation>Update</urn1:operation> <!--Zero or more repetitions:--> <urn1:rights> <!--Optional:--> <urn1:Permissions> <urn1:AddItemsPermission>false</urn1:AddItemsPermission> <urn1:DeletePermission>false</urn1:DeletePermission> <urn1:DeleteVersionsPermission>false</urn1:DeleteVersionsPermission> <urn1:EditAttributesPermission>false</urn1:EditAttributesPermission> <urn1:EditPermissionsPermission>false</urn1:EditPermissionsPermission> <urn1:ModifyPermission>false</urn1:ModifyPermission> <urn1:ReservePermission>false</urn1:ReservePermission> <urn1:SeeContentsPermission>false</urn1:SeeContentsPermission> <urn1:SeePermission>false</urn1:SeePermission> </urn1:Permissions> <urn1:RightID>26106</urn1:RightID> <!--Optional:--> <urn1:Type>ACL</urn1:Type> </urn1:rights> <urn1:propagation>TargetAndChildren</urn1:propagation> </urn1:UpdateNodeRightsContext>
Hi Kapil,
Thanks Jason. I will try it out.