ibi.broker.api.data.schedule
Class TaskStandardReport

java.lang.Object
  extended by ibi.broker.api.data.schedule.Task
      extended by ibi.broker.api.data.schedule.TaskWFServerProcedure
          extended by ibi.broker.api.data.schedule.TaskStandardReport
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
TaskMyReport

public class TaskStandardReport
extends TaskWFServerProcedure

 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>");      
        }
}

 

See Also:
Serialized Form

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.TaskWFServerProcedure
addParameter, getAllowFormatList, getExecId, getExecPassword, getFirstPostProcessingProcedure, getFirstPreProcessingProcedure, getParameterList, getSecondPostProcessingProcedure, getSecondPreProcessingProcedure, getSendFormat, getServerName, isBurst, setAllowFormatList, setBurst, setExecId, setExecPassword, setFirstPostProcessingProcedure, setFirstPreProcessingProcedure, setParameterList, setSecondPostProcessingProcedure, setSecondPreProcessingProcedure, setSendFormat, setServerName
 
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

TaskStandardReport

public TaskStandardReport()
Method Detail

getAlert

public Alert getAlert()
Obtains the Alert object associated with this task.

Returns:
An instance of the alert object.
See Also:
setAlert(Alert alert)

setAlert

public void setAlert(Alert alert)
Assigns an Alert object to this task.

Parameters:
alert - An instance of an alert object.
See Also:
getAlert()

isAlertEnabled

public boolean isAlertEnabled()
Assigns the value of the boolean flag, which determines whether or not an alert is enabled. If TRUE, the alert is enabled. If FALSE, it is disabled.

Returns:
The value of the Boolean AlertEnabled flag.
See Also:
setAlertEnabled(boolean alertEnabled)

setAlertEnabled

public void setAlertEnabled(boolean alertEnabled)
Obtains the value of the boolean flag, which determines whether or not an alert is enabled. If TRUE, the alert is enabled. If FALSE, it is disabled

Parameters:
alertEnabled - The boolean flag specifying whether or not an alert is enabled.
See Also:
isAlertEnabled()

getDomainHREF

public 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. Since the default report format for a Standard Report is HTML, all references to a given report are by way of standard HTML anchor elements followed by the URI (Universal Resource Identifier). Thus a Standard Report file can be specified in general as follows: http://domain/folder/reportfilename.

Returns:
The domain name as a String.
See Also:
setDomainHREF(java.lang.String)

setDomainHREF

public 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. Since the default report format for a Standard Report is HTML, all references to a given report are by way of standard HTML anchor elements followed by the URI (Universal Resource Identifier). Thus a Standard Report file can be specified in general as follows: http://domain/folder/reportfilename.

Parameters:
domainHREF - The domain part of the URI String.
See Also:
getDomainHREF()

getFolderHREF

public 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. Since the default report format for a Standard Report is html, all references to a report are presented as standard html anchor elements followed by the URI (Universal Resource Identifier). Thus a Standard Report file can be specified in general as follows: http://domain/folder/reportfilename.

Returns:
The folder name as a String.
See Also:
setFolderHREF(String domainHREF)

setFolderHREF

public 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. Since the default report format for a Standard Report is html, all references to a report are presented as standard html anchor elements followed by the URI (Universal Resource Identifier). Thus a Standard Report file can be specified in general as follows: http://domain/folder/reportfilename.

Parameters:
folderHREF - The folder part of the URI String.
See Also:
getFolderHREF()

getProcedureDescription

public java.lang.String getProcedureDescription()

setProcedureDescription

public void setProcedureDescription(java.lang.String procedureDescription)


Copyright © 2006 Information Builders, Incorporated.