This topic describes Schedule Service functions and provides examples for each.
Function Name: addSchedule
Purpose: Takes schedule information and adds it to the ReportCaster repository. Once the schedule is added to the repository, the newly generated schedule ID that uniquely identifies this schedule is returned. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Schedule information. |
Schedule |
Output
Description |
Type |
---|---|
A newly generated schedule identifier or schedule ID. |
String |
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting daily and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoDay Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2004, 12, 31, 10, 35, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting daily and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail);
notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2; Parameter param3 = new Parameter();
param3.setName("DIMENSION");
param3.setValue("PLANT");
params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoDay schedTime = new TimeInfoDay(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2004,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting hourly every Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoHour Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2004, 12, 31, 10, 35, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime schedTime.tuesday = True schedTime.wednesday = True
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting hourly every Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoHour schedTime = new TimeInfoHour(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2004,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime); schedTime.setTuesday(true); schedTime.setWednesday(true);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting every fifteen minutes every Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoMinute Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2004, 12, 31, 10, 35, 0) schedTime.frequency = 15 schedTime.startTime = sTime schedTime.endTime = eTime schedTime.tuesday = True schedTime.wednesday = True
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting every fifteen minutes every Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report");
task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoMinute schedTime = new TimeInfoMinute(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2004,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(15); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime); schedTime.setTuesday(true); schedTime.setWednesday(true);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting on the tenth and twentieth day of every month and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2 Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoMonth Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2005, 12, 31, 10, 35, 0) Dim schedDays As Array = Array.CreateInstance(GetType(Boolean), 31) schedDays(9) = True schedDays(19) = True schedTime.daysOfMonth = schedDays schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting on the tenth and twentieth day of every month and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoMonth schedTime = new TimeInfoMonth(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2005,Calendar.DECEMBER,31,10,35); boolean[] schedDays; schedDays = new boolean[31]; schedDays[9]=true; schedDays[19]=true; schedTime.setDaysOfMonth(schedDays); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting weekly on Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoWeek Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2005, 12, 31, 10, 35, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime schedTime.tuesday = True schedTime.wednesday = True
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting weekly on Tuesday and Wednesday and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoWeek schedTime = new TimeInfoWeek(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2005,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime); schedTime.setTuesday(true); schedTime.setWednesday(true);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting weekly on Tuesday and distributes it through e-mail. The schedule will also run every hour from the scheduled time until 6:00PM. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com" SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS" distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False notifyMe.type = "INACTIVE" Dim params As Array = _ Array.CreateInstance(GetType(SManager.Parameter), 3) Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1 Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2 Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT"
params(2) = param3 Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1) Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1 Dim schedTime As New SManager.TimeInfoWeek Dim sTime As Date = New Date(2008, 1, 8, 12, 0, 0) Dim eTime As Date = New Date(2009, 12, 31, 23, 59, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime schedTime.tuesday = True Dim secondaryRun As New SManager.TimeInterval secondaryRun.enabled = True secondaryRun.interval = 60 secondaryRun.useUntilTime = True Dim uTime As Date = New Date(1, 1, 1, 18, 0, 0) secondaryRun.untilTime = uTime schedTime.secondaryRunInterval = secondaryRun mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - Weekly" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime scheduleId = S.addSchedule(SAuthenticate, mySchedule) newOutput = scheduleId tempfile = "c:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting weekly on Tuesday and distributes it via e-mail. The schedule will also run every hour from the scheduled time until 6:00PM. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService(); String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken); String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com"; Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS"); DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false); Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE"); Parameter[] params; params = new Parameter[3]; Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1; Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2; Parameter param3 = new Parameter(); param3.setName("DIMENSION");
param3.setValue("PLANT"); params[2]=param3; TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1]; TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1; TimeInfoWeek schedTime = new TimeInfoWeek(); GregorianCalendar sTime = new GregorianCalendar(2008,Calendar.JANUARY,8,12,0); GregorianCalendar eTime = new GregorianCalendar(2009,Calendar.DECEMBER,31,23,59); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime); schedTime.setTuesday(true); TimeInterval secondaryRun = new TimeInterval(); secondaryRun.setEnabled(true); secondaryRun.setInterval(60); secondaryRun.setUseUntilTime(true); GregorianCalendar uTime = new GregorianCalendar(1,1,1,18,0); secondaryRun.setUntilTime(uTime); schedTime.setSecondaryRunInterval(secondaryRun); Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - Weekly"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime); String scheduleId = Sched.addSchedule(Authobj,mySchedule); File tempfile = new File("c:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput); out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting yearly and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoYear Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2010, 12, 31, 10, 35, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting yearly and distributes it via e-mail. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoYear schedTime = new TimeInfoYear(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2010,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a report from the application environment once and distributes it via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskWFServerProcedure), 1)
Dim task1 As New SManager.TaskWFServerProcedure
task1.burst = False task1.description = "Task1 - Ranking Report" task1.serverName = "EDASERVE" task1.execId = "EDA" task1.execPassword = "EDA" task1.parameterList = params task1.procedureName = "ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoOnce Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a report from the application environment once and distributes it via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskWFServerProcedure[] myTasks; myTasks = new TaskWFServerProcedure[1];
TaskWFServerProcedure task1 = new TaskWFServerProcedure(); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setParameterList(params); task1.setProcedureName("ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to distribute a file that has been previously stored. The job runs once and the file is distributed via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Information Builders Logo" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = True
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskFile), 1)
Dim task1 As New SManager.TaskFile
task1.description = "Task1 - IBI Logo" task1.fileName = "C:\ibi\DevStudio53\ibi_html\ib_logo_home.gif" task1.reportName = "Information Builders Logo.gif" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoOnce Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Information Builders Logo" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to distribute a file that has been previously stored. The job runs once and the file is distributed via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Information Builders Logo"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(true);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskFile[] myTasks; myTasks = new TaskFile[1];
TaskFile task1 = new TaskFile(); task1.setDescription("Task1 - IBI Logo");
task1.setFileName("C:\\ibi\\DevStudio53\\ibi_html\\ib_logo_home.gif"); task1.setReportName("Information Builders Logo.gif"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Information Builders Logo"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a My Report from Managed Reporting and it is distributed via e-mail. In this, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskMyReport), 1)
Dim task1 As New SManager.TaskMyReport
task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#.olapcustrep102pfk6dm0" task1.parameterList = params task1.procedureName = "admin/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoOnce Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a My Report from Managed Reporting and it is distributed via e-mail. In this, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskMyReport[] myTasks; myTasks = new TaskMyReport[1];
TaskMyReport task1 = new TaskMyReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#.olapcustrep102pfk6dm0"); task1.setParameterList(params); task1.setProcedureName("admin/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt");
FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput); out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to distribute a Web page once via e-mail. A Web page showing stock quote information for Microsoft Corporation (MSFT) is shown. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Current Microsoft Stock Quote" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 2)
Dim param1 As New SManager.Parameter param1.name = "qsym" param1.value = "MSFT" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "ver" param2.value = "12141" params(1) = param2
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskUrl), 1) Dim task1 As New SManager.TaskUrl task1.description = "Task1 - Stock Quote" task1.reportName = "Stock Quote" task1.urlString = _ "http://finance.infospace.com/_1_2359TM10446S2Z5__info.foxnws/" + _ "finance/quote/quote-out.htm" task1.parameterList = params myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoOnce Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "MSFT Stock Quote" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to distribute a Web page once via e-mail. A Web page showing stock quote information for Microsoft Corporation (MSFT) is shown. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Current Microsoft Stock Quote"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[2];
Parameter param1 = new Parameter(); param1.setName("qsym"); param1.setValue("MSFT"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("ver"); param2.setValue("12141"); params[1]=param2;
TaskUrl[] myTasks; myTasks = new TaskUrl[1]; TaskUrl task1 = new TaskUrl(); task1.setDescription("Task1 - Stock Quote"); task1.setParameterList(params); task1.setReportName("Stock Quote"); task1.setUrlString("http://finance.infospace.com/" + "_1_2359TM10446S2Z5__info.foxnws/finance/" + "quote/quote-out.htm"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("MSFT Stock Quote"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput); out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and then it is distributed to the ReportCaster Library. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim newOutput As String
Dim tempfile As String
fromEmail = "fromEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
Dim distributionInfo As New SManager.StorageLibrary distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.accessType = "OWNER" distributionInfo.expirationMode = "D" distributionInfo.expirationData = 3 distributionInfo.libraryURL = _ "http://localhost/rcaster/library/libreport.jsp" distributionInfo.sendEmailAfterSaveReport = True
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and then it is distributed to the ReportCaster Library. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator();
ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com";
StorageLibrary distributionInfo = new StorageLibrary(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setAccessType("OWNER"); distributionInfo.setExpirationMode("D"); distributionInfo.setExpirationData(3); distributionInfo.setLibraryURL( "http://localhost/rcaster/library/libreport.jsp"); distributionInfo.setSendEmailAfterSaveReport(true) ;
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and then it is distributed to Managed Reporting. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim newOutput As String Dim tempfile As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
Dim distributionInfo As New SManager.StorageMre distributionInfo.folderName = "Ranking Output"
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and then it is distributed to Managed Reporting. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
StorageMre distributionInfo = new StorageMre(); distributionInfo.setFolderName("Ranking Output");
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it to an FTP Location. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim newOutput As String Dim tempfile As String
SecToken = RCLogon.logon("admin", "")
SAuthenticate.securityToken = SecToken
Dim destinationInfo As New SManager.Destination destinationInfo.singleAddress = "Ranking.htm" destinationInfo.type = "SINGLE_ADDRESS"
Dim distributionInfo As New SManager.DistributionFTP distributionInfo.destination = destinationInfo distributionInfo.ftpLocation = "incoming/WSDemoReports" distributionInfo.ftpUserName = "ftpUser" distributionInfo.ftpPassword = "ftpPass" distributionInfo.ftpServerName = "ftpServer"
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it to an FTP Location. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress("Ranking.htm"); destinationInfo.setType("SINGLE_ADDRESS");
DistributionFTP distributionInfo = new DistributionFTP(); distributionInfo.setDestination(destinationInfo); distributionInfo.setFtpLocation("incoming/WSDemoReports"); distributionInfo.setFtpUserName("ftpUser"); distributionInfo.setFtpPassword("ftpPass"); distributionInfo.setFtpServerName("ftpServer");
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport();
task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to read a file from an FTP Location and distribute it to a different FTP Location. The schedule will run once and no notifications are sent. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim newOutput As String Dim tempfile As String SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken Dim destinationInfo As New SManager.Destination destinationInfo.singleAddress = "ib_logo_home.gif" destinationInfo.type = "SINGLE_ADDRESS" Dim distributionInfo As New SManager.DistributionFTP distributionInfo.destination = destinationInfo distributionInfo.ftpLocation = "incoming/WSout" distributionInfo.ftpUserName = "ftpUser" distributionInfo.ftpPassword = "ftpPass" distributionInfo.ftpServerName = "ftpServer" notifyMe.type = "INACTIVE" Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskFtp), 1) Dim task1 As New SManager.TaskFtp task1.description = "Task1 - FTP Move File" task1.deleteAfterRetrieval = False task1.fileName = "incoming/WSin/ib_logo_home.gif" task1.userName = "ftpUser" task1.password = "ftpPass" task1.serverName = "ftpServer" myTasks(0) = task1 Dim sTime As Date = New Date(2008, 1, 2, 12, 29, 0) schedTime.startTime = sTime mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "FTP File Move" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin"
mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime scheduleId = S.addSchedule(SAuthenticate, mySchedule) newOutput = scheduleId tempfile = "c:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to read a file from an FTP Location and distribute it to a different FTP Location. The schedule will run once and there will not be any notifications sent. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService(); ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService(); String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken); Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress("ib_logo_home.gif"); destinationInfo.setType("SINGLE_ADDRESS"); DistributionFTP distributionInfo = new DistributionFTP(); distributionInfo.setDestination(destinationInfo); distributionInfo.setFtpLocation("incoming/WSout"); distributionInfo.setFtpUserName("ftpUser"); distributionInfo.setFtpPassword("ftpPass"); distributionInfo.setFtpServerName("ftpServer"); Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE"); TaskFtp[] myTasks; myTasks = new TaskFtp[1]; TaskFtp task1 = new TaskFtp(); task1.setDescription("Task1 - FTP Move File"); task1.setUserName("ftpUser"); task1.setPassword("ftpPass");
task1.setServerName("ftpServer"); task1.setDeleteAfterRetrieval(false); task1.setFileName("incoming/WSin/ib_logo_home.gif"); myTasks[0] = task1; TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2008,Calendar.JANUARY,02,15,00); schedTime.setStartTime(sTime); Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("FTP File Move"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime); String scheduleId = Sched.addSchedule(Authobj,mySchedule); File tempfile = new File("c:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput); out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it to a printer. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim newOutput As String Dim tempfile As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
Dim destinationInfo As New SManager.Destination destinationInfo.singleAddress = "printerAddress" destinationInfo.type = "SINGLE_ADDRESS"
Dim distributionInfo As New SManager.DistributionPrint distributionInfo.destination = destinationInfo
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "PS" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it to a printer. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress("printerAddress"); destinationInfo.setType("SINGLE_ADDRESS");
DistributionPrint distributionInfo = new DistributionPrint(); distributionInfo.setDestination(destinationInfo);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("PS"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it via e-mail to a distribution list created dynamically. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim newOutput As String Dim tempfile As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
fromEmail = "fromEmail@ibi.com"
Dim dynamicInfo As New SManager.DynamicAddress dynamicInfo.serverName = "EDASERVE" dynamicInfo.userName = "EDA" dynamicInfo.password = "EDA" dynamicInfo.procedureName = "myList"
Dim destinationInfo As New SManager.Destination destinationInfo.dynamicAddress = dynamicInfo destinationInfo.type = "DYNAMIC_ADDRESS"
Dim distributionInfo As New SManager.DistributionEmail distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter
param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking Report - 1" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting once and distributes it via e-mail to a distribution list created dynamically. In this schedule, all notifications have been turned off. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com";
DynamicAddress dynamicInfo = new DynamicAddress(); dynamicInfo.setServerName("EDASERVE"); dynamicInfo.setUserName("EDA"); dynamicInfo.setPassword("EDA"); dynamicInfo.setProcedureName("myList");
Destination destinationInfo = new Destination(); destinationInfo.setDynamicAddress(dynamicInfo); destinationInfo.setType("DYNAMIC_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT");
param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report - 1"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run an alert from Managed Reporting every minute from Monday through Friday and distributes the report via e-mail once the alert has been triggered. The schedule is disabled after the alert has been triggered. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
Dim destinationInfo As New SManager.Destination destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
Dim distributionInfo As New SManager.DistributionEmail distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
Dim notifyMe As New SManager.Notification notifyMe.type = "ALWAYS" notifyMe.addressForBriefNotification = toEmail notifyMe.addressForFullNotification = toEmail notifyMe.from = fromEmail notifyMe.subject = "Ranking Report - Notification"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myAlert As New SManager.Alert myAlert.resetType = "TERMINATE"
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.TaskStandardReport), 1)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = True task1.alert = myAlert task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/rankinga" task1.reportName = "Ranking Report"
task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim schedTime As New SManager.TimeInfoMinute Dim sTime As Date = New Date(2004, 12, 7, 10, 35, 0) Dim eTime As Date = New Date(2004, 12, 31, 10, 35, 0) schedTime.frequency = 1 schedTime.startTime = sTime schedTime.endTime = eTime schedTime.monday = True schedTime.tuesday = True schedTime.wednesday = True schedTime.thursday = True schedTime.friday = True
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = " Ranking Report Based On Alert" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId
tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run an alert from Managed Reporting every minute from Monday through Friday and distributes the report via e-mail once the alert has been triggered. The schedule is disabled after the alert has been triggered. In this schedule, all notifications have been turned on. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("ALWAYS"); notifyMe.setAddressForBriefNotification(toEmail); notifyMe.setAddressForFullNotification(toEmail); notifyMe.setFrom(fromEmail); notifyMe.setSubject("Ranking Report - Notification");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1; Parameter param2 = new Parameter(); param2.setName("PLANT");
param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION"); param3.setValue("PLANT"); params[2]=param3;
Alert myAlert = new Alert(); myAlert.setResetType("TERMINATE");
TaskStandardReport[] myTasks; myTasks = new TaskStandardReport[1];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(true); task1.setAlert(myAlert); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/rankinga"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TimeInfoMinute schedTime = new TimeInfoMinute(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,07,10,35); GregorianCalendar eTime = new GregorianCalendar(2004,Calendar.DECEMBER,31,10,35); schedTime.setFrequency(1); schedTime.setStartTime(sTime); schedTime.setEndTime(eTime); schedTime.setMonday(true); schedTime.setTuesday(true); schedTime.setWednesday(true); schedTime.setThursday(true); schedTime.setFriday(true);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking Report Based On Alert"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin");
mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule);
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close(); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
In the following example, a schedule is added to run a Standard Report from Managed Reporting and a report from the application environment once. It is distributed via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the file RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim destinationInfo As New SManager.Destination Dim distributionInfo As New SManager.DistributionEmail Dim notifyMe As New SManager.Notification Dim schedTime As New SManager.TimeInfoOnce Dim mySchedule As New SManager.Schedule Dim scheduleId As String Dim fromEmail As String Dim toEmail As String Dim newOutput As String Dim tempfile As String
fromEmail = "fromEmail@ibi.com" toEmail = "toEmail@ibi.com"
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
destinationInfo.singleAddress = toEmail destinationInfo.type = "SINGLE_ADDRESS"
distributionInfo.mailFrom = fromEmail distributionInfo.mailReplyAddress = fromEmail distributionInfo.mailServerName = "smtpServer" distributionInfo.mailSubject = "Today's Ranking and Car Report" distributionInfo.destination = destinationInfo distributionInfo.sendingReportAsAttachment = False
notifyMe.type = "INACTIVE"
Dim params As Array = Array.CreateInstance(GetType(SManager.Parameter), 3)
Dim param1 As New SManager.Parameter param1.name = "OUTPUT" param1.value = "HTML" params(0) = param1
Dim param2 As New SManager.Parameter param2.name = "PLANT" param2.value = "All" params(1) = param2
Dim param3 As New SManager.Parameter param3.name = "DIMENSION" param3.value = "PLANT" params(2) = param3
Dim myTasks As Array = _ Array.CreateInstance(GetType(SManager.Task), 2)
Dim task1 As New SManager.TaskStandardReport task1.alertEnabled = False task1.burst = False task1.description = "Task1 - Ranking Report" task1.domainHREF = "webservi/webservi.htm" task1.execId = "EDA" task1.execPassword = "EDA" task1.folderHREF = "#wsdemoreport" task1.parameterList = params task1.procedureName = "app/ranking" task1.reportName = "Ranking Report" task1.sendFormat = "HTML" task1.serverName = "EDASERVE" myTasks(0) = task1
Dim task2 As New SManager.TaskWFServerProcedure task2.burst = False task2.description = "Task2 - Car Report" task2.serverName = "EDASERVE" task2.execId = "EDA" task2.execPassword = "EDA" task2.procedureName = "car54" task2.reportName = "Car Report" task2.sendFormat = "HTML" myTasks(1) = task2
Dim sTime As Date = New Date(2004, 12, 6, 13, 25, 0) schedTime.startTime = sTime
mySchedule.active = True mySchedule.deleteJobAfterRun = False mySchedule.description = "Ranking and Car Report" mySchedule.distribution = distributionInfo mySchedule.notification = notifyMe mySchedule.owner = "admin" mySchedule.priority = 3 mySchedule.taskList = myTasks mySchedule.timeInfo = schedTime
scheduleId = S.addSchedule(SAuthenticate, mySchedule)
newOutput = scheduleId tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output) Print(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is added to run a Standard Report from Managed Reporting and a report from the application environment once. It is distributed via e-mail. In this schedule, all notifications have been turned off. The schedule ID is written to the file RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS Sched = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String fromEmail = "fromEmail@ibi.com"; String toEmail = "toEmail@ibi.com";
Destination destinationInfo = new Destination(); destinationInfo.setSingleAddress(toEmail); destinationInfo.setType("SINGLE_ADDRESS");
DistributionEmail distributionInfo = new DistributionEmail(); distributionInfo.setMailFrom(fromEmail); distributionInfo.setMailReplyAddress(fromEmail); distributionInfo.setMailServerName("smtpServer"); distributionInfo.setMailSubject("Today's Ranking and Car Report"); distributionInfo.setDestination(destinationInfo); distributionInfo.setSendingReportAsAttachment(false);
Notification notifyMe = new Notification(); notifyMe.setType("INACTIVE");
Parameter[] params; params = new Parameter[3];
Parameter param1 = new Parameter(); param1.setName("OUTPUT"); param1.setValue("HTML"); params[0]=param1;
Parameter param2 = new Parameter(); param2.setName("PLANT"); param2.setValue("All"); params[1]=param2;
Parameter param3 = new Parameter(); param3.setName("DIMENSION");param3.setValue("PLANT"); params[2]=param3;
Task[] myTasks; myTasks = new Task[2];
TaskStandardReport task1 = new TaskStandardReport(); task1.setAlertEnabled(false); task1.setBurst(false); task1.setDescription("Task1 - Ranking Report"); task1.setDomainHREF("webservi/webservi.htm"); task1.setExecId("EDA"); task1.setExecPassword("EDA"); task1.setFolderHREF("#wsdemoreport"); task1.setParameterList(params); task1.setProcedureName("app/ranking"); task1.setReportName("Ranking Report"); task1.setSendFormat("HTML"); task1.setServerName("EDASERVE"); myTasks[0] = task1;
TaskWFServerProcedure task2 = new TaskWFServerProcedure(); task2.setBurst(false); task2.setDescription("Task2 - Car Report"); task2.setExecId("EDA"); task2.setExecPassword("EDA"); task2.setProcedureName("car54"); task2.setReportName("Car Report"); task2.setSendFormat("HTML"); task2.setServerName("EDASERVE"); myTasks[1] = task2;
TimeInfoOnce schedTime = new TimeInfoOnce(); GregorianCalendar sTime = new GregorianCalendar(2004,Calendar.DECEMBER,06,13,25); schedTime.setStartTime(sTime);
Schedule mySchedule = new Schedule(); mySchedule.setActive(true); mySchedule.setDeleteJobAfterRun(false); mySchedule.setDescription("Ranking and Car Report"); mySchedule.setDistribution(distributionInfo); mySchedule.setNotification(notifyMe); mySchedule.setOwner("admin"); mySchedule.setPriority(3); mySchedule.setTaskList(myTasks); mySchedule.setTimeInfo(schedTime);
String scheduleId = Sched.addSchedule(Authobj,mySchedule); File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile);
PrintWriter out=new PrintWriter(fos); String newOutput = scheduleId; out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: createScheduleInstance
Purpose: Creates new schedule information with defaults dependent on the time type, distribution type, and task type. This function does not add the schedule to the ReportCaster repository.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Time type. Valid values are:
|
Integer |
Distribution type. Valid values are:
|
String |
Task type. Valid values are:
|
Integer |
Output
Description |
Type |
---|---|
New schedule information. |
Schedule |
In the following example, a schedule structure is created containing certain default information for creating a schedule to run a report from Managed Reporting on a monthly basis and have it distributed via e-mail.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim mySchedule As New SManager.Schedule
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
mySchedule = S.createScheduleInstance(SAuthenticate, 5, "EMAIL", 1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule structure is created containing certain default information for creating a schedule to run a report from Managed Reporting on a monthly basis and have it distributed via e-mail.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule mySchedule = S.createScheduleInstance(Authobj,5,"EMAIL",1);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: createScheduleInstanceDefault
Purpose: Creates new schedule information with default schedule property values. The default structures are: TimeType = ONCE, DistributionType = EMAIL and TaskType = WebFOCUS Server Procedure.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Output
Description |
Type |
---|---|
New schedule information. |
Schedule |
In the following example, a schedule structure is created containing certain default information for creating a schedule to run a report from the application environment once and have it distributed via e-mail.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim mySchedule As New SManager.Schedule
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
mySchedule = S.createScheduleInstanceDefault(SAuthenticate)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule structure is created containing certain default information for creating a schedule to run a report from the application environment once and have it distributed via e-mail.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule mySchedule = S.createScheduleInstanceDefault(Authobj);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: deleteSchedule
Purpose: Deletes the schedule as identified by its unique schedule identifier from the ReportCaster repository. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
The ID that uniquely identifies the schedule in the repository. |
String |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, a schedule for a specified schedule ID is deleted.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
S.deleteSchedule(SAuthenticate, "S102aulcbd01") Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule for a specified schedule ID is deleted.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
S.deleteSchedule(Authobj,"S102aulcbd01"); }
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getAmperParameterList
Purpose: Obtains the list of parameter information that is associated with a scheduled task. This function can only be used to retrieve parameters for Standard Reports and My Reports (for example, applying to reports that exist within Managed Reporting). This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Task information containing the amper variables that get encapsulated in lists of amper parameters. |
TaskStandardReport TaskMyReport TaskWFServerProcedure |
Output
Description |
Type |
---|---|
List of amper parameters. |
AmperParameter |
In the following example, a list of parameters is retrieved for a specific task within a schedule. The getSchedule function is run first to retrieve all the schedule information for a specified schedule. In this example, the task is defined to run a report in Managed Reporting. The parameter name and parameter default value are written to the RCtaskParameters.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim scheduleInfo As New SManager.Schedule Dim params() As SManager.AmperParameter Dim MREtask As New SManager.TaskStandardReport Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
scheduleInfo = S.getSchedule(SAuthenticate, "S10259bneq04") MREtask = scheduleInfo.taskList(0)
params = S.getAmperParameterList(SAuthenticate, MREtask)
tempfile = "d:\RCtemp\RCtaskParameters.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To params.Length - 1 newOutput = params(i).parameterName + " " + _ params(i).defaultValue PrintLine(1, newOutput)
Next i
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of parameters is retrieved for a specific task within a schedule. The getSchedule function is run first to retrieve all the schedule information for a specified schedule. In this example, the task is defined to run a report in Managed Reporting. The parameter name and parameter default value are written to the RCtaskParameters.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule scheduleInfo = S.getSchedule(Authobj,"S10259bneq04"); TaskStandardReport MREtask = (TaskStandardReport)scheduleInfo.getTaskList()[0];
AmperParameter params[] = S.getAmperParameterList(Authobj,MREtask);
File tempfile = new File("d:\\RCtemp\\RCtaskParameters.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<params.length; i++ ) { String newOutput = params[i].getParameterName() + " " + params[i].getDefaultValue();
out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getOwnerList
Purpose: Retrieves a list of schedule owners from ReportCaster repository. The owner list contains the user names of individuals who have created schedules or have the right to create schedules in ReportCaster. Only the schedule administrator can call this function.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Output
Description |
Type |
---|---|
List of schedule owners. |
String |
In the following example, a list of owners is retrieved for the schedules. The owner's user ID is written to the RCscheduleOwners.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim owners() As String Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
owners = S.getOwnerList(SAuthenticate)
tempfile = "d:\RCtemp\RCscheduleOwners.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To owners.Length - 1 newOutput = owners(i) PrintLine(1, newOutput) Next i
FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of owners is retrieved for the schedules. The owner's user ID is written to the RCscheduleOwners.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String owners[] = S.getOwnerList(Authobj);
File tempfile = new File("d:\\RCtemp\\RCscheduleOwners.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<owners.length; i++ ) { String newOutput = owners[i]; out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getSchedule
Purpose: Retrieves an existing schedule from the ReportCaster repository based on a given schedule identifier. The schedule ID uniquely identifies a schedule and can be used to retrieve all schedule data including any information pertaining to tasks associated with the schedule. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
ID that uniquely identifies the schedule in the repository. |
String |
Output
Description |
Type |
---|---|
Schedule information. |
Schedule |
In the following example, schedule information for a specific schedule ID is retrieved. In this example, the schedule retrieved schedules a Standard Report from Managed Reporting to be distributed to the ReportCaster Library and it is to be run once. The schedule description, distribution type (for example, DistributionEmail/DistributionPrint/StorageLibrary), Storage Library Category, Time Type (for example, TimeInfoOnce/TimeInfoDay/TimeInfoWeek), Start Time, Task Type (for example, TaskWFServerProcedure/ TaskStandardReport), procedure name, and the report parameters are written to the RCrunSchedule.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim mySchedule As New SManager.Schedule Dim tempfile As String Dim newOutput As String Dim DistributionType As System.Type Dim TimeType As System.Type Dim TaskType As System.Type Dim i As Integer
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
mySchedule = S.getSchedule(SAuthenticate, "S10259bneq04")
DistributionType = mySchedule.distribution.GetType() TimeType = mySchedule.timeInfo.GetType TaskType = mySchedule.taskList(0).GetType
Dim SLdistribution As New SManager.StorageLibrary SLdistribution = mySchedule.distribution
Dim RunOnce As New SManager.TimeInfoOnce RunOnce = mySchedule.timeInfo
Dim MREtask As New SManager.TaskStandardReport MREtask = mySchedule.taskList(0)
tempfile = "d:\RCtemp\RCrunSchedule.txt" FileOpen(1, tempfile, OpenMode.Output)
newOutput = mySchedule.description + " " + _ DistributionType.Name + " " + _ SLdistribution.category + " " + _ TimeType.Name + " " + _ RunOnce.startTime + " " + _ TaskType.Name + " " + _ MREtask.procedureName
PrintLine(1, newOutput)
For i = 0 To MREtask.parameterList.Length - 1 newOutput = MREtask.parameterList(i).name + " " + _ MREtask.parameterList(i).value PrintLine(1, newOutput) Next i
FileClose(1)
Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, schedule information for a specific schedule ID is retrieved. In this example, the schedule retrieved schedules a Standard Report from Managed Reporting to be distributed to the ReportCaster Library and it is to be run once. The schedule description, distribution type (for example, DistributionEmail/DistributionPrint/StorageLibrary), Storage Library Category, Time Type (for example, TimeInfoOnce/TimeInfoDay/TimeInfoWeek), Start Time, Task Type (for example, TaskWFServerProcedure/ TaskStandardReport), procedure name, and the report parameters are written to the RCrunSchedule.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule mySchedule = S.getSchedule(Authobj,"S10259bneq04");
String distributionType = mySchedule.getDistribution().getClass().getName(); StorageLibrary SLdistribution = (StorageLibrary)mySchedule.getDistribution();
String timeType = mySchedule.getTimeInfo().getClass().getName(); TimeInfoOnce runOnce = (TimeInfoOnce)mySchedule.getTimeInfo();
String taskType = mySchedule.getTaskList()[0].getClass().getName(); TaskStandardReport MREtask = (TaskStandardReport)mySchedule.getTaskList()[0];
File tempfile = new File("d:\\RCtemp\\RCrunSchedule.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos); SimpleDateFormat sdf = new SimpleDateFormat();
String newOutput = mySchedule.getDescription() + " " + distributionType + " " + SLdistribution.getCategory()+ " " + timeType + " " + sdf.format(runOnce.getStartTime().getTime()) + " " + taskType + " " + MREtask.getProcedureName();
out.println(newOutput);
for ( int i=0; i<MREtask.getParameterList().length; i++ ) { newOutput = MREtask.getParameterList()[i].getName() + " " + MREtask.getParameterList()[i].getValue();
out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getScheduleId
Purpose: Retrieves the unique schedule identifier from the ReportCaster repository based on specifying the schedule description and owner. If the caller is an administrator, any owner can be specified. If the caller is an end user, the owner must be the caller itself. Otherwise, an exception will be thrown during the permission check.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
The user name of the schedule owner. |
String |
The description of the schedule. Note that the maximum length is 90 characters. |
String |
Output
Description |
Type |
---|---|
A unique schedule ID. |
String |
In the following example, the schedule ID for a schedule called "Ranking Report" is retrieved. The schedule ID is written to the RCscheduleId.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim ScheduleId As String Dim tempfile As String Dim newOutput As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
ScheduleId = S.getScheduleId(SAuthenticate, "admin", "Ranking Report")
tempfile = "d:\RCtemp\RCscheduleId.txt" FileOpen(1, tempfile, OpenMode.Output)
newOutput = ScheduleId
PrintLine(1, newOutput)
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the schedule ID for a schedule called "Ranking Report" is retrieved. The schedule ID is written to the RCscheduleId.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator();
ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
String scheduleId = S.getScheduleId(Authobj,"admin","Ranking Report");
File tempfile = new File("d:\\RCtemp\\RCscheduleId.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
String newOutput = scheduleId;
out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getScheduleInfoListByCaller
Purpose: Retrieves a list of schedule information from the ReportCaster repository that is owned by the current logon user. This is designed just to retrieve information for each schedule for performance reasons. Schedule information has all its properties populated with data with the exception of the task information, which are all NULL. An administrator will receive all schedules, and an end user will receive only those schedules owned by him.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Output
Description |
Type |
---|---|
List of schedule information. |
Schedule |
In the following example, a list of schedules containing schedule Information for the authenticated user is retrieved. The task information is not returned in this function. The getSchedule function must be used to return schedule information including the task information. The schedule ID and schedule description are written to RCscheduleListByCaller.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim ScheduleInfo() As SManager.Schedule Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
ScheduleInfo = S.getScheduleInfoListByCaller(SAuthenticate)
tempfile = "d:\RCtemp\RCscheduleListByCaller.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To ScheduleInfo.Length - 1 newOutput = ScheduleInfo(i).id + " " + _ ScheduleInfo(i).description
PrintLine(1, newOutput) Next i
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of schedules containing schedule Information for the authenticated user is retrieved. The task information is not returned in this function. The getSchedule function must be used to return schedule information including the task information. The schedule ID and schedule description are written to RCscheduleListByCaller.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule scheduleInfo[] = S.getScheduleInfoListByCaller(Authobj);
File tempfile = new File("d:\\RCtemp\\RCscheduleListByCaller.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<scheduleInfo.length; i++ ) { String newOutput = scheduleInfo[i].getId() + " " + scheduleInfo[i].getDescription();
out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: getScheduleInfoListByOwner
Purpose: Retrieves a list of schedule information from the ReportCaster repository that belongs to a specific owner. If the caller is an administrator, any owner can be specified. If the caller is an end user, the owner must be the caller itself. Otherwise, an exception will be thrown during the permission check. This is designed just to retrieve information for each schedule for performance reasons. Schedule information has all its properties populated with data with the exception of the task information, which are all NULL. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
The schedule owner's user name. |
String |
Output
Description |
Type |
---|---|
List of schedule information. |
Schedule |
In the following example, a list of schedules containing schedule information for the specified owner is retrieved. The task information is not returned in this function. The getSchedule function must be used to return schedule information including the task information. The schedule ID and schedule description are written to the RCscheduleListByOwner.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim ScheduleInfo() As SManager.Schedule Dim tempfile As String Dim newOutput As String Dim i As Integer
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
ScheduleInfo = S.getScheduleInfoListByOwner(SAuthenticate, "admin")
tempfile = "d:\RCtemp\RCscheduleListByOwner.txt" FileOpen(1, tempfile, OpenMode.Output)
For i = 0 To ScheduleInfo.Length - 1 newOutput = ScheduleInfo(i).id + " " + _ ScheduleInfo(i).description
PrintLine(1, newOutput) Next i
FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a list of schedules containing schedule information for the specified owner is retrieved. The task information is not returned in this function. The getSchedule function must be used to return schedule information including the task information. The schedule ID and schedule description are written to the RCscheduleListByOwner.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule scheduleInfo[] = S.getScheduleInfoListByOwner(Authobj,"admin");
File tempfile = new File("d:\\RCtemp\\RCscheduleListByOwner.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
for ( int i=0; i<scheduleInfo.length; i++ ) { String newOutput = scheduleInfo[i].getId() + " " + scheduleInfo[i].getDescription();
out.println(newOutput); }
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: run
Purpose: After schedule information has been created and its properties populated with data, this function immediately submits the schedule to the ReportCaster Distribution Server that runs the schedule. When the schedule runs, the Distribution Server creates a unique job number or job ID for this schedule, which is returned to the caller upon the completion/execution of the job. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Schedule information encapsulating the job that is to be run. |
Schedule |
Output
Description |
Type |
---|---|
A job number generated by the Distribution Server. |
String |
In the following example, a schedule is run. The getSchedule function is run first to retrieve all the schedule information for a specified schedule. The schedule information is used as input to the "run" function. The job ID is written to RCrunSchedule.txt file.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim scheduleInfo As New SManager.Schedule Dim jobId As String Dim tempfile As String Dim newOutput As String
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
scheduleInfo = S.getSchedule(SAuthenticate, "S10259bneq04")
jobId = S.run(SAuthenticate, scheduleInfo)
tempfile = "d:\RCtemp\RCrunSchedule.txt" FileOpen(1, tempfile, OpenMode.Output)
newOutput = jobId
PrintLine(1, newOutput) FileClose(1) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, a schedule is run. The getSchedule function is run first to retrieve all the schedule information for a specified schedule. The schedule information is used as input to the "run" function. The job ID is written to RCrunSchedule.txt file.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule scheduleInfo = S.getSchedule(Authobj,"S10259bneq04");
String jobId = S.run(Authobj,scheduleInfo);
File tempfile = new File("d:\\RCtemp\\RCrunSchedule.txt"); FileOutputStream fos = new FileOutputStream(tempfile); PrintWriter out=new PrintWriter(fos);
String newOutput = jobId;
out.println(newOutput);
out.close();
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
Function Name: updateSchedule
Purpose: Updates schedule information which already exists in the ReportCaster repository. Before modifying the schedule, ReportCaster checks the schedule ID to determine if this schedule information, as identified by its unique ID, is already in the repository. If it is, the caller can modify the properties. If it is not already in the database, an exception is thrown. This function is available to the administrator and the schedule owner only.
Input
Description |
Type |
---|---|
Authentication information. |
Authenticate |
Schedule information encapsulating the existing schedule. |
Schedule |
Output
Description |
---|
There is no output for this function. If it fails, it will throw an exception. |
In the following example, the report is updated to PDF format for a particular schedule within Managed Reporting. The getSchedule function is run first in order to retrieve all the current schedule information.
Try Dim RCLogon As New LogonManager.LogonManagerWSService Dim S As New SManager.ScheduleManagerWSService Dim SecToken As String Dim SAuthenticate As New SManager.Authenticate Dim mySchedule As New SManager.Schedule
SecToken = RCLogon.logon("admin", "") SAuthenticate.securityToken = SecToken
mySchedule = S.getSchedule(SAuthenticate, "S10259bneq04")
Dim MREtask As New SManager.TaskStandardReport MREtask = mySchedule.taskList(0) MREtask.sendFormat = "PDF"
S.updateSchedule(SAuthenticate, mySchedule) Catch x As Exception
MsgBox(x.Message, MsgBoxStyle.OKOnly, "Error Message")
End Try
In the following example, the report is updated to PDF format for a particular schedule within Managed Reporting. The getSchedule function is run first in order to retrieve all the current schedule information.
try { LogonManagerWSService LogonService = new LogonManagerWSServiceLocator(); LogonManagerWS RCLogon = LogonService.getLogonService();
ScheduleManagerWSService ScheduleService = new ScheduleManagerWSServiceLocator(); ScheduleManagerWS S = ScheduleService.getScheduleService();
String sectoken = RCLogon.logon("admin",""); Authenticate Authobj = new Authenticate(); Authobj.setSecurityToken(sectoken);
Schedule mySchedule = S.getSchedule(Authobj,"S10259bneq04");
TaskStandardReport MREtask = (TaskStandardReport)mySchedule.getTaskList()[0]; MREtask.setSendFormat("PDF");
S.updateSchedule(Authobj,mySchedule);
}
catch (Throwable t) { System.err.println(t); t.printStackTrace(); System.exit(1); }
WebFOCUS |