Address Book Service Functions

In this section:

 

This topic describes Address Book Service functions and provides examples for each.


Top of page

x
Creating an Address Book in the Repository

Function Name: addAddressBook

Purpose: Creates an Address Book in the underlying repository. Parameter AddrBook may or may not contain a DestinationElement list. All distribution lists represented by the DestinationElement list will also be inserted into the repository. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authenticate information.

Authenticate

Address book information associated with the repository data that is to be added.

AddrBook

Output

Description

There is no output for this function. If it fails, it will throw an exception.



Example: Creating an Address Book in Visual Basic .NET

In the following example, an Address Book called "MYADDRESSBOOK" is created with two destinations. Reports with a burst value of "1000" are sent to email1@ibi.com and reports with a burst value of "2000" are sent to email2@ibi.com.

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim ABDestination As New ABManager.DestinationElement
   Dim ABObject As New ABManager.AddrBook
   Dim Destination1 As New ABManager.DestinationElement
   Dim Destination2 As New ABManager.DestinationElement
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   Dim DestArray As Array = _
       Array.CreateInstance(GetType(ABManager.DestinationElement), 2)
   Destination1.burstValue = "1000"
   Destination1.location = "email1@ibi.com"
   DestArray(0) = Destination1
   Destination2.burstValue = "2000"
   Destination2.location = "email2@ibi.com"
   DestArray(1) = Destination2
   ABObject.access = "PUBLIC"
   ABObject.bookName = "MYADDRESSBOOK"
   ABObject.destinationList = DestArray
   ABObject.method = "EMAIL"
   ABObject.owner = "admin"
   ABook.addAddressBook(ABAuthenticate, ABObject)
   Catch x As Exception
       MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Creating an Address Book in Java

In the following example, an Address Book called "MYADDRESSBOOK" is created with two destinations. Reports with a burst value of "1000" are sent to email1@ibi.com and reports with a burst value of "2000" are sent to email2@ibi.com.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 DestinationElement[] destination;
 destination = new DestinationElement[2];
 DestinationElement dest1 = new DestinationElement();
 dest1.setLocation("email1@ibi.com");
 dest1.setBurstValue("1000");
 destination[0] = dest1;
 DestinationElement dest2 = new DestinationElement();
 dest2.setLocation("email2@ibi.com");
 dest2.setBurstValue("2000");
 destination[1] = dest2;
 AddrBook ABobj = new AddrBook();
 ABobj.setAccess("PUBLIC");
 ABobj.setBookName("MYADDRESSBOOK");
 ABobj.setDestinationList(destination);
 ABobj.setMethod("EMAIL");
 ABobj.setOwner("admin");
 AB.addAddressBook(Authobj,ABobj);
}
catch (Throwable t)
{
 System.err.println(t);
 t.printStackTrace();
 System.exit(1);
}

Top of page

x
Adding a DestinationElement to the Address Book

Function Name: addDestinationElement

Purpose: Adds a DestinationElement to the Address Book specified by bookName. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

The name of the Address Book stored in the database.

String

DestinationElement information containing the line in the Address Book that is to be added.

DestinationElement

Output

Description

There is no output for this function. If it fails, it will throw an exception.



Example: Adding a Destination Element for a Burst Value in Visual Basic .NET

In the following example, Destination email2@ibi.com for a Burst Value of "2000" is added to an Address Book called "MYADDRESSBOOK".

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim Destination As New ABManager.DestinationElement
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   Destination.burstValue = "2000"
   Destination.location = "email2@ibi.com"
   ABook.addDestinationElement(ABAuthenticate, "MYADDRESSBOOK", _
                               Destination)
   Catch x As Exception
       MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Adding a Destination Element for a Burst Value in Java

In the following example, Destination email2@ibi.com for a Burst Value of "2000" is added to an Address Book called "MYADDRESSBOOK".

try
  {
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
  String sectoken = RCLogon.logon("admin","");
  Authenticate Authobj = new Authenticate();
  Authobj.setSecurityToken(sectoken);
  DestinationElement dest = new DestinationElement();
  dest.setLocation("email2@ibi.com");
  dest.setBurstValue("2000");
  AB.addDestinationElement(Authobj,"MYADDRESSBOOK",dest);
  }
  catch (Throwable t)
  {
        System.err.println(t);
        t.printStackTrace();
        System.exit(1);
}

