Cognos Component
The Cognos Componentlets you automate Cognos reports. It runs on the central RunMyJobs Server using RedwoodScript and an internal Library.
Note: There is no official Cognos Connector within the product. This is a consulting solution that has proven to work but is not covered by Redwood support. If you require customer-specific questions, contact Redwood Product Management.
Requirements
Note: You must request the CAR file containing this component directly from Redwood.
For a quick implementation, gather the following requirements.
- Access to Cognos to see which reports to run (define parameters / Report Path)
- Cognos Server name and port
- Cognos user, namespace (optional), and password
- Cognos/IBM SDK
- Redwood Library code (included in this document)
Note:
The central Redwood server must be able to access the Cognos server on a specific port.
Note:
The Secure Gateway must be able to access the Cognos server on a specific port.
Configuring a Connection to Cognos
To configure a connection to Cognos:
- Create a Redwood Library named Custom_Cognos.
-
In the Sources tab, click Add and then paste the following code in the Source field. Customize the code with the desired information, or use the Parameters in the Job Definition. The password can be clear text here, or a Credential can be used (see below).
CopyString host = getParameterDefault("Cognos_Host", "HostHere");
String port = getParameterDefault("Cognos_Port", "PortHere");
String user = getParameterDefault("Cognos_Username", "UserHere");
if (StringUtils.isEmptyOrNull(user))
{
throw new RuntimeException("No username supplied to connect to " + host + ":" + port);
}
String password = getParameterDefault("Cognos_Password", "PwdHere");
String namespace = getParameterDefault("Cognos_Namespace", "AAA BBB"); -
In the JAR Files tab, click Add and upload the IBM SDK .jar files. The following is an example of a list of such .jar files, but this can be version-specific.
activation.jar
commons-logging-1.1.jar
commons-discovery-0.2.jar
commons-logging-adapters-1.1.jar
commcommons-logging-api-1.1.jar
dom4j-1.6.1.jar
axen-1.1.1.jar
axrpc.jar
stl.jar
og4j-1.2.8.jar
mail.jar
saaj.jar
serializer.jar
standard.jar
estIBMFakeTrustSocketFactory.jar
wsdl4j-1.5.1.jar
xalan.jar
axis.jar
axisCognosClient.jar
Job Definition
Creating aThe Redwood-provided CAR file contains templates that you can customize.
- Create a Job Definition to run Cognos Reports.
- Set the Type to RedwoodScript.
- Choose the Library you created from the Library dropdown list.
-
Enter the following code in the Source field:
Copyimport com.redwood.scheduler.custom.cognos.CognosReport;
{
new CognosReport().runReport();
} -
Create the following Parameters:
Cognos_ReportPath
(example:/content/package[@name='SMT Sales Analysis']/folder[@name='Reports']/folder[@name='Spring']/folder[@name='1 Under Development']/report[@name='Cognos 10 UAT Test Report']
)Cognos_OutputFormat
spreadsheetML
Cognos_Host
Cognos_Port
Cognos_Namespace
Cognos_Username
Cognos_Password
(be sure to check Password under the Parameter options)
For report parameters, you can create a Report Parameter Group and add the parameters here.
-
In the Options tab, set the Default Output Format.
Creating a Credential
To create a Credential for Cognos, enter the Protocol, Real User name, Password, and Endpoint. Be sure to check Externally Available.
Sample Output