This topic describes LibraryAccessService functions and provides examples for each.
Function Name: getOwnerList
Purpose: Retrieves a list of owners for the Library Access Books.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Output
Description |
Type |
---|---|
List of owners. |
String |
In the following example, a list of Library Access Book owners are retrieved and written to the RCowners.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim owners() As String Dim SecToken As String Dim newoutput As String Dim tempfile As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
owners = LA.getOwnerList(LAAuthenticate)
tempfile = "d:\RCtemp\RCowners.txt"
FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To owners.Length - 1 newoutput = owners(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 Library Access Book owners are retrieved and written to the RCowners.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String[] owners = LA.getOwnerList(Authobj);
String newOutput = null; File tempfile = new File("d:\\RCtemp\\RCowners.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<owners.length; i++ ) { newOutput = owners[i]; out.println(newOutput); }
out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: addLibraryAccessBook
Purpose: Creates a Library Access Book including Access Elements. A Library Access Book is used to define what users have access to specific Report Library Content.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book information. |
LibraryAccessBook |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a Library Access Book called myLibraryAccessBook is created. An Access Element for user "useraccess1" with a burst value of "1000" is added to the Library Access Book.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessBook As New LAManager.LibraryAccessBook Dim SecToken As String
Dim myAccessList As Array = _ Array.CreateInstance(GetType(LAManager.AccessElement), 1) SecToken = RCLogon.logon("admin", "")
LAAuthenticate.securityToken = SecToken
Dim element1 As New LAManager.AccessElement element1.burstValue = "1000" element1.memberName = "useraccess1" element1.memberType = "U" myAccessList(0) = element1
myAccessBook.name = "myLibraryAccessBook" myAccessBook.description = "My Library Access Book" myAccessBook.owner = "admin" myAccessBook.accessElementList = myAccessList
LA.addLibraryAccessBook(LAAuthenticate, myAccessBook)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a Library Access Book called myLibraryAccessBook is created. An Access Element for user "useraccess1" with a burst value of "1000" is added to the Library Access Book.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
AccessElement[] myAccessList; myAccessList = new AccessElement[1];
AccessElement element1 = new AccessElement(); element1.setBurstValue("1000"); element1.setMemberName("useraccess1"); element1.setMemberType("U"); myAccessList[0] = element1;
LibraryAccessBook myAccessBook = new LibraryAccessBook(); myAccessBook.setName("myLibraryAccessBook"); myAccessBook.setDescription("My Library Access Book"); myAccessBook.setOwner("admin"); myAccessBook.setAccessElementList(myAccessList);
LA.addLibraryAccessBook(Authobj,myAccessBook);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: deleteLibraryAccessBook
Purpose: Deletes a Library Access Book including all Access Elements. A Library Access Book is used to define what users have access to specific Report Library Content.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book name. |
String |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a Library Access Book called "myLibraryAccessBook" is deleted.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim SecToken As String
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
LA.deleteLibraryAccessBook(LAAuthenticate, "myLibraryAccessBook")
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a Library Access Book called "myLibraryAccessBook" is deleted.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
LA.deleteLibraryAccessBook(Authobj,"myLibraryAccessBook");
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getLibraryAccessBookInfoList
Purpose: Retrieves a list of Library Access Books. The Access Elements are not retrieved with this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Output
Description |
Type |
---|---|
List of Library Access Books. |
LibraryAccessBook |
In the following example, a list of Library Access Books is retrieved. The Library Access Book name, description, and owner are written to the RCaccessBooks.txt file. The Access Elements are not retrieved with this function.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessBooks() As LAManager.LibraryAccessBook Dim SecToken As String Dim newoutput As String Dim tempfile As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessBooks = LA.getLibraryAccessBookInfoList(LAAuthenticate)
tempfile = "d:\RCtemp\RCaccessBooks.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To myAccessBooks.Length - 1 newoutput = myAccessBooks(i).name + " " + _ myAccessBooks(i).description + " " + _ myAccessBooks(i).owner
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 Library Access Books is retrieved. The Library Access Book name, description, and owner are written to the RCaccessBooks.txt file. The Access Elements are not retrieved with this function.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
LibraryAccessBook[] myAccessBooks = LA.getLibraryAccessBookInfoList(Authobj);
String newOutput = null; File tempfile = new File("d:\\RCtemp\\RCaccessBooks.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<myAccessBooks.length; i++ ) { newOutput = myAccessBooks[i].getName() + " " + myAccessBooks[i].getDescription() + " " + myAccessBooks[i].getOwner(); out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getLibraryAccessBookInfoListByOwner
Purpose: Retrieves a list of Library Access Books for a specified owner. The Access Elements are not retrieved with this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Owner of Library Access Book. |
String |
Output
Description |
Type |
---|---|
Library Access Book information. |
LibraryAccessBook |
In the following example, a list of Library Access Books is retrieved for an owner of "admin". The Library Access Book name, description, and owner are written to the RCaccessBooksByOwner.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessBooks() As LAManager.LibraryAccessBook Dim SecToken As String Dim newoutput As String Dim tempfile As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessBooks = LA.getLibraryAccessBookInfoListByOwner(LAAuthenticate, "admin")
tempfile = "d:\RCtemp\RCaccessBooksByOwner.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To myAccessBooks.Length - 1 newoutput = myAccessBooks(i).name + " " + _ myAccessBooks(i).description + " " + _ myAccessBooks(i).owner
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 Library Access Books is retrieved for an owner of "admin". The Library Access Book name, description, and owner are written to the RCaccessBooksByOwner.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
LibraryAccessBook[] myAccessBooks = LA.getLibraryAccessBookInfoListByOwner(Authobj,"admin");
String newOutput = null; File tempfile = new File("d:\\RCtemp\\RCaccessBooksByOwner.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<myAccessBooks.length; i++ ) { newOutput = myAccessBooks[i].getName() + " " + myAccessBooks[i].getDescription() + " " + myAccessBooks[i].getOwner(); out.println(newOutput);
}
out.close();
}
catch (Throwable t)
{ System.err.println(t); t.printStackTrace(); System.exit(1);
}
Function Name: getLibraryAccessBook
Purpose: Retrieves the contents of a specific Library Access Book. The Access Elements are also retrieved with this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book name. |
String |
Output
Description |
Type |
---|---|
Library Access Book information. |
LibraryAccessBook |
In the following example, the contents of Library Access Book "myLibraryAccessBook" are retrieved. The Access Element's member name, member type, and burst value are written to the RCmyLibraryAccessBook.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessBook As New LAManager.LibraryAccessBook Dim SecToken As String Dim newoutput As String Dim tempfile As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessBook = LA.getLibraryAccessBook(LAAuthenticate, "myLibraryAccessBook")
tempfile = "d:\RCtemp\RCmyLibraryAccessBook.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To myAccessBook.accessElementList.Length - 1 newoutput = myAccessBook.accessElementList(i).memberName + " " + _ myAccessBook.accessElementList(i).memberType + " " + _ myAccessBook.accessElementList(i).burstValue PrintLine(1, newoutput) Next i
FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the contents of Library Access Book "myLibraryAccessBook" are retrieved. The Access Element's member name, member type, and burst value are written to the RCmyLibraryAccessBook.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
LibraryAccessBook myAccessBook = LA.getLibraryAccessBook(Authobj,"myLibraryAccessBook");
String newOutput = null; File tempfile = new File("d:\\RCtemp\\RCmyLibraryAccessbook.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<myAccessBook.getAccessElementList().length; i++ ) { newOutput = myAccessBook.getAccessElementList()[i].getMemberName() + " " + myAccessBook.getAccessElementList()[i].getMemberType() + " " + myAccessBook.getAccessElementList()[i].getBurstValue(); out.println(newOutput);
}
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: updateLibraryAccessBook
Purpose: Replaces the contents of a specific Library Access Book. The ReportCaster Administrator and the Library Access Book owner can use this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book information. |
LibraryAccessBook |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the description for Library Access Book "myLibraryAccessBook" is updated to "Your Library Access Book". The getLibraryAccessBook is called to retrieve the current information.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessBook As New LAManager.LibraryAccessBook Dim SecToken As String
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessBook = LA.getLibraryAccessBook(LAAuthenticate, "myLibraryAccessBook") myAccessBook.description = "Your Library Access Book"
LA.updateLibraryAccessBook(LAAuthenticate, myAccessBook)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the description for Library Access Book "myLibraryAccessBook" is updated to "Your Library Access Book". The getLibraryAccessBook is called to retrieve the current information.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
LibraryAccessBook myAccessBook = LA.getLibraryAccessBook(Authobj,"myLibraryAccessBook");
myAccessBook.setDescription("Your Library Access Book");
LA.updateLibraryAccessBook(Authobj,myAccessBook);
}
catch (Throwable t) {
System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: addAccessElement
Purpose: Adds an Access Element entry to an existing Library Access Book. The ReportCaster Administrator and the Library Access Book owner can use this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book name. |
String |
Access Element information. |
AccessElement |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a new Access Element is added to Library Access Book "myLibraryAccessBook". An Access Element for user "useraccess2" with a burst value of "2000" is added to the Library Access Book.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessElement As New LAManager.AccessElement Dim SecToken As String
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessElement.memberName = "useraccess2" myAccessElement.memberType = "U" myAccessElement.burstValue = "2000"
LA.addAccessElement(LAAuthenticate, "myLibraryAccessBook", myAccessElement) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a new Access Element is added to Library Access Book "myLibraryAccessBook". An Access Element for user "useraccess2" with a burst value of "2000" is added to the Library Access Book.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
AccessElement myAccessElement = new AccessElement(); myAccessElement.setMemberName("useraccess2"); myAccessElement.setMemberType("U"); myAccessElement.setBurstValue("2000");
LA.addAccessElement(Authobj,"myLibraryAccessBook", myAccessElement);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: deleteAccessElement
Purpose: Deletes an Access Element entry from an existing Library Access Book. The ReportCaster Administrator and the Library Access Book owner can use this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Library Access Book name. |
String |
Access Element information. |
AccessElement |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, an Access Element is deleted from Library Access Book "myLibraryAccessBook". An Access Element for user "useraccess2" with a burst value of "2000" is deleted from the Library Access Book.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim LA As New LAManager.LibraryAccessManagerWSService Dim LAAuthenticate As New LAManager.Authenticate Dim myAccessElement As New LAManager.AccessElement Dim SecToken As String
SecToken = RCLogon.logon("admin", "") LAAuthenticate.securityToken = SecToken
myAccessElement.memberName = "useraccess2" myAccessElement.memberType = "U" myAccessElement.burstValue = "2000"
LA.deleteAccessElement(LAAuthenticate, "myLibraryAccessBook", myAccessElement)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, an Access Element is deleted from Library Access Book "myLibraryAccessBook". An Access Element for user "useraccess2" with a burst value of "2000" is deleted from the Library Access Book.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); LibraryAccessManagerWSService LAService = new LibraryAccessManagerWSServiceLocator(); LibraryAccessManagerWS LA = LAService.getLibraryAccessService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
AccessElement myAccessElement = new AccessElement(); myAccessElement.setMemberName("useraccess2"); myAccessElement.setMemberType("U"); myAccessElement.setBurstValue("2000");
LA.deleteAccessElement(Authobj,"myLibraryAccessBook", myAccessElement);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
WebFOCUS |