Top of page

x
Deleting the Address Book Specified by BookName

Function Name: deleteAddressBook

Purpose: Deletes the Address Book specific by BookName. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

The name of the Address Book stored in the database.

String

Output

Description

There is no output for this function. If it fails, it will throw an exception



Example: Deleting an Address Book From the ReportCaster Repository in Visual Basic .NET

In the following example, an Address Book called "MYADDRESSBOOK" is deleted from the ReportCaster repository.

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  ABook.deleteAddressBook(ABAuthenticate, "MYADDRESSBOOK")
  Catch x As Exception
      MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Deleting an Address Book From the ReportCaster Repository in Java

In the following example, an Address Book called "MYADDRESSBOOK" is deleted from the ReportCaster repository.

try
  {
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
  String sectoken = RCLogon.logon("admin","");
  Authenticate Authobj = new Authenticate();
  Authobj.setSecurityToken(sectoken);
  AB.deleteAddressBook(Authobj,"MYADDRESSBOOK");
  }
  catch (Throwable t)
  {
        System.err.println(t);
        t.printStackTrace();
        System.exit(1);
  }

Top of page

x
Deleting a Destination Element From the Address Book

Function Name: deleteDestinationElement

Purpose: Deletes a DestinationElement from the Address Book specified by bookName. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

The name of the Address Book stored in the database.

String

DestinationElement information containing the line in the Address Book that is to be deleted.

DestinationElement

Output

Description

There is no output for this function. If it fails, it will throw an exception.



Example: Deleting a Destination Element With a Burst Value in Visual Basic .NET

In the following example, Destination email2@ibi.com with a Burst Value of "2000" is deleted from an Address Book called "MYADDRESSBOOK".

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim Destination As New ABManager.DestinationElement
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  Destination.burstValue = "2000"
  Destination.location = "email2@ibi.com"
  ABook.deleteDestinationElement(ABAuthenticate, "MYADDRESSBOOK", _
                                 Destination)
  Catch x As Exception
       MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Deleting a Destination Element With a Burst Value in Java

In the following example, Destination email2@ibi.com with a Burst Value of "2000" is deleted from an Address Book called "MYADDRESSBOOK".

try
  {
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
  String sectoken = RCLogon.logon("admin","");
  Authenticate Authobj = new Authenticate();
  Authobj.setSecurityToken(sectoken);
  DestinationElement dest = new DestinationElement();
  dest.setLocation("email2@ibi.com");
  dest.setBurstValue("2000");
  AB.deleteDestinationElement(Authobj,"MYADDRESSBOOK",dest);
  }
  catch (Throwable t)
  {
        System.err.println(t);
        t.printStackTrace();
        System.exit(1);
  }

Top of page

x
Returning Address Book Information Specified by BookName

Function Name: getAddressBook

Purpose: Returns Address Book information specified by bookName. The Address Book information returned by this function contain destination list information in the form of a DestinationElement list. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

The name of the Address Book stored in the database.

String

Output

Description

Type

Address book information.

AddrBook



Example: Returning All Address Book Information in Visual Basic .NET

In the following example, all the Address Book information for an Address Book called "MYADDRESSBOOK" is retrieved and written to the RCAB.txt file.

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim retAB As New ABManager.AddrBook
  Dim newOutput As String
  Dim tempfile As String
  Dim i As Integer
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  retAB = ABook.getAddressBook(ABAuthenticate, "MYADDRESSBOOK")
  tempfile = "d:\RCtemp\RCAB.txt"
  FileOpen(1, tempfile, OpenMode.Output)
  newOutput = retAB.bookName + " " + retAB.access + " " + _
              retAB.method + " " + retAB.owner
  PrintLine(1, newOutput)
  For i = 0 To retAB.destinationList.Length - 1
      newOutput = retAB.destinationList(i).burstValue + " " + _
                  retAB.destinationList(i).location
      PrintLine(1, newOutput)
  Next i
  FileClose(1)
  Catch x As Exception
      MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Returning All Address Book Information in Java

