IBM Cognos Sample Programs

List of Java Sample Programs for IBM Cognos

The sample files are installed in subdirectories under the installation_location/sdk/java directory. Each sample is in its own subdirectory. These subdirectories are as follows:


Agents

This sample creates and runs an agent. The explanation file is Agents/Java_CreateAgentUI_Explain.html.

Alerts

This sample demonstrates how to manage alert lists for reports. The explanation file is Alerts/Java_AlertslUI_Explain.html.

CancelExec

This sample cancels a running report. The explanation file is CancelExec/LOCATCancelExec/Java_CancelUI_Explain.htmlION.

CapabilitiesGUI

This sample adds the canUseReportStudio capability to the selected account or role for the selected package. The explanation file is CapabilitiesGUI/Java_CapabilitiesGUI_Explain.html.

This directory contains the user interface for the Capabilities sample. The methods used by this sample are in the Security directory.

Common

This directory contains functionality that is used by a number of the Java samples. CRNConnect.java is used to establish a connection to the server. ReportWizardDialog.java provides a user interface for selecting columns for a report.

ContentStoreExplorer

This sample displays all the objects in the content store. The explanation file is ContentStoreExplorer/Java_CSExplorer_Explain.html.

CreateDrillThrough

This sample creates a drill-through definition and sets its properties. The explanation file is CreateDrillThrough/Java_DrillThroughUI_Explain.html.

DeployPackage

This sample demonstrates how to specify values for the options that control Content Manager deployments. The explanation file is DeployPackage/Java_DeploymentUI_Explain.html.

DispatcherControl

This sample displays dispatcher properties, starts and stops individual services, and sets dispatcher settings. The explanation file is DispatcherControl/Java_DispatcherUI_Explain.html.

EventTrigger

This sample notifies the IBM Cognos 8 server that an external event has occurred, for the purpose of triggering trigger-based schedules.

To use trigger-based report scheduling, the user must schedule a report based on the trigger and you must set up the event on a server. Using this sample, you can link the occurrence of an external event, such as a database refresh or an email, with a trigger on the report that causes it to run.

ExecReports

This sample contains methods for executing different types of reports. The explanation file is ExecReports/Java_ExecReportsUI_Explain.html.

ExecReportsAt

This sample submits a report as a job. When the report executes, the output is saved in the content store as a report view, which is named after and located with the report. The explanation file is ExecReportsAt/Java_ExecReportsAtUI_Explain.html.

GroupsAndRolesGUI

This sample allows you to manipulate groups and roles within your secured namespace. You can add users to and delete users from groups and roles, and you can add and delete groups and roles within your namespace. The explanation file is GroupsAndRolesGUI/Java_GroupsAndRolesGUI_Explain.html.

This directory contains the user interface for the GroupsAndRoles sample. The methods used by this sample are in the Security directory.

HandlersCS

This directory contains methods that access the content store. Java methods in this directory are used by a number of the Java samples to query, add, move and delete content within Content Manager, and to handle exceptions.

PermissionsGUI

This sample denies the current user read permission to that user's MyFolders folder. The explanation file is PermissionsGUI/Java_PermissionsGUI_Explain.html.

This directory contains the user interface for the Permissions sample. The methods used by this sample are in the Security directory.

PrintReport

This sample prints a report that you specify. You can also add entries to the list of printers, or remove existing ones from it. The explanation file is PrintReport/Java_PrintUI_Explain.html.

For information about setting up to use network printers on a Windows installation, see the Administration and Security Guide.

QueryCM

This sample gets the objects from the content store in the location specified by the search option. The application file contains comments to help you follow the sequence. The explanation file is QueryCM/Java_cmQueryUI_Explain.html.

RenderReport

This sample demonstrates how to run a report in HTML format and then render the report output in XML. The explanation file is RenderReport/Java_RenderUI_Explain.html.

ReportAdd

