BCS Eclipse Luna SDK 4.4

The new Eclipse SDK Luna became available earlier last month and of course I procured a 64 bit copy and began tailoring it for production use.

Python 3.x is enabled flawlessly for utilization of all Python applications.

Groovy and Grails Tool Suite (GGTS) 3.4.0, Grails 2.3.6, Groovy 2.1.9, JVM 1.7.0_11 mixed mode, jquery 1.11.0, groovy pages 2.3.6 and hibernate 3.6.10.8 round out the grails development environment.

Php applications such as Yii 1.1.13 are also ready for service.

C, c++ Java, Ruby on Rails, FORTRAN, COBOL and HTML 5 interfaces are in place and ready for service.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

BCS Delphi XE3 PHP Source Code Generator

To make JQuery Easy UI work in the PHP environment you will need at minimum five PHP files and one HTML file.

After carefully examining the process it was determined that metadata plays a major role in making the UI function properly. Once Active Data Objects (ADO) were reverse engineered all the required metadata was made readily available.

The next problem was to understand and reverse engineer the functionality of the associated PHP files. Once that was accomplished a Delphi XE3 application was written that provides a GUI for ease of operation.

With the GUI a list of available DSN are generated (in ascending alphabetical order) for your selection. Once a DSN is selected all the required metadata is captured and passed into the code generation tool. The GUI also asks for a target location for the generated code.

Within a matter of seconds’ six PHP scripts and a HTML file is generated with zero errors and zero defects (no testing is required).

Point your browser to the location where the code was deposited and start using the newly generated code.

To begin the process the following dialog appears.

jq01

 

 

 

 

 

 

The next dialog to appear is as follows.

jq02

 

 

 

 

 

 

 

Click on the Get Data Element Names button and the following will appear.

jq03

 

 

 

 

 

Finally the code generator would like to know where you would like to place the generated code.

jq04

 

 

 

 

 

 

 

 

After the path is selected traverse to the designated location and view the generated code.

jq05

 

 

 

 

 

 

 

Below you see the generated code in action.

jq06

 

 

 

 

 

 

 

 

 

 

This tool saves the technician countless hours of coding and testing PHP and HTML by automatically generating the required code.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.

BCS Javascript Format Phone Number

There are those times when formatting data as it appears on a form is required for ease of reading and ease of use. This example show how to format a telephone number.

First we will look at the script itself.

<script type="text/javascript">
<!--
function textBoxOnBlur(elementRef)
{
 //5754578787, it should be 575-457-8787
 
 var elementValue = elementRef.value;
 
 // Remove all "(", ")", "-", and spaces...
 elementValue = elementValue.replace(/\(/g, '');
 elementValue = elementValue.replace(/\)/g, '');
 elementValue = elementValue.replace(/\-/g, '');
 elementValue = elementValue.replace(/\s+/g, '')
 
 if ( elementValue.length < 10 )
 {
  alert('The phone number needs 10 characters');
  elementRef.select();
  elementRef.focus();
  return;
 }
 
 elementRef.value = ('(' + elementValue.substr(0, 3) + ') ' + elementValue.substr(3, 3) + '-' + elementValue.substr(6, 4) + '*');
}
// -->
</script>

Then we will examine the code that implements the field formatter.

<input name=”tf01″ type=”text” value=”5734747417″ size=”15″ onblur=”textBoxOnBlur(this);” onfocus=”textBoxOnBlur(this);”/>

In this example the onblur and onfocus events invoke the field formatting.  Of course you can attach the formatter to any desired event using the above syntax.

The field 5734747417 is formatted and appears on the screen as (573) 474-7417.

Of course this code could be modified to format a SSAN as well as any formatting of almost any field.

Of course this technique will function for any technology that support JavaScript.

Mr. Arch Brooks, Software Engineer, Brooks Computing Systems authored this article.