This topic describes User Service functions and provides examples for each.
Function Name: addGroup
Purpose: Adds group information to the underlying repository. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group information. |
Group |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a group called "RCgroup" is added to ReportCaster.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim groupInfo As New UManager.Group
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupInfo.name = "RCgroup" groupInfo.description = "RCgroup Description"
U.addGroup(UAuthenticate, groupInfo)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a group called "RCgroup" is added to ReportCaster.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);Group groupInfo = new Group();
groupInfo.setName("RCgroup");
groupInfo.setDescription("RCgroup Description");U.addGroup(Authobj,groupInfo);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: addUser
Purpose: Adds the properties of a specific ReportCaster user, as contained in the passed user information, to the underlying database or repository. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
User information. |
User |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a user called "RCuserid" is added to ReportCaster.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userInfo As New UManager.User
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenuserInfo.active = True userInfo.address = "myEmail@ibi.com" userInfo.description = "RCuserid Description" userInfo.libraryCapability = True userInfo.name = "RCuserid" userInfo.password = "RCpass" userInfo.role = "USER" userInfo.scheduleCapability = True
U.addUser(UAuthenticate, userInfo)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a user called "RCuserid" is added to ReportCaster.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);User userInfo = new User();
userInfo.setActive(true);
userInfo.setAddress("myEmail@ibi.com");
userInfo.setDescription("RCuserid Description");
userInfo.setLibraryCapability(true);
userInfo.setName("RCuserid");
userInfo.setPassword("RCpass");
userInfo.setRole("USER");
userInfo.setScheduleCapability(true);U.addUser(Authobj,userInfo);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: addUserInToGroup
Purpose: Adds a userName to an existing group in the underlying repository, as identified by its group name. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group name. |
String |
|
User name. |
String |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a user ID called "RCuserid" becomes part of a group called "RCgroup".
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenU.addUserInToGroup(UAuthenticate, "RCgroup", "RCuserid") Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a user ID called "RCuserid" becomes part of a group called "RCgroup".
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);U.addUserInToGroup(Authobj,"RCgroup","RCuserid"); }
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: deleteGroup
Purpose: Deletes group information from the underlying repository. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group name. |
String |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a group called "RCgroup" is deleted from ReportCaster.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenU.deleteGroup(UAuthenticate, "RCgroup") Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a group called "RCgroup" is deleted from ReportCaster.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);U.deleteGroup(Authobj,"RCgroup");
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: deleteUser
Purpose: Deletes the specified user, identified by the passed user name, from the underlying database or repository using one of the three provided deletion functions. The deletion types are: DELETE USER ONLY, DELETE USER, DELETE SCHEDULE, or DELETE USER SET SCHEDULE INACTIVE. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
User name. |
String |
|
Deletion type. Valid values are:
|
Integer |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a user called "RCuserid" is deleted from ReportCaster.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenU.deleteUser(UAuthenticate, "RCuserid", 0) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a user called "RCuserid" is deleted from ReportCaster.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);U.deleteUser(Authobj,"RCuserid",0);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: deleteUserFromGroup
Purpose: Deletes a user as identified by its ReportCaster userName from the specified groupName. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group name. |
String |
|
User name. |
String |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a user ID "RCuserid" is removed from a group called "RCgroup".
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenU.deleteUserFromGroup(UAuthenticate, "RCgroup", "RCuserid") Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a user ID "RCuserid" is removed from a group called "RCgroup".
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);U.deleteUserFromGroup(Authobj,"RCgroup","RCuserid"); }
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getGroup
Purpose: Retrieves group information as identified by its groupName from the underlying database or repository. The specified groupName uniquely identifies a group in the database. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Unique name string identifying the group. |
String |
Output
|
Description |
Type |
|---|---|
|
Group information encapsulating the specified group name. |
Group |
In the following example, the group information for a specific group is retrieved. The group name and group description are written to the RCgroup.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim groupInfo As New UManager.Group Dim tempfile As String Dim newOutput As String
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupInfo = U.getGroup(UAuthenticate, "RCgroup")
tempfile = "d:\RCtemp\RCgroup.txt"
FileOpen(1, tempfile, OpenMode.Output)
newOutput = groupInfo.name + " " + _
groupInfo.descriptionPrintLine(1, newOutput)
FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the group information for a specific group is retrieved. The group name and group description are written to the RCgroup.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);Group groupInfo = U.getGroup(Authobj,"RCgroup");
File tempfile = new File("d:\\RCtemp\\RCgroup.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);String newOutput = groupInfo.getName() + " " +
groupInfo.getDescription();out.println(newOutput); out.close();
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getGroupList
Purpose: Retrieves list of all groups to which the current user belongs. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
Output
|
Description |
Type |
|---|---|
|
List of groups. |
Group |
In the following example, a list of groups is retrieved. The group name and group description are written to the RCgroups.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim groupInfo() As UManager.Group Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupInfo = U.getGroupList(UAuthenticate)
tempfile = "d:\RCtemp\RCgroups.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To groupInfo.Length - 1
newOutput = groupInfo(i).name + " " + _
groupInfo(i).description
PrintLine(1, newOutput)
Next iFileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of groups is retrieved. The group name and group description are written to the RCgroups.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);Group groupInfo[] = U.getGroupList(Authobj);
File tempfile = new File("d:\\RCtemp\\RCgroups.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);for ( int i=0; i<groupInfo.length; i++ )
{
String newOutput = groupInfo[i].getName() + " " +
groupInfo[i].getDescription();
out.println(newOutput);
}
out.close();}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getGroupNameListByUser
Purpose: Retrieves a list of all group names that a specific ReportCaster user belongs to or is a member of. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
User name. |
String |
Output
|
Description |
Type |
|---|---|
|
List of group names. |
String |
In the following example, a list of groups is retrieved in which user ID "RCuserid" is a member. The group is written to the RCgroupsByUser.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim groupNames() As String Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupNames = U.getGroupNameListByUser(UAuthenticate, "RCuserid")
tempfile = "d:\RCtemp\RCgroupsByUser.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To groupNames.Length - 1
newOutput = groupNames(i)
PrintLine(1, newOutput)
Next i
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of groups is retrieved in which user ID "RCuserid" is a member. The group is written to the RCgroupsByUser.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);String groupNames[] = U.getGroupNameListByUser(Authobj,"RCuserid");
File tempfile = new File("d:\\RCtemp\\RCgroupsByUser.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);for ( int i=0; i<groupNames.length; i++ )
{
String newOutput = groupNames[i];
out.println(newOutput);
}
out.close();}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getUserByName
Purpose: Retrieves user information based upon the specified ReportCaster user name.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
ReportCaster user name. |
String |
Output
|
Description |
Type |
|---|---|
|
User information. |
User |
In the following example, the user information is retrieved for a specific user ID. The user name, user description, e-mail address, role, library access, and scheduling access are written to the RCuser.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userInfo As New UManager.User Dim tempfile As String Dim newOutput As String
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenuserInfo = U.getUserByName(UAuthenticate, "RCuserid")
tempfile = "d:\RCtemp\RCuser.txt" FileOpen(1, tempfile, OpenMode.Output)
newOutput = userInfo.name + " " + _
userInfo.description + " " + _
userInfo.address + " " + _
userInfo.role + " " + _
Str(userInfo.libraryCapability) + " " + _
Str(userInfo.scheduleCapability)PrintLine(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the user information is retrieved for a specific user ID. The user name, user description, e-mail address, role, library access, and scheduling access are written to the RCuser.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);User userInfo = U.getUserByName(Authobj,"RCuserid");
File tempfile = new File("d:\\RCtemp\\RCuser.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);String newOutput = userInfo.getName() + " " +
userInfo.getDescription() + " " +
userInfo.getAddress() + " " +
userInfo.getRole() + " " +
userInfo.isLibraryCapability() + " " +
userInfo.isScheduleCapability(); out.println(newOutput); out.close();
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getUserList
Purpose: Retrieves a list of user information. This function is accessible only by an administrator, and lists all the users in the system.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
Output
|
Description |
Type |
|---|---|
|
List of user information. |
User |
In the following example, a list of user information is retrieved. The user name, user description, e-mail address, role, library access, and scheduling access are written to RCusers.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userInfo() As UManager.User Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenuserInfo = U.getUserList(UAuthenticate)
tempfile = "d:\RCtemp\RCusers.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To userInfo.Length - 1
newOutput = userInfo(i).name + " " + _
userInfo(i).description + " " + _
userInfo(i).address + " " + _
userInfo(i).role + " " + _
Str(userInfo(i).libraryCapability) + " " + _
Str(userInfo(i).scheduleCapability)PrintLine(1, newOutput) Next i
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of user information is retrieved. The user name, user description, e-mail address, role, library access, and scheduling access are written to RCusers.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);User userInfo[] = U.getUserList(Authobj);
File tempfile = new File("d:\\RCtemp\\RCusers.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);for ( int i=0; i<userInfo.length; i++ )
{
String newOutput = userInfo[i].getName() + " " +
userInfo[i].getDescription() + " " +
userInfo[i].getAddress() + " " +
userInfo[i].getRole() + " " +
userInfo[i].isLibraryCapability() + " " +
userInfo[i].isScheduleCapability(); out.println(newOutput); }
out.close();
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: getUserNameListByGroup
Purpose: Obtains a list of user names that belong to a specific group as identified by its groupName. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group name. |
String |
Output
|
Description |
Type |
|---|---|
|
List of user names. NULL if groupName doesn't exist. |
String |
In the following example, a list of users is retrieved for group "RCgroup". The user list is written to the RCnames.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userNames() As String Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenuserNames = U.getUserNameListByGroup(UAuthenticate, "RCgroup")
tempfile = "d:\RCtemp\RCnames.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To userNames.Length - 1
newOutput = userNames(i)
PrintLine(1, newOutput)Next i
FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of users is retrieved for group "RCgroup". The user list is written to the RCnames.txt file.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);String userNames[] = U.getUserNameListByGroup(Authobj,"RCgroup");
File tempfile = new File("d:\\RCtemp\\RCnames.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);for ( int i=0; i<userNames.length; i++ )
{
String newOutput = userNames[i];
out.println(newOutput);
}out.close(); }
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: updateGroup
Purpose: After modifying properties contained in the group information (except for the group name), updates the corresponding group data in the underlying repository. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group information. |
Group |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the group description is updated for group "RCgroup".
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim groupInfo As New UManager.Group
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupInfo.name = "RCgroup" groupInfo.description = "RCgroup New Description"
U.updateGroup(UAuthenticate, groupInfo) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the group description is updated for group "RCgroup".
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);Group groupInfo = new Group();
groupInfo.setName("RCgroup");
groupInfo.setDescription("RCgroup New Description");U.updateGroup(Authobj,groupInfo);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: updateGroupWithUser
Purpose: Updates a given group with a list of user names. This new list of user names replaces the existing list of user names. The group description can also be updated. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
Group information. |
Group |
|
List of users. |
String |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the group description and the user ID members for group "RCgroup" are replaced.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim Users(1) As String Dim groupInfo As New UManager.Group
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokengroupInfo.name = "RCgroup" groupInfo.description = "RCgroup Description"
Users(0) = "RCuser1" Users(1) = "RCuser2"
U.updateGroupWithUser(UAuthenticate, groupInfo, Users) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the group description and the user ID members for group "RCgroup" are replaced.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);String[] users; users = new String[2];
users[0] = "RCuser1"; users[1] = "RCuser2";
Group groupInfo = new Group();
groupInfo.setName("RCgroup");
groupInfo.setDescription("RCgroup Description");U.updateGroupWithUser(Authobj,groupInfo,users);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: updateUser
Purpose: Updates a user's property information in the underlying repository. All properties can be modified except Name which uniquely identifies the user in the database. This function is only accessible by the administrator.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
User information. |
User |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the user information for user ID "RCuserid" is replaced.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userInfo As New UManager.User
SecToken = RCLogon.logon("admin", "")UAuthenticate.securityToken = SecToken
userInfo.name = "RCuserid" userInfo.password = "RCnewPass" userInfo.description = "RCuserid New Description" userInfo.address = "newEmail@ibi.com" userInfo.libraryCapability = False userInfo.role = "ADMIN" userInfo.scheduleCapability = True userInfo.active = True
U.updateUser(UAuthenticate, userInfo) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the user information for user ID "RCuserid" is replaced.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);User userInfo = new User();
userInfo.setName("RCuserid");
userInfo.setPassword("RCnewPass");
userInfo.setDescription("RCuserid New Description");
userInfo.setAddress("newEmail@ibi.com");
userInfo.setLibraryCapability(false);
userInfo.setRole("ADMIN");
userInfo.setScheduleCapability(true);
userInfo.setActive(true);U.updateUser(Authobj,userInfo);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
Function Name: updateUserInfoProperties
Purpose: Allows an authenticated user to change limited properties belonging to him in the underlying repository. The properties contained in the user information that can be changed by this function are: Description, Address, and Password. This function is accessible by the administrator and the calling user.
Input
|
Description |
Type |
|---|---|
|
Authentication information. |
Authenticate |
|
User information. |
User |
Output
|
Description |
|---|
|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the password, description, and e-mail address for user ID "RCuserid" are updated.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim U As New UManager.UserManagerWSService Dim SecToken As String Dim UAuthenticate As New UManager.Authenticate Dim userInfo As New UManager.User
SecToken = RCLogon.logon("admin", "")
UAuthenticate.securityToken = SecTokenuserInfo.name = "RCuserid" userInfo.password = "RCnewPass" userInfo.description = "RCuserid New Description" userInfo.address = "newEmail@ibi.com"
U.updateUserInfoProperties(UAuthenticate, userInfo) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the password, description, and e-mail address for user ID "RCuserid" are updated.
try
{
LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
LogonManagerWS RCLogon = LogonService.getLogonService();UserManagerWSService UService = new UserManagerWSServiceLocator(); UserManagerWS U = UService.getUserService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);User userInfo = new User();
userInfo.setName("RCuserid");userInfo.setPassword("RCnewPass");
userInfo.setDescription("RCuserid New Description");
userInfo.setAddress("newEmail@ibi.com");U.updateUserInfoProperties(Authobj,userInfo);
}
catch (Throwable t)
{
System.err.println(t);
t.printStackTrace();
System.exit(1);
}
| WebFOCUS |