ibi.broker.api.data.schedule
Class Parameter

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

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

 The Parameter class provides a means of obtaining and assigning parameter names 
 and values relating to reporting tasks associated with a ReportCaster 
 scheduled distribution. Any parameter associated with a ReportCaster 
 schedule is resolved at the time of distribution. Parameters can be assigned to the 
 following report task types:
 
 

In WF_ServerProcedure, Standard Report, and MyReport tasks, the name portion of the parameter is associated with an amper variable within the FOCUS procedure and resolved at runtime. In the case of URLs, the name value pairs will be appended to the URL upon submission in the normal fashion - after the question mark within the URL.

The code below illustrates how the Parameter class is used, 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 Managed Reporting 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>"); } }

Version:
5.3
See Also:
Serialized Form

Constructor Summary
Parameter()
           
 
Method Summary
 AmperParameter getAmperParameter()
           
 java.lang.String getName()
          Obtains the name of a parameter associated with a task scheduled for distribution within ReportCaster.
 java.lang.String getValue()
          Obtains the value of a parameter associated with a task scheduled for distribution within ReportCaster.
 void setAmperParameter(AmperParameter amperParameter)
           
 void setName(java.lang.String name)
          Specifies the name of a parameter associated with a task scheduled for distribution within ReportCaster.
 void setValue(java.lang.String value)
          Specifies the value of a parameter associated with a task scheduled for distribution within ReportCaster.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Parameter

public Parameter()
Method Detail

getName

public java.lang.String getName()
Obtains the name of a parameter associated with a task scheduled for distribution within ReportCaster. The maximum length of the name field is 64 characters.

Returns:
The parameter name as a String.
See Also:
setName(String)

setName

public void setName(java.lang.String name)
Specifies the name of a parameter associated with a task scheduled for distribution within ReportCaster. The maximum length of the name field is 64 characters.

Parameters:
name - The parameter name as a String.
See Also:
getName()

getValue

public java.lang.String getValue()
Obtains the value of a parameter associated with a task scheduled for distribution within ReportCaster. The maximum length of the value field is 255 characters. The parameter value format depends on whether the value is a single selection or multi-select value. For a single selection, there is no format requirement. For multi-select values, use the following formats:

Returns:
A String representing the parameter value.
See Also:
setValue(String)

setValue

public void setValue(java.lang.String value)
Specifies the value of a parameter associated with a task scheduled for distribution within ReportCaster. The maximum length of the value field is 255 characters. The parameter value format depends on whether the value is a single selection or multi-select value. For a single selection, there is no format requirement. For multi-select values, use the following formats:

Parameters:
value - A String representing the parameter value.
See Also:
getValue()

getAmperParameter

public AmperParameter getAmperParameter()

setAmperParameter

public void setAmperParameter(AmperParameter amperParameter)


Copyright © 2006 Information Builders, Incorporated.