Category: programming — Nuwan Bandara @ 2:43 pm — Comments (0)

Good tutorials and resources on Apache CXF How Tos are not easy to digg. I had to spend hours searching and reading to make my small application up and running, Integrating Spring with JSF was pretty straightforward, but when it comes to integrating those two with JSF i got stuck.

So this post is about exposing a web service as a web project using JSF front end / Spring backed and CXF for service invocation

before starting I should mention few valuable resource around the net.

The web service u used was the publicly available spelling checker which is used in the netbeans tutorial.

The Step by step guide as follows >>

Step 1 :

Create the classes from the WSDL you can use netbeans for this task or WSDL2JAVA command (wsdl2java [URL]) in the shell.

(more…)

Category: About Me — Nuwan Bandara @ 1:14 pm — Comments (0)

It’s been a while. Didn’t have time to blog or rather didn’t have much to blog about. Its the final university year, work is crazy. Too much report writing, formatting references :) and researching about almost everything related to IT. I started my thesis, and was super busy with catching up all those new technologies, testing and code cutting. well its all about SOA (Service Oriented Architecture) yeahhh its hot stuff around these days, and mine was to introduce a better architecture with new technologies for public infrastructure re-engineering and service governance.

So yeah guess I will be posting on SOA for a while, and yeah mostly JAVA stuff. :)

Category: Java, Sinhala, Unicode, programming — Nuwan Bandara @ 4:58 pm — Comments (6)

Lat few days i was stuck with some web dev work for archmage. For the 1st time i had to localize a website in sinhala. Hence i had a longing desire to do something on sinhala i was glad. (Also getting payed for it :) definitely a chance. ) so yeah the site is www.technology.lk still under construction. The site back-end is powered by Joomla CMS and the famous Ecom component virtuemart. I had to prepare a language pack (Sinhala) for virtuemart, not a hard task, yet translating about 200+ words to sinhala is a boring task, so i was googling for an English-Sinhala Translator tool, Found Madura Dictionary. Unfortunately the sinhala words given in madura is not in Unicode. so it was impossible to copy and paste in my language pack php script.

After having a chat with my dear friend sanda, he suggested a FireFox plug-in which was developed by the University of Colombo (UCSC) which does a similar task. the plug-in came with a sqlite database which consisted nearly 50,000 English to sinhala translation words, and in Unicode. I was thrilled to see this. So for my personal satisfaction I just put to gather a small translator tool where you can type an English word and it gives some Sinhala suggestions (in Unicode).

En-Si Trans

Made it in Java, also wanted to test this new swing look and feel called Substance which did work smoothly. so yeah you can download

this tool and use it, modify it or what ever :) .

have fun,

p.s. : I will publish the Virtuemart Sinhala language pack in my next post.

Category: About Me, Joomla, LAMP, PHP, Web Designing & Development, open source — Nuwan Bandara @ 7:14 pm — Comments (0)

Well, not hoping to write about my dreamy vacation, so will just tip off the few productive days. :) Yeah so i was doing some work for Archmage last few days, gave life to a dead project, played with joomla, wordpress and osCommerce.

After much research and hacking me and few of my friends at Archmage thought of using Joomla and Wordpress as core CMSes for our web development tasks, to make the work more rapid and easy. So yeah am hacking and looking for plugins and modules that i can use on joomla. Since last two weeks i was working on a real estate project and an e-commerce one. i was looking for resources on them. so yeah if you are looking for something similar try Estate Agent Improved for real estate and Virtuemart for E-Commerce. both are nicely made, Joomla plugins. With a little bit of customization they can be used like a charm.

OH and yeah today i gave a new look to my blog. :) last night i updated to Wordpress 2.5.1 ( yeah I know FINALLY!! :) ) Edit: I updated it again today (16th June) to WP 2.6 :) .  Many thanks goes to Andrayogi for a pretty neat template. Added some plugins, had some problems with the DIGG IT icon. My firebug started giving a javascript error “unterminated string literal” and finally found a fix.. well its simple just edit the plugin and add

digg_bodytext = '<?php echo trim(preg_replace('/\s/', ' ', get_the_excerpt())); ?>';

instead of

digg_bodytext = '<?php get_the_excerpt(); ?>';

That will fix the error. yeah so the site looks pretty neat. am sure many over the net uses this theme. even tried some different colors and combinations but thought this is the best combination so kept it in original.

Soo yeah will write some thing with more value soon.

cheers !

Category: Uncategorized — Nuwan Bandara @ 9:10 pm — Comments (0)

Want to find a sponsor for you ? or your project need to be funded.. check this out http://www.peerdreams.com/

Category: About Me — Nuwan Bandara @ 9:26 pm — Comments (0)

This is my 1st post after 15th February. I was away from most of things i was doing and was doing some serious thinking. Had to take some important decisions in my life. I realized everything around me is so rapidly changing, and above all shockingly i have been changed. Well yeah this post is also a crappy post with no much importance, but well thought of writing something before i go to my usual articles from tomorrow onwards (Hopefully :) ) After all its my own blog, and am not making money out of this. so its my world i write all what i want. :)

I finished my Internship in Germany and am back in Sri Lanka, enjoying the warm weather :) , mocking at politics, freaked out about the inflation and of cause surviving from the random blasts, Then again its home, no place like home isn’t it? At the moment am entirely jobless, not doing anything productive. sleeping most of the time (Dreaming :) ). Oh but soon after i came i wanted to fix a nice geeky work station to start my University final year with. Yeah so last week i bought a nice 19inch Wide screen LCD, a comfortable MD chair and resembled my old PC with some new pieces. so now it looks neat and looking hot and with all theHAHOO about the Original Software I just switched to Ubuntu hardy without a hesitation. so yeah now am 100% Linux. hope I’ll stay that way.


work station
So yeah I don’t intend to write much about myself, as i said i took some important decisions which is more or less life changing (maybe a bit life threatening too at the moment, yet am really happy about how everything turned out to be). So finally what i really want to do now is to scream out so loud, SO LOUD AND SAY HOW HAPPY I AM.

cheers !!

Category: About Me — Nuwan Bandara @ 9:00 pm — Comments (3)

Thought of writing another post under NO category / general (I do this when I don’t have anything useful to blog about yet when i have alot things to blog about.). Last couple of days I was pretty busy with work. (Was playing with some Ajax frameworks for JSF.. and yeah I will write about that in my next post… it was pretty fun using Ajax in your Java EE app). So anyways as my topic says.. this Post does not contain anything important.. well maybe about movies if you are a great fan of All kinds of movies :)

Valentines day

Yesterday morning after i woke up and checked my mail…. (Well yeah i do that before having a morning tea…in-fact first thing after opening my eyes :) not that am getting thousands of mails that I should reply, but it had been a habit, which i cannot get over with). My Girl Friend had sent me an email saying
“…..oh btw…i knw we dnt celebrate but happy vals day..muwaaaahhhh…my valantine <3″
I was like WHAT ?? OH Crap the Valentines day… that’s how I knew that yesterday is the so called lovers day.. For last couple of years 14th February was just there… as she said we never used to HAHOO about it.. one reason, we were having more important stuff to worry about, and we never saw a point in that idea (same as Mothers’, Day Fathers’ day, That Day and This Day but accept the Birthday LOL )… But any how This time I thought of sending something to her.. Not that I suddenly saw a meaning in that idea, But by the end of the day i felt like i want to send something… well i do believe in doing things without a meaning.. (am talking about the Day.. not sending something to her :) ).. Anyhow yeah for the 1st time later that day night, I ordered a valentines Gift to be delivered to her… !!!

Blogging

Last week with the 1st release of the project i was working on, I got some time to surf around the net and do some reading..Specially about blogging, SEO, Micro Blogging, Pod-casting etc, etc, (Yeah my last post also a result of this reading). I was reading quite alot of blogs, Mostly Sri Lankan (Through SLBlogs and Kottu), and i found pretty interesting ones not to mention there were some Sri Lankan Blogs which discuses some serious topics in charming way (its a complement).

When I started Blogging back in 2007 i didn’t have a clear reason, the only reason I started was that I had a server to play with and a DOT COM domain was not so expensive. The reason that am doing it still is… well I dont know !! maybe i will stop it tomorrow…. !!! Anyhow still am enjoying this..its nice to see the graphs in Google analytics, and some times when some of your posts come in googles’ 1st page of search results under java or Linux hacks.

Another thing I came across last week was some thing called Micro Blogging.., well its not a new thing (Was new to me).. but well Its a pretty strange way of blogging.. because when you read one of those blogs, It doesn’t make any sense Why you do it.. !! Then again I celebrated the valentines day didn’t I !! :)

