01-27-2012 01:47 PM
01-30-2012 02:58 AM
que cuando dentro de esta aplicación se dé de alta un usuario también lo haga en Alfresco
…
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);
}
…
01-30-2012 07:39 AM
01-30-2012 10:42 AM
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.