ibi.broker.api.data.schedule
Class OptionValue

java.lang.Object
  extended by ibi.broker.api.data.schedule.OptionValue
All Implemented Interfaces:
java.io.Serializable

public class OptionValue
extends java.lang.Object
implements java.io.Serializable

 The OptionValue class is used in conjunction with the
 AmperParameter class to enable the ReportCaster user to specify
 the range of valid values for parameters defined within
 a FOCUS procedure.

 The code below illustrates the use of the OptionValue class it               
 is taken from the samples packaged with the product.                                             

 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 +  Copyright (c) 2004 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.       +
 +                                                                          +
 + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  

 public class S04_Add_AmperParameter 
  {
        public S04_Add_AmperParameter(String[] arg) throws Exception
        {
                //   Example of arg
                //   scheduleDescription #group1stkg1e app/caramper execid execpass

                //   
                //Example of Report source
                //
                //-DEFAULT &CNTR=FRANCE
                //TABLE FILE CAR
                //PRINT CAR WHERE  
                //COUNTRY EQ '&CNTR.(ENGLAND,FRANCE).'
                //END           
                //
                
                String scheduleDescription = arg[0];
                String folderHREF = arg[1];
                String procedureHREF = arg[2];
                String execId = arg[3];
                String execPassword = arg[4];
                
                String domainHREF = "untitled/untitled.htm";
                
                // Create ScheduleManager
                ScheduleManager manager = Util.createCasterConnection().getScheduleManager();
                
                //create object schedule with default values from config file
                Schedule schedule = manager.createScheduleInstanceDefault();
                
                //set description
                schedule.setDescription(scheduleDescription);
                
                //set distribution to library
                Distribution distribution = new StorageLibrary();
                schedule.setDistribution(distribution);
                
                //create task
                TaskStandardReport task = new TaskStandardReport();
                task.setProcedureName(procedureHREF);
                task.setDomainHREF(domainHREF);
                task.setFolderHREF(folderHREF);
                task.setExecId(execId);
                task.setExecPassword(execPassword);
                //create parameter
                Parameter parameter = new Parameter();
                
                // Retrieve amperparameterList from MRE
                AmperParameter[] amperparameterList = manager.getAmperParameterList(task);
                if(amperparameterList != null && amperparameterList.length != 0)
                {
                        String parameterName = amperparameterList[0].getParameterName();
                        parameter.setName(parameterName);
                        OptionValue[] optionValueList = amperparameterList[0].getOptionValueList();
                        parameter.setValue(optionValueList[0].getName());
                }
                task.setParameterList(new Parameter[]{parameter});
                schedule.setTaskList(new Task[]{task});
                
                //subscribe schedule
                manager.addSchedule(schedule);
        }
        
        
        public static void main(String[] arg)
        {
                S04_Add_AmperParameter sampl = null;
                if(arg.length < 5) {
                         menu();
                         return;
                }
                try
                {
                        System.out.println("\n******* " + S04_Add_AmperParameter.class.getName() + " *****************");
                        sampl = new S04_Add_AmperParameter(arg);
                        System.out.println("\n" + sampl.getClass().getName() + " OK");
                }
                catch(Exception ce)
                {
                        ce.printStackTrace();
                        System.out.println(sampl.getClass().getName() + " FAIL");

                }
                
                
        }
        private static void menu()
        {
                System.out.println("Usage: java " + S04_Add_AmperParameter.class.getName() + " <scheduleDescription> <folderHREF> <procedureHREF> <execId> <execPassword>");      
        }

 }
 

See Also:
Serialized Form

Constructor Summary
OptionValue()
           
 
Method Summary
 java.lang.String getDescription()
          Obtains the text used to describe what the option value is.
 java.lang.String getName()
          Obtains the name given to a particular option value.
 void setDescription(java.lang.String description)
          Specifies the text used to describe what the option value is.
 void setName(java.lang.String name)
          Obtains the name given to a particular option value.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OptionValue

public OptionValue()
Method Detail

getDescription

public java.lang.String getDescription()
Obtains the text used to describe what the option value is. For example, if the option value is "ENG" the description might read, "The country of England." The description field corresponds to the value in the procedure, and can contain as many characters as supported by the Reporting Server.

Returns:
Returns the A String indicating the option.

setDescription

public void setDescription(java.lang.String description)
Specifies the text used to describe what the option value is. For example if the option value is "ENG", the description might read: "The country of England". The description value is set by values in the FOCUS procedure. Therefore, this method is rarely applicable for use by developers.

Parameters:
description - A String indicating the description of the option.

getName

public java.lang.String getName()
Obtains the name given to a particular option value. For example if the option value is ENG, the name might be "ENG" and the description might read, "The country of England". The name field corresponds to the value in the FOCUS procedure, and can contain as many characters as supported by the Reporting Server.

Returns:
A String representing the name of the option.

setName

public void setName(java.lang.String name)
Obtains the name given to a particular option value. For example if the option value is ENG, the name might be "ENG" and the description might read, "The country of England". The description value is set by values in the FOCUS procedure. Therefore, this method is rarely applicable for use by developers.

Parameters:
name - A String representing the name of the option.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Copyright © 2006 Information Builders, Incorporated.