Amazon deals

Saturday, September 27, 2008

Writing your First Xform

Xforms isn't as complicated as people claim it to be. It is a simple, and with tons of benefits than traditional forms. Here's a step by step procedure involved inwriting an Xform that takes a persons name as an input and sends it to an jsp page process.jsp for processing.

1)

Open notepad and put in the following xhtml header

<html
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">


this header tell the browser the type of XHTML page and the different standards used as per W3C. the first line is the xforms standards, the second of schema for display and the third for the instance model. Without these your browser will not be able to intepret the page properly.

2)

Write the head section as you do in HTML, i'll elaborate the otter fields in comments delimited by //

<head>
<title>Xforms Example</title>


//The model specifies the Xforms data model. Instance contains all the fields you'll have in the model. Here we have only one field in the instance namely name.

<xf:model>
<xf:instance>
<name/>
</xf:instance>

//in submission action link to your serverside code
<xf:submission action="process.jsp"
method="get" id="sub"/>
</xf:model>
</head>


3) Now to the body part of the page.

<body>
<xf:input ref="name">


// the ref field is used to referance particular elements from the instance model. The label is what the label you want to show on the page

<xf:label>Name:</xf:label>
</xf:input>
<br />


//br is normal HTML break. The submission="sub" specifies the id as given in the instance model in head.

<xf:submit submission="sub"><xf:label>Submit</xf:label></xf:submit>
</body>
</html>


4) There you have your first Xforms ready. Save the file with a .xhtml extension and view in any Xforms compitable browser(click here to know more about xforms viewers) and there you go.

Tuesday, September 23, 2008

A Girl Called Deepa

I thought Deepa would be the ideal person to be referred to in this new blog of mine especially since no other girl could be introspected here, the case being a void in my personal space. The other day when the topic of writing a testimonial in orkut came up, it struck to me that not much can be said about this worthy being in a span of 1024 characters. So it struck to me to dedicate a blog to this girl who is typically intrusive, analytic and introspective and currently assumed a loving role of a foster sister to me.

Dee as i affectionately call her, though with her typical girlish charm has aura of silence surrounding her. This is a shell that one has to break into and go through the process of knowing and understanding to get this otherwise extremely talkative, fun loving female to open her mouth. Putting aside all the pinkish tags, the major reason dee serves as an admiration as well as an inspiration is the grit and valour embedded in her as a modern day female to face. dwell and survive in hard situations still bearing a smile on the face. She is one stop destination for advices from mobile phones to relationships ;) People who know me do know the fact that i turn a deaf  ear to most advices but this is one person i listen to and that must be enough for you to know how powerful advisory she is.

She's got an AWESOME handwriting and is one major brains!! She is but a typical girl who likes being admired, praised and gifted. Please don't think i am bluffing or trying to impress when i tell you she's one heck of a cook. My stomach vouches for the pleasantness and my tongue for the taste of the food she brought the other day to college. I secretly hope though that writing this blog would reduce the price tag of the rakhi gift i'm delaying in giving her :P She's got a sweet voice, and a patient ear to listen to. She is everything a girl should be and more.

I must say that she has a great future in whatever she takes up in her life be it being a great chef or a good housewife(pardon me she's doing a engineering course right now ;)) She's a female who easily assumes the role of being the spurtive oasis you see in you myriad dreams in wayward travels through this desert called life. I wouldn't end this blog with just this one entry, every word i type here henceforth, every character(whitespace or non-white space) is a dedication to this wonderful human being called Deepa. No matter how many twinkling eyes and smiling faces sneak upon me from the oblivion i shall never forget one of my best friends in UVCE, a true sister, A Girl Called Deepa. 567 words, 1502478 procesor ticks, are nothing but a token of admiration, a rose flower at thy graceful feet.

"We romanticize, criticize, fantasize and theorize about the eyes. So, why should beauty be any different. It's all in the eyes. But if you don't see the beauty of character, you will but realise that what you miss in life is a ray of hope, a silver lining in the dark black cloud called life, where humanity is by far a virtue and beauty a vice"

Monday, September 22, 2008

Xforms - An insight

Xpath, Xquery, Xlink, XSLT, Xforms uph... the never ending list of techologies that begin with an X and literaly give people headaches being one of the most complicated yet powerful SGML. This is a honest effort to render off itsy bitsy details about one such XML based technology - Xforms.

Well Xforms to begin with is a W3C recommendation that is a replacement for standard HTML forms. XForms provides a richer, more secure, and device independent way of handling web input. Pretty easy to learn actuall if u go through some tutorials like http://www.w3schools.com/xforms/xforms_intro.asp but they don't spell out the looming truth. You can very well write an xform page but to get it to display in your ordinary browser... well its close to defining hell. So here's what you got to do.

XForms browser Plugins


For Mozilla: Well for all those who switched to mozilla 3.0 there's no plugin available for Xforms, there goes W3c statements of supporting Xforms in all future browsers. The new kid on the block Chrome also doesn't support it natively nor has it plugins. For those still on Mozilla 2.0 check http://www.mozilla.org/projects/xforms/download.html

For IE: for once IE is good. Well atleast there are plugin developers who have developed plugins for Xforms for non native support. These include formsplayer and Novell

XForms standalone browsers


The most popular standalone XForms browser is surely X-Smiles, developed by the the University of Helsinky. X-Smiles is a Java-based browser, with full support for XForms and for Smil. X-Smiles works as well on PCs, as on PDAs as on (modern) mobile phones

XForms application servers


This is the third category which is quite useful if you don't want your clients to install software at their end to run your web application. That doesn't make it the recommended option though as its damn slow as the server process your xml based form and renders an equivalent html+js. However you can try it out in case you can sacrifice the speed for delivering your end users a hassle free usage of your application. The most popular of these application servers is probably Chiba 2.0, from ChibaCon. It is open source, very stable, and very easy to install on the server: just deploy the .war file on your favorite application server (Tomcat, JBoss, Orion, Resin, Oracle, WebLogic, WebSphere ...), and you are ready.

Friday, September 19, 2008

Lessons learnt

I've learned that it's taking me a long time to become the person I want to be.

I've learned that we are responsible for what we do, no matter how we feel.

I've learned that either you control your attitude or it controls you.

I've learned that learning to forgive takes practice.

I've learned that there are people who love you dearly, but just don't know how to show it.

I've learned that just because someone doesn't love you the way you want them to doesn't mean they don't love you with all they have.

I've learned that it isn't always enough to be forgiven by others. Sometimes you have to learn to forgive yourself.

Last but not the least I've learned that no matter how bad your heart is broken the world doesn't stop for your grief.

Wednesday, September 10, 2008

Don't move a database that has it's tables linked in db2

Hey guys, don't make the mistake I did by trying to move a database that has its tables linked. You'll get an sql error numbered 3304.

LOAD is a very fast and direct way to get data from a file residing in the file system into a table in your database. LOAD does not use SQL INSERT statements, as does IMPORT. Instead, it writes the data directly to the data pages in the tablespace. Additionally, less logging occurs to further improve performance of the load process.

So, we need to keep the behavior of LOAD itself in mind. If there are any dependent tables (tables that have a foreign key referencing the table into which data is to be loaded, for example), they might be placed in the CHECK PENDING state. Additionally, further constraints could also result in the table not being available right after the LOAD operation, requiring you to run the SET INTEGRITY SQL statement first.

So, you could either set INTEGRITY SQL or you could do the mapping in your buisness logic using entity beans.