With my last article (The criticism about a criticism) I happened to do some reading on this So called HOT topic SEO. After reading some articles i actually wondered, Whats there to talk about this much. SEO for me is all about good content..!! infarct 99% of the Google page rank is directly depending on the valuable content, its The valuable content which makes back links (Organic links).. All other gambling which is done is just a matter of 1%. And that 1% can never make you site go more than 2 in PR. One of my friends last week said, doing SEO is like we are putting few bugs when we program. :). But i must also say before 1998 (before Google born) SEO was a big deal. Meta tags and keywords made a huge difference, But with the Goolge’s Algorithm the story took a different turn. So Don’t waste time in gambling for back links. write valuable content it will surely make a deference.

Movies

After i started my Interns in Germany since last July, I guess my Bit-torrent client is running nonstop (well maybe few days of a rest on my notebook). Soon as i landed here my 1st wish was to experience, at-least more than 2Mbps DSL line (That’s the best we can have in Sri Lanka). Making my dreams come true for few euros i took a DSL connection of 4Mbps . and was being fond like a child with a candy bar. My room mate those days said… “Dude now you can download movies faster than you watch them.” apparently making that statement true. I had a to buy a bigger hard drive after not more than one month. So yeah I took a 500GB external hard Drive, in august, and yeah 90% of it is now filled.. !!

Okey so I guess the above lines says that I have downloaded almost all the rated movies in IMDB… so for the all types of movies fans… there are few good stuff i wanted to tell..check release log every day.. It contains almost all the releases up-t-odate…maybe you feel its too much information, and yeah true..yet its a valuable site.. I found it through Kasun.

And check out the torrentfive.com this a good site where they publish new movie torrents with good quality. One drawback is you have to register before downloading torrents.

Talking about some TV series, I got to write about Band Of brothers, this is an awesome war story. Not a new one yet then again I found it recently. Jericho 2nd season is out and casting on every Wednesday, but with the strike of the writers guild i am missing some pretty good stories these day, Office, Heroes are among them.

So yeah I will not waste time writing about my 430GB movie collection, just visit release log and download what ever you like.

All sort of other crap.

Well other than above… when i stared writing this post i wanted to write some Sri Lankan politics and some philosophical stuff, but after writing the above… i think i am done jabbering about crap for the day. So this will be my last post on general or “No Category” category. (At least for some time :) )

So…am sorry for wasting your time !!

cheers !!

Category: Uncategorized — Nuwan Bandara @ 1:41 pm — Comments (2)

Well Its been some time that I have written a post under the category of general, or rather non-technical. After reading my friend kasun’s blog, I happened discover an interesting post of a fellow Sri Lankan blogger, which made me write this. Few days back I wrote the news about SLBlogs, and yeah this post is also about SLBlogs, or rather about a criticism that SLBlogs received recently.
Before I start saying anything, i must say that this post brings no offense on the fellow blogger who made the criticism.
Sir William Arthur once said “Flatter me, and I may not believe you. Criticize me, and I may not like you. Ignore me, and I may not forgive you. Encourage me, and I may not forget you.”
So yeah Criticisms are good, they may not make the critique your favorite, but you will remember an encouraging criticism.
I am not naive to say that SLBlogs is a perfect Blog syndicator, or that it is THE Sri Lankan Blog-o-spere. SlBlogs is 1 month old child. Which can and will improve with age… yet again, I find some unrealistic or let me put it this way, “I cannot 100% agree with mind blogger with his 5 points on SLBlog not being THE Sri Lankan Blog-o-spere”. So I will just point out how I see these five points. Then again it’s how i see :)

1. Blog syndication networks work no more without specific niches.

I do agree with Mindblogger up to a certain extent. Its true SLBlogs still has 16 Blogs syndicated, it lacks content. I do read Kottu to find some news and ideas. But well SLBlogs is one month old. still the bloggers of Sri Lanka doesn’t know about it, and surely if The MindBlogger have syndicated his own blog to SLblogs.org and wrote this criticism I will not see the hypocrisy behind this 1st point.
As we all know a Blog syndication site work its way, from the help of its contributors, and when that Syndicator says it’s for Sri Lankan bloggers. The Sri Lankan blogging community has to help it. The owner of the Site will do his part. Yet as the Bloggers in Sri Lanka, we also should do our part. So how I see about Mind Bloggers 1st point is That SLBlogs is not 100% responsible in its Contributor count.

2. Doesn’t know open link-baiting could ban a blog.