This sample demonstrates how to add a report to the content store based on an existing report specification. The explanation file is ReportAdd/Java_AddReportUI_Explain.html.

ReportCopyMove

This sample copies or moves a report to another location. The explanation file is ReportCopyMove/Java_CopyMoveReportUI_Explain.html.

ReportCreate

This sample allows you to create a new report. It prompts you to select the columns that you want to add to the report. The explanation file is ReportCreate/Java_CreateReportUI_Explain.html.

ReportDelete

This sample deletes a report from the content store. The explanation file is ReportDelete/Java_DeleteReportUI_Explain.html.

ReportParams

This utility class is used by other samples to execute a prompted report. It retrieves the parameters required by the report, builds an array of parameter values, and then passes those parameters to the execute method to run the report.

ReportSpec

When you run this sample, you will be prompted to select a column to add to a report. This sample modifies a report specification using a Document Object Model (DOM) parser. It retrieves the report specification, changes the specification using the DOM parser, and then saves the modified report back to the content store. The explanation file is ReportSpec/Java_EditReportSpecUI_Explain.html.

ReportUpgrade

This sample upgrades the specification property of report objects in the content store. It also allows report specifications to be extracted to the local file system, as they exist, or upgraded. The explanation file is ReportUpgrade/Java_ReportUpgrade_Explain.html.

runreport

This sample runs a report and saves the output as HTML. By default, the selected report is Product Introduction List in the SDK Report Samples folder of the GO Data Warehouse (query) package. You can change the report to be run by editing the Java code.

When the report execution is complete, the report appears in the Java samples location installation_location/webcontent/samples. You can then open the file to view the result.

The explanation file is runreport/README.txt.

SaveAs

This sample executes a report and saves either the report or the report output back in the content store. The explanation file is SaveAs/Java_SaveReportUI_Explain.html.

Scheduler

This sample creates a new schedule for a report. The explanation file is Scheduler/Java_NewScheduler_Explain.html.

Security

These samples allow you to perform a number of security related tasks, such as logging on to a secured namespace, logging off, and displaying the current logon information. If you are not logged on when you attempt to display your logon information, you will be prompted to log on. The explanation file is Security/Java_SecurityUI_Explain.html.

Although most of the samples will work when Anonymous access is enabled, they serve as more robust examples when a secured namespace is used.

SendEmail

This sample demonstrates how to run a report and send the output as an email to a specific user. IBM Cognos must be configured with permissions to send email to a valid email server. For more information, see the Administration and Security Guide. The explanation file is SendEmail/Java_EmailUI_Explain.html.

Submit

This sample submits a report for execution as a job. The explanation file is Submit/Java_SubmitReportUI_Explain.html.

TestDIMS

This sample sends a runSpecification() request to the dimension management service using XML supplied by the user, and displays the response. Requires Business Viewpoint setup. Java_DimensionManagementServiceTest_Explain.html.

TesterCM

This sample tests that the content store is operational. The explanation file is TesterCM/Java_CMTesterUI_Explain.html.

TesterQueryService

This sample allows the user to perform query service operations. The explanation file is TesterQueryService/Java_QueryServiceUI_Explain.html.

ViewAll

This sample displays a list of all packages, reports, and queries in the content store. The explanation file is ViewAll/Java_ViewAllUI_Explain.html.

ViewCMPackages

This sample displays a list of all packages in the content store. The explanation file is ViewCMPackages/Java_ViewPackagesUI_Explain.html.

ViewCMReports

This sample displays a list of all reports and queries in the content store. The explanation file is ViewCMReports/Java_ViewReportsUI_Explain.html.

Documentation

The IBM Cognos Software Development Kit Developer Guide contains additional information about the samples. See the chapter titled 'Methods' and the appendix titled 'Code Samples and Language-Specific Coding Practices'.

Please note that the samples are not intended to be treated as end-user applications. Refer to the sample code for examples of how to use the API when developing your own applications.