In the following example, all the Address Book information for an Address Book called "MYADDRESSBOOK" is retrieved and written to the RCAB.txt file.

try
  {
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
  String sectoken = RCLogon.logon("admin","");
  Authenticate Authobj = new Authenticate();
  Authobj.setSecurityToken(sectoken);
  AddrBook retAB = AB.getAddressBook(Authobj,"MYADDRESSBOOK");
  File tempfile = new File("d:\\RCtemp\\RCAB.txt");
  FileOutputStream fos = new FileOutputStream(tempfile);
  PrintWriter out=new PrintWriter(fos);
  String newOutput = retAB.getBookName() + " " +
                     retAB.getAccess() + " " +
                     retAB.getMethod() + " " +
                     retAB.getOwner();
  out.println(newOutput);
  for ( int i=0; i<retAB.getDestinationList().length; i++ )
  {
        newOutput = retAB.getDestinationList()[i].getBurstValue()
                      + " " +retAB.getDestinationList()[i].getLocation();
        out.println(newOutput);
}
out.close();
}
		
catch (Throwable t)
{
       System.err.println(t);
       t.printStackTrace();
       System.exit(1);
}

Top of page

x
Returning a List of Private Address Books for a Caller

Function Name: getAddressBookPrivateListByCaller

Purpose: Returns a list of private Address Books for a given distribution function and the caller who has authenticated. The distribution function is one of three values: EMAIL, PRINT, or FTP. If there are no private Address Books for the specified distribution function, an empty list will be returned. If the specified distribution function is NULL, all Address Books will be returned. For performance reasons, the Address Book information returned by this function does not contain the destination list. This function is available to the administrator and Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

Function of distribution. Valid values are:

  • EMAIL
  • PRINT
  • FTP

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving a List of Private Address Books by Caller in Visual Basic .NET

In the following example, a list of private Address Books for an e-mail method of distribution and for user "admin" is retrieved and written to the RCABPrivateListByCaller.txt file.

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim retABlist() As ABManager.AddrBook
  Dim newOutput As String
  Dim tempfile As String
  Dim i As Integer
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  retABlist = ABook.getAddressBookPrivateListByCaller(ABAuthenticate, _
              "EMAIL")
  tempfile = "d:\RCtemp\RCABPrivateListByCaller.txt"
  FileOpen(1, tempfile, OpenMode.Output)
  For i = 0 To retABlist.Length - 1
        newOutput = retABlist(i).bookName
        PrintLine(1, newOutput)
  Next i
  FileClose(1)
  Catch x As Exception
       MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving a List of Private Address Books by Caller in Java

In the following example, a list of private Address Books for an e-mail method of distribution and for user "admin" is retrieved and written to the RCABPrivateListByCaller.txt file.

try
{
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 AddrBook[] retABlist = 
AB.getAddressBookPrivateListByCaller(Authobj,"EMAIL");
 String newOutput = null;
 File tempfile = new File("d:\\RCtemp\\RCABPrivateListByCaller.txt");
 FileOutputStream fos = new FileOutputStream(tempfile);
 PrintWriter out=new PrintWriter(fos);
 for ( int i=0; i<retABlist.length; i++ )
 {
       newOutput = retABlist[i].getBookName();
       out.println(newOutput);
 }
 out.close();
 }
 catch (Throwable t)
 {
  System.err.println(t);
  t.printStackTrace();
  System.exit(1);
}

Top of page

x
Returning a List of Private Address Books for an Owner

Function Name: getAddressBookPrivateListByOwner

Purpose: Returns a list of private Address Books for a given distribution function, and the specific owner of the Address Books. The distribution function is one of three values: EMAIL, PRINT, or FTP. If there are no private Address Books for the specified distribution function, an empty list will be returned. If the specified distribution function is NULL, all Address Books will be returned. If the caller is an administrator, any owner may be specified. If the caller is an end user, the user may specify his own user ID. Otherwise, an exception is thrown. For performance reasons, the Address Book information returned by this function does not contain the destination list. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

Address Book owner.

String

Function of distribution. Valid values are:

  • EMAIL
  • PRINT
  • FTP

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving a List of Private Address Books by Owner in Visual Basic .NET

In the following example, a list of private Address Books for an e-mail method of distribution and owner of "admin" is retrieved and written to the RCABPrivateListByOwner.txt file.

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim retABlist() As ABManager.AddrBook
   Dim newOutput As String
   Dim tempfile As String
   Dim i As Integer
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   retABlist = ABook.getAddressBookPrivateListByOwner(ABAuthenticate, _
               "admin", "EMAIL")
   tempfile = "d:\RCtemp\RCABPrivateListByOwner.txt"
   FileOpen(1, tempfile, OpenMode.Output)
   For i = 0 To retABlist.Length - 1
         newOutput = retABlist(i).bookName
         PrintLine(1, newOutput)
   Next i
   FileClose(1)
   Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving a List of Private Address Books by Owner in Java

In the following example, a list of private Address Books for an e-mail method of distribution and owner of "admin" is retrieved and written to the RCABPrivateListByOwner.txt file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 AddrBook[] retABlist = AB.getAddressBookPrivateListByOwner(Authobj, 
                                       "admin","EMAIL");
 String newOutput = null;
 File tempfile = new File("d:\\RCtemp\\RCABPrivateListByOwner.txt");
 FileOutputStream fos = new FileOutputStream(tempfile); 
 PrintWriter out=new PrintWriter(fos);
 for ( int i=0; i<retABlist.length; i++ )
 {
         newOutput = retABlist[i].getBookName();
         out.println(newOutput);
 }
 out.close();
}
catch (Throwable t)
{
 System.err.println(t);
 t.printStackTrace();
 System.exit(1);
}

Top of page

x
Returning Address Book Information Specified by bookName

Function Name: getAddressBookProperty

Purpose: Returns a Address Book information specified by bookName. For performance reasons, the Address Book information returned by this function does not contain the destination list. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authentication information.

Authenticate

The name of the Address Book.

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving Address Book Properties in Visual Basic .NET

In the following example, the properties (Owner, Distribution Method, Access) for an Address Book called "MYADDRESSBOOK" are retrieved and written to the RCABProperty.txt file.

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim retAB As New ABManager.AddrBook
  Dim newOutput As String
  Dim tempfile As String
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  retAB = ABook.getAddressBookProperty(ABAuthenticate, "MYADDRESSBOOK")
  tempfile = "d:\RCtemp\RCABProperty.txt"
  FileOpen(1, tempfile, OpenMode.Output)
  newOutput = retAB.bookName + " " + retAB.access + " " + _
              retAB.method + " " + retAB.owner
  PrintLine(1, newOutput)
  FileClose(1)
  Catch x As Exception
       MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Retrieving Address Book Properties in Java

In the following example, the properties (Owner, Distribution Method, Access) for an Address Book called "MYADDRESSBOOK" are retrieved and written to the RCABProperty.txt file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 AddrBook retAB = AB.getAddressBookProperty(Authobj,"MYADDRESSBOOK");
 String newOutput = null;
 File tempfile = new File("d:\\RCtemp\\RCABProperty.txt");
 FileOutputStream fos = new FileOutputStream(tempfile);
 PrintWriter out=new PrintWriter(fos);
 newOutput = retAB.getBookName() + " " +
            		 retAB.getAccess() + " " +
            		 retAB.getMethod() + " " +
            		 retAB.getOwner();
 out.println(newOutput);
 out.close();
}
 catch (Throwable t)
 {
        System.err.println(t);
        t.printStackTrace();
        System.exit(1);
    }

Top of page

x
Returning a List of Public Address Books for a Distribution Function

Function Name: getAddressBookPublicList

Purpose: Returns a list of public address books for a given distribution function. The distribution function is one of three values: EMAIL, PRINT, or FTP. For performance reasons, the Address Book information returned by this function do not contain the destination list. If there are no public Address Books for the specified distribution function, an empty list will be returned. If the specified distribution function is NULL, all Address Books will be returned.

Input

Description

Type

Authentication information.

Authenticate

Function of distribution. Valid values are:

  • EMAIL
  • PRINT
  • FTP

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving a List of Public Address Books for E-mail in Visual Basic .NET

In the following example, a list of public Address Books for an e-mail method of distribution is retrieved and is written to the RCABPublicList.txt file.

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim retABlist() As ABManager.AddrBook
   Dim newOutput As String
   Dim tempfile As String
   Dim i As Integer
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   retABlist = ABook.getAddressBookPublicList(ABAuthenticate, "EMAIL")
   tempfile = "d:\RCtemp\RCABPublicList.txt"
   FileOpen(1, tempfile, OpenMode.Output)
   For i = 0 To retABlist.Length - 1
         newOutput = retABlist(i).bookName
         PrintLine(1, newOutput)
   Next i
   FileClose(1)
   Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving a List of Public Address Books for E-mail in Java

In the following example, a list of public Address Books for an e-mail method of distribution is retrieved and is written to the RCABPublicList.txt file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 AddrBook[] retABlist = AB.getAddressBookPublicList(Authobj,"EMAIL");
 String newOutput = null;
 File tempfile = new File("d:\\RCtemp\\RCABPublicList.txt");
 FileOutputStream fos = new FileOutputStream(tempfile);
 PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<retABlist.length; i++ )
{
      newOutput = retABlist[i].getBookName();
      out.println(newOutput);
 }
 out.close();
}
catch (Throwable t)
{
 System.err.println(t);
 t.printStackTrace();
 System.exit(1);
}

Top of page

x
Returning a List of Public Address Books for an Authenticated Caller

Function Name: getAddressBookPublicListByCaller

Purpose: Returns a list of public Address Books for a given distribution function and the caller who has authenticated. The distribution function is one of three values: EMAIL, PRINT, or FTP. If there are no public Address Books for the specified distribution function, an empty list will be returned. If the specified distribution function is NULL, all Address Books will be returned. For performance reasons, the Address Book information returned by this function doesn't contain the destination list.

Input

Description

Type

Authentication information.

Authenticate

Function of distribution. Valid values are:

  • EMAIL
  • PRINT
  • FTP

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving a List of Public Address Books by Caller in Visual Basic .NET

In the following example, a list of public Address Books for an e-mail method of distribution is retrieved for user "admin" and is written to the RCABPublicListByCaller.txt. file.

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim retABlist() As ABManager.AddrBook
   Dim newOutput As String
   Dim tempfile As String
   Dim i As Integer
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   retABlist = ABook.getAddressBookPublicListByCaller(ABAuthenticate, _
               "EMAIL")
   tempfile = "d:\RCtemp\RCABPublicListByCaller.txt"
   FileOpen(1, tempfile, OpenMode.Output)
   For i = 0 To retABlist.Length - 1
         newOutput = retABlist(i).bookName
         PrintLine(1, newOutput)
   Next i
   FileClose(1)
   Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving a List of Public Address Books by Caller in Java

In the following example, a list of public Address Books for an e-mail method of distribution is retrieved for user "admin" and is written to the RCABPublicListByCaller.txt. file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
String sectoken = RCLogon.logon("admin","");
Authenticate Authobj = new Authenticate();
Authobj.setSecurityToken(sectoken);
AddrBook[] retABlist = 
AB.getAddressBookPublicListByCaller(Authobj,"EMAIL");
String newOutput = null;
File tempfile = new File("d:\\RCtemp\\RCABPublicListByCaller.txt");
FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<retABlist.length; i++ )
{
      newOutput = retABlist[i].getBookName();
      out.println(newOutput);
}
out.close();
}
catch (Throwable t)
{
  System.err.println(t);
  t.printStackTrace();
  System.exit(1);
}

Top of page

x
Returning a List of Public Address Books for a Specific Owner

Function Name: getAddressBookPublicListByOwner

Purpose: Returns a list of public Address Books for a given distribution function and the specified owner of the Address Books. The distribution function is one of three values: EMAIL, PRINT, or FTP. If there are no public Address Books for the specified distribution function, an empty list will be returned. If the specified distribution function is NULL, all Address Books will be returned. For performance reasons, the Address Book information returned by this function doesn't contain the destination list.

Input

Description

Type

Authentication information.

Authenticate

Address Book owner.

String

Function of distribution. Valid values are:

  • EMAIL
  • PRINT
  • FTP

String

Output

Description

Type

Address book information.

AddrBook



Example: Retrieving a List of Public Address Books by Owner in Visual Basic .NET

In the following example, a list of public Address Books for an e-mail method of distribution and owner of "admin" are retrieved and written to the RCABPublicListByOwner.txt file.

Try
   Dim RCLogon As New LogonManager.LogonManagerWSService
   Dim ABook As New ABManager.AddressBookManagerWSService
   Dim SecToken As String
   Dim ABAuthenticate As New ABManager.Authenticate
   Dim retABlist() As ABManager.AddrBook
   Dim newOutput As String
   Dim tempfile As String
   Dim i As Integer
   SecToken = RCLogon.logon("admin", "")
   ABAuthenticate.securityToken = SecToken
   retABlist = ABook.getAddressBookPublicListByOwner(ABAuthenticate, _
               "admin", "EMAIL")
   tempfile = "d:\RCtemp\RCABPublicListByOwner.txt"
   FileOpen(1, tempfile, OpenMode.Output)
   For i = 0 To retABlist.Length - 1
         newOutput = retABlist(i).bookName
         PrintLine(1, newOutput)
   Next i
   FileClose(1)
   Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving a List of Public Address Books by Owner in Java

In the following example, a list of public Address Books for an e-mail method of distribution and owner of "admin" are retrieved and written to the RCABPublicListByOwner.txt file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 AddrBook[] retABlist = AB.getAddressBookPublicListByOwner(Authobj, 
                                       "admin","EMAIL");
 String newOutput = null;
 File tempfile = new File("d:\\RCtemp\\RCABPublicListByOwner.txt");
 FileOutputStream fos = new FileOutputStream(tempfile);
 PrintWriter out=new PrintWriter(fos);
 for ( int i=0; i<retABlist.length; i++ )
 {
      newOutput = retABlist[i].getBookName();
      out.println(newOutput);
 }
 out.close();
}
catch (Throwable t)
{
  System.err.println(t);
  t.printStackTrace();
  System.exit(1);
}

Top of page

x
Retrieving the Address Book Owner List

Function Name: getOwnerList

Purpose: Retrieves the Address Book owner list from the ReportCaster repository. This function can only be called by an administrator.

Input

Description

Type

Authentication information.

Authenticate

Output

Description

Type

List of owners.

String



Example: Retrieving Address Book Owners in Visual Basic .NET

In the following example, a list of Address Book owners are retrieved and written to the RCowners.txt file.

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim retOwners() As String
  Dim newOutput As String
  Dim tempfile As String
  Dim i As Integer
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  retOwners = ABook.getOwnerList(ABAuthenticate)
  tempfile = "d:\RCtemp\RCowners.txt"
  FileOpen(1, tempfile, OpenMode.Output)
  For i = 0 To retOwners.Length - 1
        newOutput = retOwners(i)
        PrintLine(1, newOutput)
  Next i
  FileClose(1)
  Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Retrieving Address Book Owners in Java

In the following example, a list of Address Book owners are retrieved and written to the RCowners.txt file.

try
{
 LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
 LogonManagerWS RCLogon = LogonService.getLogonService();
 AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
 AddressBookManagerWS AB = ABService.getAddressBookService();
 String sectoken = RCLogon.logon("admin","");
 Authenticate Authobj = new Authenticate();
 Authobj.setSecurityToken(sectoken);
 String[] retOwners = AB.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<retOwners.length; i++ )
 {
       newOutput = retOwners[i];
       out.println(newOutput);
 }
 out.close();
}
catch (Throwable t)
{
       System.err.println(t);
       t.printStackTrace();
       System.exit(1);
}

Top of page

x
Updating an Address Book

Function Name: updateAddressBook

Purpose: Updates an Address Book's properties, deletes the existing distribution list, and inserts the new distribution list which is represented by the DestinationElement list stored in the Address Book. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authenticate information.

Authenticate

Address book information.

AddrBook

Output

Description

There is no output for this function. If it fails, it will throw an exception.



Example: Updating All Address Book Information in Visual Basic .NET

