ibi.broker.api.data.libraryaccess
Class LibraryAccessBook

java.lang.Object
  extended by ibi.broker.api.data.content.ContentObject
      extended by ibi.broker.api.data.libraryaccess.LibraryAccessBook
All Implemented Interfaces:
java.io.Serializable

public class LibraryAccessBook
extends ibi.broker.api.data.content.ContentObject

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");
                }
        }
 }
 
 
 

Version:
5.3.4
See Also:
Serialized Form

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

LibraryAccessBook

public LibraryAccessBook()
Method Detail

getAccessElementList

public AccessElement[] getAccessElementList()
Returns an Array of AccessElements. Each AccessElement includes a member name, a member type and a burst value. This methods returns all AccessElements in an Access List.

Returns:
An Array of AccessElement.

setAccessElementList

public void setAccessElementList(AccessElement[] accessElementList)
Accepts an Array of AccessElements. Each AccessElement contains a member name, a member type, and a burst value.

Parameters:
accessElementList - An Array of AccessElement.

getDescription

public java.lang.String getDescription()
Returns the description of an Access List.

Returns:
An Access List description.

setDescription

public void setDescription(java.lang.String description)
Specifies the description of an Access List.

Parameters:
description - An Access List description.

getName

public java.lang.String getName()
Returns the unique name of an Access List. This value can be specified or automatically generated by ReportCaster.

Returns:
The unique name (id) of an Access List.

setName

public void setName(java.lang.String id)
Specifies the unique name of an Access List. This value can be specified or automatically generated by ReportCaster.

Parameters:
id - The unique name (id) of an Access List.

getOwner

public java.lang.String getOwner()
Returns the ID of the owner of an Access List. The owner is the only ID with viewing privileges other than ReportCaster Administrators.

Returns:
The owner of an Access List.

setOwner

public void setOwner(java.lang.String owner)
Specifies the ID of the owner of an Access List. The owner is the only ID with viewing privileges other than ReportCaster Administrators.

Parameters:
owner - The owner of an Access List.

validate

public void validate(java.lang.String parentName)
              throws CasterException
Verifies that a LibraryAccessBook String is valid. An invalid String may include missing values for name or owner, description names that exceed maxLen, or owner names that exceed maxLen.

Parameters:
parentName - The String to be verified.
Throws:
CasterException - If the String is invalid.


Copyright © 2006 Information Builders, Incorporated.