on ‎2010 Apr 15 10:06 AM
Hi,
Is there any to add new user to Collaborator List of Master Agreement List through scripting?
Request clarification before answering.
A new user can be added to the collaborator list as follows....
//Create a collection memeber
collabColln=doc.getCollaborators();
newMember=collabColln.create();
//Set the Necessary values...Here are some sample setters. Details about the setter functions are provided in the RG
newMember.setApprovalRule(new CollaboratorApprovalRuleType(new Integer(0)));
newMember.setCollaboratorEmail("EmailAddress");
roleBean.setDisplayName("role Display name");
newMember.setCollaboratorType(new CollaboratorTypeEnumType(0));
newMember.setDisplayName("Display Name");
newMember.setSource(new CollaboratorSourceEnumType (0));
newMember.setUsage(new CollaboratorUsageEnumType(0));
//Set other mandatory or rquired data....
//add the collection member to the collection
collabColln.add(newMember);
//save the document
doc.getIBeanHomeIfc().save(doc);
Use the appropriate bean instead of doc if the script is not executed from the document for which the collaborator is added.
hope this helps.
Regards
Immanuel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Özlem,
Once you find the group (GroupIBeanIfc):
newCollab = doc.getCollaborators().create();
newCollab.setPrincipal(group.getObjectReference());
//group variable is of type GroupIBeanIfc
doc.getCollaborators().add(newCollab);
This will simply add the group as collaborator with default values for role and type.
Bogdan Toma
Thank you Bogdan! That helped.
I also added Role like this. There was no other info necessary
groupHome = IBeanHomeLocator.lookup(session, GroupIBeanHomeIfc.sHOME_NAME);
group = groupHome.findGroup(member);
groupRef = group.getObjectReference();
collaborators = doc.getCollaborators();
newMember = collaborators.create();
newMember.setPrincipal(groupRef);
roleHome=IBeanHomeLocator.lookup(session,CollaboratorRoleIBeanHomeIfc.sHOME_NAME);
roleBean=roleHome.findUniqueByName("Reviewer");
roleObjRef = roleBean.getObjectReference();
newMember.setCollaboratorRole(roleObjRef);
collaborators.add(newMember);
Thanks and regards,
Özlem
On the RG area of E-Sourcing application, there is detailed documentation and import work books for importing several Master Agreement and Agreement fields into the application and Collaborator is one of the fields. Please refer "View the sample Contracts Import Workbook" to obtain additional help.
I am not too sure, if you will be able to populate the Collaborator field using scripting.
Regards,
Parankush
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.