In the following example, all the Address Book information is updated for an Address Book called "MYADDRESSBOOK".

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim ABObject As New ABManager.AddrBook
  Dim Destination1 As New ABManager.DestinationElement
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  Dim DestArray As Array = _
      Array.CreateInstance(GetType(ABManager.DestinationElement), 1)
  Destination1.burstValue = "1000"
  Destination1.location = "email1@ibi.com"
  DestArray(0) = Destination1
  ABObject.access = "PRIVATE"
  ABObject.bookName = "MYADDRESSBOOK"
  ABObject.method = "EMAIL"
  ABObject.owner = "admin"
  ABObject.destinationList = DestArray
  ABook.updateAddressBook(ABAuthenticate, ABObject)
  Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try 


Example: Updating All Address Book Information in Java

In the following example, all the Address Book information is updated for an Address Book called "MYADDRESSBOOK".

try
  {
  LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
  LogonManagerWS RCLogon = LogonService.getLogonService();
  AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
  AddressBookManagerWS AB = ABService.getAddressBookService();
  String sectoken = RCLogon.logon("admin","");
  Authenticate Authobj = new Authenticate();
  Authobj.setSecurityToken(sectoken);
  AddrBook ABObject = new AddrBook();
  DestinationElement[] destination;
  destination = new DestinationElement[1];
  DestinationElement dest1 = new DestinationElement();
  dest1.setLocation("email1@ibi.com");
  dest1.setBurstValue("1000");
  destination[0] = dest1;
  ABObject.setBookName("MYADDRESSBOOK");
  ABObject.setAccess("PRIVATE");
  ABObject.setMethod("EMAIL");
  ABObject.setOwner("admin");
  ABObject.setDestinationList(destination);
  AB.updateAddressBook(Authobj,ABObject);
  }
  catch (Throwable t)
{
         System.err.println(t);
         t.printStackTrace();
         System.exit(1);
}

Top of page

x
Updating an Address Book's Properties

Function Name: updateAddressBookProperty

Purpose: Updates an Address Book's properties in the underlying repository only and does not update the DestinationElement list. This function is available to the administrator and the Address Book owner only.

Input

Description

Type

Authenticate information.

Authenticate

Address book information.

AddrBook

Output

Description

There is no output for this function. If it fails, it will throw an exception.



Example: Updating Address Book Properties in Visual Basic .NET

In the following example, the Address Book Properties properties (Owner, Distribution Method, Access) are updated for an Address Book called "MYADDRESSBOOK".

Try
  Dim RCLogon As New LogonManager.LogonManagerWSService
  Dim ABook As New ABManager.AddressBookManagerWSService
  Dim SecToken As String
  Dim ABAuthenticate As New ABManager.Authenticate
  Dim ABObject As New ABManager.AddrBook
  SecToken = RCLogon.logon("admin", "")
  ABAuthenticate.securityToken = SecToken
  ABObject.access = "PRIVATE"
  ABObject.bookName = "MYADDRESSBOOK"
  ABObject.method = "EMAIL"
  ABObject.owner = "admin"
  ABook.updateAddressBookProperty(ABAuthenticate, ABObject)
  Catch x As Exception
        MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try


Example: Updating Address Book Properties in Java

In the following example, the Address Book Properties properties (Owner, Distribution Method, Access) are updated for an Address Book called "MYADDRESSBOOK".

try
   {
   LogonManagerWSService LogonService = new LogonManagerWSServiceLocator();
   LogonManagerWS RCLogon = LogonService.getLogonService();
   AddressBookManagerWSService ABService = new AddressBookManagerWSServiceLocator();
   AddressBookManagerWS AB = ABService.getAddressBookService();
   String sectoken = RCLogon.logon("admin","");
   Authenticate Authobj = new Authenticate();
   Authobj.setSecurityToken(sectoken);
   AddrBook ABObject = new AddrBook();
   ABObject.setBookName("MYADDRESSBOOK");
   ABObject.setAccess("PRIVATE");
   ABObject.setMethod("EMAIL");
   ABObject.setOwner("admin");
   AB.updateAddressBookProperty(Authobj,ABObject);
   }
   catch (Throwable t)
   {
         System.err.println(t);
         t.printStackTrace();
         System.exit(1);
   }

WebFOCUS