<?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>Shaaf's Blog &#187; scripting</title>
	<atom:link href="http://www.shaafshah.com/tag/scripting/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.shaafshah.com</link>
	<description>Another bit in the wall</description>
	<lastBuildDate>Wed, 12 Aug 2009 14:28:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Calling wsadmin scripts from ant</title>
		<link>http://www.shaafshah.com/2008/12/11/calling-wsadmin-scripts-from-ant/</link>
		<comments>http://www.shaafshah.com/2008/12/11/calling-wsadmin-scripts-from-ant/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:17:46 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=148</guid>
		<description><![CDATA[You can simply add the following to a target. For the following wsadmin should be in your PATH env. < exec dir="." executable="wsadmin.bat" logError="true" failonerror="true" output="wsconfig.out" > < arg line="-lang jython -f ../../createQFactory.py"/ > < /exec > All output will be logged to wsconfig.out]]></description>
			<content:encoded><![CDATA[<p>You can simply add the following to a target.<br />
For the following wsadmin should be in your PATH env.</p>
<p>< exec dir="." executable="wsadmin.bat" logError="true" failonerror="true" output="wsconfig.out" ><br />
   < arg line="-lang jython -f ../../createQFactory.py"/ ><br />
< /exec ></p>
<p>All output will be logged to wsconfig.out</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/12/11/calling-wsadmin-scripts-from-ant/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>wasprofile -create -delete</title>
		<link>http://www.shaafshah.com/2008/10/24/wasprofile-create-delete/</link>
		<comments>http://www.shaafshah.com/2008/10/24/wasprofile-create-delete/#comments</comments>
		<pubDate>Fri, 24 Oct 2008 11:38:00 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[wasprofile]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=91</guid>
		<description><![CDATA[Sometimes you require to do things silently, without any questions asked and &#8220;Just Do It&#8221; attitude is required. I often find my self with this problem. If you want to delete or create a Websphere profile from your command line try the following. (I have tried on RSA only) # deleteing a profile wasprofile -delete [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you require to do things silently, without any questions asked and &#8220;Just Do It&#8221; attitude is required.</p>
<p>I often find my self with this problem.</p>
<p>If you want to delete or create a Websphere profile from your command line try the following. (I have tried on RSA only)</p>
<p># deleteing a profile<br />
<strong>wasprofile </strong>-delete -profileName MyProfile</p>
<p>You should get the following message on deletion</p>
<p><strong>INSTCONFSUCCESS: Success: The profile no longer exists.</strong></p>
<p>Creating a websphere profile</p>
<p><strong>wasprofile </strong>-create -profileName MyProfile -profilePath \<br />
[PROFILE PATH] -templatePath \<br />
[RSA HOME]runtimes\base_v6\profileTemplates\default \<br />
-nodeName [NODE NAME] -cellName [CELL NAME] -hostName [HOSTNAME].</p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/10/24/wasprofile-create-delete/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SVN &#8211; some quick commands during merge.</title>
		<link>http://www.shaafshah.com/2008/08/25/svn-some-quick-commands-during-merge/</link>
		<comments>http://www.shaafshah.com/2008/08/25/svn-some-quick-commands-during-merge/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 13:55:54 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=36</guid>
		<description><![CDATA[Following are some of the frequently used svn commands during merging and branching. I used to work with tortoise for this but as soon as I learned these, it feels like a more easier space to be in. Although no points taken away from tortoise, it still works pretty good for the gui part, This [...]]]></description>
			<content:encoded><![CDATA[<p>Following are some of the frequently used svn commands during merging and branching. I used to work with tortoise for this but as soon as I learned these, it feels like a more easier space to be in. Although no points taken away from tortoise, it still works pretty good for the gui part, This article is more  targeted towards dark screen lovers.</p>
<p><strong>Create a new branch from trunk:</strong><br />
If you want to create a branch from a specific revision of Trunk following command is handy. It does a remote copy. which means the machine you are on does not need a copy of the whole tree.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> copy <span style="color: #660033;">-r</span> REVISION TRUNK_URL NEW_BRANCH_URL <span style="color: #660033;">--username</span> USERNAME <span style="color: #660033;">--password</span> PASSWORD <span style="color: #660033;">-m</span> MESSAGE</pre></div></div>

<p>An example</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> copy <span style="color: #660033;">-r</span> <span style="color: #000000;">1234</span> http:<span style="color: #000000; font-weight: bold;">//</span>shaafshah.com<span style="color: #000000; font-weight: bold;">/</span>trunk http:<span style="color: #000000; font-weight: bold;">//</span>shaafshah.com<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>MY_BRANCH <span style="color: #660033;">--username</span> foo <span style="color: #660033;">--password</span> bar <span style="color: #660033;">-m</span> <span style="color: #ff0000;">&quot;Remote copy&quot;</span></pre></div></div>

<p><strong>When was this branch created?</strong><br />
If you want to know the day branch was created.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> log <span style="color: #660033;">-v</span> <span style="color: #660033;">--stop-on-copy</span> BRANCH_URL</pre></div></div>

<p>The last record will show you the day the branch as created.</p>
<p><strong>List all the branches:</strong><br />
If you want to take a listing of branches or a tree</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> BRANCHES_URL</pre></div></div>

<p>e.g. http://shaafshah.com/branches</p>
<p><strong>Merge from Branch to Trunk:</strong></p>
<p>Browse to where you have checkedout trunk in the local directory.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> shaafshah.com<span style="color: #000000; font-weight: bold;">/</span>trunk</pre></div></div>

<p>Update trunk to HEAD.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> update
At revision 1234.</pre></div></div>

<p>Following will merge from branch to trunk but will not commit.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> merge <span style="color: #660033;">-r</span> BRANCH_REVISION:TRUNK_REVISION BRANCH_URL</pre></div></div>

<p>Branch_REVISION will be the revision branch was created if this is the first time you are doing the merge.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> merge <span style="color: #660033;">-r</span> <span style="color: #000000;">1233</span>:<span style="color: #000000;">1234</span> http:<span style="color: #000000; font-weight: bold;">//</span>shaafshah.com<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>my_new_branch</pre></div></div>

<p>After this you should do an</p>
<p>svn status</p>
<p>to check the status of the files. the files will be marked with following Characters.</p>
<p>&#8216;A&#8217; Added<br />
&#8216;C&#8217; Conflicted<br />
&#8216;D&#8217; Deleted<br />
&#8216;I&#8217; Ignored<br />
&#8216;M&#8217; Modified</p>
<p>If there is any &#8216;C&#8217; in the status the files will not be committed if you try an svn commit to save the merge to the trunk.</p>
<p><strong>Merge from Trunk to Branch:</strong></p>
<p>To merge from Trunk to branch you would need to browse to the branch checked out in the local direcotry.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #7a0874; font-weight: bold;">cd</span> shaafshah.com<span style="color: #000000; font-weight: bold;">/</span>branches<span style="color: #000000; font-weight: bold;">/</span>mybranch</pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> update
At revision 1234.</pre></div></div>

<p>The following command will try merging trunk from revision 1233 i.e. the day branch was created to branch head.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">$ <span style="color: #c20cb9; font-weight: bold;">svn</span> merge <span style="color: #660033;">-r</span> <span style="color: #000000;">1233</span>:HEAD TrunkURL BRANCH_URL</pre></div></div>

<p>Hopefully this should help. However you should definitely refer to SVN Book for more detail.</p>
<p>svnbook at <a title="http://svnbook.red-bean.com/" href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/08/25/svn-some-quick-commands-during-merge/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>HowTo create a JDBC provider with wsadmin scripting &#8211; Jython</title>
		<link>http://www.shaafshah.com/2008/07/01/howto-create-a-jdbc-provider-with-wsadmin-scripting-jython/</link>
		<comments>http://www.shaafshah.com/2008/07/01/howto-create-a-jdbc-provider-with-wsadmin-scripting-jython/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 12:21:48 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[jdbc]]></category>
		<category><![CDATA[jython]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=12</guid>
		<description><![CDATA[Last week I wrote a post about creating MQQueues with jacl. However today I am moving to Jython. This is the new scripting languauge supported by the wsadmin. The following write-up helps you create a JDBC provider using Jython in 6 easy steps on the wsadmin console. Pre requirements: Following should be known to start using [...]]]></description>
			<content:encoded><![CDATA[<p>Last week I wrote a post about creating MQQueues with jacl. However today I am moving to Jython. This is the new scripting languauge supported by the wsadmin. The following write-up helps you create a JDBC provider using Jython in 6 easy steps on the wsadmin console.</p>
<p><strong>Pre requirements:<br />
</strong>Following should be known to start using this tutorial.</p>
<p>1. How to launch the wsadmin with Jython enabled.</p>
<p><strong>Where will I find the wsadmin?<br />
</strong>It is typically placed in the bin directory of your server.<br />
In my case its lying in my RAD installation directory as<br />
../Rational/SDP/6.0/runtimes/base_v6/bin</p>
<p>To invoke the wasadmin, just open your terminal and move to the bin dir where you can simply call it by typing wsadmin -lang jython. By doing so you would be invoking the default profile. if you want to specify the profile then use the switch -profileName YOURPROFILENAME</p>
<p>You can either paste the commands step by step or store the whole code listing in one file like DataSources.py. This means you can run this with wsadmin by specifying the -f switch.</p>
<p>After the wsadmin console is launched we can now move to creating the provider step by step.</p>
<p><strong>STEP 1.</strong><br />
Identify classpath for the provider. This is a path to the jar files that need to be used by the provider. In our case its a jdbc dirver for oracle.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">driverPath = <span style="color: #483d8b;">'C:<span style="color: #000099; font-weight: bold;">\l</span>ib<span style="color: #000099; font-weight: bold;">\o</span>jdbc14.jar'</span></pre></div></div>

<p><strong>STEP 2.</strong><br />
Identify the node and cell that will hold this provider. Node/Cell is how websphere is organized. As the Provider will be created inside a node we need to know which node we are working with.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">cellName=AdminControl.<span style="color: black;">getCell</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
nodeName=AdminControl.<span style="color: black;">getNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
node = AdminConfig.<span style="color: black;">getid</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/Cell:%s/Node:%s/'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>cellName,nodeName<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>In the code above first we get the NodeName and CellName of the current connected server and then take the reference of it as node.</p>
<p><strong>STEP 3.<br />
</strong>Specify a template, In our case we have taken an &#8216;Oracle JDBC Driver (XA)&#8217; template.<br />
The following command will list the template for the provider specified and store it in a variable &#8216;providerTemplate&#8217;</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">providerTemplate=AdminConfig.<span style="color: black;">listTemplates</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'JDBCProvider'</span>, <span style="color: #483d8b;">'Oracle JDBC Driver (XA)'</span><span style="color: black;">&#41;</span></pre></div></div>

<p><strong>STEP 4.<br />
</strong>The name for our provider. It could be any name you want to give your provider.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">providerName = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span>, <span style="color: #483d8b;">'Oracle JDBC Driver (XA)'</span><span style="color: black;">&#93;</span></pre></div></div>

<p>Implementation class and classpath for driver.<br />
It is important to give the implementation class for our provider. In some cases they can be different in ours we use the default one.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">implClassName = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'implementationClassName'</span>, <span style="color: #483d8b;">'oracle.jdbc.xa.client.OracleXADataSource'</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>STEP 5.</strong><br />
The following code will just put all the above variables into a form expected by wsadmin as a temp variable jdbcAttrs.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">classpath = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'classpath'</span>,driverPath<span style="color: black;">&#93;</span>
jdbcAttrs = <span style="color: black;">&#91;</span>providerName,  implClassName,classpath<span style="color: black;">&#93;</span></pre></div></div>

<p><strong>STEP 6.</strong></p>
<p>Now is the time to create the provider. and the following will just do that. It passes the type of the provider, the node ref, the jdbcAttrs created in step 5 and the template to be used to create the provider.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">provider  = AdminConfig.<span style="color: black;">createUsingTemplate</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'JDBCProvider'</span>, node, jdbcAttrs, providerTemplate<span style="color: black;">&#41;</span>
AdminConfig.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>This is pretty much it. You should now be able to see the provider in the AdminConsole.</p>
<p>Complete code listing is as follows</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">driverPath = <span style="color: #483d8b;">'C:<span style="color: #000099; font-weight: bold;">\l</span>ib<span style="color: #000099; font-weight: bold;">\o</span>jdbc14.jar'</span>
cellName=AdminControl.<span style="color: black;">getCell</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
nodeName=AdminControl.<span style="color: black;">getNode</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
providerTemplate=AdminConfig.<span style="color: black;">listTemplates</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'JDBCProvider'</span>, <span style="color: #483d8b;">'Oracle JDBC Driver (XA)'</span><span style="color: black;">&#41;</span>
node = AdminConfig.<span style="color: black;">getid</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'/Cell:%s/Node:%s/'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>cellName,nodeName<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
providerName = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'name'</span>, <span style="color: #483d8b;">'Oracle JDBC Driver (XA)'</span><span style="color: black;">&#93;</span>
implClassName = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'implementationClassName'</span>, <span style="color: #483d8b;">'oracle.jdbc.xa.client.OracleXADataSource'</span><span style="color: black;">&#93;</span>
classpath = <span style="color: black;">&#91;</span><span style="color: #483d8b;">'classpath'</span>,driverPath<span style="color: black;">&#93;</span>
jdbcAttrs = <span style="color: black;">&#91;</span>providerName,  implClassName,classpath<span style="color: black;">&#93;</span>
provider  = AdminConfig.<span style="color: black;">createUsingTemplate</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'JDBCProvider'</span>, node, jdbcAttrs, providerTemplate<span style="color: black;">&#41;</span>
AdminConfig.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/07/01/howto-create-a-jdbc-provider-with-wsadmin-scripting-jython/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an SVN wrap for your build using Ant</title>
		<link>http://www.shaafshah.com/2008/06/30/creating-an-svn-wrap-for-your-build-using-ant/</link>
		<comments>http://www.shaafshah.com/2008/06/30/creating-an-svn-wrap-for-your-build-using-ant/#comments</comments>
		<pubDate>Mon, 30 Jun 2008 12:45:32 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[ant]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[build]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=11</guid>
		<description><![CDATA[Today after along break I would jump right on to one of the interesting topics in my den these days. One of my friends was lately troubled with doing some SVN stuff like merging etc. And a lot of people will agree with me on their first experiences. I think. While Automated builds take a [...]]]></description>
			<content:encoded><![CDATA[<p>Today after along break I would jump right on to one of the interesting topics in my den these days.</p>
<p>One of my friends was lately troubled with doing some SVN stuff like merging etc. And a lot of people will agree with me on their first experiences. <img src='http://www.shaafshah.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I think.</p>
<p>While Automated builds take a lot of our time I thought I could plug in with some automated merging and a few other tasks. Its hard to go over all of that in one post but I will try putting in some basic stuff to get us started.</p>
<p>I call it the SVN Wrap.</p>
<p><strong>Step 1.</strong><br />
Create a simple script file for wrapping svn and our environment.</p>
<p>A simple bat script could look like the following</p>

<div class="wp_syntax"><div class="code"><pre class="bat" style="font-family:monospace;">@echo off
svn %*</pre></div></div>

<p>However some people might want to add some environment variables to it. And that is where the strength of the this file comes in. You can tailor the environment dynamically!<br />
e.g.</p>

<div class="wp_syntax"><div class="code"><pre class="bat" style="font-family:monospace;">set LC_ALL=C
set SVN_HOME=svn-win32-1.4.6
set PATH=%SVN_HOME%\bin;%PATH%;</pre></div></div>

<p><strong>FYI:</strong> By setting LC_ALL I am telling the system I disregard the default locale. Its just used as an example here. for more information refer to the svnbook at <a title="http://svnbook.red-bean.com/" href="http://svnbook.red-bean.com/">http://svnbook.red-bean.com/</a></p>
<p><strong>Step 2. </strong><br />
Create the build.xml<br />
It doesnt get simpler then this.</p>
<p>I have created a project with the name CI-Test</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CI-Test&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;status&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		This is a POC for SVN Wrap.
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Importantly I am setting a property local.branch so that I can tell svn where my code has been checked out locally.</p>
<p>And finally the target that will take a status of the branch. for more details on the status command you could go here.</p>
<p>In general this target will give a general overview of the files and thier state at the moment.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;status&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Following is the status for this tree.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;output is logged here: status.out&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${local.branch}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;ci-svn.bat&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;status.out&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;status&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>With in the target there are a few echo commands but the key construct is the exec.<br />
The exec is going to do the following</p>
<p><strong>dir</strong>=&#8221;${local.branch}&#8221; &#8211; would meant execute the command in this directory<br />
<strong>executable</strong>=&#8221;ci-svn.bat&#8221; &#8211; Identifies the executable<br />
and finally the output attribute to show where the output of this activity goes.<br />
The following line will pass the parameters to the executable<br />
<strong>&lt; arg line=&#8221;status&#8221; /&gt;</strong><br />
And in this case its sending a status command to svn.</p>
<p>For more details on exec goto. <a title="http://ant.apache.org/manual/" href="http://ant.apache.org/manual/">http://ant.apache.org/manual/</a></p>
<p>Now I would presume both these files in saved in one direcotry as</p>
<p>1. ci-svn.bat<br />
2. build.xml</p>
<p>To run this simply goto your command console and once in the same directory execute by running<br />
ant</p>
<p>It is assumed that all paths to java,ant and svn are set on your console or system.</p>
<p>As an output you should be able to see a status.out in the same directory from where you executed ant.</p>
<p>Hopefully this should get you started with doing some bit of svn commands from ant. And that just opens a lot of more possibilities in your build environment.</p>
<p>The complete code listing of the build file is as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;CI-Test&quot;</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;status&quot;</span> <span style="color: #000066;">basedir</span>=<span style="color: #ff0000;">&quot;.&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		This is a POC for SVN Wrap.
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;local.branch&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;C:\branches\my-branch&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;status&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;Following is the status for this tree.&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;echo</span> <span style="color: #000066;">message</span>=<span style="color: #ff0000;">&quot;output is logged here: status.out&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
	          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;${local.branch}&quot;</span> <span style="color: #000066;">executable</span>=<span style="color: #ff0000;">&quot;ci-svn.bat&quot;</span> <span style="color: #000066;">output</span>=<span style="color: #ff0000;">&quot;status.out&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;arg</span> <span style="color: #000066;">line</span>=<span style="color: #ff0000;">&quot;status&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
          	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/06/30/creating-an-svn-wrap-for-your-build-using-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating the MQQueues with wsadmin scripting &#8211; JACL Part 2</title>
		<link>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/</link>
		<comments>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 12:40:47 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[jacl]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MQ]]></category>
		<category><![CDATA[MQQueue]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=9</guid>
		<description><![CDATA[Yesterday I wrote an article about creating and configuring the MQQueueConnectionFactory with the JACL on the wsadmin console. The other half of the article that was left out was to create the queues also. The world looks pretty much the same today and my /etc/profile doesnt seemed to have been sourced again. Good we dont [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I wrote an article about creating and configuring the MQQueueConnectionFactory with the JACL on the wsadmin console. The other half of the article that was left out was to create the queues also.</p>
<p>The world looks pretty much the same today and my /etc/profile doesnt seemed to have been sourced again. Good we dont need a restart.</p>
<p>You would find some of the steps to be similar and that is because we are running on the same configs.</p>
<p><strong>Step 1.</strong><br />
Identify the Provider for your Queue. By default this is the name for it. If you have created a new provider with a different name then specify it here.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span></pre></div></div>

<p><strong>Step 2.</strong><br />
Now you would need to find the CELL NAME and the NODE NAME of your server<br />
A typical location to my websphere profile’s Node configuration file is as follows<br />
C:\Programs\IBM\Rational\SDP\6.0\runtimes\base_v6\profiles\test_wsp\config\cells\BNode05Cell\nodes\BNode05<br />
The cell name in this location is after \cells\ i.e. BNode05Cell<br />
And the node name is at the end after \nodes\ i.e. BNode05</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> newjmsp <span style="color: black;">&#91;</span><span style="color: #ff3333;">$AdminConfig</span> getid /Cell:CELLNAMECell/Node:NODENAME/JMSProvider:<span style="color: #ff3333;">$tmp1</span>/<span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 3.</strong><br />
You would now need to set the attributes that go into the queue.</p>
<p>To see all the attributes you can simply run the following command</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">$AdminConfig</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>required<span style="color: #000000; font-weight: bold;">|</span>attributes<span style="color: #7a0874; font-weight: bold;">&#93;</span> MQQueue</pre></div></div>

<p>i.e. required or attributes</p>
<p>The attributes that I will be setting in the following commands are<br />
name, jndiName, baseQueueName, targetClient</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name NAME<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/jndiName<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> baseQN <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> baseQueueName BASEQUEUENAME<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> targetclient <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> targetClient MQ<span style="color: black;">&#93;</span></pre></div></div>

<p>You can see in the above example the target client is set to MQ it can be JMS based on your configuration.</p>
<p><strong>Step 4.</strong><br />
Now set all parameters in one string so that they can be passed to the command as one.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> mqqAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$baseQN</span> <span style="color: #ff3333;">$targetclient</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 5.</strong><br />
Now to create the MQQueue use the following command. This will add the Queue to the node and cell mentioned earlier in step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> create MQQueue <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqqAttrs</span></pre></div></div>

<p>Once it is created it is not saved and only stays in the current session. So to save it run the following command. And you should be all set.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

<p>You can alternatively also save this script in a file on your local system. And run it by passing it to the wasadmin. Follwing is a sample command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wsadmin <span style="color: #660033;">-profileName</span> test_wsp <span style="color: #660033;">-f</span> <span style="color: #007800;">$SCRIPT_FILENAME_LOCATION</span>$</pre></div></div>

<p>&#8216;Complete code listing is as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> newjmsp <span style="color: black;">&#91;</span><span style="color: #ff3333;">$AdminConfig</span> getid /Cell:HOSTNAMENode04Cell/Node:HOSTNAMENode04/JMSProvider:<span style="color: #ff3333;">$tmp1</span>/<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name Q.REPLY<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/Q.REPLY<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> baseQN <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> baseQueueName Q.SYSTEM<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> targetclient <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> targetClient MQ<span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> mqqAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$baseQN</span> <span style="color: #ff3333;">$targetclient</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> create MQQueue <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqqAttrs</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/06/25/creating-the-mqqueues-with-wsadmin-scripting-jacl-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Creating the MQQueueConnectionFactory with wsadmin scripting  &#8211; JACL Part 1.</title>
		<link>http://www.shaafshah.com/2008/06/24/websphere-admin-scripting-jacl-part-1/</link>
		<comments>http://www.shaafshah.com/2008/06/24/websphere-admin-scripting-jacl-part-1/#comments</comments>
		<pubDate>Tue, 24 Jun 2008 13:44:31 +0000</pubDate>
		<dc:creator>Shaaf Shah</dc:creator>
				<category><![CDATA[HOWTO]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[System Administration]]></category>
		<category><![CDATA[Administrator]]></category>
		<category><![CDATA[IBM]]></category>
		<category><![CDATA[jacl]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[MQ]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[websphere]]></category>
		<category><![CDATA[wsadmin]]></category>

		<guid isPermaLink="false">http://www.shaafshah.com/?p=8</guid>
		<description><![CDATA[While working my way in some piece of long java code I came across this huge pile of sand that just shattered me off every bit of patience I was left with. The dilemma all of us face every second day. CONFIGURATIONS!! While my sarcastic mind was just saying Congratulations to me instead. And just [...]]]></description>
			<content:encoded><![CDATA[<p>While working my way in some piece of long java code I came across this huge pile of sand that just shattered me off every bit of patience I was left with. The dilemma all of us face every second day. <span style="color: #808080;">CONFIGURATIONS!!</span></p>
<p>While my sarcastic mind was just saying Congratulations to me instead. And just how the &#8211; would you expect me to start configuring now.</p>
<p>So what exactly is my problem? I have a list of MQs, Factories, datasource, providers etc.. that I need to configure. And every time I create a new profile on my RAD (Rational Application Developer) I have to manually goto the Admin console and configure them.</p>
<p>With the very useless bit of linux I am acquainted too I cant live with clicks at least while programming.</p>
<p>As I am working with websphere and its a biggy in all those names I thought the guys would be smart and would at least have something in the box for *people like me. Well guess what I was right.</p>
<p>IBM has provided two languages for scripting.</p>
<p>1. JACL<br />
2. Jython</p>
<p>If I am not wrong JACL will be deprecated out in future releases and Jython would be the tool for our scripting bit. <a title="[ Link Here ]" href="http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rmig_deprecationlist.html">[ Link here ]</a></p>
<p>In this article I will just go briefly with JACL and move to Jython in the next version where we will be able to configure the data sources in the websphere.</p>
<p>So what exactly is JACL. or pronounced as &#8220;JACKAL&#8221;</p>
<p>Jacl, Java Command Language, is much like/version of the Tcl scripting language for the Java. It runs on the JVM much like we hear about JRuby and the interpreter is written completely in Java.</p>
<p>For more details on the language itself you could go <a title="[ Here ]" href="http://publib.boulder.ibm.com/infocenter/imshelp1/v3r0/index.jsp?topic=/com.ibm.sif.doc/jaclabout.html">[ here ]</a></p>
<p>Lets get down to business: <strong>How to create a Webspehere MQ Connection Factory with wsamdin using JACL.</strong><br />
You would already have some of the details of the queues but some you will need to extract.</p>
<p><strong>Step 1.<br />
</strong>Identify the Provider for your Factory. By default this is the name for it. If you have created a new provider with a different name then specify it here.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span></pre></div></div>

<p><strong>Step 2.</strong><br />
Now you would need to find the CELL NAME and the NODE NAME of your server<br />
A typical location to my websphere profile&#8217;s Node configuration file is as follows<br />
C:\Programs\IBM\Rational\SDP\6.0\runtimes\base_v6\profiles\test_wsp\config\cells\BNode05Cell\nodes\BNode05<br />
The cell name in this location is after \cells\ i.e. BNode05Cell<br />
And the node name is at the end after \nodes\ i.e. BNode05</p>
<p>set newjmsp [$AdminConfig getid /Cell:CELLNAMECell/Node:NODENAME/JMSProvider:$tmp1/]</p>
<p><strong>Step 3.</strong><br />
Now you need to specify the Factories properties.</p>
<p>The properties I plan to setup are as follows.<br />
Name, jndiName,QueueManager, sname, port, channel, ttype, xaenabled</p>
<p>To check what are the required parameters for the Factory you can run the following command on the wsadmin console.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> required WASQueueConnectionFactory</pre></div></div>

<p>Example output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wsadmin <span style="color: #007800;">$AdminConfig</span> required WASQueueConnectionFactory
Attribute                       Type
name                            String
jndiName                        String</pre></div></div>

<p><strong>Where will I find the wsadmin?</strong><br />
It is typically placed in the bin directory of your server.<br />
In my case its lying in my RAD installation directory as<br />
../Rational/SDP/6.0/runtimes/base_v6/bin</p>
<p>To invoke the wasadmin, just open your terminal and move to the bin dir where you can simply call it by typing wsadmin.  By doing so you would be invoking the default profile. if you want to specify the profile then use the switch -profileName YOURPROFILENAME</p>
<p>To see the all parameters required and optional write the following command on the console.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> attributes WASQueueConnectionFactory</pre></div></div>

<p>Example output:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wsadmin <span style="color: #007800;">$AdminConfig</span> attributes WASQueueConnectionFactory
<span style="color: #ff0000;">&quot;XAEnabled boolean&quot;</span>
<span style="color: #ff0000;">&quot;authDataAlias String&quot;</span>
<span style="color: #ff0000;">&quot;authMechanismPreference ENUM(BASIC_PASSWORD, KERBEROS)&quot;</span>
<span style="color: #ff0000;">&quot;category String&quot;</span>
<span style="color: #ff0000;">&quot;connectionPool ConnectionPool&quot;</span>
<span style="color: #ff0000;">&quot;description String&quot;</span>
<span style="color: #ff0000;">&quot;jndiName String&quot;</span>
<span style="color: #ff0000;">&quot;logMissingTransactionContext boolean&quot;</span>
<span style="color: #ff0000;">&quot;manageCachedHandles boolean&quot;</span>
<span style="color: #ff0000;">&quot;mapping MappingModule&quot;</span>
<span style="color: #ff0000;">&quot;name String&quot;</span>
<span style="color: #ff0000;">&quot;node String&quot;</span>
<span style="color: #ff0000;">&quot;preTestConfig ConnectionTest&quot;</span>
<span style="color: #ff0000;">&quot;propertySet J2EEResourcePropertySet&quot;</span>
<span style="color: #ff0000;">&quot;provider J2EEResourceProvider@&quot;</span>
<span style="color: #ff0000;">&quot;providerType String&quot;</span>
<span style="color: #ff0000;">&quot;serverName String&quot;</span>
<span style="color: #ff0000;">&quot;sessionPool ConnectionPool&quot;</span>
<span style="color: #ff0000;">&quot;xaRecoveryAuthAlias String&quot;</span></pre></div></div>

<p>I have added some extra optional parameters for those of us who are using extra options.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name NAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/JNDINAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> qManager <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> queueManager QMANAGER<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> sname <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> host HOSTNAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> port <span style="color: #ff4500;">1414</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> channel <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> channel CHANNEL<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ttype <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> transportType CLIENT<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> xa <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> XAEnabled True|false<span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 4.</strong><br />
Now set all parameters in one string so that they can be passed to the command as one.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> mqcfAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$qManager</span> <span style="color: #ff3333;">$sname</span> <span style="color: #ff3333;">$port</span> <span style="color: #ff3333;">$channel</span> <span style="color: #ff3333;">$ttype</span> <span style="color: #ff3333;">$xa</span><span style="color: black;">&#93;</span></pre></div></div>

<p><strong>Step 5.</strong><br />
Now to create the Factory use the following command. This will add the factory to the node and cell mentioned earlier in step 2.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> create MQQueueConnectionFactory <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqcfAttrs</span></pre></div></div>

<p>Once it is created it is not saved and only stays in the current session. So to save it run the following command. And you should be all set.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

<p>You can alternatively also save this script in a file on your local system. And run it by passing it to the wasadmin. Follwing is a sample command.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">wsadmin <span style="color: #660033;">-profileName</span> test_wsp <span style="color: #660033;">-f</span> <span style="color: #007800;">$SCRIPT_FILENAME_LOCATION</span>$</pre></div></div>

<p>Complete code listing is as follows.</p>

<div class="wp_syntax"><div class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">set</span> tmp1 <span style="color: #483d8b;">&quot;WebSphere MQ JMS Provider&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> newjmsp <span style="color: black;">&#91;</span><span style="color: #ff3333;">$AdminConfig</span> getid /Cell:CELLNAMECell/Node:NODENAME/JMSProvider:<span style="color: #ff3333;">$tmp1</span>/<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> name <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> name NAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> jndi <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> jndiName jms/JNDINAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> qManager <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> queueManager QMANAGER<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> sname <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> host HOSTNAME<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> port <span style="color: #ff4500;">1414</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> channel <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> channel CHANNEL<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ttype <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> transportType CLIENT<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> xa <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> XAEnabled false<span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> mqcfAttrs <span style="color: black;">&#91;</span><span style="color: #008000;">list</span> <span style="color: #ff3333;">$name</span> <span style="color: #ff3333;">$jndi</span> <span style="color: #ff3333;">$qManager</span> <span style="color: #ff3333;">$sname</span> <span style="color: #ff3333;">$port</span> <span style="color: #ff3333;">$channel</span> <span style="color: #ff3333;">$ttype</span> <span style="color: #ff3333;">$xa</span><span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> create MQQueueConnectionFactory <span style="color: #ff3333;">$newjmsp</span> <span style="color: #ff3333;">$mqcfAttrs</span>
&nbsp;
<span style="color: #ff3333;">$AdminConfig</span> save</pre></div></div>

<p><strong>More Resources:</strong></p>
<p>[http://publib.boulder.ibm.com/infocenter/wasinfo/v6r1/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/rmig_deprecationlist.html]</p>
<p>[http://publib.boulder.ibm.com/infocenter/imshelp1/v3r0/index.jsp?topic=/com.ibm.sif.doc/jaclabout.html]</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.shaafshah.com/2008/06/24/websphere-admin-scripting-jacl-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