This is one interesting point!! The MindBlogger have directly Mentioned that SLBlogs.org doesn’t know anything about open link-baiting. Actually till I read the Mind bloggers comment under this point, I didn’t have a clear idea about this topic, not that am saying The MindBlogger have a clear definition of what is Open Link baiting is…. I knew that John Chow and the BMW -German website has been banned and ranked 0 from Google due to some illegal ways of search engine optimization.
Yet even in Google’s terms, Google doesn’t explain how it will be illegal to build links, or make your page ranks grow…. So yeah!! After some reading and surfing over the net what I finally found is that link building or baiting is not at all illegal. Am not saying that Google is wrong in banning John Chow or BMW. What am saying is there are healthier ways of link building. If you are really interested in reading about this topic. I found a nice article in the Smashing Magazine.
So if I come back to what I was telling… What SLBlogs have mentioned in its Competition page (Which the sentence is no longer there) is as I can remember “OF CAUSE you can also add a link to SLBlogs” There is no direct sentence saying that you will get a Domain if you link back to SLBlogs. What it clearly said is..if you really want you can put a link to SLBlogs. This is not at all similar with the John Chow situation.
John Chow directly asked from his readers to make a link to his blog when those readers use certain key words (”make money online”) when they write posts in their blogs. For the people who do this John Chow gave a link back. Yes this is an extreme of link building. Its like you reserve a keyword over the internet for your own blog.
So What I see in Mind Bloggers second point is that he doesn’t know what is link building is. (Well I didn’t know it before too :) ) If SLBlogs attempt of building links is illegal it will be closer to illegalness if someone uses an Internet Marketing Link Exchange Directory. But what am saying is using that kind of a directory is also not illegal or its rather in the Gray Zone. (There are no direct definitions of the limits in this matter). So as I see SLBlogs should not remove the line which said about this. (Well Its all SLBlogs decision.)

3. “7 things Why a slBlogger needs a RSS reader!” - now, that’s a bit cliche.

“Cliché” if I am correct with this very word and about the SLBlogs article. I should actually ask why is it so… even the MindBlogger say do not ask. My view for this point is, This is another Blog Post. Yeah it is done by the owner of SLBlogs. I am not saying the topic of this article is very suitable or colorful. Yet the content of this article is not “Cliche”, at least not to me. Yes this post contains some nice phrases about me… and one might say am writing this to defend myself. Then again this is my Blog, and this is My thought. This reminds me of only one thing, several days ago, i downloaded some of the linux.conf.au 2008 talks. In the talk, “Fixing Web”, look at the first minute of his talk and you’ll see why..

So what am saying is Something being Cliché is so personal. Some great programmer can say my whole Blog is Cliché. I write what was new to me.. What I found..There can be people who know all what I write daily… But yet.. There can also be people who don’t.. So a blog Post will never be Cliché.

So in this case there can be plenty of readers who don’t know about a RSS reader. Being honest I started using Google reader after I started Blogging. Thanks to Sandaruwan. So yeah why do you need a RSS reader….? SLBlogs says WHY….

4. Open display of subscriber count?

Yes on this point I do agree with Mind Blogger. But yeah as usual its only because the display of the feedburner. I do agree that SLBlogs should remove this, from its Display.

But I would like to put out the main reason as I think why it is only 3. SLBlogs is not in my Google reader too. In fact I do have a question why is it 3. It should be 0. Why I say this is. SLBlogs is a Blog syndicator. Why do you want a blog syndicator in your RSS reader? I don’t want to read all the posts which are pasted on SLBlogs. I have only few and some important blogs in my RSS reader.

What am saying is the Subscriber count in a syndication Site Does not show its regular readers. So it will never be 50 to show. With a syndicator what you do is, you visit the site time to time, do a quick sniffing around the posts, then if you feel like it’s good, click on the link, go to the individual blog and read it.. Then subscribe to the blog if you want..

So anyhow. I also believe SLBlogs should remove the feedburner display. Because it says nothing about SLBlogs.

5. Take a look around.

As i see The Mind Blogger in his 5th point have said that the Sri Lankan Blogging community will be offended by SLBlogs motto.

slblogs.org “the” Sri Lankan blog syndication network

well this is partially true. Yet there is always another point of view. Someone can be so narrow minded and think that this phrase is an offence to all the great bloggers in Sri Lanka. Yet all Companies, societies, products..or ideas do have their own mottos. SLBlogs as it seems has a clear goal of being THE Sri Lankan blog syndication network. SO they are using this phrase as their own motto. Which is not closed to any great Sri Lankan blogger.. It openly invites all the Sri Lankan Bloggers to Join Its community.
A simple example is… while I was walking outside today… An Italian restaurant said

