|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.content.ContentObject
ibi.broker.api.data.libraryaccess.LibraryAccessBook
public class LibraryAccessBook
The LibraryAccessBook class creates and configures ReportCaster Access Lists. An Access List is used with the Report Library to define the users and groups that are allowed to view the output of specified schedules.
Each Access List is created as a private list that is known only by the user
who created it and ReportCaster Administrators.
The code example below shows an implementation of the LibraryAccessBook
class. It is taken from the coding samples packaged with the product in the
samples directory.
+ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + Copyright (c) 2005 Information Builders, Inc. All Rights Reserved. + + + + Information Builders offers sample API programs as a heuristic device. + + They are not intended, as is, for production use. Licensed users are + + welcome to alter and extend these samples and deploy them in other + + environments, or alternate configurations, as they see fit. + + Information Builders will support the documented functionality of + + its API classes and methods. However, Information Builders is not + + responsible for functionality or behavior of products built with + + its API unless the documented behavior of its discrete classes and + + methods is different than the actual results. + + + + Redistributions of IBI source code and documentation must be within + + the scope of the Information Builders Software License Agreement. + + + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ import ibi.broker.api.cci.CasterConnection; import ibi.broker.api.cci.LibraryAccessManager; import ibi.broker.api.data.libraryaccess.AccessElement; import ibi.broker.api.data.libraryaccess.LibraryAccessBook; public class AL_AccessBook { public AL_AccessBook(String[] arg) throws Exception { String accessBookName = arg[0]; String memberName = arg[1]; String burstValue = arg[2]; // Create manager CasterConnection casterConnection = Util.createCasterConnection(); LibraryAccessManager manager = casterConnection.getLibraryAccessManager(); // Open Existing access book LibraryAccessBook book = manager.getLibraryAccessBook(accessBookName); // Print result System.out.println("\n******* Open " + accessBookName + " **********"); System.out.println("name = " + book.getName()); System.out.println("description = " + book.getDescription()); System.out.println("Owner = " + book.getOwner()); AccessElement[] elementList = book.getAccessElementList(); for(int i = 0; i < elementList.length; i++) System.out.println("memberType = " + elementList[i].getMemberType() + " memberName = " + elementList[i].getMemberName() + " burstValue = " + elementList[i].getBurstValue()); // Delete first access element elementList = book.getAccessElementList(); if(elementList.length > 0) manager.deleteAccessElement(accessBookName, elementList[0]); //Print result book = manager.getLibraryAccessBook(accessBookName); System.out.println("\n******* Open " + accessBookName + " after delete accessElement **********"); System.out.println("name = " + book.getName()); System.out.println("description = " + book.getDescription()); System.out.println("Owner = " + book.getOwner()); elementList = book.getAccessElementList(); for(int i = 0; i < elementList.length; i++) System.out.println("memberType = " + elementList[i].getMemberType() + " memberName = " + elementList[i].getMemberName() + " burstValue = " + elementList[i].getBurstValue()); //Add new access element AccessElement newElement = new AccessElement(); newElement.setMemberName(memberName); newElement.setBurstValue(burstValue); manager.addAccessElement(accessBookName, newElement); //Print result book = manager.getLibraryAccessBook(accessBookName); System.out.println("\n******* Open " + accessBookName + " after add new element **********"); System.out.println("name = " + book.getName()); System.out.println("description = " + book.getDescription()); System.out.println("Owner = " + book.getOwner()); elementList = book.getAccessElementList(); for(int i = 0; i < elementList.length; i++) System.out.println("memberType = " + elementList[i].getMemberType() + " memberName = " + elementList[i].getMemberName() + " burstValue = " + elementList[i].getBurstValue()); } public static void main(String[] arg) { AL_AccessBook sampl = null; if(arg.length < 3) { System.out.println("Usage: java " + AL_AccessBook.class.getName() + " <accessBookName> <memberName> * <burstValue>"); return; } try { System.out.println("\n******* " + AL_AccessBook.class.getName() + " *****************"); sampl = new AL_AccessBook(arg); System.out.println(sampl.getClass().getName() + " OK"); } catch(Exception ce) { ce.printStackTrace(); System.out.println(sampl.getClass().getName() + " FAIL"); } } }
Field Summary |
---|
Fields inherited from class ibi.broker.api.data.content.ContentObject |
---|
id |
Constructor Summary | |
---|---|
LibraryAccessBook()
|
Method Summary | |
---|---|
AccessElement[] |
getAccessElementList()
Returns an Array of AccessElements. |
java.lang.String |
getDescription()
Returns the description of an Access List. |
java.lang.String |
getName()
Returns the unique name of an Access List. |
java.lang.String |
getOwner()
Returns the ID of the owner of an Access List. |
void |
setAccessElementList(AccessElement[] accessElementList)
Accepts an Array of AccessElements. |
void |
setDescription(java.lang.String description)
Specifies the description of an Access List. |
void |
setName(java.lang.String id)
Specifies the unique name of an Access List. |
void |
setOwner(java.lang.String owner)
Specifies the ID of the owner of an Access List. |
void |
validate(java.lang.String parentName)
Verifies that a LibraryAccessBook String is valid. |
Methods inherited from class ibi.broker.api.data.content.ContentObject |
---|
equals, getId, hashCode, setId |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LibraryAccessBook()
Method Detail |
---|
public AccessElement[] getAccessElementList()
public void setAccessElementList(AccessElement[] accessElementList)
accessElementList
- An Array of AccessElement
.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- An Access List description.public java.lang.String getName()
public void setName(java.lang.String id)
id
- The unique name (id) of an Access List.public java.lang.String getOwner()
public void setOwner(java.lang.String owner)
owner
- The owner of an Access List.public void validate(java.lang.String parentName) throws CasterException
maxLen
, or owner
names that exceed maxLen
.
parentName
- The String to be verified.
CasterException
- If the String is invalid.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |