CherylAnderton
Technical User
I'm in a jam. I need to create 750+ groups and assign a group member by end of week. I know this can be doe by API, but I'm not that good with developing the API code yet. I grabbed this code from the internet, but I need to create the group and then add the users to the group from a listing of groups and a users to add as a member. Any help would be appreciated.
import com.opentext.api.*; //If you are ajar person the right jars
public class addUserToGroup
{
public static void main( String[] args )
{
try
{
// Declare some local fields
LLSession session;
int status;
session = new LLSession( "localhost", 2099, "", "Admin", "Admin" );
LAPI_USERS users = new LAPI_USERS( session );
public int AddUserToGroup (
String user,
int toType,
String toName)
status = users.AddUserToGroup("asha",users.GROUP,"Controlled" );
if ( status != 0 )
{
String statustext = session.getStatusMessage();
String errtext = session.getErrMsg();
String apitext = session.getApiError();
System.out.println( "\nERROR: " + statustext + "\n" + errtext + "\n" + apitext );
} else {
System.out.println( "\nSUCCESS: New HARD CODED user " + " has been added" );
}
}
catch ( Throwable e )
{
String x = e.getClass().getName();
String s = e.getMessage();
e.printStackTrace();
}
} // end main
}
import com.opentext.api.*; //If you are ajar person the right jars
public class addUserToGroup
{
public static void main( String[] args )
{
try
{
// Declare some local fields
LLSession session;
int status;
session = new LLSession( "localhost", 2099, "", "Admin", "Admin" );
LAPI_USERS users = new LAPI_USERS( session );
public int AddUserToGroup (
String user,
int toType,
String toName)
status = users.AddUserToGroup("asha",users.GROUP,"Controlled" );
if ( status != 0 )
{
String statustext = session.getStatusMessage();
String errtext = session.getErrMsg();
String apitext = session.getApiError();
System.out.println( "\nERROR: " + statustext + "\n" + errtext + "\n" + apitext );
} else {
System.out.println( "\nSUCCESS: New HARD CODED user " + " has been added" );
}
}
catch ( Throwable e )
{
String x = e.getClass().getName();
String s = e.getMessage();
e.printStackTrace();
}
} // end main
}