Have the Experience of Nectar in Heaven.”

I know it’s funny. But well there are very few English billboards in Germany. Anyway my whole point is. Each of these people including SLBlogs need to gain attention from the community. So they use their own mottoes. So if some blogger will get offended by this kind of a motto. What kind of a blogging community do we have?
So I guess I have written the lengthiest post in my blogging life… yet again. This is just my opinion. And SLBlogs have to be happy because criticisms always make you popular. And as Mind Blogger said his 200+ loyal subscribers will surely make some traffic on SLBlogs.

Finally I should say. SLBlogs is doing a good job. There are things to be learnt. Things to be changed, and things to be improved and criticized, I hope the admin of SLBlogs will do these changes in order to make it a more mature network.

And before wrapping up I must again mention this does not make any offense to anyone. This is my point of view. Open for debate… !!

Category: Java, Web Designing & Development, programming — Nuwan Bandara @ 2:59 pm — Comments (0)

After few days, got some time to write a post… well as i promised in my earlier post.. I thought of writing about the Annoying problem anybody will face while using selectMany component in JSF.

At 1st with out any experience what any one would do is writing both assessor and mutator methods to return and set A LIST of selected objects. some thing like

private List<myClass> selectList;

public List<myClass> getSelectList() {
return selectList;
}

public void setSelectList(List<myClass> selectList) {
this.selectList = selectList;
}

Even though this is the straight forward way, For some reason JSF implementation does not support it. In many places over the NET and in JSF forums, people have advised to use String Arrays, Saying you cannot use Java Collections in this scenario.

But Use of String Arrays are very much annoying and makes your work very messy. After some testing and trying I found this work around to take the selected objects as it is, not just the label string, Its pretty simple. Instead of using String arrays, Just use an array of your own class. Something like this

private myClass[] selectList;

public myClass[] getSelectList() {
return selectList;
}

public void setSelectList(myClass[] selectList) {
this.selectList = selectList;
}

Of-cause you have to use a converter in this case but not difference out there its just a normal converter for your class. So hope this tip will help

cheers !!

Category: Java, Web Designing & Development, programming — Nuwan Bandara @ 2:27 pm — Comments (19)

This is one problem i faced when i worked with select-many and select-one menus in Java Server Faces. For any one who have worked with JSF knows that you have to use custom converters in order to populate select-many and select-on menus with ur own data types.

if i elaborate on this a little bit, Select menus are not just there to show simple value-label pairs. you can give directly an object to its value and one of its fields as the label. for an example,

public ArrayList<SelectItem> getLandSelectList() {
if (landSelectList != null) {
return landSelectList;
}
    landSelectList = new ArrayList<SelectItem>();
List<Land> landList = this.getLandList();
for (int i = 0; i < landList.size(); i++) {
        landSelectList.add(new SelectItem(landList.get(i), landList.get(i)
.getLandsName_DE()));
}
return landSelectList;
}

The returning Select list can be taken to a select one or a select many list box like..

<h:selectOneMenu id=”listBoxLand
value=”#{userManagerBean.land}” required=”true”>
<f:selectItems value=”#{userManagerBean.landSelectList}” />
</h:selectOneMenu>
<h:message for=”listBoxLand” />

This component will set the selected land object directly to the backing bean. If you used simple value(some text or the id) - label pair. you should again query for the object from the selected id and save in the backing bean. but in this way that extra trouble will be handled by JSF.

The problem is if you do it just like this with out anything else.. you will get a wired validation error saying “Validation Error: Value is not valid“. This is where you start googling and debugging. Well after some hours of googling..(couldn’t do much debugging because this is a exception thrown by JSF framework) and reading about 10 to 20 forums i found out that the object which is loaded and the object wich was selected will be compared when setting to the backing bean. So if your object’s Class has not overridden the equals method this error message is shown.

So what you have to do is. if you are using your own data Objects for the select menus or in that case for any other JSF tag where you will use converters. You have to override the Equals method. Probably do the comparison with the Id, or with some unique value in that data Object. That’s it.. The problem solved. In my case the equals methods looks like

// overridden equals method
public boolean equals(Object obj) {
if (!(obj instanceof Land)) {
return false;
}
Land land = (Land) obj;

return (this.id == land.id);

}

Yeah hope this will be useful to some one.. !! I will write another post on how to use Java Collections when working with Select-Many menus.