Okay Fine… for the past week i've been thinking of this over and over again…
why not post a blog about what i've done in the office for the day before i leave home from work.. or blog in the morning to what happened to me the night before…..
Yeah I know everyone does that.. but hey.. I wanna do it too.. sayang naman tong i.ph blog ko kung wala rin lamang laman..
To start thing off..
I've been doing this project given to me by Sir Sherwin to come up with a UI resembling our Time Clock System using XUL generated by perl…
Here's the problem… perl is a server side programming XUL is an interface language meaning it doesn't have any other functions other than being an interface…
A little background on XUL…
XUL is around since 2001 i think and it's the interface in all Mozilla products… Firefox, Thunderbird, etc… To add functions to XUL we use javascript… btw, XUL is actually like XML… And is really fun to see…
So how does perl generate XUL?
By using a module by Jesse Vincent called Template::Declare (it's in CPAN)
with that installed we need not anymore learn much about perl… if you are good with formats then you're set to go..
I would really like to make this into a tutorial but maybe next time.. or if anyone requests it…
So okay, i'm done now with the UI… next question is.. HOW DO I LOGIN?
XUL has no forms… it doesn't need them because XUL does not send data to server hence 'THERE IS NO DATA.
THERE IS ONLY XUL.' tagline…
…that poses a big problem since i need to log into the time clock system…
there are 2 ways of working around it in XUL.
1.) since it's like XML ( i think it is and not like) we can use: XMLHttpRequest
2.) if you REALLY want to use forms.. we can use HTML forms by embedding it and adding it to the namespace..
ref: http://www.xulplanet.com/tutorials/xulqa/q_submit.html
BUT, I tried to use HTML forms.. the thing is, it does not display… It's there but it not.. weird..
so I'll use XMLhttpRequest… the thing there is i need to make another XML file? for what? my data is in a database..
So we have to have another work around…
I found an element called <http:serverpost />
it acts like a form for XUL and sends it using the post method to a page…
But if there are solutions.. there are bound to be problems again… http:serverpost is not part of the Template::Declare tags (Template::Declare currently support XUL HTML and RDF only)
Being makalkal as I am… I made my own tag declaration so that the template declare can reconize my http::serverpost element..
So okay, it is now displayed in the form.. the thing is.. it POSTS but it doesn't post the right things… what I get as a response is the whole page of th targetURL (the page where I was supose to send the message) without the data that I was suppose to send..
And I've been researching about the serverpost element for two straight days.. no answer found.. .. no forum post.. no mailing list post… as if like it's there being used by everyone and no one is getting any problem.. IT is there since 2004! or maybe no one's bothering to use it? serverpost spec in mozdev.
So i guess with that into about serverpost maybe everyone can support it somehow… currently it's 0.6 and i think it's embedded in firefox's chrome..
with that serverpost partly useless. I'm back to perl…
In perl.. I tried to use 2 methods…
CGI.pm
and
LWP
CGI is useless and I can't figure much about it…
and LWP? I'm currently on it..
I'll post about CGI.pm and LWP maybe next time.. or if I have more things to talk about it…
So there… this is getting too long for me to keep up.. and I must shut up somehow…
BTW, Christmas Party naming mga intern sa school bukas.. hehe ala pa ako suot.. tae, Hollywood Movie theme.. corny!