<?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>Pete&#039;s Wordshop</title>
	<atom:link href="http://www.petesworkshop.com/blog_wp/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.petesworkshop.com/blog_wp</link>
	<description>Musings, rants on open source and IBM i - The WordPress Version</description>
	<lastBuildDate>Tue, 08 May 2012 17:42:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>More (ir)-Rationality</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=127</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=127#comments</comments>
		<pubDate>Fri, 13 Apr 2012 17:30:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=127</guid>
		<description><![CDATA[I love Rational tools but as I mentioned to my IBM sales representative &#8220;I am beginning to suspect that the Rational Marketing team has never left the 60&#8242;s and is still &#8220;tripping&#8221; when they decide to put their pricing together.  That or they took their sales class from PT Barnum (&#8220;There&#8217;s a sucker born every [...]]]></description>
			<content:encoded><![CDATA[<p>I love Rational tools but as I mentioned to my IBM sales representative &#8220;I am beginning to suspect that the Rational Marketing team has never left the 60&#8242;s and is still &#8220;tripping&#8221; when they decide to put their pricing together.  That or they took their sales class from PT Barnum (&#8220;There&#8217;s a sucker born every minute&#8230;&#8221;). &#8220;  The source of the pain here is that as a developer enrolled in IBM&#8217;s wonderful (and it IS wonderful) developer discount program, I had two primary complaints:</p>
<p>1) You receive no notification of expiring Software Maintenance Agreements (SWMA)</p>
<p>2) Trying to sort out what the final costs will be based on the various discounts and product ID&#8217;s is nothing short of alchemy&#8230;.</p>
<p>#1, I am happy to say, has been &#8220;fixed&#8221;.  I did receive notification that my SWMA was expiring. But every year is an adventure and this year was no exception! The IBM OS and licensed programs are very simple, I never have a problem with them.  But when it comes to the Rational products, you can never really know how the pricing will come out.  Fortunately, I only have ONE Rational product &#8211; RDP (it has been through many naming conventions: WDSc, WDSCi, RDi, RDP and if I can believe what my IBM sales rep says, it is now RDG) but the constant name game leads to confusion every year as to *what* exactly, needs software support.  This year I was finally able to narrow it down to my two licenses of RDG.  &#8220;Send me the quote&#8221; I said!</p>
<p>What I received first surprised and then confused me.  The quote I *thought* I would receive was $548 for *both* my licenses. You have to remember that this is a developer *discount* program and everything on the i IS heavily discounted.  Everything BUT the Rational tools.  The cost of the OS (nada).  The cost of the supporting OS products, nada!  Cost of the Rational tools? 131% of list!  Yeah, you read that correctly.  For a developer &#8216;discount&#8217; program the actual tools cost you MORE than if you purchased them retail.  Tis the &#8220;Smarter Planet&#8221; at work at IBM!  I am just hoping that Microsoft (which *discounts* it&#8217;s tools) doesn&#8217;t catch wind of this cash cow approachfor IBM&#8230;..</p>
<p>My SWMA on *each* copy of RDG is $548.  My cost if I buy a license with 1 year of support from IBM &#8220;retail&#8221;: $416.00  You would *think* that a developer discount would produce a *lower* cost for the developer.  Gee, I wonder why RPG developers *don&#8217;t* move to use Rational tooling?  Hmmm, could it be the (ir)-Rational pricing?</p>
<p>Just once I would love to be surprised in a happy way by Rational pricing.  Developers should get a discount when there is a &#8216;developer discount&#8217; offering don&#8217;t you think?  Apparently the Rational division thinks not&#8230;..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=127</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile application development and IBM i (Part four) &#8211; Mobilize me!</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=120</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=120#comments</comments>
		<pubDate>Wed, 08 Feb 2012 04:19:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[IBM i]]></category>
		<category><![CDATA[Mobile development]]></category>
		<category><![CDATA[PhoneGap]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[RPG ILE]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=120</guid>
		<description><![CDATA[So we have this great little 5250 application which is now just an ugly web application.  Truth is, this thing is so lightweight that as a web application, it is pretty snappy.  But, not ALL applications are going to be this light weight and unless your standards are as low as mine when it comes [...]]]></description>
			<content:encoded><![CDATA[<p>So we have this great little 5250 application which is now just an ugly web application.  Truth is, this thing is so lightweight that as a web application, it is pretty snappy.  But, not ALL applications are going to be this light weight and unless your standards are as low as mine when it comes to GUI, you&#8217;ll want to make this a *little* prettier.  Here is where we are, so far:  http://opensourceoni.com/mobilerem/cgi_punch.pgm</p>
<p>The great news is that with CSS3 and HTML5 the road from ugly to beautiful is short and sweet.  We just need to add a bit of css and perhaps a javascript library to improve things.  But there is some redesign needed as well, especially since we are now going to add some more heft to the size of the application.  Our original design had two separate CGI programs which basically presented the two screens of information.  In each case a page is constructed at the server end and sent back to the browser to be rendered.  Not a great design since a large portion of the page really doesn&#8217;t change.  And imagine if we had headers, footers and graphics on the page as well.  All that back and forth can eat bandwidth and breaks our &#8220;good citizen&#8221; rule.  So we need a new approach.</p>
<p>First, we are going to change from multiple pages to a single page.  In jQuery mobile, the &#8220;trick&#8221; that is used is to define a div and treat it as if it were a page.  With jQuery, jQuery mobile and the css added to the file, we can start to redesign the page like so:</p>
<p>&lt;body&gt;</p>
<p>&lt;div data-role=&#8221;page&#8221; id=&#8221;main&#8221; data-theme=&#8221;b&#8221; &gt;</p>
<p>&lt;div&gt;</p>
<p>&lt;div data-role=&#8221;page&#8221; id=&#8221;punches&#8221; data-theme=&#8221;b&#8221; &gt;</p>
<p>&lt;/div&gt;</p>
<p>&lt;/body&gt;</p>
<p>That creates two &#8220;pages&#8221; for jQuery mobile to work with.  The library takes care of the heavy lifting of showing and hiding the pages as we &#8220;page&#8221; back and forth.  Make sense?</p>
<p>For the &#8220;main&#8221; page, the first page we see that has the last punch and current time and date information as well as the buttons, there really isn&#8217;t all that much difference between the &#8220;classic&#8221; CGI page and our mobile page.  We have a table with our information formatted into it.  The &#8220;punches&#8221; page, where we list the information on the punches returned from the server, hasn&#8217;t changed all that much either except on both pages the /% %/ variable delimiters are gone because we are not making the round trip to the server so our CGI program no longer has to dump the information into the variables.  So how, you ask, are we going to get data into the HTML forms?  Ah! For that we use the magic of AJAX, JSON and the jQuery libraries.</p>
<p><strong>AJAX</strong></p>
<p>AJAX is the easiest part to understand.  All AJAX does is send a small bit of data to the server (think of it as a miniscule web page) which the server reads and executes.  That execution may return data, or it may not (usually does).  The server packages up the data and sends it back to the AJAX requestor. At that point, the function that called the AJAX deals with the response.</p>
<p><strong>JSON</strong></p>
<p>The second piece, JSON, is a little harder to understand.  Basically, JSON is just a string of data in a particular format.  Basically the format is this:  { &#8220;name&#8221;:value}.  Deceptively simple but very powerful because if you know anything about JavaScript you know that looks very similar to an object definition in JavaScript.  So, as an example, if we wanted to create an object called Person and add some attributes to it you would do it something like this:</p>
<p>personObj=new Object();<br />
personObj.firstname=&#8221;John&#8221;;<br />
personObj.lastname=&#8221;Doe&#8221;;<br />
personObj.age=50;<br />
personObj.eyecolor=&#8221;blue&#8221;;</p>
<p>But we could also do it like this:<br />
personObj={firstname:&#8221;John&#8221;,lastname:&#8221;Doe&#8221;,age:50,eyecolor:&#8221;blue&#8221;};</p>
<p>And when we needed to get values from the object we would do it like so:</p>
<p>var first = personObj.firstname;</p>
<p>It shouldn&#8217;t take much of your brain&#8217;s CPU cycles to think: Hey, wait a minute!  If I had a string formatted like so on the server: &#8216;{firstname:&#8221;John&#8221;,lastname:&#8221;Doe&#8221;,age:50,eyecolor:&#8221;blue&#8221;}&#8217; and I returned that string to my web page with an AJAX call,  I can create objects of data on the client without much effort!  Pseudocode would be something like:<br />
var personObj = getJsonFromAjax();  Nice!  That is EXACTLY what we will do with a little help from jQuery.</p>
<p><strong>jQuery</strong></p>
<p>If we want to start hooking some of this stuff up, let&#8217;s begin by assuming that we have returned a JSON formatted string to our client application.  jQuery pretty much handles all of the heavy lifting:</p>
<p>jsonURL =  &#8216;cgi_mobile.pgm?action=getList&#8217;;  // URL that calls our CGI program on the server</p>
<p>$.ajax({<br />
url: jsonURL,<br />
async: false,<br />
cache: false,<br />
success: function(data){</p>
<p>try<br />
{<br />
jsonContent = $.parseJSON(data);<br />
}<br />
catch(err)<br />
{<br />
alert(&#8216;(JSON exception)&#8217;);<br />
return false;<br />
}<br />
}</p>
<p>This code snippet would call the cgi_mobile.pgm and pass the action &#8216;getList&#8217; and then the program would return that list in a JSON formatted string which is parsed back to an object using the $.parseJSON function in jQuery.  You can take a look at the program source but basically the CGI program simply formats the data using a &#8216;json&#8217; template and sends back the result which is a JSON string.  It does it EXACTLY the way it would take an HTML template and send back HTML.  You can take a look at the jsonlist.json template but there isn&#8217;t anything new except it formats the data as a JSON string.</p>
<p>That string is actually an array of JSON objects (because that is the way I formatted it!) so now I have an array of objects and those objects are &#8220;punches&#8221;.  It looks like this:</p>
<p>[ { "lastPunch": "IN", "punchDate": "12/30/11", "punchTime":"07:40:38" } ,{ "lastPunch": "IN", "punchDate": "12/30/11", "punchTime":"08:07:43"}]  In fact, you can see the &#8220;raw&#8221; data just by calling that action in your browser:</p>
<p>http://opensourceoni.com/mobilerem/cgi_mobile.pgm?action=getList</p>
<p>Nothing special.  AND since we now have an object we can iterate through and format our table on the client side with a little bit of javascript:</p>
<p>for(var i =0;i&lt;jsonContent.length;i++)<br />
{<br />
var rec = jsonContent[i];<br />
html = html + &#8216;&lt;tr&gt;&lt;td&gt;&lt;input type=text name=lastPunch id=lastPunch value=&#8217;+rec.lastPunch+&#8217; readonly&gt;&lt;/td&gt;&#8217;<br />
html = html + &#8216;&lt;td&gt;&lt;input type=text name=punchDate id=punchDate value=&#8217;+rec.punchDate+&#8217; readonly&gt;&lt;/td&gt;&#8217;<br />
html = html + &#8216;&lt;td&gt;&lt;input type=text name=punchTime id=punchTime id=punchTime value=&#8217;+rec.punchTime+&#8217; readonly&gt;&lt;/td&gt;&lt;/tr&gt;&#8217;</p>
<p>}</p>
<p>Once we have that HTML constructed, jQuery just let&#8217;s us stuff the html into the empty body of the table in our &#8220;punches&#8221; &#8220;page&#8221;:</p>
<p>$(&#8220;#punchList tbody&#8221;).html(html);</p>
<p>And then we change the &#8220;page&#8221; (basically hiding the div we are on and showing the div named &#8220;punches&#8221;)<br />
$.mobile.changePage(&#8220;#punches&#8221;,&#8217;slide&#8217;,false,true);</p>
<p>Not a whole lot of magic here.  Just taking advantage of the capabilities of AJAX, JSON, and jQuery.</p>
<p>Believe it or not, the hard part is done.  We can easily take this mobile web application and turn it into a mobile &#8220;native&#8221; application using PhoneGap.  But, that will have to wait until next week (or so).  Remember that you can get this code right <a title="Mobile Application Development Code (V6R1)" href="http://www.petesworkshop.com/downloads/mobilerem.zip">here</a>.</p>
<p>OH!  I missed giving you a link to the actual web application.  You will find that here: http://opensourceoni.com/mobilerem/cgi_mobile.pgm</p>
<p>Have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=120</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile application development and IBM i (Part three) &#8211; To the web!</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=112</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=112#comments</comments>
		<pubDate>Sat, 31 Dec 2011 20:40:23 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=112</guid>
		<description><![CDATA[So a lengthy delay in getting to the &#8220;webby&#8221; part of this post due to the holiday distractions.  This new post should, however, get you going again and get the creative juices going. When last we met I walked through the &#8220;green screen&#8221; version of the &#8220;timeclock&#8221; app.  This would actually make a fairly poor [...]]]></description>
			<content:encoded><![CDATA[<p>So a lengthy delay in getting to the &#8220;webby&#8221; part of this post due to the holiday distractions.  This new post should, however, get you going again and get the creative juices going.</p>
<p>When last we met I walked through the &#8220;green screen&#8221; version of the &#8220;timeclock&#8221; app.  This would actually make a fairly poor mobile application unless you have a 5250 client for your mobile phone (such things do exists!).  But when it comes to mobile applications, either a native application or a web application is the way to go so we&#8217;ll start down the initial path of a web application which will eventually end up as a mobile native application.</p>
<p>We are still keeping it simple so you can get the basics under your belt.  So, a quick review.  The basic &#8220;cycle&#8221; of our RPG application (which doesn&#8217;t use &#8216;the cycle&#8217;) is this:</p>
<ol>
<li>When we enter the program we set some &#8216;global&#8217; variables that we will use in the program.  Some of them are just initial variables like the &#8216;punchdate&#8217;, &#8216;punchtime&#8217;, the day of the week and initial indicators.  We also call a procedure to get the last punch of the employee (which is always employee &#8217;55&#8242;).</li>
<li>We then enter a loop that set&#8217;s a couple of indicators and then displays the 5250 screen (EXFMT) and then the program waits for a key event to continue processing. The code below the EXFMT is executed when the button for &#8220;Punch IN&#8221;, &#8216;Punch OUT&#8221; or exit is clicked (or alternatively when F6,F7 0r F3 are pressed).</li>
<li>The procedure &#8220;Punch&#8221; does the heavily lifting.  All of this should be easily (!) discernible from the code if I have done my programming job right.</li>
</ol>
<p>Again the reason for the sub procedures, which we could have coded more procedurally, is so that we could reuse them when we convert the 5250 program into a CGI web program with CGIDEV2. In our 5250 program we have 25 lines of operable code.  In our CGIDEV2 equivalent web program we have 26 lines, so our coding remains pretty much the same. The big difference? Note the missing DOU loop?  How can this work?  In our 5250 app the program loads and remains running until the exit key is pressed.  In our CGIDEV2 program, the web server calls and executes our RPG program but the program does not continue to run.  It is simply called again if the page is requested again. Web programming is essentially stateless.  It doesn&#8217;t retain a &#8220;context&#8221; between calls.  A user in China could access the page and another user in the states could access the page and the program is really clueless about the two locations.  As HTTP server technologies grew and pages became interactive then state was built into the process using a host of approaches, most commonly using and storing session information to track the users connection to the server.  5250 doesn&#8217;t suffer from this design so preserving state isn&#8217;t an issue in a 5250 program but it is an issue in Web development and although we won&#8217;t jump into the approaches it explains the unusual design of our CGI program.  It runs, it&#8217;s done.</p>
<p>So looking at the differences in the code. Let&#8217;s start with the &#8220;screen design&#8221; which in this case is bare bones HTML (well *almost* bare bones).  Lets start with the most important components (look at BASIC.HTML in source file HOSTHTML).  Take time to check out the w3schools.com website to understand the basic HTML directives if you are unfamiliar with them.  I don&#8217;t plan to dwell deeply on the HTML:</p>
<ul>
<li>/$thepage &#8211; this directive gives a name to the section the CGIDEV2 will read and write to the HTTP server.  This is PURELY a CGIDEV2 directive.  PHP, the FreeMarker and Velocity frameworks and a host of other templating frameworks use different conventions for their directives but in this case CGIDEV2 uses this to denote the start of a &#8216;section&#8217;.</li>
<li>/%lastPunch%/, /%punchDate%/,/%doweek%/,/%punchTime%/  &#8211; These are all &#8216;placeholders&#8217; in the HTML that will be replaced with data when the form is processed by the RPG CGIDEV2 program. Think of them as the field definitions in your DSPF.  The replacement is handled very automagically for you in 5250 programming.  In CGIDEV2 you need to be a bit more explicit.</li>
<li>The rest of the form has standard HTML.  You&#8217;ll notice a &#8220;hidden&#8221; field in the form called PB2.  We&#8217;ll use that to store which button was pushed, much like we did in the 5250 program (for comparison sake). We are writing out a table in the HTML using the &lt;table&gt; tags along with &lt;tr&gt; (table row) and &lt;td&gt; (table division &#8211; think column).  We draw a couple of buttons with the &lt;input type=button&gt; tags and we call some javascript (within the &lt;script&gt; tags near the top of the HTML) to process the button click events.</li>
</ul>
<p>Examining the RPG (CGIDEV2) code (CGI_PUNCH.SQLRPGLE).  We have added some infrastructure for CGIDEV2 (all of the copy statements) and you&#8217;ll need all of them particularly don&#8217;t forget the prolog3 copybook (don&#8217;t ask me why I mention it&#8230;.).  Outside the inclusion of some additional variables and copybooks, it looks pretty similar to our original.  With the following changes:</p>
<ul>
<li>PunchBtn = %trim(zhbgetvar(&#8216;PB2&#8242;)); &#8211; Remember that hidden text field? It is updated by the javascript on our HTML form but then read here in the program using the CGIDEV2 procedure zhbgetvar which basically pulls it from the HTML that was read in.</li>
<li>gethtml(&#8216;HOSTSHTML&#8217;:'MOBILEREM&#8217;:'BASIC&#8217;); &#8211; Grabs the HTML for our page so we can write new data to it before it is sent back to the browser.</li>
<li>getLastPunch(employee); We run this procedure here because the &#8220;punch&#8221; procedures above could have just recorded a punch so we want to retrieve those values before we write them back to the page.</li>
<li>updhtmlvar(&#8216;lastPunch&#8217;:lastPunch); All of the updhtmlvar calls write the data to the retrieved HTML page into the replacement fields we have identified.  The /%lastPunch%/ directive in the HTML will be replaced with the data in the lastPunch variable found in our RPG.  There is no need to name these the same.  The value on the left (&#8216;lastPunch&#8217;) is replaced by the contents on the right (host variable :lastPunch) simple as that. Note that we ALSO update the hidden field PB2 with a &#8217;0&#8242; so that our &#8216;button state&#8217; is reset.</li>
<li>wrtsection(&#8216;thepage&#8217;); Actually in this first iteration we have only one &#8220;section&#8221; which is the whole page.  wrtsection writes data to the server.</li>
<li>exit &#8211; just a cleanup routine that tells the server than we are done writing data.  It is flushed out to the browser at this point.</li>
</ul>
<p>So that is basically it.  A web based app which *could* be called from a mobile device browser if you wanted to. It is pretty lightweight so it should be fairly performant.  In the first post on this subject, I talked about being a good citizen when it comes to data transfer &#8211; move as little data as possible.  We can improve this data movement and we will explore those options when we make this app much more mobile friendly.</p>
<p>What does this look like.  Well, like our 5250 app, it ain&#8217;t much to look at:</p>
<p><img class="alignleft" title="Timecard Punch page" src="http://www.petesworkshop.com/images/cgi_punch.jpg" alt="" width="336" height="311" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Missing is the &#8220;Exit&#8221; button.  Simply close the browser window to exit!  You&#8217;ll notice I added a small feature improvement in the web version of our timeclock you can now list the punches that have been recorded.  Not much of a feature improvement but, one step at a time!  Here is what that page looks like:</p>
<p><img class="alignnone" title="Timecard punch listing" src="http://www.petesworkshop.com/images/cgi_p_list.jpg" alt="" width="334" height="309" /></p>
<p>&nbsp;</p>
<p>You can check out the code which you can download from <a title="Mobile Application Development Code (V6R1)" href="http://www.petesworkshop.com/downloads/mobilerem.zip" target="_blank">here</a>: The code is compiled for V6R1 (IBM i 6.1).  I&#8217;ll try to get it recompiled *PRV so it will be happy about a download for V5RM0.</p>
<p>The next step is to use HTML5 to dress up the web pages, add a little JSON and Ajax and make this a bit more mobile friendly!  Coming soon!  Happy New Year!</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=112</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile application development and IBM i (part Deux)</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=102</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=102#comments</comments>
		<pubDate>Mon, 21 Nov 2011 18:23:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=102</guid>
		<description><![CDATA[Running a little later on this second post because I had to write a 5250 green screen version of our timeclock punch program.  Like most new things I do, I try to actually learn something new when I go forward with a new project.  ALWAYS!  So there is rarely any same ol, same ol when [...]]]></description>
			<content:encoded><![CDATA[<p>Running a little later on this second post because I had to write a 5250 green screen version of our timeclock punch program.  Like most new things I do, I try to actually learn something new when I go forward with a new project.  ALWAYS!  So there is rarely any same ol, same ol when I write code.  If you are writing the same code over and over for every application you create you are just a programmer.  If you try a new approach or a new language feature every time you write an application then you are a developer.  If you try new approaches and new language features and wholly new languages every time you develop an application, well, you are a nutcase like I am.  But I thrive on new stuff so&#8230;..</p>
<p>OK!  So here is what the application does:</p>
<p>When you run the app you see a screen with a Punch In, Punch Out, and Exit button (Using MOUBTN was the &#8220;new&#8221; thing for me).  The screen displays the time, the date and the last punch on the clock.  If you click on the &#8216;Punch IN&#8217; button OR Press F6, an IN punch is recorded and the program exits.  If you click on the &#8216;Punch OUT&#8217; button OR press F7, an OUT punch is recorded and the program exits.  If you click on the &#8216;Exit&#8217; button OR press F3, the program exits.</p>
<p>The application screen looks like this:</p>
<p><img class="alignnone" title="Punch Clock" src="http://www.petesworkshop.com/images/punchclock.jpg" alt="" width="725" height="272" /></p>
<p>MOUBTN may not be supported on your 5250 emulator and that is why I include the function keys as well.  Also, you may say, &#8220;Where is the security here? Anyone who can run the program can punch in as employee 55&#8243;! Yep. You didn&#8217;t think I was going to do ALL the work for you did you?  Besides that is a trivial plumbing job and would have to be adapted to your employee master file anyway.</p>
<p>So, where is the code?  You can download the zip that contains the save file <a title="Punch save file" href="http://www.petesworkshop.com/downloads/punch.zip">here</a>:</p>
<p>The source is included in the save file and it was saved at V5R4M0 ( I am running 6.1 and 7.1 in two partitions).  The text version of the program source can be found <a title="Punch program source" href="http://www.petesworkshop.com/Projects/Mobile_Punch/PunchPGM.txt" target="_blank">here</a> and the text version of the DDS can be found<a href="http://www.petesworkshop.com/Projects/Mobile_Punch/PunchDDS.txt" target="_blank"> here</a>. It ain&#8217;t the prettiest code but the FBU  (functional but ugly) approach always works for me.</p>
<p>Go ahead and run the program a few times to get the gist of it.  It&#8217;s pretty simple and I plan to follow the KISS pattern for the remaining steps that take that 5250 stuff to the web and then mobile web world.</p>
<p>So you are still chomping at the bit to write some Mobile app code?  Ok, Ok, I hear you. The next installment will be a web version of our 5250 Punch Clock program and from then on it just gets easier and easier&#8230;.(honest).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=102</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mobile application development and IBM i (part 1)</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=100</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=100#comments</comments>
		<pubDate>Mon, 07 Nov 2011 20:42:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=100</guid>
		<description><![CDATA[This is part one of a XX part series on mobile application development for IBM i.  I say XX since I really have no idea of how many parts it will take to make it whole. I&#8217;ll just keep going until you say &#8220;STOP!&#8221;. Notice I didn&#8217;t set the title to be Mobile application development [...]]]></description>
			<content:encoded><![CDATA[<p>This is part one of a XX part series on mobile application development for IBM i.  I say XX since I really have no idea of how many parts it will take to make it whole. I&#8217;ll just keep going until you say &#8220;STOP!&#8221;.</p>
<p>Notice I didn&#8217;t set the title to be Mobile application development ON IBM i because the i isn&#8217;t a mobile device (yet&#8230;someday the Power chip will power a mobile device&#8230;).  Where the i comes into play of course is in application *serving* and it serves that purpose well.  We will eventually take a look at a CGIDEV2 application, a PHP application, and a Java application. Actually, *just* the IBM i HTTP server could do the job in the simplest of cases.  In other words, any application server language supported by the i could be used which includes Rails and Grails (Ruby and Groovy) and if I can come up with an application that I could write for each language and framework, I will.  Actually, the *server* side of the equation is the easiet to solve because my experience is that the world of mobile application development revolves around HTML5 and Javascript on the client. The server, well, it just serves the application (DUH!).</p>
<p>So let me flesh that out a bit.  I would guess that perhaps 90% of mobile applications that would come out of an IBM i shop would be scaled down versions of the 5250 and web applications that an i would typically be serving.  Of course the 5250 app would be written in RPG (ILE RPG) and would be a &#8216;classic&#8217; green screen application.  If the shop was delivering web applications to it&#8217;s users, then I would again guess that PHP and CGIDEV2 (RPG) would be right up there at the top of the list with Java further down. EGL would probably make a showing on the list and  there would also be a smattering of 5250 modernization applications with a single digit presence like web facing, Look Software, and a host of others (again I am GUESSING so no flames for getting it wrong).  Of the remaining 10% of mobile applications, there might be another 5% that have no 5250/web analog on i because it truly needs to run on a mobile OS (e.g. uses geolocation and/or accelerometer or other function) and the remaining 5% need some &#8220;from scratch&#8221; in a native language development for some other reason (iPhone, iPad, iDontCare&#8230;etc).  So, if you are in the 90% listed above, that is, a shop that needs a mobile web application presence, then I think I&#8217;ll be able to help you along.</p>
<p>We still have some legwork to do.  Depending upon the design of the 5250 application and/or the web application that is served on IBM i, the question is, how well designed is the current application?  If it is an RPG app, is it modular with a clear separation of UI, business logic and database I/O?  If not, you will probably want to skip from RPG directly to something like PHP because there won&#8217;t be much in  your code that can be leveraged for your mobile web application.  If it IS modular, well designed code, you can probably take it from the 5250 world into the web world using something like CGIDEV2.  With CGIDEV2 you&#8217;ll still be writing your code in RPG and you can use existing modules to handle some of the functionality. The alternative to CGIDEV2 would be PHP (which is NOT an RPG derivative) because rumor has it PHP is an easier jump for RPG programmers.  I went from RPG to Java with nary a hiccup so there is no one size fits all RPG to ??? language transition.  I also code in PHP and in Ruby as well.  EGL is cool and has greatly matured over the last couple of years.  But, in any case, I&#8217;ll try to give you analogs in as many different languages as I can.  Certainly one will work for you.</p>
<p>One thing you WILL have to learn is HTML5 and Javascript.  On the client side of the equation (the mobile device side) you really can&#8217;t avoid learning HTML5 and Javascript.  You can do VERY cool things with these tools and you will soon see the value of investing some time in learning them.  For mobile web applications that are NOT going to use a mobile device&#8217;s capabilities like geolocation, accelerometer, etc you can pretty much write, test and deploy using the browser on your PC or laptop with the caveat that you will have very little real estate to play with when you deploy to the mobile device.  But what I like about mobile *web* application development is that it doesn&#8217;t take a special IDE to design the application interface, you could do it with a text editor on your PC.</p>
<p>OK! I hope that is enough to wet your appetite.  In the next installment (weekly or better) I&#8217;ll take you through some design considerations that should help shape your mobile web application design.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=100</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Glassfish on IBM i</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=98</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=98#comments</comments>
		<pubDate>Tue, 01 Nov 2011 18:09:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=98</guid>
		<description><![CDATA[I am a *little* biased in that I think  IBM i on Power is the greatest server platform on the planet but you really can&#8217;t blame me since it seems that it can run just about any app you can throw at it (well, any non-Windows based app). Over a year ago I had attempted [...]]]></description>
			<content:encoded><![CDATA[<p>I am a *little* biased in that I think  IBM i on Power is the greatest server platform on the planet but you really can&#8217;t blame me since it seems that it can run just about any app you can throw at it (well, any non-Windows based app). Over a year ago I had attempted to get Glassfish running on i because I had heard good things about it and wanted to give it a whirl.  It actually started with a Ruby CMS application called Radiant that I wanted to run to demonstrate that yes, Ruby can run on i.  This particular implementation suggested Glassfish as the web server.  First I tried a full blown copy of Glassfish (3.0.1) but got a couple of very strange errors that seemed related to the IBM J9 JVM and after running them down with marginal success, I decided to install the Glassfish gem, which, surprisingly, ran just fine on i.  I documented the issues to both Oracle and IBM and moved on. (BTW you can check out the Ruby on IBM i site <a title="Ruby on IBM i" href="http://www.roroni.com" target="_blank">here</a>)</p>
<p>The primary issue with the full Glassfish implementation was that the Admin console wouldn&#8217;t display and it was definitely due to the J9 JVM. The actual server would run fine.  You could auto-deploy and run servlets and other apps but you couldn&#8217;t manage them.  One of things I liked about Glassfish was the administration console, so not having a console made using Glassfish a non-starter for me.</p>
<p>What a difference a year or so makes.  Oracle released Glassfish 3.1.1 and that seems to have solved the Admin console issue for me.  There is still one open issue now, but there is a workaround, so using Glassfish in production on IBM i is now a reality.  Here is all you need to do:</p>
<p>I downloaded the aix zip version of Glassfish 3.1.1 and just expanded it to the IFS.  I made some changes to the domain.xml file to point to the correct IP and ports I needed and I removed references to the -server and -client java directives (they had given me trouble before, so I<br />
commented them out).  I changed the MaxPermSize as well ( -XX:MaxPermSize=384m ).  That was about it.  I am running Java 6, 32bit<br />
and I am pretty current on Group PTF&#8217;s.</p>
<p>I came across one additional issue when running Liferay on Glassfish on IBM i: There was a java.lang.NoSuchMethodException: com.ibm.lang.management.OperatingSystemMXBeanImpl.getTotalPhysicalMemorySize() error.  Turns out that this was patched for AIX on a previous build but that patch is conditional on the os.name system property returning &#8216;AIX&#8217;.  This should work on i except that PASE returns &#8216;OS/400 &#8216; instead of &#8216;AIX&#8217; so I have submitted a bug report to Oracle (could hack it myself, I guess) but there is a workaround: the Oracle developer I worked with suggested I pass this argument to the Glassfish start command:</p>
<p>asadmin create-jvm-options -Dos.name=OS/400-AIX</p>
<p>That seems to work fine.  With all that info, you should have no problems using Glassfish on IBM  (FYI: I am running 6.1 and use the Java 6 JVM)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=98</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Life with Liferay</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=95</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=95#comments</comments>
		<pubDate>Thu, 27 Oct 2011 19:24:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=95</guid>
		<description><![CDATA[Summer is long gone and fall is fading fast, so what happened to me?  Been deep into a project (pro bono, alas) using LifeRay portal.  LifeRay  is an Open Source Portal which is pretty cool. The Open Source version has a long way to go in some areas (documentation would be a good starting place) [...]]]></description>
			<content:encoded><![CDATA[<p>Summer is long gone and fall is fading fast, so what happened to me?  Been deep into a project (pro bono, alas) using LifeRay portal.  <a title="LifeRay Portal" href="http://www.liferay.com" target="_blank">LifeRay  </a>is an Open Source Portal which is pretty cool. The Open Source version has a long way to go in some areas (documentation would be a good starting place) but some of the functionality out of the box is great (some needs work).</p>
<p>My application is a servlet and wrapping a servlet in a portlet, sharing data between them, was not s trivial task.  I had a long learning curve and was heading into a deep technical dive on the framework when an epiphany rescued me from heading down a technical rabbit hole.  I simply wrapped the servlet in an iframe and constructed the URL for the iframe using jQuery and portlet  parameters from within the hosting jsp.  LifeRay *has* a portlet iFrame but it has the same limitations as the html iframe: Moving data between the portlet and the html/app within the iframe is near impossible to do without getting pretty hacky&#8230;.</p>
<p>I was able to get the hacky solution to work OK, although I wished I could handle things a little more elegantly.  I also wanted to host a message board (aka forum) but I had nothing but trouble getting the email functionality to work.  In fact I am still dead in the water on the emails sent to the board reaching the forum posts.</p>
<p>The support at the LifeRay forum is so-so.  Too many dead ends on posts of similar problems and many, many similar problems exist without resolution.  If I were the LifeRay team I&#8217;d handle the posts that are most frequent with either a solution or an intelligible FAQ in the Wiki.  As it is, I still have posts that were never completely resolved.</p>
<p>I&#8217;ll probably continue to use LifeRay because 1. This pro bono project requires it and 2. It seems to be the best Open Source portal solution I can find.  I am not completely satisfied, but hopefully one day you&#8217;ll be reading this blog from within LifeRay and all will be well.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=95</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Summer fun</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=92</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=92#comments</comments>
		<pubDate>Mon, 11 Jul 2011 17:41:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=92</guid>
		<description><![CDATA[It&#8217;s summertime, summertime, sum, sum, summertime&#8230;.. Right!  Time for fun in the sun!  Given the time lapse since my last post, you&#8217;d think that I had gone on vacation.  Not so!  I have been busy, mostly with some challenging projects both in the tech world and outside it.  I have been to Italy and back [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s summertime, summertime, sum, sum, summertime&#8230;..</p>
<p>Right!  Time for fun in the sun!  Given the time lapse since my last post, you&#8217;d think that I had gone on vacation.  Not so!  I have been busy, mostly with some challenging projects both in the tech world and outside it.  I have been to Italy and back attending the Common Europe Congress in Milan.  I have written a lengthy magazine article which forced me to grow my mobile app development skills.  I have been invited to present a mobile application development workshop at the Common Fall Conference along with presenting on Open Source Report Writing tools and using Open Office with IBM i data.  So, it looks like there is no rest to come this fall.  Add travel, a couple of pro-bono jobs (like I can afford to give away my time&#8230;) and I can see the summer gone in a flash.</p>
<p>Anything new besides the same ol, same ol?  Yes.  I have been playing with Liferay which is a pretty cool and easy to use portal application (if there is such a thing).  I have been trying to sort out the CMS and the portal plugin pieces because they would be of the most use to me directly.  Redesigning the valadd.com and the petesworkshop.com sites along with assap.com and the opensource4i.com (and it&#8217;s variations) sites is HIGH on my list, I just can&#8217;t afford to hand rewrite all of them. I was hoping to &#8220;portalize&#8221; them and consolidate them into a few portlets.  We&#8217;ll see.  The summer is quickly fading&#8230;</p>
<p>IBM seems to have fixed the SWMA mysteries and I am very hopeful that my next round of renewals (next year) will be problem free&#8230;</p>
<p>Still much to do.  I have an exam to pass to get certified as a GIAC Secure Software Programmer-Java and my time is running out.  I&#8217;ll update you by August 12th (if not sooner).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=92</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IBM Rational is Irrational &#8211; Call a SWMA&#8230;</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=89</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=89#comments</comments>
		<pubDate>Fri, 04 Mar 2011 17:53:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=89</guid>
		<description><![CDATA[Before I begin this rant, let me say that IBM, the IBM I grew up with, has been an amazing company to have a developer relationship with.  I have said it before and I&#8217;ll say it again, nobody does support or supports it&#8217;s developer community better than IBM.  But Rational, well, not so much&#8230;My mantra [...]]]></description>
			<content:encoded><![CDATA[<p>Before I begin this rant, let me say that IBM, the IBM I grew up with, has been an amazing company to have a developer relationship with.  I have said it before and I&#8217;ll say it again, nobody does support or supports it&#8217;s developer community better than IBM.  But Rational, well, not so much&#8230;My mantra with HP products is: &#8220;Great hardware, crappy software&#8221;.  With IBM (ir)Rational my mantra is &#8220;Great tools, crappy processes&#8221;.</p>
<p>If you haven&#8217;t been an IBM i developer then you have missed out on some of the most marvelous marketing missteps on the planet.  Our hardware has gone through multiple name changes (not SO unusual) and our Operating System name has had, to paraphrase the late Al Barsa, &#8220;more names than Elizabeth Taylor had husbands&#8221;.  We have also experienced the thrill of &#8220;unbundling&#8221; where the heretofore &#8220;all you can eat buffet of developer tools&#8221; was reduced to an A la Cart sampling.  This was done, as IBM claims,  to benefit us developers and this is &#8220;what we asked for&#8221; (yeah, right).  Add to that a set of PC based, GUI development tools that evolved from WDSc (Websphere Development Studio Client), to RDi (Rational Developer for i), to RDp (Rational Developer for Power) and next (yes, rumor has it maybe another name change)&#8230;As those names evolved so have the components that have been removed, added, deprecated and enhanced. It is really difficult to keep track of what the current version of tools are and what they include.  You couldn&#8217;t design a more daunting environment to navigate when it comes to development tools (And, I am not even going to try to explain the compilers that must be purchased separately.)</p>
<p>So I have come to the conclusion that developing software for IBM i isn&#8217;t for wimps.  The tools are great, if you can keep up with the names and the changing features.  But when navigating the SWMA path, things get ugly (I&#8217;ll get to SWMA in a minute)</p>
<p>But wait, there is more. IBM also has an awesome developer discount program so that you can purchase the hardware and software at low rates.  In most cases the OS and software components are next to free. All,that is, except the Rational Tools.  For that you pay real money.  The process of configuring and purchasing through the developer discount program is really a breeze. The folks who put together the configurations are helpful and patient and the order and delivery is nearly flawless.  A couple of years ago, though we ordered a Bladecenter S and a JS12 running IBM i, everything we needed showed up properly configured and ready to go.  All the hardware was there and all the software was there which is no mean feat when the hardware itself has changed so radically and IBM i on the blade runs in virtual operating environment.  Even support was OK to navigate, given that the hardware and software came from the &#8220;p&#8221; (Power) world and the IBM i world.  The REAL challenge was yet to come.  SWMA renewal&#8230;</p>
<p>SWMA is the software maintenance agreement that keeps support and software updates current.  Now, I have been on the phone with IBM probably only a dozen times over the 15 years I have been in the software developer program with IBM.  I measure *years* between calls, that is how stable and trouble free the i is.  For me SWMA allows me to stay current with software updates, period. But staying current on SWMA is not easy in the developer program.  IBM doesn&#8217;t notify you when SWMA will expire (actually it does, NOW) and the process of renewing SWMA is cumbersome and confusing.  In a perfect world, you would receive a notice which lists all the software and charges and has a link that says &#8220;Click here to renew&#8221;.   Not so with DD (developer discount)  SWMA.  First you contact IBM.  Next they send you a listing of all the hardware and software you have that is associated with the machine serial number (a mind numbing list of part numbers and ID&#8217;s) and then that configuration is priced and a quote sent to you.  The challenge is that if you assume the listing is complete, you may have missed something important. [Quick aside: When it was all bundled together, the SWMA was quoted on the bundle which made it easy.  Now SWMA is quoted separately for some of the unbundled items].  In my case, because the Rational tools had gone through a renaming and product ID change, it didn&#8217;t show up on the renewal list so my Rational SWMA didn&#8217;t renew (sigh)&#8230;</p>
<p>So let&#8217;s get to the meat of it.  IBM (used to) not notify of renewals but at least when it was renewed, it was simply renewed as a bundle.  Not so any more. The SWMA renewals are A la Cart.  Here is my specific scenario when it came to the attempt to renew SWMA on RDp (and this truly illustrates the irrationality of the process)</p>
<ol>
<li> The SWMA had expired.  I had to pay the after license rate (a 200% premium) in order to &#8216;renew&#8217; which came to $535.</li>
<li>I could buy a &#8220;retail&#8221; version of RDp for $886 and then *next* year my SWMA renewal would be $117.</li>
<li>Even if the SWMA hadn&#8217;t lapsed, I&#8217;d still have to pay the $535 to renew because the configuration tool that IBM uses (e-config) doesn&#8217;t have a product code for RDp *renewal*, only the after license upcharge.</li>
<li>If I had a license for the &#8216;OLD&#8217; version of RDp (which is RDi) then I *could* &#8216;renew&#8217; that for $159 even though it has been withdrawn from marketing.</li>
</ol>
<p>So I pay a penalty for being on the developer discount program when it comes to renewing SWMA on Rational developer tools.  I pay no such penalty on any other software product on my IBM i.  Something doesn&#8217;t seem quite right with that.  All of this comes after hours of talking with my IBM contact, the person who configures the i and SWMA, and a very helpful Rational Sales rep (on the *retail* side of the house).</p>
<p>So what am I going to do?  Well, turns out that when we bought the JS12 we bought TWO licenses of RDi.  One license was upgraded to RDp (within the SWMA window) but the other license was not upgraded.  Turns out that RDi license can be upgraded to the new version of the Rational Developer tool (whatever it will be called) for $159.00.  So my inclination is to pay the $159.00 to upgrade the RDi license and just live with the older RDp 7.6 software we have since it would cost $535.00 to upgrade that (Yes, I know, the older, expired software license is cheaper to renew than the newer license and that doesn&#8217;t make sense).  But, as the guy using the configuration tool said &#8220;I can only do what the tool lets me do&#8221;.</p>
<p>Apparently this particular, very helpful person said that Rational is working to resolve the issue, too late for my current SWMA renewal but maybe BEFORE my SWMA expires on &#8220;Open Access RPG&#8221; product we own that is, alas, on yet another separate SWMA contract.</p>
<p>A Smarter Planet?  A Rational Tool?  I don&#8217;t think so.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=89</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One more time with Asterisk</title>
		<link>http://www.petesworkshop.com/blog_wp/?p=86</link>
		<comments>http://www.petesworkshop.com/blog_wp/?p=86#comments</comments>
		<pubDate>Tue, 15 Feb 2011 23:51:00 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.petesworkshop.com/blog_wp/?p=86</guid>
		<description><![CDATA[A long while ago, maybe 4 years ago, I installed Asterisk, an open source voice mail and call management system.  It is a little bit of overkill for a small office like mine and although I also host my home voicemail on it, it really isn&#8217;t a necessity.  But I installed it to get familiar [...]]]></description>
			<content:encoded><![CDATA[<p>A long while ago, maybe 4 years ago, I installed Asterisk, an open source voice mail and call management system.  It is a little bit of overkill for a small office like mine and although I also host my home voicemail on it, it really isn&#8217;t a necessity.  But I installed it to get familiar with it in anticipation using it as the IVR engine in my attendance management system. It has worked well but after two hacking experiences in the past 6 months I figured it was time to upgrade and perhaps find an easier way to install and manage it.  AsteriskNow is a &#8220;pre-packaged&#8221; installation of Asterisk and a Linux distro called CentOS and is supposed to make the whole experience easy and painless.</p>
<p>In my first attempt I chose to install Asterisk with a web GUI called FreePBX.  The installation was a no brainer.  Skills required are the ability to push the open/close drawer button on the CD/DVD drive and be able to use a keyboard. If you can&#8217;t do that you shouldn&#8217;t be near a computer in the first place.  I will say this: AsteriskNow is by far the easiest way to get an Asterisk installation installed on Linux.  Period.  It is perfect.  But the EASY part stops there.</p>
<p>First a little background on configuring Asterisk.  Everything is handled by configuration files. Everything!  For Linux geeks this is nirvana.  Grab your favorite text editor and away you go.  The default installation of AsteriskNow includes no desktop application so you will be hacking files with a command line text editor (whoopee!).  My first go around with Asterisk four years ago took just that approach.  Tediously configuring Asterisk using a text editor and a lot of luck.  The good news here is that there is plenty of good documentation on how the files all hang together.  The bad news is that if you fat-finger something it can take hours to sort out just where you went wrong.   Enter FreePBX and Asterisk GUI!  These web front ends are designed to make the whole thing quick and easy.</p>
<p>After my first install of AsteriskNow/FreePBX I brought up the web interface and then did a quick search to find the step by step documentation on how to use the GUI to configure Asterisk.  Nada! Everything I came across was incomplete or out of date so after poking around for an afternoon, I decided to give up and reload, this time with Asterisk GUI as the web front end.</p>
<p>At least Asterisk GUI uses the base Asterisk config files AND the Asterisk GUI has an easy way to get logged in and change the admin&#8217;s password (which was almost impossible to do with ease using FreePBX).  So I was off and running!  The menu layout from top to bottom is basically the &#8216;step by step&#8217; so I moved down the menu tree working through the config.  The context help is good but again there is VERY little documentation on how to use the GUI and the few places I got stuck I really was stuck.</p>
<p>I finally got most of the steps completed but I couldn&#8217;t make any outbound calls (I *could* call other extensions) and none of my inbound calling was working either.  In frustration I posted some of my questions to the Asterisk forum (which happened to be unusually responsive) and got to the point where I just decided to reload.  Which I did.  I made a couple of tweaks, broke it again, and reloaded again (see, it really IS easy to install, thank goodness).  And then using all I had learned in the prior attempts, made one last effort to sort out my issues.  Here is what it came down to:</p>
<p>I was thrown by the Module Name on the hardware config page.  It had &#8216;wctdm24xxp&#8217; which seemed to point to a different card than I had installed (TDM400p).  Based on the Asterisk forum I changed it to &#8216;wctdm&#8217; which was supposedly the correct module name for my card but every time I did that and rebooted it basically hosed up my install.  So, DON&#8217;T change it!</p>
<p>I tracked down my issues with the inbound and outbound calls to an incorrect configuration that the Asterisk GUI was placing in the extensions.conf file. So it was back to editing the config files manually!  In the globals section, the GUI had configured the two trunks I had as trunk_1 = DAHDI/1 and trunk_2 = DAHDI/2 I think those should have been either DAHDI/G1 and DAHDI/G2 OR I just set them to DAHDI/3 and DAHDI/4 which should point them directly to my FXO ports 3 and 4.  The G1/G2 syntax is to automatically chose the highest available ports but something is broken there.</p>
<p>The second issue I had with the inbound calling was that two entries that Asterisk GUI added to the contexts broke the inbound answering.  Those two entries are:</p>
<p>exten = s,1,ExecIf($[ "${CALLERID(num)}"="" ]?SetCallerPres(unavailable))<br />
exten = s,1,ExecIf($[ "${CALLERID(num)}"="" ]?Set(CALLERID(all)=unknown &lt;0000000&gt;))</p>
<p>I just commented them out.  Not sure what those commands do, except break the inbound contexts I had.</p>
<p>With those things out of the way, the rest of Asterisk GUI really DOES make it easier to manage your Asterisk installation but, MAN!, you really have to stick with it.  I haven&#8217;t had a chance to explore any other features yet; I have already flushed the better part of two days sorting out the GUI.  But, all is well now. So, call me (and you&#8217;ll get my voicemail!)</p>
<p>The next steps are to go back and secure the server again before I open it back up to the Internet.  The bad guys are always knocking&#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.petesworkshop.com/blog_wp/?feed=rss2&#038;p=86</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

