06-29-2009 06:22 AM
06-29-2009 06:49 AM
06-29-2009 10:41 AM
08-12-2009 09:28 AM
var groupPrefix="GROUP_";
var srcGrpNode=people.getGroup(groupPrefix+srcGrp);
var authority = people.getPerson(user);
if(authority)
{
people.addAuthority(srcGrpNode,authority);
}
08-12-2009 11:11 AM
08-19-2009 08:39 AM
…
public static final String ADMIN_USERNAME = "admin";
public static final String ADMIN_PASSWORD = "admin";
public static final String GROUP_AUTHORITY_TYPE = "GROUP";
public static final String CP01_USERNAME = "cp01";
protected static final String CONTENT_PROVIDER_GROUPNAME = "RBT_CONTENT_PROVIDER";
public static void main(String[] args) throws Exception {
// Start the session
AuthenticationUtils.startSession(ADMIN_USERNAME, ADMIN_PASSWORD);
try {
createGroups();
//createUsers();
addUsersToGroup();
} finally {
// End the session
AuthenticationUtils.endSession();
}
}
private static void createGroups() throws AccessControlFault, RemoteException {
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
NewAuthority cpGrpAuth = new NewAuthority(GROUP_AUTHORITY_TYPE, CONTENT_PROVIDER_GROUPNAME);
NewAuthority[] newAuthorities = {cpGrpAuth};
String result[] = accessControlService.createAuthorities(null, newAuthorities);
}
private static void addUsersToGroup() throws AccessControlFault, RemoteException {
String[] cpUsers = {CP01_USERNAME};
String parentAuthority = GROUP_AUTHORITY_TYPE + "_" + CONTENT_PROVIDER_GROUPNAME;
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
String[] result = accessControlService.addChildAuthorities(parentAuthority,
cpUsers);
}
…
09-22-2009 04:11 AM
public static boolean deleteGroups(String groupname) {
boolean control=true;
try{
String[] delgroup = {groupname};
/* String parentAuthority = GROUP_AUTHORITY_TYPE + "_" + groupname;
AccessControlServiceSoapBindingStub accessControlService = WebServiceFactory.getAccessControlService();
NewAuthority cpGrpAuth = new NewAuthority(GROUP_AUTHORITY_TYPE,groupname);
NewAuthority[] newAuthorities = {cpGrpAuth};
accessControlService.deleteAuthorities(delgroup);*/
}
but a group doesn't delete.09-22-2009 07:33 AM
10-07-2009 01:38 PM
11-11-2009 07:08 AM
private AuthenticationService authenticationService;
private PersonService personService;
ManageTaxonomyHelper helper;
public void execute(WebScriptRequest req, WebScriptResponse res)
throws IOException {
String userName = req.getParameter("userName");
String firstName = req.getParameter("firstName");
String lastName = req.getParameter("lastName");
String password = req.getParameter("password");
String emailId = req.getParameter("emailId");
helper = new ManageTaxonomyHelper();
this.authenticationService = helper.getAuthenticationService();
this.personService = helper.getPersonService();
if (this.authenticationService.authenticationExists(userName) == false) {
this.authenticationService.createAuthentication(userName, password.toCharArray());
PropertyMap propMap = new PropertyMap(3);
propMap.put(ContentModel.PROP_USERNAME, userName);
propMap.put(ContentModel.PROP_FIRSTNAME, firstName);
propMap.put(ContentModel.PROP_LASTNAME, lastName);
propMap.put(ContentModel.PROP_EMAIL, emailId);
this.personService.createPerson(propMap);//Creating a new user here.
}else{
System.out.println("User already exists");
}
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.