<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Clearview Informatics &#187; Code Samples</title>
	<atom:link href="http://www.clearviewinformatics.com/category/code-samples/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.clearviewinformatics.com</link>
	<description>Business Productivity Solutions in the Cloud.</description>
	<lastBuildDate>Thu, 28 Jan 2010 02:26:30 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compiling the Cognos 8 SDK Java Samples on Windows</title>
		<link>http://www.clearviewinformatics.com/2008/05/15/setting-up-the-cognos-8-sdk-java-samples/</link>
		<comments>http://www.clearviewinformatics.com/2008/05/15/setting-up-the-cognos-8-sdk-java-samples/#comments</comments>
		<pubDate>Thu, 15 May 2008 14:26:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Cognos 8 SDK]]></category>

		<guid isPermaLink="false">http://www.clearviewinformatics.com/2008/05/15/setting-up-the-cognos-8-sdk-java-samples/</guid>
		<description><![CDATA[When the Cognos 8 SDK is installed, the java libraries (jar files) are installed in the ..\c8\sdk\java\lib folder. The sample applications are located in individual directories in the ..\c8\sdk\java folder. Also included are two scripts, build-samples.bat (for Windows) and build-samples.sh (for Unix and Linux) for compiling the java samples. Here are the steps for compiling [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>When the Cognos 8 SDK is installed, the java libraries (jar files) are installed in the ..\c8\sdk\java\lib folder. The sample applications are located in individual directories in the ..\c8\sdk\java folder. Also included are two scripts, build-samples.bat (for Windows) and build-samples.sh (for Unix and Linux) for compiling the java samples. Here are the steps for compiling the samples:<br id="sflo0" /><span id="more-106"></span><br id="sflo1" />1. Verify that you have a JDK installed. Cognos 8 requires JDK 1.4 or higher. The JDK can be downloaded from Sun Microsystems <a id="r_i5" title="here" href="http://java.sun.com/javase/downloads/index.jsp" target="_blank">here</a>.<br id="px4l0" /></p>
<p><a href="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/snag-00171.png"><img class="alignright alignnone size-full wp-image-108" style="float: right;" title="snag-00171" src="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/snag-00171.png" alt="" width="416" height="131" /></a></p>
<p>2. Check that the JDK location is in the Windows PATH environment variable. To do this, type &#8217;set path&#8217; from the command prompt.<br id="mif20" /></p>
<p>3. Open up the file CRNConnect.java in the ..c8sdkjavacommon folder. Edit the following line (line 102), if necessary, to reflect the location and port number of your Cognos 8 server:</p>
<pre><span style="font-family: Courier New;">public static String CM_URL = "http://localhost:9300/p2pd/servlet/dispatch";</span></pre>
<p>4. In the build-samples. bat file, modify the following line to reflect where the JDK is installed:</p>
<pre id="rn3z26" class="code">set JAVA_HOME=c:/jdk1.4.2_15 <br id="iane0" /></pre>
<p>5. If necessary, modify this line to point to where Cognos 8 is installed:<br id="rn3z1" /></p>
<p>6. Run build-samples.bat to compile the samples. This script will compile the sample code and create .class files in the folders. In each of the folders there will be a run.bat file.</p>
<p><img id="o:-61" style="width: 842px; height: 608px;" src="http://docs.google.com/File?id=dg3hk3rm_217cqk4kfcv_b" alt="" /></p>
<p>7. To test your compiled sample code, execute the run.bat file in the CapabilitiesGUI directory to run the sample Capabilities application.</p>
<pre id="rn3z26" class="code">
<div id="yjwa" style="padding: 1em 0pt; text-align: left;"><img id="qfbk0" style="width: 704px; height: 106px;" src="http://docs.google.com/File?id=dg3hk3rm_218hrtt2ddn_b" alt="" /></div>
</pre>
<p>8. If the URL is correct, click the OK button to connect to Cognos 8.</p>
<p><span id="lyt_0"><strong>Troubleshooting</strong></span></p>
<p>Upon running the sample code, the following error will occur if the java compiler compatibility flag needed to be set:</p>
<p><span style="font-family: Courier New;">Exception in thread &#8220;main&#8221; java.lang.UnsupportedClassVersionError: Bad version number in .class file.</span><br id="u8y30" /><br id="u8y31" />The samples will use the JRE that ships with Cognos 8. The error occurs because the java complier defaults to a version that is not compatible. To set the compatibility, in the build-samples.bat file, add the following two switches after &#8220;%JAVAC%&#8221;: -source 1.4 -target 1.4</p>
<p>The line will read as follows:<br id="n3rv0" /><br id="i-pm0" /><span style="font-family: Courier New;">&#8220;%JAVAC%&#8221; -source 1.4 -target 1.4 -classpath &#8220;%CLASSPATH%&#8221; Alerts/*.java CancelExec/*.java Common/*.java CapabilitiesGUI/*.java ContentStoreExplorer/*.java CreateDrillThrough/*.java DeployPackage/*.java DispatcherControl/*.java ReportCopyMove/*.java EventTrigger/*.java ExecReports/*.java ExecReportsAt/*.java GroupsAndRolesGUI/*.java HandlersCS/*.java PermissionsGUI/*.java PrintReport/*.java QueryCM/*.java RenderReport/*.java ReportAdd/*.java ReportCreate/*.java ReportDelete/*.java ReportParams/*.java ReportSpec/*.java ReportUpgrade/*.java runreport/*.java SaveAs/*.java Scheduler/*.java Security/*.java SendEmail/*.java Submit/*.java TesterCM/*.java ViewAll/*.java ViewCMReports/*.java ViewCMPackages/*.java</span><br id="i-pm1" style="font-family: Courier New;" /><br id="i-pm2" />Execute build-samples.bat again to recreate the class files.</p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Compiling+the+Cognos+8+SDK+Java+Samples+on+Windows+http://86c7m.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.clearviewinformatics.com/wp-content/plugins/tweet-this/icons/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.clearviewinformatics.com/2008/05/15/setting-up-the-cognos-8-sdk-java-samples/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Creating an Input File for Access Manager Batch Maintenance</title>
		<link>http://www.clearviewinformatics.com/2008/05/14/creating-an-input-file-for-access-manager-batch-maintenance/</link>
		<comments>http://www.clearviewinformatics.com/2008/05/14/creating-an-input-file-for-access-manager-batch-maintenance/#comments</comments>
		<pubDate>Wed, 14 May 2008 17:48:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Series 7]]></category>

		<guid isPermaLink="false">http://www.clearviewinformatics.com/?p=103</guid>
		<description><![CDATA[Creating users in a Series 7 namespace can be automated with Access Manager Batch Maintenance, but writing the required input file is an error prone and time consuming chore. This Visual Basic script will take a list of users from a comma-delimited file (it could be exported from Excel or some other system), create the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Creating users in a Series 7 namespace can be automated with Access Manager Batch Maintenance, but writing the required input file is an error prone and time consuming chore. This Visual Basic script will take a list of users from a comma-delimited file (it could be exported from Excel or some other system), create the users in the namespace, create the user classes, assign the users to their user class and then create a signon for the user. When the file is ready, the input file is run with Access Manager Batch Maintenance (via a batch file, so additional code can be inserted here if necessary). Finally, an email message is sent with the log file attached.</p>
<p>Notes:</p>
<ul>
<li>This example is written in Visual Basic, and it can be run as is on a Windows system under the Windows Scripting host (a vbs file). It can also be integrated into a Visual Basic or Cognos Script application.</li>
<li>The message is sent via Outlook on the machine where the script is run. If you are not using Outlook or Outlook is not installed where this script is being run, then this subroutine must be replaced by alternate code.</li>
</ul>
<p>Download the files:</p>
<p><a href="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/accman_maintenance.vbs">accman_maintenance.vbs</a></p>
<p><a href="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/users.csv">users.csv</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Creating+an+Input+File+for+Access+Manager+Batch+Maintenance+http://cpxx3.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.clearviewinformatics.com/wp-content/plugins/tweet-this/icons/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.clearviewinformatics.com/2008/05/14/creating-an-input-file-for-access-manager-batch-maintenance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Series 7 Impromptu Automation</title>
		<link>http://www.clearviewinformatics.com/2008/05/14/series-7-impromptu-automation/</link>
		<comments>http://www.clearviewinformatics.com/2008/05/14/series-7-impromptu-automation/#comments</comments>
		<pubDate>Wed, 14 May 2008 13:16:36 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Code Samples]]></category>
		<category><![CDATA[Series 7]]></category>

		<guid isPermaLink="false">http://www.clearviewinformatics.com/?p=100</guid>
		<description><![CDATA[Here are two sample scripts to illustrate how to automate Impromptu using the Cognos Script macro language. Cognos scripts can be easily integrated into a Visual Basic, VB Script or an ASP script, as the language follows the same conventions as Visual Basic.  The first script will run a report and save the output [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Here are two sample scripts to illustrate how to automate Impromptu using the Cognos Script macro language. Cognos scripts can be easily integrated into a Visual Basic, VB Script or an ASP script, as the language follows the same conventions as Visual Basic.<br id="o:h20" /> <br id="o:h21" /> The first script will run a report and save the output as a pdf file. The format can easily be changed to csv or another supported format. This script is useful when you have long running reports that you would like to run in off hours. <br id="dayj0" /> <br id="dayj1" /> This second script runs the report and saves the output, like in the first script, but it also sends it as an email attachment. It uses Microsoft Outlook libraries to create and to send the message.</p>
<p>Download the sample code here:</p>
<p><a href="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/save_pdf.mac">save_pdf</a></p>
<p><a href="http://www.clearviewinformatics.com/wp-content/uploads/2008/05/email_pdf.mac">email_pdf</a></p>
<p align="left"><a class="tt" href="http://twitter.com/home/?status=Series+7+Impromptu+Automation+http://5xmys.th8.us" title="Post to Twitter"><img class="nothumb" src="http://www.clearviewinformatics.com/wp-content/plugins/tweet-this/icons/tt-twitter-micro3.png" alt="Post to Twitter" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.clearviewinformatics.com/2008/05/14/series-7-impromptu-automation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
