<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Software Production Management</title>
	<atom:link href="http://www.simpleprojectz.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.simpleprojectz.com</link>
	<description>project management &#38; software development &#38; personal stuff</description>
	<lastBuildDate>Wed, 05 Oct 2011 01:46:12 +0000</lastBuildDate>
	<language>es-ES</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Simple Project Management</title>
		<link>http://www.simpleprojectz.com/2011/10/project-management-simple/</link>
		<comments>http://www.simpleprojectz.com/2011/10/project-management-simple/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 01:46:12 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[SW Development]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=539</guid>
		<description><![CDATA[I&#8217;ve been thinking and working on a simple idea, that probably will sound bad for some old school project managers. I&#8217;ve been living, working, and teaching about the PMI standard for almost 3 years, and I&#8217;ve been working on agile &#8230; <a href="http://www.simpleprojectz.com/2011/10/project-management-simple/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve been thinking and working on a simple idea, that probably will sound bad for some old school project managers. I&#8217;ve been living, working, and teaching about the PMI standard for almost 3 years, and I&#8217;ve been working on agile software development since forever &#8211; because in software development, scope is a moving target so you cannot count on your &#8220;printed gantt chart&#8221;.</p>
<p><strong>The Idea</strong></p>
<p>To build a simple, extremely simple an online tool (webapp) to handle projects, but no only software projects -which is, I believe, the common approach. Build a set of easy-to-use tools to breakdown work (using drag-and-drop automagic for WBS or even to create Product Backlogs as you will probably build the WBS graphically. I&#8217;m not sure about how it will result, but I&#8217;m sure you get the point behind the idea. My mind is thinking about a built-in worksheet (like in a spreadsheets tool) to dynamically generate reports that works also as input forms &#8211; so you don&#8217;t have the Import/Export pain (if you use any online tool every day you know what I&#8217;m talking about).</p>
<p>I love little colored pieces of paper, boards (aka information radiators), eDocs with names and tasks and colors (I do love eDocs) &#8211; I&#8217;m not sure why Google does not have a Project Tool in its office suite.</p>
<p>I&#8217;m not sure when, while performing as PM, Professor, Speaker, and VP of Special Projects for PMI Colombia Chapter, I will get the time to work on this personal project.</p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2011/10/project-management-simple/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Happy Holidays &#8211; 2011</title>
		<link>http://www.simpleprojectz.com/2010/12/happy-holidays-2011/</link>
		<comments>http://www.simpleprojectz.com/2010/12/happy-holidays-2011/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 02:31:51 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=534</guid>
		<description><![CDATA[It took more than I would like, to write a new blog post. It was maybe because I was working from Sunday to Sunday on a great project, or maybe because I could not find an blank spot in my &#8230; <a href="http://www.simpleprojectz.com/2010/12/happy-holidays-2011/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It took more than I would like, to write a new blog post. It was maybe because I was working from Sunday to Sunday on a great project, or maybe because I could not find an blank spot in my mind to fill with a new blog post. It is time to write again a post.</p>
<p>This one is a simple one, the Happy Holidays post is always an easy way to remove that task from your ToDo list.</p>
<p>For me, this year is one of those when you feel you have done a lot, change a lot, and it is probably why I feel I&#8217;m not the same one -and I&#8217;m not talking about getting older, which is also true <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . This year I had the opportunity to work closer on a start-up company and to travel to New York City to work side-by-side with the team over there. I do not have words to express how much I learned. Now I feel closer to my personal goals. Being part of such start-up company was an amazing time.</p>
<p>I&#8217;m happy because this year is finally ending with all the changes it brought to me. I&#8217;m happy because this year was the year it was, but also happy because I&#8217;m pretty sure the next will be even better and even more challenging.</p>
<p>IThe last paragraph of this post is to thank you all the people who spend valuable time with me: my family (the first and most important) which is always supporting me, my friends (the old and the new ones), my coworkers, and my students (the ones who get A+ and those who didn&#8217;t). Happy holidays, and I wish you spend some great time with your beloved ones.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2010/12/happy-holidays-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Labs &amp; RRapido Methodology</title>
		<link>http://www.simpleprojectz.com/2010/03/labs-rrapido-methodology/</link>
		<comments>http://www.simpleprojectz.com/2010/03/labs-rrapido-methodology/#comments</comments>
		<pubDate>Fri, 19 Mar 2010 15:54:38 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Framework]]></category>
		<category><![CDATA[Methods]]></category>
		<category><![CDATA[SW Development]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=522</guid>
		<description><![CDATA[Eight+ months ago I decided to bring a change to my life. I decided to resign to my Account Director position at Studiocom. I was sure that even when Studiocom was named as one of the best place to work &#8230; <a href="http://www.simpleprojectz.com/2010/03/labs-rrapido-methodology/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.simpleprojectz.com/wp-content/uploads/2010/03/rrapido.jpg"><img class="alignleft size-full wp-image-526" title="Get Focus" src="http://www.simpleprojectz.com/wp-content/uploads/2010/03/rrapido.jpg" alt="http://www.flickr.com/photos/margolove/1810357551/sizes/s/" width="240" height="240" /></a>Eight+ months ago I decided to bring a change to my life. I decided to resign to my Account Director position at <a href="http://www.studiocom.com" target="_blank">Studiocom</a>. I was sure that even when Studiocom was named as one of the best place to work here in Colombia, there was no opportunity for me to grow personal or professional. I was working hard more than a year on amazing projects, getting results for the company, and the client, but with no professional opportunities, or any recognition or reward, feeling frustration and of course, leading me to a no-return situation.</p>
<p>Then, I took a chance with a well-known entrepreneur at <a href="http://www.torrenegralabs.com" target="_blank">Torrenegra Labs</a> &#8211; thanks to Leo Suarez and Alex Torrenegra. It was not a smooth transition. At the beginning I was supposed to work on a<strong> project </strong>(shh! It is a secret one)<strong>, </strong>however after our first formal review on the scope and budget, we decided to keep this initiative on hold. It was back on December! OMG! What am I going to do?</p>
<p>Fortunately for me, Alex invited me to join the LetMeGo Team as the owner of the Referral Program (during my first three months here at Torrenegra Labs I offered my help on LetMeGo project giving a hand to launch the Beta on time). I joined the team last January. So, &#8220;What? Referral what?&#8221; I was confused and I was feeling ignorant, what is a referral program? and how am I suppose build a successful referral program?</p>
<p>I started working as Architect of the LetMeGo Subsystem on charge of the Referral Program, and then of course, as any good Architect, I started coding, but not coding like I was used to. That is when RRapido Methodology and I formally met. Even when it is a mix of Agile, Traditional Development and Test Driven development, I have to say that the most valuable asset that we have is our methodology. I&#8217;m not saying it is perfect or a &#8220;One-Size-Fits-All&#8221;, however I will give my impressions on it:</p>
<ul>
<li>Applied Test Driven Development reduces the chances of getting errors on late development phases or iterations (I will not discuss here if they are the same or not).</li>
<li>Extremely well document UC, TC and UI &#8211; LMG is the first project I had participated on were tech docs are almost perfect and detailed good enough to allow clear trace between code, tests and UC &#8211; it is a little bit confusing because Agile Manifesto includes a line &#8220;Working software over comprehensive documentation&#8221; &#8211; what does it means anyway? Even on traditional approach you are always looking for &#8220;working software&#8221;.</li>
<li>Noisy communications &#8211; RRapido fails on how things are communicated. We had what we call here in Colombia &#8220;meetin-gitis&#8221;, but through Skype. Most of the times we over communicate everything to everybogy. With time you get used to it, but it is like be in a party with everybody talking each other and with loud music.</li>
<li>Microblogging looks like useless. We use Yammer, I microblogging tool for private(?) teams. We used it to promote our tasks every day -I&#8217;ve to admit that I&#8217;m not most dedicated team member to that.</li>
<li>Small group with one &#8220;<em>I-know-everything-about-the-system</em>&#8221; manager. RRapido, and the most significant and valuable addition to our team is what Scrum calls the <strong>Product Owner</strong>. Alex is our product owner, he is a technical person that has developed a great &#8220;business&#8221; sense. With his experience and dedication RRapido and the whole project is kept on track. There is no doubt about it. One day without Alex is a day when things slow down (a little bit)</li>
</ul>
<p>So it is time to talk about Mr. Alex or  Don Alex. I disagree about few practices on Alex management style however, and based on the facts and the results I say: He is on care of <strong>EVERY </strong>detail of the system, leading the team to a successful product and &#8220;working software&#8221;. He is the dream of every development team, a dedicated and objective Product Owner that understands technical challenges and risks of every decision. Alex does not ask for outstanding deliverables all the time, but when he does that, he also provides the tools and time to succeed.</p>
<p>RRapido Methodology depends 100% on the Product Owner -what we call Product Developer. He/she is the key of the RRapido Methodology, as the keeper of the process. It is so difficult to know about the system, the business, the market, the customer drivers, to have relevant technical background on the development, to have passion about the business, and also to be the process owner, that RRapido becomes a process for few -maybe a process that can be adapted for those who had worked with Alex.</p>
<h3>Recomendations</h3>
<p>As my dad always says, if your are complaining about something that you can change, why you do not change it. I decided then to write this post, sure that Torrenegra Team will read it and probably -if I succeed- will include few process to the methodology.</p>
<ul>
<li>Methodology is a set of steps, it is not a ToDo list. RRapido feels like a set of things to do, but I would prefer if we can set them as a procedure.</li>
<li> Communications are noisy, One-on-One meetings are great, Publishing Notification Board is ok, all other are noisy. I would prefer a message board or workspace site.</li>
<li>Microblogging is useless when weekly tasks have been set. Remove it or use it to assign tasks, not to report them.</li>
<li>Documentation. I&#8217;m in love with documentation, it is not perfect, but it supplies all developers need to code, test and validate the required functionality, however, navigation between UC, UT and UI is painfull. I would look for another way to link UC and UI (maybe a two column page or something similar).</li>
<li>By formalizing RRapido steps, dependency on the Product Developer role will be reduced.</li>
<li>Test Driven Development Rocks!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2010/03/labs-rrapido-methodology/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Import contacts using Google&#8217;s API</title>
		<link>http://www.simpleprojectz.com/2010/03/import-contacts-googles-api/</link>
		<comments>http://www.simpleprojectz.com/2010/03/import-contacts-googles-api/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 23:55:31 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[SW Development]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[contacts]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[import]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=519</guid>
		<description><![CDATA[Maybe the most important thing about this post is how to use HTTP based APIs in a simple way -using a wrapper for cURL PHP extension. Most of the examples available on the Web are kind of out-of-date, based on &#8230; <a href="http://www.simpleprojectz.com/2010/03/import-contacts-googles-api/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Maybe the most important thing about this post is how to use HTTP based APIs in a simple way -using a wrapper for cURL PHP extension. Most of the examples available on the Web are kind of out-of-date, based on the idea that there is no a better abstraction layer.</p>
<p>Requirements / Example environment configuration.</p>
<ul>
<li><a href="http://www.php.net" target="_blank">PHP 5.2.x</a></li>
<li><a href="http://php.net/manual/en/book.curl.php" target="_blank">cURL PHP Extension</a></li>
<li><a href="http://pear.php.net/" target="_blank">PEAR extension</a></li>
<li><a href="http://pear.php.net/manual/en/package.http.http-request2.php" target="_blank">HTTP Request2 (beta)</a></li>
</ul>
<p>This example was originally built for <a href="http://www.cakephp.org" target="_blank">CakePHP</a>, but as you can see, it can be used or migrated to several frameworks &#8211; the key is to use the PEAR component. Note: I believe that this example will make most of the example out there crappy &#8211; and I hope it, so other developers could use it.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="php" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">// PEAR Package HTTP_Request2</span>
<span style="color: #666666; font-style: italic;">// http://pear.php.net/manual/en/package.http.http-request2.php</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTTP'</span> <span style="color: #339933;">.</span> DS <span style="color: #339933;">.</span> <span style="color: #0000ff;">'Request2.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> GoogleImportComponent <span style="color: #000000; font-weight: bold;">extends</span> Object <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$username</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$password</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$token</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Authenticate user credential against provider services
	 *
	 * @param string $username User's login
	 * @param string $password User's account password
	 * @see http://code.google.com/apis/contacts/docs/3.0/developers_guide_protocol.html
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> authenticate<span style="color: #009900;">&#40;</span><span style="color: #000088;">$username</span><span style="color: #339933;">,</span> <span style="color: #000088;">$password</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$password</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$hrc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTP_Request2<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'https://www.google.com/accounts/ClientLogin'</span><span style="color: #339933;">,</span> HTTP_Request2<span style="color: #339933;">::</span><span style="color: #004000;">METHOD_POST</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAdapter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HTTP_Request2_Adapter_Curl'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setConfig</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'ssl_verify_peer'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addPostParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'accountType'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'HOSTED_OR_GOOGLE'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addPostParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'service'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'cp'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addPostParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'source'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'MY_APP_ID'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addPostParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Email'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addPostParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Passwd'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">password</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$body</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">token</span> <span style="color: #339933;">=</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$body</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Auth='</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getReasonPhrase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #009933; font-style: italic;">/**
	 * Return the contacts' email list
	 *
	 * @return array
	 * @see http://code.google.com/apis/contacts/docs/3.0/developers_guide_protocol.html
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> get<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$addresses</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000088;">$hrc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HTTP_Request2<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;http://www.google.com/m8/feeds/contacts/<span style="color: #006699; font-weight: bold;">{$this-&gt;username}</span>/full&quot;</span><span style="color: #339933;">,</span> HTTP_Request2<span style="color: #339933;">::</span><span style="color: #004000;">METHOD_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setHeader</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Authorization'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;GoogleLogin auth=<span style="color: #006699; font-weight: bold;">{$this-&gt;token}</span>&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$response</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$hrc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">send</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">200</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000088;">$xml</span> <span style="color: #339933;">=</span> <span style="color: #990000;">simplexml_load_string</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">utf8_encode</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBody</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$xmladd</span> <span style="color: #339933;">=</span>  <span style="color: #000088;">$xml</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">xpath</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;//gd:email/@address&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$xmladd</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #990000;">get_object_vars</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000088;">$addrs</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'@attributes'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'address'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
				<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$addrs</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					<span style="color: #000088;">$addresses</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$addrs</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #009900;">&#40;</span><span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getReasonPhrase</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$response</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getStatus</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$addresses</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>That&#8217;s it. It is not a huge amount of code with HTTP protocol related instructions &#8211; like the ones you can get for free. It relies on HTTP_Request2 PEAR module, that even if it&#8217;s on beta, works like a charm.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2010/03/import-contacts-googles-api/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Search Portlet</title>
		<link>http://www.simpleprojectz.com/2009/11/search-portlet/</link>
		<comments>http://www.simpleprojectz.com/2009/11/search-portlet/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 03:02:59 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[SW Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[jboss]]></category>
		<category><![CDATA[jboss portal]]></category>
		<category><![CDATA[portal]]></category>
		<category><![CDATA[portlet]]></category>
		<category><![CDATA[search]]></category>
		<category><![CDATA[search portlet]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=493</guid>
		<description><![CDATA[Few months ago I was developing a project on top of JBoss Portal. Unfortunately, JBoss Portal 2.7.x is a nice Portlet Container but a crappy CMS/Search engine -even when it is supported on Apache&#8217;s JackRabbit. However, I was forced to &#8230; <a href="http://www.simpleprojectz.com/2009/11/search-portlet/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Few months ago I was developing a project on top of JBoss Portal. Unfortunately, JBoss Portal 2.7.x is a nice Portlet Container but a crappy CMS/Search engine -even when it is supported on Apache&#8217;s JackRabbit. However, I was forced to develop a search portlet. It wasn&#8217;t easy, and you will probably find that it is not a perfect solution. However I really hope you find this Search Portlet really useful.</p>
<p><strong>SearchPortlet.java</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
</pre></td><td class="code"><pre class="java5" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">portal.portlets</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.Iterator</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.ActionRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.ActionResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.GenericPortlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletConfig</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletRequestDispatcher</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletSecurityException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.RenderRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.RenderResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.UnavailableException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.WindowState</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.Logger</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.CMS</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.CMSException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.Command</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.model.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.core.cms.ui.CMSPortlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.FederatedQuery</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.QueryConversionException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.federation.SearchFederation</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.impl.jcr.JCRQuery</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.impl.jcr.JCRQueryConverter</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SearchPortlet <span style="color: #000000; font-weight: bold;">extends</span> CMSPortlet <span style="color: #009900;">&#123;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #003399; font-weight: bold;">Logger</span> log = <span style="color: #003399; font-weight: bold;">Logger</span>.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>SearchPortlet.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> SearchFederation SearchService<span style="color: #339933;">;</span>
  <span style="color: #000000; font-weight: bold;">private</span> CMS CMSService<span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>PortletConfig config<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> destroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">destroy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">/*
   * (non-Javadoc)
   *
   * @see javax.portlet.Portlet#init()
   */</span>
  @<span style="color: #003399; font-weight: bold;">Override</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">SearchService</span> = <span style="color: #009900;">&#40;</span>SearchFederation<span style="color: #009900;">&#41;</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SearchFederationService&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">CMSService</span> = <span style="color: #009900;">&#40;</span>CMS<span style="color: #009900;">&#41;</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">SearchService</span> == <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> PortletException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Unable to start search service&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">CMSService</span> == <span style="color: #006600; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> PortletException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS services not available&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">/*
   * (non-Javadoc)
   *
   * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
   * javax.portlet.RenderResponse)
   */</span>
  @<span style="color: #003399; font-weight: bold;">Override</span>
  <span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #006600; font-weight: bold;">void</span> doView<span style="color: #009900;">&#40;</span>RenderRequest request, RenderResponse response<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException, <span style="color: #003399; font-weight: bold;">IOException</span>, UnavailableException <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #003399; font-weight: bold;">String</span> portalInstance = request.<span style="color: #006633;">getWindowID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, request.<span style="color: #006633;">getWindowID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span>, <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    PortletRequestDispatcher prd = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #003399; font-weight: bold;">String</span> operation = <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;search&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003399; font-weight: bold;">String</span> queryString = <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        request.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;files&quot;</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getFiles</span><span style="color: #009900;">&#40;</span>queryString, portalInstance<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        prd = <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getPortletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/results.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000;  font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        prd = getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/search.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      prd.<span style="color: #006633;">include</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000;  font-weight: bold;">else</span> <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;display&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">doView</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000;  font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      prd = getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/search.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      prd.<span style="color: #006633;">include</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #666666; font-style: italic;">/*
   * (non-Javadoc)
   *
   * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest,
   * javax.portlet.ActionResponse)
   */</span>
  @<span style="color: #003399; font-weight: bold;">Override</span>
  <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #006600; font-weight: bold;">void</span> processAction<span style="color: #009900;">&#40;</span>ActionRequest request, ActionResponse response<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException, PortletSecurityException, <span style="color: #003399; font-weight: bold;">IOException</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003399; font-weight: bold;">String</span> profile<span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #003399; font-weight: bold;">String</span> operation = <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> operation.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ask&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        response.<span style="color: #006633;">setWindowState</span><span style="color: #009900;">&#40;</span>WindowState.<span style="color: #006633;">NORMAL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000;  font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
        response.<span style="color: #006633;">setWindowState</span><span style="color: #009900;">&#40;</span>WindowState.<span style="color: #006633;">MAXIMIZED</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
      response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span>, operation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span> <span style="color: #000000;  font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
      response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span>, <span style="color: #0000ff;">&quot;ask&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      response.<span style="color: #006633;">setWindowState</span><span style="color: #009900;">&#40;</span>WindowState.<span style="color: #006633;">NORMAL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;search&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #003399; font-weight: bold;">String</span> queryString = <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span>, queryString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
  <span style="color: #009900;">&#125;</span>
&nbsp;
  <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399; font-weight: bold;">List</span> getFiles<span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">String</span> queryString, <span style="color: #003399; font-weight: bold;">String</span> portal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #003399; font-weight: bold;">List</span> files = <span style="color: #006600; font-weight: bold;">null</span><span style="color: #339933;">;</span>
    <span style="color: #003399; font-weight: bold;">List</span> filteredFiles = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399; font-weight: bold;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #000000;  font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!</span>= <span style="color: #006600; font-weight: bold;">null</span> <span style="color: #339933;">&amp;&amp;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      FederatedQuery query = <span style="color: #000000; font-weight: bold;">new</span> FederatedQuery<span style="color: #009900;">&#40;</span>queryString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      JCRQueryConverter converter = <span style="color: #000000; font-weight: bold;">new</span> JCRQueryConverter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
        Command searchCommand = CMSService.<span style="color: #006633;">getCommandFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createSearchCommand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>JCRQuery<span style="color: #009900;">&#41;</span> converter.<span style="color: #006633;">convert</span><span style="color: #009900;">&#40;</span>query<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        files = <span style="color: #009900;">&#40;</span><span style="color: #003399; font-weight: bold;">List</span><span style="color: #009900;">&#41;</span> CMSService.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>searchCommand<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">// You can filter files if needed by reviewing its path under the CMS</span>
        <span style="color: #666666; font-style: italic;">// structure, by name, or any other criteria that fits your needs.</span>
&nbsp;
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>CMSException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        log.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS Error&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>QueryConversionException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        log.<span style="color: #006633;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Conversion Error&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">return</span> files<span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>I used two JSP pages to support this portlet.</p>
<ul>
<li>search.jsp &#8211; Search form &#8211; the standard portlet view</li>
<li>results.jsp &#8211; Results list page &#8211; appears with the portlet MAXIMIZED and displays CMS files that matches the criteria</li>
</ul>
<p><strong>search.jsp</strong> &#8211; (<a href="http://wordpress.org/extend/plugins/wp-syntax/" target="_blank">WP-Syntax</a> does not support JSP)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #66cc66;">&lt;</span>h2<span style="color: #66cc66;">&gt;</span>Search<span style="color: #66cc66;">&lt;</span>/h2<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>form action<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;%=contactActionURL%&gt;&quot;</span> method<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;POST&quot;</span><span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>fieldset style<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;border: none;&quot;</span><span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>input name<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;op&quot;</span> type<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;hidden&quot;</span> value<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;search&quot;</span> /<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>input name<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;query&quot;</span> type<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text&quot;</span> /<span style="color: #66cc66;">&gt;</span>
    <span style="color: #66cc66;">&lt;</span>input type<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;submit&quot;</span> value<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;Search&quot;</span> /<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>/fieldset<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;</span>/form<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p><strong>results.jsp</strong> &#8211; (<a href="http://wordpress.org/extend/plugins/wp-syntax/" target="_blank">WP-Syntax</a> does not support JSP)</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre></td><td class="code"><pre class="groovy" style="font-family:monospace;"><span style="color: #66cc66;">&lt;%</span>@ page <span style="color: #000000; font-weight: bold;">import</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;org.jboss.portal.cms.model.File&quot;</span><span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;%</span>@ page <span style="color: #000000; font-weight: bold;">import</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;java.util.List&quot;</span><span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;%</span>@ page language<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;java&quot;</span> <span style="color: #000000; font-weight: bold;">extends</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;org.jboss.portal.core.servlet.jsp.PortalJsp&quot;</span><span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;%</span>@ taglib uri<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://java.sun.com/portlet_2_0&quot;</span> prefix<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;portlet&quot;</span><span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;%</span>
  List<span style="color: #66cc66;">&lt;</span>File<span style="color: #66cc66;">&gt;</span> files <span style="color: #66cc66;">=</span> <span style="color: #66cc66;">&#40;</span>List<span style="color: #66cc66;">&lt;</span>File<span style="color: #66cc66;">&gt;</span><span style="color: #66cc66;">&#41;</span> request.<span style="color: #006600;">getAttribute</span><span style="color: #66cc66;">&#40;</span><span style="color: #ff0000;">&quot;files&quot;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
  <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>files <span style="color: #66cc66;">!=</span> <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&amp;&amp;</span> files.<span style="color: #663399;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;</span>h1<span style="color: #66cc66;">&gt;</span>RESULTADOS DE B<span style="color: #66cc66;">&amp;</span>Uacute<span style="color: #66cc66;">;</span>QUEDA<span style="color: #66cc66;">&lt;</span>/h1<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;%</span>
    <span style="color: #b1b100;">for</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333;">int</span> i <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">;</span> i <span style="color: #66cc66;">&lt;</span> files.<span style="color: #663399;">size</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span> i<span style="color: #66cc66;">++</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span>
        <span style="color: #aaaadd; font-weight: bold;">File</span> file <span style="color: #66cc66;">=</span> files.<span style="color: #663399;">get</span><span style="color: #66cc66;">&#40;</span>i<span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">;</span>
  <span style="color: #66cc66;">%&gt;</span>
  <span style="color: #66cc66;">&lt;</span>h2<span style="color: #66cc66;">&gt;&lt;%=</span> file.<span style="color: #006600;">getName</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">%&gt;&lt;</span>/h2<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>p<span style="color: #66cc66;">&gt;&lt;%</span> <span style="color: #b1b100;">if</span> <span style="color: #66cc66;">&#40;</span>file.<span style="color: #006600;">getDescription</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">!=</span> <span style="color: #000000; font-weight: bold;">null</span> <span style="color: #66cc66;">&amp;&amp;</span> file.<span style="color: #006600;">getDescription</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">%&gt;&lt;%=</span> file.<span style="color: #006600;">getDescription</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">%&gt;&lt;%</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">%&gt;&lt;</span>a href<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;portlet:actionURL&gt;&lt;portlet:param name=&quot;</span>op<span style="color: #ff0000;">&quot; value=&quot;</span>display<span style="color: #ff0000;">&quot; /&gt;&lt;portlet:param name=&quot;</span>file<span style="color: #ff0000;">&quot; value=&quot;</span><span style="color: #66cc66;">&lt;%=</span> file.<span style="color: #006600;">getBasePath</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">%&gt;</span><span style="color: #ff0000;">&quot; /&gt;&lt;/portlet:actionURL&gt;&quot;</span><span style="color: #66cc66;">&gt;</span>Ver m<span style="color: #66cc66;">&amp;</span>aacute<span style="color: #66cc66;">;</span>s...<span style="color: #66cc66;">&lt;</span>/a<span style="color: #66cc66;">&gt;&lt;</span>/p<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;</span>hr /<span style="color: #66cc66;">&gt;</span>
  <span style="color: #66cc66;">&lt;%</span>
    <span style="color: #66cc66;">&#125;</span>
  <span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;%</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;</span>h1<span style="color: #66cc66;">&gt;</span>NO HAY RESULTADOS<span style="color: #66cc66;">&lt;</span>/h1<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&lt;%</span> <span style="color: #66cc66;">&#125;</span> <span style="color: #66cc66;">%&gt;</span>
<span style="color: #66cc66;">&lt;</span>p align<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;center&quot;</span><span style="color: #66cc66;">&gt;&lt;</span>a href<span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;&lt;portlet:actionURL&gt;&lt;portlet:param name=&quot;</span>op<span style="color: #ff0000;">&quot; value=&quot;</span>ask<span style="color: #ff0000;">&quot; /&gt;&lt;/portlet:actionURL&gt;&quot;</span><span style="color: #66cc66;">&gt;</span>Volver<span style="color: #66cc66;">&lt;</span>/a<span style="color: #66cc66;">&gt;&lt;</span>/p<span style="color: #66cc66;">&gt;</span></pre></td></tr></table></div>

<p>Include the following lines on your <code>jboss-portlet.xml</code> file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portal.cms.CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>:service=CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchFederationService<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portal.search.federation.SearchFederation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>:service=SearchFederationService<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And finally add the following lines on your <code>portlet.xml</code> file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DESC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NAME<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>portal.portlets.SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;supports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mime-type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>text/html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mime-type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-mode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>VIEW<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-mode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/supports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resource-bundle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Resource<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resource-bundle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SEARCH<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-preferences<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>indexpage<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/default/index.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>setBrowserTitle<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-preferences<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JBoss Portlet Filter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portlet.filter.JBossPortletFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ACTION_PHASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RENDER_PHASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JBoss Portlet Filter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/11/search-portlet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When criticism becomes feedback</title>
		<link>http://www.simpleprojectz.com/2009/10/from_criticism_to_feedback/</link>
		<comments>http://www.simpleprojectz.com/2009/10/from_criticism_to_feedback/#comments</comments>
		<pubDate>Mon, 26 Oct 2009 23:37:26 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Methods]]></category>
		<category><![CDATA[communication]]></category>
		<category><![CDATA[criticism]]></category>
		<category><![CDATA[feedback]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=488</guid>
		<description><![CDATA[It is curious how all of us take criticism in a bad way. Most of the times, and even more during hard times like this we live now, businesses and partners are criticize every second, like on how they address &#8230; <a href="http://www.simpleprojectz.com/2009/10/from_criticism_to_feedback/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/95257089@N00/1767258349/" target="_blank"><img class="alignleft size-full wp-image-490" title="YARGHHH!" src="http://www.simpleprojectz.com/wp-content/uploads/2009/10/scream.jpg" alt="YARGHHH!" width="160" height="240" /></a>It is curious how all of us take criticism in a bad way. Most of the times, and even more during hard times like this we live now, businesses and partners are criticize every second, like on how they address their customers needs, on how they handle the crisis, on how the company performs financially, on how we react to the situations, and even how senior management is affected -because sometimes senior management is not affected at all.</p>
<p>During hard times we, of course, feel additional pressure on every duty we have to accomplish, on both personal and professional fields. So it is not difficult to explode and to fail on our communication methods and/or messages. Express our disagreement as a criticism could not be the best way, but it is common and widely used one. The problem is that communication is always between at least two actors, sender and receiver (source and destination), and probably our criticism will affect others directly. However, a problem is always a source of opportunities. Receivers, those who got criticized, can get the very best of every criticism and evolve it into feedback. There is no criticism without foundation, even for those how want to emotionally affect others.</p>
<p>As project managers we need to be the example, we need to effectively communicate information to every relevant stakeholder but, something that is not fully promoted is that we also have to handle the inputs from a 2-way process. It is not about giving and giving, it is about receiving and processing too.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/10/from_criticism_to_feedback/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Now as Product Developer</title>
		<link>http://www.simpleprojectz.com/2009/10/now-as-product-developer/</link>
		<comments>http://www.simpleprojectz.com/2009/10/now-as-product-developer/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 00:12:07 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[rrapido]]></category>
		<category><![CDATA[torrenegra]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=485</guid>
		<description><![CDATA[It has been a quite long time since I wrote my last post about project management. I even changed the whole look and feel of my Blog to fit (a little bit) closer the things I wrote here. The reason &#8230; <a href="http://www.simpleprojectz.com/2009/10/now-as-product-developer/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It has been a quite long time since I wrote my last post about project management. I even changed the whole look and feel of my Blog to fit (a little bit) closer the things I wrote here.</p>
<p>The reason is simple, I changed my job. I resigned from my previous Account Manager position at Studiocom (an interactive and digital WPP agency). It was difficult to leave that position (and such a great team) but it was a required decision from a professional perspective.</p>
<p>So I moved  to a new position as Product Developer at <a href="http://www.torrenegralabs.com" target="_blank">Torrenegra Labs</a>. I&#8217;ve been working at Torrenegra Labs for the last two months on a new business development that I&#8217;m sure will make me better person and integral Project Manager.</p>
<p>I&#8217;m currently learning about their management methods and of course and because I&#8217;m a techie guy, I&#8217;m looking at their code too <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />   &#8211; they have create their own PHP Framework on top of CakePHP, including JSON and SOAP Webservices and other cool stuff &#8211; I&#8217;m pushing hard to share most of those nice CakePHP extensions back to the community. You should take a look to their great product once it gets released &#8211; check <a href="http://alexander.letmego.com/" target="_blank">Alexander’s Blog – The Making of LetMeGo</a>.</p>
<p>I&#8217;ve been setting all the things to start a new huge initiative but also learning about their framework, coding style and development methodology (a.k.a <a href="http://www.torrenegralabs.com/group/content/rrapido_methodology" target="_blank">RRapido</a>). I&#8217;ve take the time to know the people -the most important asset on this and every company. It has been an inspiring time and now its time to rock-n-roll.</p>
<p>Starting next week, I will be in charge of my own top secret project that I&#8217;m pretty sure will shake the market -as it happens for most of the Torrenegra products (like <a href="http://www.voice123.com" target="_blank">Voice123 </a>and for sure <a href="http://www.letmego.com" target="_self">LetMeGo</a>). It is an exciting time for me, and I hope you enjoy the future posts about the project progress.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/10/now-as-product-developer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JBoss Portal Fail!</title>
		<link>http://www.simpleprojectz.com/2009/09/jboss-portal-fail/</link>
		<comments>http://www.simpleprojectz.com/2009/09/jboss-portal-fail/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 03:05:08 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[jboss portal]]></category>
		<category><![CDATA[search portlet]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=467</guid>
		<description><![CDATA[Ok, I do not like to write about useless stuff, but this time, I got into deep troubles because one of my clients ask me to implement a portal page on top of JBoss Portal. My first thought was &#8220;Ok, &#8230; <a href="http://www.simpleprojectz.com/2009/09/jboss-portal-fail/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Ok, I do not like to write about useless stuff, but this time, I got into deep troubles because one of my clients ask me to implement a portal page on top of JBoss Portal. My first thought was &#8220;Ok, if it is as good as JBoss Application Server, it should be good enough&#8221;.</p>
<p>So I downloaded it -the 2.7.2 bundled version. I started working on it, simple configuration and customization. I even bought a book, because, I still do believe that books are good for reference.</p>
<p>Oh Dear God! What a SHAME, the book <strong>JBoss Portal Server Development [Packt Publishing]</strong> is nothing more than printed version of the online <em>Reference Guide. </em>I read the customers reviews before get  the book but to be honest, I found websites with useful tips and post. I believe I will donate the book&#8230; for recycling.</p>
<p>About the product, I don&#8217; t have enough word to express my frustration.</p>
<h4>Content Management</h4>
<p>When you read on JBoss Portal documentation <strong>it is not a CMS</strong>, it really means <strong>it doesn&#8217;t even work to store content at all</strong>.</p>
<ul>
<li>CMS performance will decrease dramatically as you load and modifies your content. BIG BIG FAIL! <strong>TIP</strong> JCR performance gets BETTER if you switch the repo to the FS instead of using databases.</li>
<li>CMS doesn&#8217; t have Search functionality. Even when JCR has a great index analyser, JBoss Portal fails. I downloaded (svn co) the 2.7.2 version source code from the repos. &#8220;core-search&#8221; module doesn&#8217;t compile. Ant scripts are too fragmented and hard to read. You&#8217;ll have to replace and <strong>FIX </strong>all the jar dependencies to make it work. <strong>Note</strong>: I didn&#8217;t test it, but probably repo works flawless on 2.6.8 version -looking at the scripts and code it could be possible. Once you make it work, the deploy target will not work. Server will consume too memory and then CRASH!</li>
<li>Portal Pages and CMS content are not related. I built my own search portlet -fragment of code is at the end of this post. It is not easy to match Portal Pages with CMS content -I didn&#8217; t tried it, however I&#8217;m pretty sure it is possible.</li>
</ul>
<h4>Documentation</h4>
<p>Official docs are good enough -not great but good to be a Open Source project, however Wiki is a shame, its confusing and incomplete. There are a lot of unexplained things like how to get sources, and how to compile, troubleshooting, and stuff like that.</p>
<p>PortalSwap is a FAIL&#8230; it is supposed to be a community place to share portlets but there are like four simple portlets.</p>
<h4>Community and DevTeam Support</h4>
<p>Well, I was contacted -in some how- by the DevTeam on twitter. The  truth, I &#8220;tweet&#8221; my frustration several weeks ago! and they noticed &#8211; At the beginning I was angry about the product but then I realized that IT IS FOR FREE, so let&#8217;s try to change and improve things! I wrote a nice email to the DevTeam. All I want is to get paid (from my client) and also to contribute to the project.</p>
<p>I&#8217;m still waiting for the answer from DevTeam, without mention that the &#8220;Twitter Support&#8221; was more like a complain than a &#8220;Branding Strategy&#8221;. So there is no community support, and DevTeam doesn&#8217;t know about Customer Care. My suggestion is, next time you contact a frustrated developer, try to convince to &#8220;help DevTeam&#8221; instead of debate!</p>
<p>As a recap, JBoss AS is a great product, JBoss Portal is seems to me like a &#8220;work in progress&#8221; &#8211; Maybe it is a students project!</p>
<h4>Search Portlet Source</h4>
<p>The original code have been edited -please let me know if it works for you.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">xxx</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.io.IOException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.ArrayList</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">java.util.List</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.ActionRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.ActionResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletConfig</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletPreferences</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletRequestDispatcher</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.PortletSecurityException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.RenderRequest</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.RenderResponse</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.UnavailableException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">javax.portlet.WindowState</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.apache.log4j.Logger</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.CMS</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.CMSException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.Command</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.cms.model.File</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.core.cms.ui.CMSPortlet</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.FederatedQuery</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.QueryConversionException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.federation.SearchFederation</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.impl.jcr.JCRQuery</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.jboss.portal.search.impl.jcr.JCRQueryConverter</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SearchPortlet <span style="color: #000000; font-weight: bold;">extends</span> CMSPortlet <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> Logger log <span style="color: #339933;">=</span> Logger.<span style="color: #006633;">getLogger</span><span style="color: #009900;">&#40;</span>SearchPortlet.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> SearchFederation SearchService<span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">private</span> CMS CMSService<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>PortletConfig config<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span>config<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> destroy<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">destroy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">/*
	 * (non-Javadoc)
	 *
	 * @see javax.portlet.Portlet#init()
	 */</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">SearchService</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>SearchFederation<span style="color: #009900;">&#41;</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SearchFederationService&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">CMSService</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>CMS<span style="color: #009900;">&#41;</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">SearchService</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> PortletException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Search Service Not Available&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">CMSService</span> <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> PortletException<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS Not Available&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">init</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">/*
	 * (non-Javadoc)
	 *
	 * @see javax.portlet.GenericPortlet#doView(javax.portlet.RenderRequest,
	 * javax.portlet.RenderResponse)
	 */</span>
	@Override
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000066; font-weight: bold;">void</span> doView<span style="color: #009900;">&#40;</span>RenderRequest request, RenderResponse response<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException, <span style="color: #003399;">IOException</span>, UnavailableException <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #003399;">String</span> portalInstance <span style="color: #339933;">=</span> request.<span style="color: #006633;">getWindowID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">substring</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span>, request.<span style="color: #006633;">getWindowID</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">indexOf</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/'</span>, <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		PortletRequestDispatcher prd <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #003399;">String</span> operation <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;search&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #003399;">String</span> queryString <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				request.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;files&quot;</span>, <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getFiles</span><span style="color: #009900;">&#40;</span>queryString, portalInstance<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				prd <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getPortletContext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/results.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
				prd <span style="color: #339933;">=</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/search.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
			prd.<span style="color: #006633;">include</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;display&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">doView</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			prd <span style="color: #339933;">=</span> getPortletContext<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">getRequestDispatcher</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/WEB-INF/jsp/search.jsp&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			prd.<span style="color: #006633;">include</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">/*
	 * (non-Javadoc)
	 *
	 * @see javax.portlet.Portlet#processAction(javax.portlet.ActionRequest,
	 * javax.portlet.ActionResponse)
	 */</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> processAction<span style="color: #009900;">&#40;</span>ActionRequest request, ActionResponse response<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortletException, PortletSecurityException, <span style="color: #003399;">IOException</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #003399;">String</span> operation <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		PortletPreferences prefs <span style="color: #339933;">=</span> request.<span style="color: #006633;">getPreferences</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">||</span> operation.<span style="color: #006633;">equalsIgnoreCase</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ask&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span>, <span style="color: #0000ff;">&quot;ask&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">//FIXME response.setWindowState(WindowState.NORMAL);</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #000000; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">//FIXME response.setWindowState(WindowState.MAXIMIZED);</span>
			response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;op&quot;</span>, operation<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;search&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">String</span> queryString <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span><span style="color: #009900;">&#41;</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
					response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;query&quot;</span>, queryString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #009900;">&#125;</span>
			<span style="color: #009900;">&#125;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>operation.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;display&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #003399;">String</span> uri <span style="color: #339933;">=</span> request.<span style="color: #006633;">getParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;uri&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				response.<span style="color: #006633;">setRenderParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;uri&quot;</span>, uri<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #000000; font-weight: bold;">super</span>.<span style="color: #006633;">processAction</span><span style="color: #009900;">&#40;</span>request, response<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">private</span> <span style="color: #003399;">List</span> getFiles<span style="color: #009900;">&#40;</span><span style="color: #003399;">String</span> queryString, <span style="color: #003399;">String</span> portal<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #003399;">List</span> files <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>queryString <span style="color: #339933;">!=</span> <span style="color: #000066; font-weight: bold;">null</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> queryString.<span style="color: #006633;">length</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			FederatedQuery query <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> FederatedQuery<span style="color: #009900;">&#40;</span>queryString<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			JCRQueryConverter converter <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> JCRQueryConverter<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
				Command searchCommand <span style="color: #339933;">=</span> CMSService.<span style="color: #006633;">getCommandFactory</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">createSearchCommand</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>JCRQuery<span style="color: #009900;">&#41;</span> converter.<span style="color: #006633;">convert</span><span style="color: #009900;">&#40;</span>query<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				files <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #003399;">List</span><span style="color: #009900;">&#41;</span> CMSService.<span style="color: #006633;">execute</span><span style="color: #009900;">&#40;</span>searchCommand<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
				<span style="color: #666666; font-style: italic;">//FIXME: &quot;portal&quot; parameter was used to filter files depending on the portal instance but it was removed for this example!</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>CMSException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				log.<span style="color: #006633;">error</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;CMS Error&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>QueryConversionException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				log.<span style="color: #006633;">warn</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Conversion Error&quot;</span>, e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000000; font-weight: bold;">return</span> <span style="color: #009900;">&#40;</span>files <span style="color: #339933;">==</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">ArrayList</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> files<span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Include the following lines on your <code>jboss-portlet.xml</code> file.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portal.cms.CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>:service=CMS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchFederationService<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portal.search.federation.SearchFederation<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>:service=SearchFederationService<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/service<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>And do not forget to include the following lines on your <code>portlet.xml</code> file.</p>

<div class="wp_syntax"><table><tr><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>DESC<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>NAME<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/display-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>xxx.SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;supports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;mime-type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>text/html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/mime-type<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-mode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>VIEW<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-mode<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/supports<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;resource-bundle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>Resource<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/resource-bundle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SEARCH<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/title<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-info<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-preferences<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>indexpage<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/default/index.html<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>setBrowserTitle<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>false<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/preference<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-preferences<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JBoss Portlet Filter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>org.jboss.portlet.filter.JBossPortletFilter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-class<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>ACTION_PHASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RENDER_PHASE<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/lifecycle<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>JBoss Portlet Filter<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>SearchPortlet<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filter-mapping<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></td></tr></table></div>

<p>Please <strong>THIS IS NOT A PERFECT SOLUTION</strong>, but it is a solution. It uses the existing CMSPortlet to display the content -and this approach causes an issue -due to WindowState changes. I hope someone find it useful and improves it. Feel free to contact me if you have any question.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/09/jboss-portal-fail/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I Ditched Windows&#8230;and, So Can You</title>
		<link>http://www.simpleprojectz.com/2009/08/i-ditched-windows-and-so-can-you/</link>
		<comments>http://www.simpleprojectz.com/2009/08/i-ditched-windows-and-so-can-you/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 01:33:30 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Digital Life]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[linux migration]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[windows vista]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=452</guid>
		<description><![CDATA[I bought a new desktop computer like a week ago, a nice desktop PC with a beautiful 22&#8243; screen. The truth is that I was looking for an iMac 24&#8243;, but unfortunately here in Colombia it could be have an &#8230; <a href="http://www.simpleprojectz.com/2009/08/i-ditched-windows-and-so-can-you/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-458" title="etiqueta_ubuntu4" src="http://www.simpleprojectz.com/wp-content/uploads/2009/08/etiqueta_ubuntu4.png" alt="etiqueta_ubuntu4" width="200" height="300" />I bought a new desktop computer like a week ago, a nice desktop PC with a beautiful 22&#8243; screen. The truth is that I was looking for an iMac 24&#8243;, but unfortunately here in Colombia it could be have an overprice of USD$500 ~ USD$1000. So as you can tell it could be a trip to U.S. with an iMac on your baggage. I talked to some of my friends and coworkers asking for somebody to bring it, but it wasn&#8217;t possible this time -at least shortly.</p>
<p>So I bought a nice computer with <strong>Windows Vista Home Premium</strong> -as usual and some useless stuff like a remote and <strong>MediaCenter</strong>. I tried it few days and Vista did its magic -slowing down the newest computer even faster than I thought- so I moved to <strong>Windows 7</strong> (64 bits version) -Oh Yeah it is like <em>Windows Vista but better</em> (like G.M. TV commercials with their cars).</p>
<p>A week ago, and after doing a realistic evaluation of my computing needs I decided to switch to Ubuntu 9.04 (64 bits version) and mount a VM with <strong>Windows XP Home </strong>to<strong> </strong>keep testing on <strong>Internet Explorer</strong> 6.0. It was a HUGE improvement in performance &#8211; I just remembered D.O.S. days when programs run immediately after being called. Ubuntu offers a lot of advantages in compare to Windows, but obviously we are so attached to Microsoft pseudo-world that just thinking on the switch could be a nightmare. I will not debate on architecture, security or speed. I&#8217;ll say this as clear as possible. If you do not have to use MS products like Exchange, or you do not have to use speciallized software that runs on Windows -like AutoCAD or Adobe CS4- you can just switch without fair, it will be the reinvention of the computer processing performance.</p>
<p>There are a lot of Linux Distributions in the market -like Ubuntu- but I have to say that Ubuntu is for soft-users and not hard-crazy linux fans. Ubuntu is nice, is really REALLY <strong>REALLY</strong> easy to install and if you aren&#8217;t sure about replacing your desktop with it, you can try <strong>Wubi</strong> -it installs Ubuntu as a Windows application -WOW!</p>
<p>Just to clarify, I had been using Ubuntu and other linux distributions for a long time (Fedora is another one) but it is the first time I decided to switch to Linux WITHOUT a Windows partition. My wife -who is a dentist- hates its portable due to its response time, and I did all the normal-not-so-risky tasks to speed up its XPS 1210 (that used to be mine) with <strong>Windows XP Home Edition</strong>, today we had our first class about linux and she is so happy about the speed and performance, and also the virus/crappy-sw situation that isn&#8217;t a critical issue on Ubuntu (Linux) so she is thinking seriously about moving to Ubuntu her portable too.</p>
<blockquote><p><strong>&#8220;So, if you’re using Windows and want to ditch it, <a href="http://www.ubuntu.com/">click here to begin a less stressful life&#8221;</a></strong></p></blockquote>
<p><strong>IMPORTANT NOTE</strong>: I decided to write this post when a friend of mine sent me a link to a post who has the same title of this one. Thanks to <a href="http://www.fastcompany.com/blog/gregory-ferenstein/fastminds/i-ditched-windowshellipand-so-can-you" target="_blank">Gregory Ferenstein</a> for such inspiring post -I did&#8217;t move to Linux because of his post, but I makes me feel like &#8220;<em>I&#8217;m not alone, I&#8217;m not just a crazy guy that hates Microsoft, I&#8217;m not a linux fanboy&#8230; we are just right about Windows: it sucks!</em>&#8220;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/08/i-ditched-windows-and-so-can-you/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is going on with offshore in Colombia?</title>
		<link>http://www.simpleprojectz.com/2009/07/what-is-going-on-with-offshore-in-colombia/</link>
		<comments>http://www.simpleprojectz.com/2009/07/what-is-going-on-with-offshore-in-colombia/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 04:47:51 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Methods]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[colombia]]></category>
		<category><![CDATA[lazy]]></category>
		<category><![CDATA[offshore]]></category>
		<category><![CDATA[worker]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=406</guid>
		<description><![CDATA[Colombia is a country full of high qualified developers, designers and in general, great web builder experts. However something is going wrong with those lucky guys that work for companies who have offshore contracts. After few months or even years &#8230; <a href="http://www.simpleprojectz.com/2009/07/what-is-going-on-with-offshore-in-colombia/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/mau_igaly/3167971925/" target="_blank"><img class="alignleft size-full wp-image-421" title="Offshore" src="http://www.simpleprojectz.com/wp-content/uploads/2009/07/offshore.jpg" alt="Offshore" width="190" height="240" /></a>Colombia is a country full of high qualified developers, designers and in general, great web builder experts. However something is going wrong with those lucky guys that work for companies who have offshore contracts. After few months or even years of great work, people start feeling comfortable as well-paid workers and then suddenly and without notice, quality sense of work and care about details fade away. Why? I&#8217;m not sure, but I will do my best trying to discover the reasons through this post -and this is because I&#8217;m one of those lucky guys working for great company, but I REALLY do not want to start feeling comfortable, and  I REALLY REALLY do not want to start losing my tiny sense of quality and responsibility.</p>
<p>Feeling comfortable about having a job is not bad at all, even more these days during this crisis time, but is it really enough? Dedicated workers stand out from others because they do not feel comfortable, they are always looking for opportunities of doing great and better things. When this comfortable feeling grows more than it should, workers start forgetting that they are in Colombia, and start asking for foreign benefits and privileges, and they even believe that they deserve them. And that&#8217;s wrong, that&#8217;s totally wrong. It is not bad at all to get few additional benefits, however, it doesn&#8217; t mean we should take them for granted, we are still working in Colombia.</p>
<p>One of the amazing transformations of Colombian workers is: once we get used to a job,  we believe we can decide our own duties and decide what to do and when. Well my friends, most of the time and all around the world, bosses decides what must be done and when. So WTF! I really can&#8217;t deal with that, it piss me off. Job is responsibility, it is not about doing &#8220;favors&#8221; to the managers, it is about to do what it is supposed because you are getting paid for that. It is not because you want, it is because you have to -and I&#8217;m talking about legal, non-extra activities of course, but just to point that out.</p>
<p>Another endemic attitude is to look for responsible when there is no other guy doing the job. I will no get into this because&#8230; do I need to? A variance of this behaviour: people start doing EXACTLY what they were asked, even if managers are expecting a little support. They perform as machines, they do not evaluate and therefore there is no added value. If there is a misspelled word on their assignment description, they do not fix it, if there is something that requires some additional work or a little of analysis, they will try to delegate it. But, hey! keep in mind they are great developers, keep in mind we are not talking about junior resources. So why they decide to do that? Maybe I just pointed it out, it is because they do not want to assume their responsibility.</p>
<p>This comfortable behaviour is surrounding me for a little while, and I will say <strong>NO</strong>. I do not want to become one of those lazy but great workers that decide to keep their jobs by giving up their abilities. I will do my best tomorrow, and the day after tomorrow. Not sure what it means but probably I have an idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/07/what-is-going-on-with-offshore-in-colombia/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
