|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.schedule.Parameter
public class Parameter
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>");
}
}
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 |
---|
public Parameter()
Method Detail |
---|
public java.lang.String getName()
setName(String)
public void setName(java.lang.String name)
name
- The parameter name as a String.getName()
public java.lang.String getValue()
setValue(String)
public void setValue(java.lang.String value)
value
- A String representing the parameter value.getValue()
public AmperParameter getAmperParameter()
public void setAmperParameter(AmperParameter amperParameter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |