|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectibi.broker.api.data.schedule.Task
ibi.broker.api.data.schedule.TaskWFServerProcedure
ibi.broker.api.data.schedule.TaskStandardReport
public class TaskStandardReport
The TaskStandardReport class is one of six task types supported by
ReportCaster (WF Server Procedure, MyReport, File, FTP, and URL are the
others). Each task type corresponds to a means of running or accessing a
report that can be distributed by ReportCaster.
TaskStandardReport allows ReportCaster to schedule the distribution of Managed
Reporting Standard Reports. With TaskStandardReport (as opposed to the other four
task types) you can associate an alert with the report, which allows
you to schedule actions that are contingent upon specific alert conditions being
triggered.
The code below illustrates the use of the TaskStandardReport
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 S03_Add_StandardReport
{
public S03_Add_StandardReport(String[] arg) throws Exception
{
// Example of arg
// scheduleDescription #group1stkg1e app/carstdre execid execpass
//
//Example of Report source
//
//-DEFAULT &CNTRY='ENGLAND'
//TABLE FILE CAR
//PRINT CAR WHERE
//COUNTRY EQ '&CNTRY'
//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);
String defaultValue = amperparameterList[0].getDefaultValue();
if(defaultValue != null)
parameter.setValue(defaultValue);
else
parameter.setValue("ITALY");
}
task.setParameterList(new Parameter[]{parameter});
schedule.setTaskList(new Task[]{task});
//subscribe schedule
manager.addSchedule(schedule);
}
public static void main(String[] arg)
{
S03_Add_StandardReport sampl = null;
if(arg.length < 5) {
menu();
return;
}
try
{
System.out.println("\n******* " + S03_Add_StandardReport.class.getName() + " *****************");
sampl = new S03_Add_StandardReport(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 " + S03_Add_StandardReport.class.getName() + " <scheduleDescription> <folderHREF> <procedureHREF> <execId> <execPassword>");
}
}
Nested Class Summary |
---|
Nested classes/interfaces inherited from class ibi.broker.api.data.schedule.Task |
---|
Task.SystemTask |
Field Summary |
---|
Fields inherited from class ibi.broker.api.data.schedule.TaskWFServerProcedure |
---|
AHTML, ALPHA, APDF, COM, COMMA, COMT, DFIX_DELIMITER, DHTML, DOC, EXCEL, EXCEL_TEMPLATE, EXL07, EXL07_TEMPLATE, EXL2K, EXL2K_FORMULA, EXL2K_PIVOT, EXL97, FLEX, GIF, HTML, HTML_ODP, JPEG, MHT, PDF, PNG, PPT, PPT_TEMPLATE, PPTX, PS, SVG, TAB, TABT, VISDIS, VISDISAE, WK1, WP, XML |
Fields inherited from class ibi.broker.api.data.schedule.Task |
---|
description, enabled, FILE, FTP, id, MAINFRAME_JES_RETRIEVE, MY_REPORT, procedureName, reportName, SCHEDULE, STANDARD_REPORT, taskRetry, URL, WEBFOCUS_SERVER_PROCEDURE |
Constructor Summary | |
---|---|
TaskStandardReport()
|
Method Summary | |
---|---|
Alert |
getAlert()
Obtains the Alert object associated with this task. |
java.lang.String |
getDomainHREF()
Obtains the value of the domain that is a part of the URI that references the Standard Report on the Managed Report Server. |
java.lang.String |
getFolderHREF()
Obtains the value of the folder that is a part of the URI that references the Standard Report on the Managed Report Server. |
java.lang.String |
getProcedureDescription()
|
boolean |
isAlertEnabled()
Assigns the value of the boolean flag, which determines whether or not an alert is enabled. |
void |
setAlert(Alert alert)
Assigns an Alert object to this task. |
void |
setAlertEnabled(boolean alertEnabled)
Obtains the value of the boolean flag, which determines whether or not an alert is enabled. |
void |
setDomainHREF(java.lang.String domainHREF)
Assigns the value of the domain that is a part of the URI that references the Standard Report on the Managed Report Server. |
void |
setFolderHREF(java.lang.String folderHREF)
Assigns the value of the folder that is a part of the URI that references the Standard Report on the Managed Report Server. |
void |
setProcedureDescription(java.lang.String procedureDescription)
|
Methods inherited from class ibi.broker.api.data.schedule.Task |
---|
getDescription, getId, getProcedureName, getReportName, getTaskRetry, isEnabled, setDescription, setEnabled, setId, setProcedureName, setReportName, setTaskRetry |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TaskStandardReport()
Method Detail |
---|
public Alert getAlert()
setAlert(Alert alert)
public void setAlert(Alert alert)
alert
- An instance of an alert object.getAlert()
public boolean isAlertEnabled()
setAlertEnabled(boolean alertEnabled)
public void setAlertEnabled(boolean alertEnabled)
alertEnabled
- The boolean flag specifying whether or not an alert is
enabled.isAlertEnabled()
public java.lang.String getDomainHREF()
setDomainHREF(java.lang.String)
public void setDomainHREF(java.lang.String domainHREF)
domainHREF
- The domain part of the URI String.getDomainHREF()
public java.lang.String getFolderHREF()
setFolderHREF(String domainHREF)
public void setFolderHREF(java.lang.String folderHREF)
folderHREF
- The folder part of the URI String.getFolderHREF()
public java.lang.String getProcedureDescription()
public void setProcedureDescription(java.lang.String procedureDescription)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |