getFormXml = function(form, xmltablename) {
var rowsIndex;
var xmltable = '';
var xmlrow = '';
for (i = 0; i < form.length; i++) {
var cells = form[i];
if (cells.name != '')
{
//Additional checks could be entered here for check boxes and
//other form components
xmlrow = xmlrow + '<' + cells.name + '>'
+ cells.value + '</' + cells.name + '>';
}
if (xmlrow != null)
{
xmltable = xmltable + xmlrow;
}
xmlrow = '';
}
if (xmltable != null)
xmltable = '<' + xmltablename + '>' + xmltable + '</'+ xmltablename + '>';
return (xmltable);
}
Return the XML representation of the form variable.
Sharing my thoughts and ideas on subjects ranging from software technology to music. Thank you for reading.
Sunday, 18 November 2012
Saturday, 10 November 2012
Preparation and Processes
Most (if not all) activities involve 2 stages - Preparation and then Execution. For any activity to be executed effectively and in a timely manner , preparation is key. Lets take the example of the activity of preparing to go work in the morning. If you need to iron your shirt or find your socks then you will be much slower than if you had those things prepared. You will also will be more frustrated. Cooking is another example where the preparation of your ingredients and tools before hand is vital for a satisfactory result. There many, many other such examples.
In a company setting preparation usually resolves around getting the right information and mobilizing the right people. From the information perspective data can be stored in many locations. The more spread out the information the longer it will take to prepare the data and the less accurate the information will be. It is therefore vital that data is organised and accessible to everyone to meet repeatable requirements. I highlight repeatable because one-off activities many require additional new preparation. But most activities in a given industry are repeatable. Skilled management are able to recognise those repeatable patterns and define strategies to streamline and optimise Preparation.
In a company setting preparation usually resolves around getting the right information and mobilizing the right people. From the information perspective data can be stored in many locations. The more spread out the information the longer it will take to prepare the data and the less accurate the information will be. It is therefore vital that data is organised and accessible to everyone to meet repeatable requirements. I highlight repeatable because one-off activities many require additional new preparation. But most activities in a given industry are repeatable. Skilled management are able to recognise those repeatable patterns and define strategies to streamline and optimise Preparation.
Labels:
Business process
Friday, 2 November 2012
JdbcXmlService - Context driven shopping cart demo
A second example of the flexibility and power of the jdbxXmlservice API. This simple JavaScript based shopping-cart demo communicates with the JMS jdbcXmlservice via the activemq script adaptor. Each product has a xquery based rule associated with it, which determines the product to display and in what order - based on the product selected. In the example shown, selecting a computer would activate a rule to display all the complementary products.such as a monitor and sound card.
More details will be added later.
Labels:
JdbcXmlService
Saturday, 20 October 2012
Wednesday, 10 October 2012
JdbcXmlService - Stock ticker demo
JdbcXmlService is a java based server framework which I have been developing part-time since 2006. I have decided to show it the light of day via a demo stock ticker web application. This is a stock ticker with a difference. It can be programmed to display messages based on the historical stock movement data.
The business logic works by :
1. Retrieving the stock ticker and rules data from remote stock database
2. Retrieving the stock data from external web source based on stock ticker
3. Store a subset of the attributes retrieved in (.2) into a remostock history database
4. Execute rules based on the stock history
5. Display results
6. Repeat every 5 minutes
The above steps were accomplished using a custom xml configuration file (The details of which will be explored later) which JdbcXmlService executes.
Please note the demo will be available for the Evening US market opening times. Post a message on twitter or on the Facebook site to let me know your interests or thoughts on it.
Please note that the application is currently down at the moment. The above screen cast shows a very brief overview of the demo and the Xquery rules and the database interaction - unfortunately the explanation text appears to very small - another screen cast will be uploaded later (and use YouTube's annotation editor)
The business logic works by :
1. Retrieving the stock ticker and rules data from remote stock database
2. Retrieving the stock data from external web source based on stock ticker
3. Store a subset of the attributes retrieved in (.2) into a remostock history database
4. Execute rules based on the stock history
5. Display results
6. Repeat every 5 minutes
The above steps were accomplished using a custom xml configuration file (The details of which will be explored later) which JdbcXmlService executes.
Please note the demo will be available for the Evening US market opening times. Post a message on twitter or on the Facebook site to let me know your interests or thoughts on it.
Please note that the application is currently down at the moment. The above screen cast shows a very brief overview of the demo and the Xquery rules and the database interaction - unfortunately the explanation text appears to very small - another screen cast will be uploaded later (and use YouTube's annotation editor)
Labels:
JdbcXmlService
Friday, 15 June 2012
HTML table to XML in JavaScript
Please note this code will now be hosted github :
https://github.com/aetuk/wasjsapi/blob/master/tabletoxml.js
getCheckedRowsXml = function(htmltablename, xmltablename) {
var rowsIndex;
var xmltable = '';
var xmlrow = '';
var rows = document.getElementById(htmltablename).getElementsByTagName(
'tbody')[0].getElementsByTagName('tr');
for (i = 1; i < rows.length; i++) {
// Xml defined based on a ‘checked’ checkbox - Feel free to add your
// criteria here to filter the data selected ( or not)
if (rows[i].getElementsByTagName('td')[0]
.getElementsByTagName('input')[0].checked) {
// here "i" is the row number if checked
var cells = rows[i].getElementsByTagName('td');
for (c = 0; c < cells.length; c++) {
// xmlrow = xmlrow + '
// '+cells[c].id+'="'+cells[c].innerHTML+'"';
xmlrow = xmlrow + '<' + cells[c].id + '>'
+ cells[c].innerHTML + '</' + cells[c].id + '>';
}
if (xmlrow != null)
xmltable = xmltable + '<row>' + xmlrow + '</row>';
xmlrow = '';
}
}
if (xmltable != null)
xmltable = '<' + xmltablename + '>' + xmltable + '</'
+ xmltablename + '>';
return (xmltable);
}
This function will return a xml representation of a HTML table for each row on the table has a checkbox set to true in the form : <xmltablename><row><cell_name>cell_value<cell_name/><row/><xmltablename/>
It assumes that the html table has a checkbox on each row and that the name of the column is defined by cell id. Feel free customise it to suit your needs.
Labels:
javascript dev
Sunday, 10 June 2012
Long term project success
In general great solutions stand the test of time with little or no maintenance - that differentiates a poor solution from a good one. A great solution takes this further and requires little effort to evolve. Successful projects are also governed by this rule.
Technology in most cases is not the limiting factor of producing a great long-term project outcome - it is the mindset and imagination of project participants.
Critical success factors are defined during requirements stages, attempting to instill longevity into its the solutions foundations, by covering as many events and outcomes as possible as laid out by the business. But the theme of these factors is still governed by the project decision makers.So if simple, easy and seamless maintenance is not a priority then factors nvolving maintenance would be included as an afterthought or simply ignored when shaping the projects direction - Ultimately a functional but poor solution is achieved.
The maintenance aspect of the project is in most cases treated as an afterthought - especially if the project is handled by an external consultants - but its still the stakeholders responsibility to highlight maintenance as a central theme . Ignoring it displays a short-term attitude of the Return of investment. Maintenance has a huge impact on costs and time. A project may have cost 1 million GBP to complete but over the course of of 2 years maintenance cost may add 4 million to that value due to additional labour costs. Investing in maintenance from the start may add 1 million GBP to initial project costs while reducing maintenance costs to 2 million.
For example you as a consultant has been tasked to create a ecommerce website 123 for company xyz. You have a choice of building an automated ETL mechanism to extract product data from an existing system, or you can enter this data by hand. So you present these options to the business with the associated advantages and disadvantages. If time to market takes priority , then the manual approach would most likely be selected. If maintenance takes priority then the ETL approach would be taken.
Successful projects requires maintenance to built in at its core.
Labels:
Business process
Subscribe to:
Posts (Atom)