HTML5 – World Wide Web Revolution

Chorme and Droids opening up the floodgate of amazing possibilities that will capture the imagination of the Netizens !

Welcome to a new World free from ‘Desktop Vendor Lock-In’ and ‘Internet Monopoly’ !

A new Revolution had begun when Web started being treated as Platform by Facebook, Zoho , Netflix, Google, LinkedIn, SaleForce, Tumblr, Jigsaw and many more who joined the forces in recent time !

Internet at a growth rate of 120% .. has definitely outperformed and outpaced other networking mediums – tv/radio/magazine/newspaper.

And now today Browsers empowered with HTML5 are helping Web apps become as powerful as Desktop applications !

Essentially its a giant leap forward by Google and like-minded benedictors towards the efforts of creating powerful Browsers to free the Earth from the bondage of Desktop OS !

Thanks to HTML5 Server Sent messages for performing this magic of representing Rich Media / High-Perfornace Graphics / Desktop Content / Complex Netwroking / Offline storage etc.

HTML5 – Web GL is the technology behind rendering GPS on mobile and computer browsers.

HTML5- Workers allow web apps to access and leverage the power of multi-core CPUs boosting the Rich-UI experience to a great extent.

As per the Google Prediction, by the end of 2010, the HTML 5 features like – Web Video / Canvas / SVG / AppCache / Web Storage / Web Sockets / Geo Locations .. will be supported by all major browsers (Opera, Chrome, Safary, FireFox) .. except … guess what !.. Yes .. IE .. which will support only Video / SVG and Web Storage falling behind all other 4 browsers !!

So there will be a surge in start-ups and new initiatives for developing innovative products on these open standrds !

Say, DarkRoom (from MugTug) allows editing photos and applying amzing affects Online .. and pretty fast ! It makes best of ‘AppCache’ for creating GUI on Web. Even browsers will support creating GUI using local storage in offline mode and then simply synching up once user goes online.

So no need to install a ‘Photo Editor’ on desktop, then download photos locally, apply effect and upload on web and sync back n forth !! Great Huh !

Gmail and many other mail clients had adopted the HTML 5 File API and Notification API for Drag-n-Drop of any attachment on the mail.

The beauty is – if the proper chrome extension is installed, then while surfing net, users will automcatically get notifcation about gmails even without leaving current page and without starting local mail client!

Clicker.TV is a great implementor of ‘Worker‘ for pulling a huge amount of TV and Media live streaming and then caching. Its a huge leap forward !

Open Video Codec (VP8) offering super quality video streaming through Chrome and Youtube by taking advanges of multiple cores and open standrds of DSP.

Google TV will certainly revolutinize the concpet of ‘Telecast over Net’

How about Animation using CSS and Javascript using html5.

Tooling around CSS and fast network roundtrips (all HTML5 blessings) will open up new possibilities in the Multi-player Online Gaming World !

Imagine running any 3d Game written using native Client into the browser !

Mashing Up service and online apps will also become easier.

TwitDeck is a great example.

Here one can move the twit widgets and instanly comes to know from where ‘certain apps’ are coming from. Twit notifications are constantly monitord and pushed from server and corresponding Geo Locations are queried upon to present all the relevant information to the users.

The big question is once a Magazine is actually represneted as a Magazine in a browser and not as a mere Webpage , then do we really need to invest in iPad or Kindle !

Thats the power of openness !

Thats what Chrome is about to do .. just stay tuned to Google Technologies …. its going to Recrate the same Immersive Experience that you enjoy while reading a newspaper or magazine !

Imagine how dramatically it will increase the reachability of popular media brands and skyrocket its revenue !

HTML 5 will simply metamorphose business models !

Now there is great gift from Google for the Apps Developers !

Using HTML 5 google provides Infrastructure as Services on demand and Virtualize existing complex apps through its collaboration with VMWare Cloud and SpringSource.

Few commands in Spring Roo Shell will – create a Spring Project, do the Persistence Setup, Create Entities, Services, provide GWT artifacts, package, update GWT .. in couple of minutes (for a small demo app) and Google App Engine Plugins (assuming user installed SpringSource tool Suite) upload the app in cloud .. also immediately use Spring Insights and Cloud Monitors to provide performance stats !

Lets all enjoy the freedom of choice and openness offered by HTML5.

Reference : HTML5 Google IO , Chrome OS

Why Imaginea?

Ok, why should start-ups choose Imaginea for their venture?

A start-up requires innovation. Innovation by nature deals with uncertainty. The uncertainty is about the feasibility or practicability of the new technology and is a function of its reception in the marketplace. Innovators proceed to build systems under great uncertainty when technologies and markets are co-evolving.

This uncertainty creates an evolution game where firms carve out their niche in the struggle for survival. In the process it necessitates a rapid change in their way of working -the very reason for their existence. Business models have to accommodate this change, which otherwise would lead to a binary result in the short term- success or failure.

A successful outcome from innovation depends on the exploratory capacity of the start-up in form of people, time and money. The hardest of the three is getting the right people, who are the most valuable assets during exploration and experimentation. The first few months of a start-up are always about engineering. The start-up has to build the new gene pool in short period of time. Evolution is important and the ability to adopt is the key to this gene pool and the market since technology and requirements keep changing. In short, start-ups need engineers not employees.

The founders spend lot of time and energy in convincing VCs about the business model and explaining ‘what next’ to the VCs. The time spent on ‘non-productive’ work results in frustration and the ability to lead innovation and exploration at a rapid pace often suffers.

Potential customers cannot guide development because they have no experience with new technologies, and any analogies to existing ones may be flawed. Hence one needs engineers with balance of experience and attitude for innovation.

Many of the initial internet companies assumed that the Internet would deliver all goods and services to consumers. Their B2B models appeared with the internet seen as the way for business to interact. Initially many software based companies see value in delivering products within their business and innovate accordingly.

Our founders too, continually innovated, developed technologies and solutions as the market evolved. Some of our products, which set out to service the consumer industry, morphed to serve businesses, became profitable and hence created compelling intellectual property.

At Imaginea we have experienced all these phases. Our engineers are innovative and they are trained to think like entrepreneurs. For start-ups requiring such engineers to take their ideas to the market, Imaginea is the place to go! The market is competitive for good talent. With Imaginea’s help start-ups can save time in hiring, coaching and mentoring. They can focus on exploring the market, creating markets and morphing themselves to solve various issues.

Sustained growth of a venture hinges on the effective sharing of ideas, leveraging organizational knowledge and ideas by its talented workforce. Effective knowledge sharing within teams takes substantial time. Imaginea is built on the fundamentals of sharing, mentoring and coaching people to become technology evangelists, entrepreneurs and business leaders.

No wonder then start-ups and software companies can rely on Imaginea’s skilled engineering team to support them at their most crucial phase – when they are creating new products.

grails yui datatable template

I was fiddling with YUI 2 and Grails and needed a rich table in list screen with search functionality. YUI datatable can talk json and Grails can reply in it, so with some changes to the list screen and controller template this feature could be easily implemented. This blog documents some of these code snippets.

So the tasks ahead were

  1. Modify the controller template to send json
  2. Add YUI datatable column and response schema definition from the grails domain class
  3. Add a search section for the domain natural keys

Send JSON

Well this task like most of the other tasks in grails is straightforward. I added a new method listJson to Controller.groovy which renders a JSON response.

Column and Datasource Definition

The columns and the response schema can be used from the grails domain class, looking it up is as easy as calling domainClass.properties, though very intuitive, implicit variables in the template are not the most well documented feature, but things are improving greatly. These properties are then used to define the columns and the response schema for the YUI datasoure. Once the data table is defined, we can listen to specific events via its subscription model(code snippet at bottom of the page).

Integrating search

In list.gsp I iterated through the properties to find the natural keys, converted that to displayable names and listed it at the top of the screen. At the back end these params were then converted to an hql and executed via findAll which creates a hql query from the request parameters and executes it via findAll.

The only caveat was since there were associations in the object model, they needed to be translated while firing the query, for example Student may have an association with Department, so it would be shown as “Department Name”, but at time of creating the hql it should be referred to as department.name, a simple string replace and this too is taken care of (code snippet at bottom of the page).

Pitfalls

The only pitfalls are in customization, for example if we wanted to send the natural key of the referenced object in the json response, we would need to plugin our own converter, which is a bit more involved, but that’s a story for another day.

Controller Code Snippet

def listJson = {
params.max = Math.min( params.max ? params.max.toInteger() : 10, 100)
log.debug "parameters received at controller \${params}"
render getValues(params) as JSON
}

private YUIResultSet getValues(Map params) {
def ${propertyName}List = null
def definedActions = ["max","action","controller"]
def queryString = "from ${className} as a";
def countQuery = "select count(*) ${queryString}"

def predicate = "";
def totalRecords = 0

if (params.keySet().size() > 3) {
def fieldFilters = new LinkedHashMap();
params.each{ key, value ->
if (!definedActions.contains(key)) {
if (value != null && value.length() > 0) {
if (!fieldFilters.isEmpty()) {
predicate +=" and "
} else {
predicate +=" where "
}

//since we also need to handle nested properties (like department.name), we need this value replacement
def fieldName = "\${key}".replace( '-','.')
def fieldKey = "\${key}".replace( '-','')
if (value.indexOf(",")!= -1) {
String[] values = value.split(",")
predicate +=" a.\${fieldName} in (:\${fieldKey})"
fieldFilters.put(fieldKey, values);
} else {
predicate +=" a.\${fieldName} = :\${fieldKey}"
fieldFilters.put(fieldKey, value);
}
}
}
}

def offsetAndMaxFilters = new HashMap(fieldFilters).plus([max:10, offset:0]);
${propertyName}List = ${className}.findAll(queryString + predicate, offsetAndMaxFilters);
totalRecords = ${className}.executeQuery(countQuery + predicate, fieldFilters).get(0);
} else {
${propertyName}List = ${className}.list( params );
totalRecords = ${className}.count()
}

return new YUIResultSet(totalResultsAvailable: totalRecords, results:${propertyName}List, totalResultsReturned: Math.min(${propertyName}List.size(), 10))
}
}

list.gsp sinppet

var myData
var myColumnDefs = [
<%

excludedProps = ['version',
Events.ONLOAD_EVENT,
Events.BEFORE_DELETE_EVENT,
Events.BEFORE_INSERT_EVENT,
Events.BEFORE_UPDATE_EVENT]

props = domainClass.properties.findAll { !excludedProps.contains(it.name) && it.type != Set.class }
Collections.sort(props, comparator.constructors[0].newInstance([domainClass] as Object[]))
props.eachWithIndex { p,i ->
print "{key : '${p.name}', label:'${p.naturalName}', sortable:true, formatter:'myCustom'}"
if (i < (props.size() -1 ))
println ","
}

println "]"

println "var dataSourceFields = ["
props.eachWithIndex { p,i ->
println "'${p.name}'"
if (i < (props.size() -1 ))
println ","
}
println "]"

%>

var myDataSource, myDataTable;

YAHOO.util.Event.addListener(window, "load", function() {

YAHOO.example.XHR_JSON = function() {
this.jsonAwareCustomFormatter = function(elLiner, oRecord, oColumn, oData) {

var fieldValue = oData;
if (oData!=null && oData.name) {
fieldValue = oData.name;
}
elLiner.innerHTML = fieldValue;
};

YAHOO.widget.DataTable.Formatter.myCustom = this.jsonAwareCustomFormatter;

myDataSource = new YAHOO.util.DataSource("${camelCaseUrl(className, 'listJson')}");
myDataSource.responseType = YAHOO.util.DataSource.TYPE_JSON;
myDataSource.connXhrMode = "queueRequests";
myDataSource.responseSchema = {
resultsList: "results",
fields: dataSourceFields
};

myDataTable = new YAHOO.widget.DataTable("json", myColumnDefs, myDataSource, {initialRequest:""});
myDataTable.subscribe("rowMouseoverEvent", myDataTable.onEventHighlightRow);
myDataTable.subscribe("rowMouseoutEvent", myDataTable.onEventUnhighlightRow);
myDataTable.subscribe("rowClickEvent", myDataTable.onEventSelectRow);

// Programmatically select the first row
myDataTable.selectRow(myDataTable.getTrEl(0));

// Programmatically bring focus to the first text box used for search
jQuery(":text ")[1].focus();

return {
oDS: myDataSource,
oDT: myDataTable
};
}();
});

seam performance tips

Recently I was helping with performance of one of our jboss seam applications, apart from the usual db interactions, interaction between our ui and seam components were making a huge impact on performance. In short, if you have a seam application that avoids using @BypassInterceptors and has Component methods called from EL in the UI, this blog may be worth a read. Links to some of the available tools and the home grown ones are provided at the end of the blog.

Taking a step back lets think about a select with 12 select items like the creditCardExpiryMonth in book.xhtml of jpa example, this typically will look something like

<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
<f:selectItem itemLabel="Jan" itemValue="1"/>
....
<f:selectItem itemLabel="Dec" itemValue="12"/>
</h:selectOneMenu>

Lets try to guess how many times the value EL (booking.creditCardExpiryMonth) may be evaluated on the sun jsf ri version 1.2_04, the correct answer is 12(once for every select item to determine whether or not to mark the select item as selected), think of the havoc it can cause if this getCreditCardExpiryMonth method were to be invoked on a seam component (with all its interceptor chain). This seems like a straight forward case and you may be sure that in your application you do not have any such case, but wouldn’t it be great if we could check if this really is the case, for such checks we can use AOP Based EL call measurement tool or Component Instrumentation for invocation count and time, personally I prefer a modified version which combines the two.

Great, so we now know that we have problems with EL evaluations, what do we do about it. First stop, try to outject it, DataModel annotation is a trusted friend there. Another way of getting around such issues is to cache the actual EL value so that subsequent invocations can be supplied from the cache rather than needing a proper evaluation. Adam Warski in his blog documents and provides source for such a component, with a few enhancements this component can solve most of such re-evaluation problems (I call this enhanced component CachingSet). In the case of selects, however, I prefer my own renderer which caches the selected value for the timespan of rendering this select (MenuRenderer).

Rather than guessing blindly which components in the UI are taking more time, it would be great if we had some way of printing the time taken for any component, enter timediff. A small component which measures the time taken for its child to be rendered, for example in case if I wanted to see how much time the above select takes, I could do something like

<app:timediff childName="creditCardExpiryMonthSelect">
<h:selectOneMenu id="creditCardExpiryMonth" value="#{booking.creditCardExpiryMonth}">
...
</h:selectOneMenu>
</app:timediff>

This would print on the screen the actual time taken for creditCardExpiryMonth select to be rendered. Depending on the time taken we could then think of renderers or any other such changes.

You may be surprised but at times selects depending on their size can take a huge chunk of time, part of it is because of the way the i18n labels are looked up from the properties files, part of it is the way the component tree becomes more complicated. I have found that for static selects, I can reduce this rendering time considerably if the actual html snippet were to be cached and then a small javascript snippet were to select the actual value. This helps in reducing the rendering time of selects with a large number of items drastically (CachingEnumSelectOne), especially if the select items are coming from an enum. For general caching seam cache tag is handy, unfortunately as selects are not actually static, so need some javascript magic and can not be handled with seam cache tag.

We also have some screens where the viewid is dynamic (linked to an EL expression), as seam allows page level message overrides, this meant that the viewid EL was getting evaluated for each label resolution on this page. Since we do not allow page level overrides, we extended the messages component to not do page level override lookups, this helped a lot in performance (assuming that the new version of seam has a better implementation of this part, you may still want to see if this is the bottleneck in your application).

It is always a good idea to expose hibernate stats and cache stats over JMX, using seam this is pretty easy and a simple component (class called HibernateStatistics) helps us do this. If we are using ehcache the cache management mbeans can also be exposed, this is less than 20 lines. The output can be seen in the jmx-console of the appserver.

Code links
Code base for HibernateStatistics, CachingSet, MenuRenderer and CachingEnumSelectOne

Sources as jar file

Original caching Set and its details at Adam Warski’s blog

AOP Based EL call measurement tool

Component Instrumentation for invocation count and time

Gov2.0 – Better Governance using the cloud @reduced costs

Being at the technology forefront we at Imaginea felt our superior cloud engineering capabilities can help us be the answer provider for many a challenge that gov2.0 initiatives face. I happened to read this paper : http://www.brookings.edu/papers/2010/0407_cloud_computing_west.aspx and felt interested to see some of these statistics.

These statistics also made me think what can the benefits be to a country of 1 Billion that i represent. Representing a country of 1 Billion i was really motivated to see what can Cloud do to help us leap forward. Answer was Gov2.0.  A lot of interesting work is happening around.

Public utility services, massive data intensive programs and large scale  delivery capabilities are some of the most challenging aspects that any government faces when it wants to caters to millions of people. Technology consumption, right framework creation and adoption have always been a issue either at strategy level or execution level. However modern day governments can take  a  CIO centric approach these days to cater to public demands using technologies such as  Cloud computing.

If rightly adopted, implemented and rolled out the result could be a TAPE that i dare to call which will constitute and assure Transparency, Accountability, Efficiency and Productivity (TAPE)  Gov2.0 is all about better governance @reduced costs and increased efficiency.

In this blog i will try to touch base challenges that typical e-governance ecosystem face and also different areas of a typical IT driven e-governance model which can take advantage of Cloud services as a channel of delivery.

Challenges

Why cloud for e-governance:

Simply put gov2.0 initiatives if well executed can solve many a problem described above. UUID project that the Indian govt is adopting is a classic example of how different technology peices can be put together to offer a completely hassle free administration.

The Imaginea Edge for Gov2.0

However ability to design, architect, develop and implement larger cloud based frameworks that can add value to life is certainly a dream come true for any technology services provider. Best of the minds need to be in one place to pull all the strings to get it going. We at Imaginea have been pioneers in adoption, usage and implementation of cloud computing for years now.

Please check our detailed white paper on Cloud and e-governance (http://imaginea.com/docs/Whitepaper-Cloud-egovernance.pdf). Visit our cloud engineering services and capabilities at www.imaginea.com/ cloud to take advantage of our superior engineering skills.

ideas to life is what we envision.  If you are looking to make a difference to the world, join us in leveraging what can be done with, over and using the Cloud. We would be more than glad to help, understand your challenge, partner and help you move forward!

Financial Industries and Cloud Services- Trends and Innovations

Financial industry has been through tough path post 2008 recession. It went through gigantic turmoil, and its on a restructuring phase. One of the foremost industries to adopt Information technology is Financial sector. Although most companies are adopting to Cloud at a faster pace, the financial sector remained an exception. Selling cloud computing to financial services firms could seem problematic. The sector is renowned for its reluctance to give up control over operations, which is exactly what is involved with the cloud. Added to this is a mountain of regulation. However due the restructuring and re-evaluation of process and focus areas at the financial firms is helping the intrusion of cloud based services into the Financial sector.

Let us look at  a recent innovation in this space. One the most foremost successful cloud service has been started by wall street for the FX market (Foreign exchange), which is called as ESN (Electronic Settlement Network) Volume growth for FX market continued unabated while financial markets were in turmoil over the credit crunch. The tier 2 and tier 3 banks have less margin in FX market because of the higher cost on per transaction. This would really curb the them entering into the segment. This made the volume on demand, for all the players of FX market big and small by creating ESN.

Let us take a bank “X” which is tier 1 bank and bank “Y” which is a tier 2 bank. Both were severely affected by the credit crunch. They started looking for operational efficiency and newer ways to improve there business operations and improve there business in those areas where the financial sector is not severely affected. FX (Foreign Exchange) has been place where the banks were targeting to improve there business in. The Bank “X” and Bank “Y” found Electronic settlement network as an option to improve their FX market which has volume trading and has got all the advantages of SaaS usage.

So, Bank “X” being tier 1 bank entered into huge volumes of FX, Cash and OTC (over the counter) derivatives without enhancing the existing IT infrastructure and operational expenditure instead opted for the On-demand ESN. For Bank “X” ESN provides a trade Capacity “insurance policy” and during periods of high volume, banks can switch a percentage of their post-trade activity to ESN to reduce queues in their own infrastructure. ESN helped the Bank “X” to go for high volume trading, but removing the overhead of planning for huge network and infrastructure improvements and getting into the pay per use ESN from Wallstreet.

Bank “Y” had to invest a lot for per transaction on FX trading, and being a tier 2 bank they were not going for high volume trading. So they needed a third party which can lower the per transaction cost on FX trading which ESN was the there exact solution. ESN enables the smaller banks to reduce processing costs and allow them to get into the market without establishing there own infrastructure and also providing cheaper per transaction cost on FX trade for there comparatively lower volumes. Now Bank “X” and Bank “Y” go to ESN as a single place to collectively process for its members with associated economies of scale, introducing a transaction based model for processing FX, Cash and OTC (over the counter) derivatives. The utility provides capacity, functionality and operations on demand and sets the benchmark for the lowest trade processing costs in the industry.

We strongly believe, This phase is just a beginning once the design for privacy concepts come up to level of building the cloud computer services the financial sector will move into the area of getting things into being with cloud advantages. There are legislations which are coming for cloud computing, which would definitely help to have far better SLA’s for Financial sectors, which would protect and understand the needs of Financial sector.

Imaginea has a strong understanding of cloud computing, its implications from a technology stand point, security and privacy requirements in a on demand computing environment. Over the years Imaginea has also been a strong technology services provider for some of the best names in the BFSI sector. We think we are thus positioned uniquely to help leverage our unique combination of technology and sector understandings to help companies in this space innovate more.

Setting up Svn Repository over apache2 easy and quick:

Step1>Downloading and Installing Svn modules and dependencies :

Download the most recent distribution tarball from here :

Subversion depends on a number of third party tools and libraries.The Subversion has a package containing the minimal prerequisite libraries (Apache Portable Runtime, serf,neon,sqlite-amalgamation and Zlib) called the “dependency package” tarball or zipfile.

Step1(a)> Building a Subversion Server:

Subversion has two servers you can choose from:svnserve and Apache.

Step2> Downloading and Installing Apache2 :

Please refer to the below mentioned URL for the latest released version:

http://httpd.apache.org/download.cgi

Compile the below mentioned configuration files as said below:

$ ./buildconf

$ ./configure –enable-maintainer-mode (This arg says to include debugging information.As similar we did while running the ./configure for svn as said in above process.Same setup should be followed else we can run into issues .Take this is as a feedback keep the prefixes usage as same as you do for svn & apache modules).

Compile and install apache:

$ make

$ make install

Step2(a)> Making and Installing the Subversion Apache Server Module :

Go back into your subversion working copy and run ./autogen.sh if you need to. Then, assuming Apache httpd 2.0 is installed in the standard location, run:

$ ./configure

Note: do *not* configure subversion with “–disable-shared”! mod_dav_svn *must* be built as a shared library, and it will look for other libsvn_*.so libraries on your system.

Note: If you have old subversion libraries sitting on your system,libtool will link them instead of the `fresh’ ones in your tree.Remove them before building subversion.

 $ make clean && make && make install

Step 3> Configuring and authorizing Apache for Subversion:

By default you will find the httpd.conf file at the below mentioned location:

> /usr/local/apache2/conf/httpd.conf

Verify the below svn modules are added in your httpd.conf file :

LoadModule dav_svn_module modules/mod_dav_svn.so

LoadModule authz_svn_module modules/mod_authz_svn.so

Note: Create a file with the name as ‘svn-auth-file’ and save it under /etc directory.

Add the below mentioned svn module to the end of the httpd.conf file. This is one of the basic example for setting up your Svn repository with limited access.

<Location /repos>

DAV svn

SVNPath /absolute/path/to/repository

AuthType Basic

AuthName “Suvbersion Repository”

AuthUserFile /etc/svn-auth-file

Require valid-user

</Location>

Please refer to the below URL for other authorization options available:

http://svnbook.red-bean.com/en/1.0/svn-book.html#svn-ch-6-sect-4.4

Step 3(a)> How to add a SVN user in svn-auth-file :

1.To do this use command htpasswd -m /etc/svn-auth-file “UserName”

(Here the -m option modifies the svn-auth-file)

2.This will add a user and prompt for a password

3.Enter a desired password

4.Restart the apache server with command :/etc/init.d/httpd restart or

sudo /etc/init.d/apache2 restart

5.To delete the user . Use command htpasswd -D /etc/svn-auth-file userName

(Here the -D option delete the desired user from the svn-auth-file)

Step 4> Running the apace server with Svn plugin :

Trigger the below mentioned command:

$ /usr/local/apache2/bin/apachectl start or/etc/init.d/apache2 start

(This will start your apache server with effect to the recent modifications done in httpd.conf file.)

$ /usr/local/apache2/bin/apachectl stop or/etc/init.d/apache2 stop

(This command stops the apache server and you can re-edit your httpd.conf as and when desired and re-start your apache server to have the changes into effect).

Check /usr/local/apache2/logs/error_log to make sure it started up okay.

Step 5> Testing and using the SVN repository:

Steps to checkout and checkin some stuff to your repository :

$ svn checkout/co http://localhost/svn/repos (The most common reason this might fail due, to the permissions for reading the files from the repo DB.Make sure that the httpd process has permission to read and write to the repository).

$ svn commit/ci – This command recursively sends your changes to the SVN server. It will commit changed files, added files, and deleted files. The -m option should always be used to pass a log message to the command.

 $ svn add – When you are creating a new file or directory, you need to tell the SVN server about it. This command authenticates the newly created file or directory to the SVN server.

$ svn update/up – This command syncs your local sand box with the server. If you have made local changes, it will try and merge any changes on the server with your changes on your machine.

$svn help - Provides a summary of the available commands.

Note: Please proceed to Step3 If you already have a SVN server installed on your Unix machine. If you are starting afresh ,follow the steps from the beginning.

As per my understanding I have tried to explain the setup with easy and quickly understood steps.Hope this might help to the extent of setting up your client Repository quick and easy with minimal configuration issues.If I am missing something here and if there are any valuable feedback feel free to say them.

Cloud musings!

Suddenly, everyone is looking for fuel efficient cars. That is what is happening with IT resources as well. Cloud is enabling that to happen in a very rapid and scalable manner. Over the last decade, there has been a real push to look at IT services from the service centric point of view. Businesses that have done this were able to innovate faster and provide best value to their customers.

Cloud computing has graduated and has really come out of clouds. It re-affirms the benefits of thinking at a service centric manner. Cloud computing takes the IT services to the next level by virtualizing almost everything that IT provides. A variety of Cloud services has come out of the box. Cloud providers can now provide storage, cpu and network out of the box for a fees.

Cloud could also be a threat to traditional models of software licensing. What will be the impact of Cloud computing on software development, deployment, support and maintenance?

Can a warehouse application be deployed on Cloud and offer the same level of customization and SLA’s for different customers.

Cloud has some more challenges to face. Cloud portability, security and compliance are the keys areas innovation has to happen in future to take cloud to the main stream. Location of the data in various geographies and data disposal could be a compliance issue for sensitive information.

Biggest beneficiaries and customers for the cloud are governments. Governments have huge data that needs to be stored and safeguarded. Security is one man aspect of the cloud. Governments would probably go to private clouds to optimize the resources and thereby reducing operating costs.

ISV’s and ERP companies have already embraced cloud computing and are using for their main line of businesses. Companies that need computing power have used Cloud and are using it on a pay as you go basis and saving huge costs. Cloud will make innovations in the business and could reduce barriers of entry for some businesses to get into the space, which they could not get to earlier.

Hacking in cloud. Can some one who is smart gets onto Cloud computing, really wipes all your machines, data and not even leave traces of what happened?. Auditing and control could be one of the main compliance issues as well.

Applications need to gel with cloud infrastructure seamlessly. We know for sure, how much time and energy we spent in starting a new production release, even of the machines and operating system remains same. Ability to simulate cloud environments locally and deploy in cloud infrastructure seamlessly is challenge.

At Imaginea, we think, Cloud has to be embraced in a step by step manner rather than a big bang. For service companies, there is also a point, where they will start paying more for cloud services compared when hosted in house.

Deploying & hosting application on Amazon-ec2 Unix environment.

Amazon ec2 presents a true virtual computing environment, allowing you to use web service interfaces to requisition machines for use, load them with your custom application environment, manage your network’s access permissions, and run your image using as many or few systems as you desire.

Pre-requisites :

1)Account for amazon S3 and ec2 .
2)Command-line tool (ec2-ami-tool).The AMI Tools are a set of command line utilities for creating,bundling and uploading AMIs to S3 storage where they can be used by ec2.

a). Download ec2-ami-tool from the below mentioned URL:

http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351

Select rpm for linux and zip for windows.

b). Installation : To install the AMI Tools unzip the installation file into a suitable installation directory
such as ‘/usr/local’:

unzip ec2-ami-tools-X.X-XXXX.zip -d
This will create the directory ‘/ec2-ami-tools-X.X-XXXX’
where X.X-XXXX represents the release and build numbers.
Before running the utilities the ec2_HOME environment variable needs to be set:

export ec2_HOME=/ec2-ami-tools-X.X-XXXX

Running and authorizing an instance :

1). Sign up for Amazon S3 & ec2 .
2). Create a work directory and there download and unzip Command-Line Tools(ec2-ami-tools.zip) .
3). Create a new X.509 Certificate to generate a PEM encoded signed X.509 certificate (cert-*.pem) and an unencrypted, PEM encoded RSA private key that corresponds to the X.509 certificate (pk-*.pem) and save the certificate and private key in the work directory.
4). Setup environment variables by creating a batch file with the following configuration :

set JAVA_HOME =
set EXTRACT_DIR =
set ec2_HOME = \
set PATH = \bin
set ec2_PRIVATE_KEY = \PRIVATE_KEY_NAME
set ec2_CERT = \CAERTIFICATE_KEY_NAME

copy this batch file onto your work directory and execute it.

5). Run the command > “ec2-describe-images” : it will return a list of available images.
(on a mac you must set JAVA_HOME by doing: export JAVA_HOME=/home/foobar/jdk1.6.0 )

Output will be something like this :
IMAGE ami-68ae4b01 ec2-public-images/fedora-core4-base.manifest 206029621532 available public
Description of the above said command :

Record Type Identifier – IMAGE
Image Identifier - ami-68ae4b01
Manifest Location - ec2-public-images/fedora-core4-base.manifest
User Identifier(Who has registered the image) - 206029621532
Image Status - available
Visibility - public

6). Create a Keypair : “ec2-add-keypair ”

In order to launch an AMI we need a named key pair. The name of the key pair is specified in the web service call that launches the instance and the private key is used by ssh to authenticate for the same.

Use this private key that is hence created, save it to a file called id_rsa-gsg-keypair.
Now set it’s permissions to be rw——- (chmod 600 id_rsa-gsg-keypair).And copy this keypair file onto your work directory

7). Create a group : “ec2-add-group group_name -d ‘description_of_group’ ”

Security is important for any machine hooked up to any network at any time .Amazon’s ec2 cloud has a built-in firewall capability that is easy to setup. It is based on the concept of security groups. A security group is simply a group of access rules that apply to any instance which is a member of that group.

8). Create and Authorize a Security group to HTTP :
Follow the below mentioned commands for opening specific ports for ssh & http respectively.
ec2-authorize default -p 22 (ssh)
ec2-authorize default -p 80 (and http)

9). Now we have done the basics, here is the final step to get an instance up and running on Cloud.
Create an instance of your machine : ec2-run-instances ami-xxxxxxxx -k gsg-keypair

Where ami-xxxxxxxxx is the id of the machine you used to as in step 5 with ec2-describe-images.If this step failed and reported creation of the instance something like this as seen below :

So output will something like this :

INSTANCE i-xxxxxxxx ami-xxxxxxxx gsg-keypair

Description of the o/p of the above command :

Output Type Identifier - INSTANCE
Instance ID - i-xxxxxxxx
AMI ID - ami-xxxxxxxx
Key name - gsg-keypair
Hence ,wait for it,

Using ec2-describe-instances you can check the status of your instance, it will display the desired details as mentioned below:

INSTANCE i-xxxxxxxx ami-xxxxxxxx domU-##-##-##-##-##-##.usma1.compute.amazonaws.com running gsg-keypair

Description of the o/p of the above command :

Output Type Identifier - INSTANCE
Instance ID - i-xxxxxxxx
AMI ID - ami-xxxxxxxx
Public DNS name - domU-##-##-##-##-##-##.usma1.compute.amazonaws.com
Instance state – running
Key name - gsg-keypair

10). Url to access your application installed on ec2 instance is : http://publicDNSname/appname

For example : http://domU-##-##-##-##-##-##.usma1.compute.amazonaws.com/mworks

You can ssh into the machine using the key you created in step 6

ssh -i id_rsa-gsg-keypair root@domU-##-##-##-##-##-##.usma1.compute.amazonaws.com

and user will view the o/p as seen below :

__| __|_ )
_| ( /
___|\___|___|

Welcome to an ec2 Public Image :-)

S3(Simple storage service) steps & configuration :

How to take the backup of your hosted instance(s) as an Private Image for storing it on Amazon S3(Simple Storage Service)

Taking backup of instance means storing the complete instance as an image in S3(Simple Storage Service),for this first we need to create a folder called ec2 on your instance with the following details:

1) ec2-api-tools-1.2-13740
2) keypair_name.ppk
3) keypair_file
4) setup.sh(batch file for setting the Environment variables)
5) certificate
6) private key

one more batch file Setup.sh is required(For bundling up the instance as an image and upload onto S3 in a Bucket) .
Setup.sh should contain following details:
#!bin/sh

export JAVA_HOME = java_home_location
export EXTRACT_DIR = location_of_ec2_folder
export ec2_HOME = EXTRACT_DIR/ec2-api-tools-1.2-13740
export PATH = ec2_HOME/bin
export ec2_PRIVATE_KEY = EXTRACT_DIR/private-key
export ec2_CERT = EXTRACT_DIR/certificate

After setting up the environment variables , provide all permissions using this command – chmod +x setup.sh .And then execute this .sh file as mentioned below:
> ./setup.sh.

If it doesn’t execute properly then it may be possible that it is not in proper unix format, hence execute the below mentioned command:
> dos2unix setup.sh setup.sh

the above said command formats your .sh file in proper unix format.Now we can execute all ec2-api commands hereafter on the hosted instance.

We need one more called jSh3ll(The jSh3ll is a Java based command shell for managing your Amazon S3 objects) on the hosted instance. And one more batch_file.sh will contain following details:

#!/bin/sh
echo “Starting to script”
current_date=`date ‘+%Y-%m-%d-%H-%M-’`
export JAVA_HOME = jdk location
export EXTRACT_DIR = location_of_ec2_folder
export ec2_HOM = EXTRACT_DIR/ec2-api-tools-1.2-13740
export PATH = ec2_HOME/bin/JAVA_HOME/bin
export ec2_PRIVATE_KEY= EXTRACT_DIR/private_key
export ec2_CERT = EXTRACT_DIR/certificate

export jShellDir=/usr/ami/jSh3ll/(location of jSh3ll)
s3Dir=$jShellDir$current_date
s3inputCommands=$s3Dir”s3commands.txt”
s3output=$s3Dir”s3output.txt”

echo “bucket “$current_date”myappS(bucket_name)” > $s3inputCommands
echo “createbucket private” >> $s3inputCommands
echo “quit” >> $s3inputCommands

cat $s3inputCommands

$JAVA_HOME/bin/java -jar $jShellDir/dist/jSh3ll.jar -h s3.amazonaws.com -u AWS_ACCESS_KEY -p AWS_SECRET ACCESS KEY -i $s3inputCommands -o
$s3Dir”s3output.txt”
echo “create bucket output”
cat $s3Dir”s3output.txt”
echo “after creating bucket: “‘date’

currentDir=/usr/ami/
amiDir=/mnt/backup/
#mkdir “/usr/ami/backups/”$current_date
dbDir=”/usr/ami/backups/”$current_date”/mysql”
#mkdir $dbDir

mkdir “/mnt/backup/”$current_date

/usr/local/bin/ec2-bundle-vol -r i386 -d “/mnt/backup/”$current_date -c /usr/ami/ec2/CERITIFICATE_NAME -k /usr/ami/ec2/PRIVATE_KEY_NAME -u ec2
_USERID -a -p $current_date”myapp(BUCKET_NAME)”

echo “after bundling: “`date`

/usr/local/bin/ec2-upload-bundle -b $current_date”myapp” -m “/mnt/backup/”$current_date”/”$current_date”myapp.manifest.xml” -a AWS_ACCESS_KEY -s
AWS_SECRET ACCESS KEY

echo “after uploading: “`date
ec2-register $current_date”myapp”/$current_date”myapp.manifest.xml”//This command register whole data as an image(private)

This script will bundle the instance as an image and upload it in S3 in a BUCKET with unique name.

One great thing about Amazon S3 is that all uploaded files are available as URLs from a web browser (or any application that can read a URL). The format of the URL is as follows:

http://.s3.amazonaws.com/

Recovering data from S3 :
For this we should go to jetS3t directory there we will see configs/synchronize.properties.Provide AWS
ACCESS KEY ,JAVA_HOME and AWS SECRET ACCESS KEY,something like this in it.

####################################
# Synchronize application properties
#
# This file must be available on the
# classpath when Synchronize is run
####################################

# AWS Access Key (required)

accesskey=01G4VJZ4VPV73ZXV10G2

# AWS Secret Key (required)
secretkey=5hl8jETZD7wvAsS5VDuQgfiTyuafExGgKbbGFRE4

export JAVA_HOME=/usr/jdk/jdk1.6.0_04

# Access Control List setting to apply to uploads, must be one of: PRIVATE, PUBLIC_READ,
PUBLIC_READ_WRITE
# The ACL setting defaults to PRIVATE if this setting is missing.
acl=PRIVATE

# Password used when encrypting/decrypting files. Only required when the –crypto setting is used.
# password=

Create a folder in which you want to store the data,after this go to jetS3t/bin directory and execute the below command.
> ./synchronize.sh –keepfiles DOWN bucketname foldername.

Now the data is being stored in the desired folder.When you will execute ec2-describe-images then will return back with the private image which user has created and using the desired image we can easily launch/host a new instance.

Useful Link:http://jets3t.s3.amazonaws.com/applications/synchronize.html

New age Banking is all about being Social and Cloud enabled

Enterprise relationship Management is very important for the success of Banking industry.

Offering loans to SME’s/SMB’s and individuals most often depends upon the relationship of the customer with the bank. This relationship is always in the hands of Employees of the bank. But the bank employees keep moving from place to place. The enterprise relationship can be tracked by having a Social collaboration tool that will have all the information and communication had with the client.

It is more powerful when this kind of a Social collaboration is integrated with CRM system. The CRM system tracks the relationship with the client more in business related manner, the Social collaboration will actually go further to track the social interaction with the customer.

Let us take a use case. Richard is an entrepreneur who was banking for his small business and individual needs with a Bank X and Bank Y for 10 years. He has plans to start a new business enterprise. But there was nobody he knew in the bank X as some got layed off, others moved to other branched. He hardly knew anyone in the bank. The only way he can estimated with his previous transactions. It was the similar situation with Bank Y. But there are so many soft factors, which cannot be tracked. Richard’s new business is actually a transformation of his old business with new technology to cater the emerging market. He has been heavily successful in turning up his previous business a success. Richard is also funded by a well known venture capitalist fund, which adds to the confidentiality of the business Richard is going to start.

Bank Y uses a Social collaboration tool, which is integrated with the CRM system of the bank. All the social interaction is communicated and entered into the Collaboration tool. This was any new person can understand customer relationship and measure it to the benefit of the bank. Richard approached Bank X and Bank Y for a loan.

Bank Y employees know the previous history of Richard and they were aggressive in perceiving a deal with Richard. Richard also felt very comfortable with Bank Y, as they treated him with all the information they had. Bank X couldn’t be so aggressive and has to take traditional route and losses the opportunity.

Bank Y gets this Social Collaboration tool from very successful cloud computing concepts for Social networking portals. They start using a cloud service, which is available anywhere with a login and password and makes quick communication with client to be easier. In fact they have mobile client with on there blackberry’s to communicate with the customers and internal communication with collaboration. This enhances there speed of operation with good information to carry with employees about the customers in chaos ridden banking industry, where they need to have first hand information to offer proper deals to the eligible customers. Bank Y also got this tool on a pay per use basis, which added up to to be a cost advantage and they were not facing those maintenance hurdles for the software.

We at Imaginea have always been at the forefront of applying cutting edge technologies to better serve our customers. If you are looking to apply and use cloud computing, social colloboration tools, web2.0 technologies and SaaS engineering for your new age Banking Solutions, get in touch with us.

(With inputs from Sivaram.S)