|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.schedule.OptionValue
public class OptionValue
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>");
}
}
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 |
---|
public OptionValue()
Method Detail |
---|
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
description
- A String indicating the description of the option.public java.lang.String getName()
public void setName(java.lang.String name)
name
- A String representing the name of the option.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |