Five years and already a liferay of memories

March 15, 2010 By David Truong

This month marks the fifth year, I've been with this company.  A quick warning: I'll be sharing some personal thoughts so if you are looking for something more technical check out Ed Shin's post for that (we started at the same time, so it is his five year anniversay also).

Liferay was my first real job.  I was 22 when I accepted my Liferay position and they gave me 3 days to move to LA.  It was the scariest decision I had made in my life but it has turned out to be one of the most rewarding.

I remember the first day I arrived thousands of miles away from home (I'm from Chicago), I walked into 6 guys in a tiny cubicle.  On that day I connected with my ancestors a little bit more as I tasted what they must have went through working in Chinese sweat shops.  That though was not the biggest shock of the night. 

I was told that they would provide room and board when I went to LA.  They told me a hotel or some alternative would be provided.  The alternative was provided.  The alternative was Brian Kim's friend's apartment floor.  Yes, Brian Kim's FRIEND's apartment floor!  This floor was to be shared by Brian Kim, Ed Shin, and me...  If you are wondering how I made it past that first day... I've wondered that same question many many times. 

I can do all things through Him who gives me strength.

Things actually got worse.  A few days later, I discovered BKim's friend was a trader and went to sleep at 10 pm and work up at 5am.  The bathroom was conviently located in his bedroom.  It was 10:30pm.  I needed to use the bathroom but I was afraid to wake up his friend so I just held it.... until the morning.  I never fell asleep that night because I was afraid I would accidently pee in the queen size aerobed I was sharing with my coworker Ed who I had met yesterday. 

"Have I not commanded you?  Be strong and courageous.  Do not be terrified; do not be discouraged, for the Lord your God will be with you wherever you go."

Things actually got worse.  So I let Brian Chan and Brian Kim know that I was uncomfortable living at BKim's friend's apartment floor.  Ming-Gih one of the other new hires let me know I could stay with him.  He lived at his friend, Wilson (who eventually joined the company)'s sublet room floor.  It wasn't much of an upgrade but at least the room was private, the bathroom wasn't located in some strangers room, and because the friend was going out of town, I could sleep on the floor by myself.  We stayed there two days before the police came and informed us that Ming Gih's windshield got smashed over night.  Wilson's landlord thought we were part of a gang so we left in search of a new home where we could rest our feet.

"For I know the plans I have for you," declares the Lord, "plans to prosper you and not to harm you, plans to give you hope and a future."

The next day Mike Young graciously volunteered his home and took care of us the rest of the weekend.  That was my first week in LA.  Honestly at the time, I was ready to go home already, but I'm glad I didn't.  Looking back at it now, I laugh and realized it made the rest of the journey that much more memorable.  That was just the beginning and definitely things could only get better from here... right?

My New Obsession: SEO and Liferay

February 3, 2010 By David Truong

So BChan should have never given me a server.  Since making my wedding site, I've been exploring different things about websites outside the scope of portlet development.

This includes:

  • Setting up a full web server (not just running startup.bat)
  • Business (if you could call what I'm doing business) Requirements
  • Advertising (adsense, etc.)
  • SEO

The last one has become somewhat of an obsession for me.  It seems silly to want to have Google/Yahoo/Bing list your website because after all who is going to want to search for my wedding website, but there is something truly satisfying knowing that you are ranked in the single digitals for a search query.  I am current ranked 3 for "david and winnie" because there's some dude named David Winnie... arg!

Well anyway's I've come to let you guys know my discoveries (that is if you care at all about SEO) so you don't make the same mistakes I did.

1.  If you can live with url sessions you should immediately disable it.

This is how: session.enable.url.with.session.id=false in portal-ext.properties

Most of us don't need it since most of us require cookies for our sites || (don't require cookies && url sessions) I would actually recommend everyone do this.  Here's an article that explains further why they suck and also shows you an alternative way to remove them if you aren't lucky enough to use liferay.

Why?  Because googlebot and all the other crawlers don't support cookies so the url's to your site all end up with ;jsessionid=12356yourseoisscrewed5950 and you end up with duplicate urls because ;jsessionid=12356yourseoisscrewed5950 != ;jsessionid=6079messedupseo459056.

2. If you need them, you need to set up mod_rewrites for them immediately

I can't give a full answer for this one since I've never done it.  But I did read alot of stuff so here are some suggestions...

Make a RewriteCond for Googlebot, MSNBot and all the other ones you can think of.

Then a RewriteRule that removes the jsessionid...

I'm not sure the what the answer is really... if you know leave a comment.

3.  If you've messed up and trying to recover from your mistake (same boat as me)

First read this article.  Then do what they say =).  It took me awhile to figure it out since I didn't know apache that well because I was trying to do everything in http.conf.  I had to do them in my virtual hosts conf file before it worked because I have my server running another site (maybe I can explain another day what I learned from that site).

You are basically writing a mod_rewrite that tells the crawlers that all urls with jsessionid's appended to them have moved and they will take them off the list of urls for your site.  This is good because you won't have duplicate urls which makes them think you have duplicate content.

So there you go...

If someone can tell me how to use robots.txt for virtual hosts.. or even setting it for just one server since all my sites will use the same robot.txt   And I did read the wiki... just need more explanations =)

My Wedding Website

January 21, 2010 By David Truong

Hey guys,

So I promised I would put up a link and so here it is: www.winnieanddavid.com

Here were a few things I learned...

1) Weddings are really expensive... I should create a donate to my wedding portlet and let anyone send money to my paypal =P

2) Props to you if you are good at photoshop.  The pictures took me a long time to do and they don't even look great.

3) My site doesn't work in IE and I don't care

4) MP3 player's don't really work well for websites unless it's flash.

First a lot of people don't like them but my soon to be wife does so sucks to be them... 

Next reloading a page causes a song to start over each time... I spent seriously 2 weeks trying to figure out a good solution.  If you have a flash site, this isn't a problem but unfortunately I don't know how to code in flash/action script.  I didn't really want to use frames and in all honesty... I wasn't sure how to do frames in Liferay...  I tried a flash mp3 player with autoresume but it didn't seem to work in Firefox and I do care about that... so I decided on making the whole content part (everything under then nav and above the footer) refresh with ajax.

AJAXNav = {
	init: function(params) {	
		var layouts = jQuery(params.className);
		this.changeNavURLs(layouts);
	},
	changeNavURLs: function(layouts) {
		var layout;
		layouts.each(
			function() {
				layout = jQuery(this);
				var friendlyURL = layout.attr("url").replace("/", "#");
				layout.attr("href", friendlyURL);
				layout.click(
					function() {
						var a = jQuery(this);
						var p = a.parent();
						p.addClass("selected")
						p.siblings().removeClass("selected");
						var plid = a.attr("plid");
						var friendlyURL = a.attr("url").replace("/", "");
						//var url = document.location.hash;
						 window.location.hash = friendlyURL;//url;
						jQuery.get(
							"/c/portal/url?p_l_id=" + plid,
							function(html) {
								jQuery("#portal-content").html(html);
								var layouts = jQuery(".sub-nav-item");
								
								if (layouts.length > 0) {
									console.log("processing .sub-nav-item");
									AJAXNav.changeNavURLs(layouts);
								}
							}
						);
					}
				)
			}
		);
	}
};

That was the code I wrote in javascript.  If you noticed the url was /c/portal/url which basically hit a custom action I made that spit back portlet.jsp.  It worked actually fairly well actually but I had some other issues. 

The back button stopped working so I had to do some funny things with the url adding anchors (i.e. #home) to signal the page changed.

I couldn't get the AJAXNav to play nice with the twitter widget... and unfortunately that was just cut and paste from Twitter so I can't modify that code.  I actually wrote my own twitter portlet that parsed my rss feed so I could still switch to that but I'm not sure all that work I did was worth the effort anyways.

In the end I think I will just make the mp3 player into a popup so you can leave it running if you like or close it if it bugs you.

4) Now that you all discovered I am not a cartoon ninja, I have decided I must put up a real image of myself soon for my avatar (which I liked as a movie).

www.winnieanddavid.com

Love, Marriage, and Liferay?

December 23, 2009 By David Truong

It's been awhile since I last posted a blog.  It's not like I had a bunch of avid readers; in fact I would be surprised if I even had one.  But nevertheless a lot has happened which has kept me away.  The most notable thing is that I got engaged and I am now in the process of getting married.

Being the prideful web programmer that I am, I decided I had to build my own website.  I was thinking which direction I could go.  I could have used Word Press.  It's easy and honestly it's a pretty darn good product.  In retrospect, it may have been the better choice but I decided to go with Liferay.  I used the EE version since I can generate my own keys but I could just have easily gone for the latest 5.2.x CE.  Both are excellent solutions.

I had to eat my own dog food I guess but right off the bat I want to tell you, it tastes pretty darn good.  I only brought up that maybe Word Press was a better solution because of a few things, cost and how simple my website was.  I'll let you guys know my experiences of using Liferay for my wedding site but if some of you guys want to stop now, here is the bottom line.  Liferay isn't the best choice for personal websites, but I can see why companies use Liferay and fall in love.  It is the best open source portal in the market (fact) and maybe the best portal period (maybe I am biased).

First thing first I go over the negatives of Liferay for my wedding website.

There were too many features, too many options.  In real life this wasn't a negative but because my website was so simple I had to decide between all the different options.  Should I go with cms, portlets, leverage existing Liferay portlets?  The options were endless.  It was a good and a bad thing.

Second and last negative.  This is a biggie.  I couldn't find a cheap place to host my site.  Java hosting is expensive!!!  Not quite as much as getting married but it's not like php.  I could have done tomcat hosting, but it was pretty complicated to get it working right and even harder to get it working with my plugins also since I didn't want to build anything in the ext.  I tried to get a vm but they were usually around 50 dollars a month!  When you're saving any way you can for the wedding of your dreams, there is no way to justify that. I was just going to have to swallow my pride and go to theknot.com and use one of their templates for my site.   Luckily Liferay, loves me and gave me my own private vm so I didn't have to resort to that =).

Ok now for the good things.

It's so easy to develope for Liferay.  The plugins have made my life as a liferay consultant so easy.  I built all my portlets and theme in a matter of a few days.  I'm a Liferay expert of course so it made things faster but still Liferay is simply a fantastic tool to use to build a professional website.  We could really change our product and call it Liferay Framework and I doubt anyone could disagree.

The CMS is so much better now.  I am one of the first employees in Liferay so I started using Liferay from its earliest versions.  I remember on one project for a non-profit we built much of their content on our CMS.  It was a nightmare.  We built some of their content with portlets because the CMS wasn't advanced enough to handle what we needed it to.  If we did the same project today, I doubt we would need portlets and I think I could have done the entire project myself instead of needing a 3 man team.  It has gotten that easy and that good.

There are a lot of features that are really made my life easier.  I used remote publish from my laptop to publish my website to my vm.  If I didn't want to do that I could have just manually exported my communtier to a lar and then import it back.  I could create different communities and host other sites if I wanted to.  And Liferay is almost easy enough that I might be able to ask my fiancee to do some stuff.

Using Liferay did allow me to do somethings Word Press wouldn't have allowed for (not that I know of at least).  I was able to build a guest list portlet where I could input all my guest and have them register what foods they want.  I can later export this to excel if I feel like doing that and I guess that's the beauty of using Liferay.  I feel like I have the power to do anything I want as long as I want to put some hours into it.

* Hopefully I can update this post with a link as I'm still in the process of getting all the content written =).

Idealist vs. Pragmatists

April 3, 2008 By David Truong

I read an interesting article today.  You should probably read it first to understand my thoughts but I’ll summarize since most of you aren’t gonna read it and it’s a bit long anyways…  It’s talking about the decision Microsoft has to make with IE8.  The problem is that IE7 and below are all bad browsers because by default they are in quirks mode (it means it renders the page funny… ie style).  The dev team now has to decide if they want to go the same route or switch to standards mode which is what firefox, opera, safari does… and I know most of you are thinking oh of course switch to standards mode… but in reality the solution isn’t that simple because that mean’s millions of pages designed for IE (and IE8 is still IE) will now be broken.  The question is do you piss off the people who will be building the stuff for your product (developers) or do you piss off the people who’ve been supporting you (customers).

I thought this article was interesting not because I care what decision Microsoft will ultimately make…  but I think Liferay is finding themselves in this position with the release of 5.0.  We’ve already made decisions (java5) that will cause us to lose some past customers… (hopefully that will be offset by new customers that will pick us because of the decision).  I think we are at a crucial time where a lot of us are hoping to make even more drastic decisions that will further kill our backwards compatibility… but offer us in return the opportunity to make Liferay the best product it can be… like using Expandos or tighter integration with spring/hibernate or whatever…  we shouldn’t be tied down to our past anymore if we want to make a better future product.  But that’s never the path we take… (except java 5 which we were forced to do)… we always build for a way to be backwards compatible.  The key word here is TO BE.  We are not always backwards compatible by default (Neil found an issue with existing url's and the new JSR-286) which is why I of all people found this article interesting.

Everyone in Liferay is put into one of two sides:  There are the core developers and then support/consultants.  Yeah everyone does a little of both but primarily that is their job… anyways it’s hard as a consultant sometimes that the core team makes 80% of the decisions about the product when we do 80% of the (money-generating) work… I’m not being bitter like I think that’s the right way to go about it… just hard in that we have to figure out stuff like Neil’s URL issue without always knowing why it's happened (I've done every upgrade since 3.2 to the next version.. so I know how you're feeling Neil!).  So this has been complained about a lot before to the core team (that knowledge must be transferred better)… and it’s not really the point… but rather new insight because recently I went to China with Brian (Chan) and Nate. I spent some time working on core and spent time seeing people working on core.  And the improvements they are planning to make or are in the process of making is very exciting.  So exciting that I think older companies might be willing to pay more money to have these new features even if they have to abandon some previous work.

Anyways, if there’s only one thing you read about this post… it’s this: the article I read was really about Idealists (in our company it would be people like Nate who preach standards, standards standards… if they don’t want to support standards then screw them.. we want to make Liferay the product AWESOME) vs. pragmatists (in our company it would be Ed Chung… standards are good.. but they can’t get in the way of our ultimate goal… not to make Liferay product better… but to make more money for the company).   The article ended with this: “You see? No right answer. As usual, the idealists are 100% right in principle and, as usual, the pragmatists are right in practice.“  I realized that as a company, Liferay is constantly walking a fine line between the two, fighting to find that balance… and I think it’s also the reason Liferay hasn’t failed like so many other open source projects.


DT

Showing 1 - 5 of 10 results.
Items 5
of 2