Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

API to create groups and assign group member

Status
Not open for further replies.

CherylAnderton

Technical User
Nov 21, 2016
30
US
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
}
 
The code is probably something I wrote a while back LAPI has been deprecated you can use soap/CWS/ restapi to do this


LAPI will work only up to livelink versions CS10.5

Are you even able to compile that jar file?

Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Yes. I'm still on 9.7.1.

I need is a simple java/vb.net /C# routine to parse aexcel/csv file.When each of the entries are encountered you just need to call a lapi call createGroup then creategrouptogroup.
 
Ok here are a few hiccups you will find if you choose the lapi path almost no one else will be willing to support you ot will if you give them money they support with rudimentary code in the realm of soap so what you are looking to do is trivially simple

For my part I was a hobby programmer and i had my own page in communities.opentext.com which has been conveniently retired by OT.

I found an old piece of code that created users from a csv file


In a computer that had lapi help I checked so if you spend a few hours you will be able to make the above code do whatever you want or else pay for webreports because that is the most popular dev tool.

Frankly i do not know why you need this api if you have directory services installed you can use that without writing any custom code.

I also know a lot of programmer struggle at lapi because the llvalue concept and error handling is kind of difficult if you do not understand

if you need to see some short examples Greg has a lot of my old code preserved

If I remeber correctly the bulk fetch uses a obsolete jdbc jar file so you may have to work around that

old code used setAssocNotSet() in many places the coreect way is setAssoc()




Well, if I called the wrong number, why did you answer the phone?
James Thurber, New Yorker cartoon caption, June 5, 1937
Certified OT Developer,Livelink ECM Champion 2008,Livelink ECM Champion 2010
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top