<?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 &#187; SW Development</title>
	<atom:link href="http://www.simpleprojectz.com/category/development/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>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
		<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 software development since forever &#8211; because in software development, scope is a moving target so [...]]]></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>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 here in Colombia, there was no opportunity for me to grow personal or professional. I [...]]]></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 the idea that there is no a better abstraction layer. Requirements / Example environment configuration. [...]]]></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"><div 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></div></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 develop a search portlet. It wasn&#8217;t easy, and you will probably find that it is [...]]]></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>Team Building vs. Labor Climate</title>
		<link>http://www.simpleprojectz.com/2009/02/team-building/</link>
		<comments>http://www.simpleprojectz.com/2009/02/team-building/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 04:28:53 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Methods]]></category>
		<category><![CDATA[PM Community]]></category>
		<category><![CDATA[SW Development]]></category>
		<category><![CDATA[labor climate]]></category>
		<category><![CDATA[project management]]></category>
		<category><![CDATA[team building]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=354</guid>
		<description><![CDATA[Few days ago I had a conversation with one of the most active Bloggers I had ever known: Bas de Baar about project management in Colombia.I&#8217;m not the most experienced project manager here in Colombia, but probably I had worked for few companies that provide me with a very well understanding of what is going [...]]]></description>
			<content:encoded><![CDATA[<p>Few days ago I had a conversation with one of the most active Bloggers I had ever known: <a href="http://blog.softwareprojects.org/" target="_blank">Bas de Baar</a> about project management in Colombia.I&#8217;m not the most experienced project manager here in Colombia, but probably I had worked for few companies that provide me with a very well understanding of what is going on with project management in Colombia.</p>
<p>Project Management isn&#8217;t new in Colombia. At least for IT and software related companies Project Managers have been there forever (due to the nature of the IT and software development processes). But, there is something missing about PM here in Colombia: Team Building.</p>
<p>I do believe that Labor Climate and Team Building aren&#8217;t the same. As I said to Bas, almost all Colombians -good, not so good, and bad ones- will try to be your friend. Colombian people is really appreciated because of their willingness and attitude of service and camaraderie (did I write it right?). However those are two different things: try to be your friend, and be a good boss, project manager or director.</p>
<p>And that&#8217;s why Labor Climate seems to be amazing on Colombian SW development related companies even when &#8220;team building&#8221; is not a priority. And it could be good, because of its impact on the organizational behavior, improve the labor climate will probably  boost the team efficiency and collaboration. But, not to perform team building activities will be bad for long-term employee &amp; employers relationship, because &#8220;personal&#8221; friendship isn&#8217;t necessarily based on the idea of personal and professional growth and career development.</p>
<p>Furthermore,  SW developers, designers, and architects, and IT project managers, prefers to have project-based relationships with their employers. And for those who know, contractors, even if they are good doing what they do, increase the probability of certain risks to occur -example: dependency on people because there is no knowledge spread opportunity.</p>
<p>To conclude. there is a big difference between &#8220;having a great time with amazing people at the office&#8221; and &#8220;having a great work experience&#8221;. It should be a balance between labor climate and team building to ensure a short-term motivation, but also a long-term relationship between employers and employees.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/02/team-building/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Automagic Platforms</title>
		<link>http://www.simpleprojectz.com/2009/01/automagic-platforms/</link>
		<comments>http://www.simpleprojectz.com/2009/01/automagic-platforms/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 18:19:11 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Digital Life]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[SW Development]]></category>
		<category><![CDATA[.net]]></category>
		<category><![CDATA[automagic]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=317</guid>
		<description><![CDATA[Few years a go, Ruby on Rails (RoR) start shinning because it was only framework able to speed up the Web development with a set of all-in-one tools. As Java experienced programmer and architect, I&#8217;ve to recognize that the RoR team made their point. I still remember that video with a guy with a lot [...]]]></description>
			<content:encoded><![CDATA[<p>Few years a go, Ruby on Rails (RoR) start shinning because it was only framework able to speed up the Web development with a set of all-in-one tools. As Java experienced programmer and architect, I&#8217;ve to recognize that the RoR team made their point. I still remember that video with a guy with a lot of jars on top of a table (<a href="http://www.youtube.com/watch?v=PQbuyKUaKFo" target="_blank">check it here</a>) that made me LoL for a while -an awful truth. Now we have a lot of solutions that offers similar out-of-the-box scripts and frameworks that build code as RoR does -the fancy but power/useful scaffolding, the code generators, and others. Few of them:</p>
<ul>
<li><a href="http://seamframework.org/" target="_blank">Seam Framework</a> -great tool</li>
<li><a href="http://www.djangoproject.com" target="_blank">Django</a> -for Python developers.</li>
<li><a href="http://www.cakephp.org/" target="_blank">CakePHP</a></li>
<li><a href="http://www.codeigniter.com/" target="_blank">Code Igniter</a></li>
<li><a href="http://www.symfony-project.org/" target="_blank">Symfony</a></li>
<li><a href="http://framework.zend.com/" target="_blank">Zend Framework</a></li>
</ul>
<p>The list could be huge, but the main point is not to check them all but to provide few tips to start a Web-based project and choose the right tool.</p>
<p><strong>The .NET and Java mistakes</strong><br />
I do love Java, I&#8217;m a fan-boy of JEE technology and portability but, I&#8217;ve to say, even if it hurts, Java is a huge rock. It means you need to have a huge infrastructure, a huge processing capacity and a lot of tools to start a JEE project. Why? Let&#8217;s face it, you need more than your imagination to start a project and it isn&#8217;t easy nor cheap to find a great hosting solution, to properly setup an environment for development (with sandbox and preproduction/test environments). Even if your project is really small it is a good idea not to have the test environment on the developer computer -I hope you don&#8217;t think this is a joke, it happens ALL the time.</p>
<p>So, instead of being easy to start with a basis, you have to deal with complex configuration problems -it is good to have all those options if you are on a banking/financial project with a couple millions as budget, but in a real economic-crisis world you should look for &#8220;point-n-shoot&#8221; solutions -if you know what I meant.</p>
<p><strong>The Apache Friends</strong><br />
So you have a lot of alternatives on the Apache HTTPD side, with PHP (the popular), Perl (the bad cousin), Python (the genius), RoR (the cocky brother) and all others.</p>
<p>I&#8217;m not a scripter guy, the compiling hell is for me but, the simplicity shows us that you don&#8217;t have to deal with complexity all the time for Web projects. So, give non-corporate-supported technologies a chance. It was hard to me, but they worked faster and cheaper than expected -there is not measure to say better. It is cheaper to create a top-class development and testing environment and work with remote teams if you use open solutions -not necessarily open source. It is not all about the language you love, the server you own, the database that rules the world. It is about cost, simplicity and efficiency. It is easier to get/hire great developers on these tools than for Java &#8211; .NET is for chickens and everybody knows it (<a href="http://blogs.msdn.com/somasegar/archive/2005/07/13/438647.aspx" target="_blank">check this article</a> if you do not believe me). Software development is not about coding, is about solving, that&#8217;s what Microsoft doesn&#8217;t understand. They code a lot but they do not solve too much, right? You should notice since Windows 95 and the coming of the Blue Screen ERA!</p>
<p><strong>The Automagic</strong><br />
Before I became a senior developer I worked migrating some applications from Oracle Forms and PowerBuilder to J2EE -we used to put a horrible 2 in the middle few years ago. And those tools were great for the task they were created. So it took almost a decade to have those tools on the Web -and they do not work as fine as those mentioned. However, the Automagic isn&#8217;t new at all. ActiveRecord exists since, I don&#8217;t know, the Z81 maybe? He He He!</p>
<p>So now we have tools that reverse the database and create ORM models, pre-formatted pages and objects that speed up -years- the development. So you can concentrate in other <em>IMPORTANT STUFF </em>like, User Experience (UX), Information Architecture (IA) and the forgotten design.</p>
<p>The generated code is clean as possible (I remember the JBuilder and its generated &amp; encrypted code). And this is thanks to the separation of concerns and excellent pattern implementations &#8211; the commonly used for the Web is the MVC supported with other ones like ActiveRecord and IoC, but you can find a whole universe on each platform and framework &#8211; I do have an old poster of J2EE patterns as wallpaper for example!</p>
<p><strong>The Verdict</strong><br />
Before fan-boys appears into the scene while you are deciding what platform should use, please take a look to the ones you probably will not look at -don&#8217;t waste your time with .NET <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> . During these 7 (should I said 8?) years working on Web development I&#8217;ve noticed that only big companies uses robust (slow development) platforms like Java and .NET -by big  companies I meant with more than couple billions of dollars on their budgets. They spent a lot of money in servers and infrastructure and ironically most of the time they use always versions old versions of platforms, servers, databases and all. So even if they spent a lot of money they cannot move as fast as it happens with the technology. Microsoft still produces Adobe Flash banners right, even if they have their own Silverlight. And it also happens with JavaFX. When you develop Flash components some companies still requests Flash 6 or 7, when we all know that we have version 9 and 10 running on most of the computers on the web. But hey, they want to be sure and even those computers that are off since 1995 can see them! &#8211; why?</p>
<p>Before you spent more then 6 months working on a project without a single release -could be a partial one, but functional- keep in mind that probably it will take other 6 months before you see the product/result you are expecting. Automagic means fast, so I hope you do not spend more time thinking on if you should or not, and how, than coding&#8230; Otherwise it will demostrate my point <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2009/01/automagic-platforms/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Facebook &amp; CodeIgniter &#8211; Definitive Guide</title>
		<link>http://www.simpleprojectz.com/2008/10/facebook-codeigniter/</link>
		<comments>http://www.simpleprojectz.com/2008/10/facebook-codeigniter/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 03:29:29 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[SW Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[facebook]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=185</guid>
		<description><![CDATA[I spent more hours than the expected starting a simple development for a new Facebook application that runs on top of CodeIgniter. First I read A LOT, then I checked for solutions and, of course, I read a little bit more. After several hours reading and coding I knew it wasn&#8217;t good at all so [...]]]></description>
			<content:encoded><![CDATA[<p>I spent more hours than the expected starting a simple development for a new Facebook application that runs on top of CodeIgniter. First I read A LOT, then I checked for solutions and, of course, I read a little bit more. After several hours reading and coding I knew it wasn&#8217;t good at all so I decided to start a new integration method from the scratch using only the code I found as guide. Here&#8217;s the result:</p>
<p><strong>0. Environment</strong></p>
<p>Before you get excited just review a few things before spent time reading another useless post <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<ul>
<li>PHP Version 5.2.6</li>
<li>MySQL 5 (It doesn&#8217;t affect Facebook integration at all but it is good to know)</li>
<li>HostMonster is my hosting provider (it is not a marketing initiative, just they have a nice environment set up for PHP)</li>
<li>Facebook platform 5 &#8211; I upload a copy of it to ensure you get the same copy I used.</li>
<li>CodeIgniter 1.6.3 &#8211; latest version available at the time of this post.</li>
</ul>
<p><strong>1. Do not hack CodeIgniter</strong></p>
<p>I found a lot of solutions about hacking CodeIgniter by overriding functions or classes. NO, YOU DO NOT HAVE TO DO IT.</p>
<p><strong>2. Install facebook library as plugin</strong></p>
<ul>
<li>Download the facebook platform ZIP</li>
<li>Unzip the files wherever you want -outside your Code Igniter application</li>
<li>Copy the WHOLE content under <em>/php</em> folder (under means files inside the folder and not with the container folder) to yout <em>./system/plugins</em> folder inside Code Igniter application -<strong>Note:</strong> Yes, you have to include the <em>jsonwrapper</em> folder.</li>
<li>Rename the <em>facebook.php</em> file to <em>facebook_pi.php</em></li>
</ul>
<p>It is done! You already have installed facebook framework as plugin.</p>
<p><strong>3. Autoload facebook plugin </strong>[optional]</p>
<p>To avoid the need of including the &#8220;load plugin&#8221; sentence inside every controller/class you can modify the <em>./system/config/autoload.php</em> to include facebook plugin as required. It is almost a requirement for Facebook applications. Add to your <em>$autoload['plugin']</em> array the facebook plugin. It could look like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$autoload</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugin'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'facebook'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Note: </strong>If you skip this step you will have to include the following line every time you need facebook functionality available.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>load<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>plugin<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'facebook'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>4. Setup your application </strong>[updated]</p>
<p>Update your configuration file and set the .<em>/system/application/config/config.php</em> and change it as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'uri_protocol'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;PATH_INFO&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'base_url'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;APPLICATION_URL&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Note:</strong> If you want to test your application locally, you can set <em>base_url</em> to <em>http://127.0.0.1/path_to_your_app/</em></p>
<p><strong>5. Extend your Controller class</strong></p>
<p>Because I&#8217;m building a 100% facebook application, all my controllers require facebook API available. So I decided to extend my main Controller class as follows &#8211; BTW: By the date of this post the CodeIgniter documentation <strong>WAS WRONG</strong> about how to extend the core classes (<a href="http://codeigniter.com/user_guide/general/core_classes.html" target="_blank">CodeIgniter User Guide Version 1.6.3 &#8211; Creating Core System Classes</a>). It is not true -i.e. it is false- that you have to extend the <em>CI_ClassName</em>. At least it didn&#8217;t work for me at all. Extend the <em>ClassName</em> directly.</p>
<p>Facebook Controller class should be placed under <em>./system/application/libraries</em> folder.</p>
<p><strong>Filename:</strong> XX_Controller.php (where &#8220;XX_&#8221; is the prefix you set on your<em> ./system/application/config/config.php</em> file &#8211; subclass_prefix parameter)</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> FB_Controller <span style="color: #000000; font-weight: bold;">extends</span> Controller <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Facebook application key</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$API_KEY</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YOUR_API_KEY'</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$facebook</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">var</span> <span style="color: #000088;">$uid</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">/*
	 * Custom Controller constructor.
	 * Adds Facebook support.
	 *
	 */</span>
	<span style="color: #000000; font-weight: bold;">function</span> FB_Controller<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		parent<span style="color: #339933;">::</span><span style="color: #004000;">Controller</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Authentication key</span>
		<span style="color: #000088;">$secret</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'YOUR_SECRET_KEY'</span><span style="color: #339933;">;</span> 
&nbsp;
		<span style="color: #666666; font-style: italic;">// Prevent the 'Undefined index: facebook_config' notice from being thrown.</span>
		<span style="color: #000088;">$GLOBALS</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'facebook_config'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Create a Facebook client API object.</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Facebook<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>API_KEY<span style="color: #339933;">,</span> <span style="color: #000088;">$secret</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>uid <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>require_login<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>Note:</strong> Inside the facebook application I built I always require an authenticated users, so that&#8217;s why I do have the <em>require_login() </em>call. However you can also validate if the user already have the application added. You should do this manually inside controller classes because there are a few exceptions where it is needed that user is authenticated but without adding the application.</p>
<p><strong>6. Create your own controllers</strong></p>
<p>Now you can extend your controllers from your Custom Controller. <strong>Note:</strong> You do not have to add any include or require sentence in your other classes, CodeIgniter will load directly your <em>XX_Controller.php</em> file -if it doesn&#8217;t load please check the <em>config.php</em> file and validate the <em>subclass_prefix</em> parameter.</p>
<p>Below you will find an example of a Controller that will validate if the user has the application added in his/her profile.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">class</span> Welcome <span style="color: #000000; font-weight: bold;">extends</span> XX_Controller <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> Welcome<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		parent<span style="color: #339933;">::</span><span style="color: #004000;">XX_Controller</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Check if the application has been added by the user</span>
		try <span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>api_client<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>users_isAppAdded<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>redirect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_add_url<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: #b1b100;">return</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span>
		catch <span style="color: #009900;">&#40;</span>Exception <span style="color: #000088;">$x</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Clear cookies for your application and redirect them to a login prompt</span>
			<span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>expire_session<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$facebook</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>redirect<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>facebook<span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>get_login_url<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: #666666; font-style: italic;">// You should place your Controller's methods below.</span>
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>

<p><strong>7. Get out and celebrate</strong></p>
<p>CodeIgniter is running as cleaner as you expected and Facebook API was included nicely!</p>
<p>I hope you find this post useful as I said at the beginning.</p>
Note: There is a file embedded within this post, please visit this post to download the file.
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2008/10/facebook-codeigniter/feed/</wfw:commentRss>
		<slash:comments>49</slash:comments>
		</item>
		<item>
		<title>The interactive agencies that develop software</title>
		<link>http://www.simpleprojectz.com/2008/03/the-interactive-project-execution-model/</link>
		<comments>http://www.simpleprojectz.com/2008/03/the-interactive-project-execution-model/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 22:23:42 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[Methods]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[PM Community]]></category>
		<category><![CDATA[SW Development]]></category>
		<category><![CDATA[coder]]></category>
		<category><![CDATA[creative teams]]></category>
		<category><![CDATA[designer]]></category>
		<category><![CDATA[team development]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=9</guid>
		<description><![CDATA[From creative to coders Do you believe that the cold war has ended? If yes, it is because you don&#8217;t work in an interactive agency (a creative agency that produce a kind of interactive software) or in a web development company (a software development company that delivers creative content via Web). Agencies are internally informal [...]]]></description>
			<content:encoded><![CDATA[<h3>From creative to coders</h3>
<p>Do you believe that the cold war has ended? If yes, it is because you don&#8217;t work in an interactive agency (a creative agency that produce a kind of interactive software) or in a web development company (a software development company that delivers creative content via Web).</p>
<p>Agencies are internally informal companies -but serious companies of course. Agencies fight with their PMs to keep their projects running without concern but at the same time, are permissive with their creative teams because they know about the free-sense of the design process. I&#8217;m pretty sure no body told God that he has to end the world creation by the seventh day EOD (end of day). Creation/Creative is related to the feelings and passion, and we all know they cannot be scheduled. However it doesn&#8217;t mean that creative process could take whatever it takes, it means you need trained team members to understand the business model.</p>
<p>Developers are the creative nemesis. Probably, developers are persons that will want to have their life planned, or at least under control. They (should I say we?) want to reduce the risk and be a step ahead of the opportunities and treats. Why they don&#8217;t like designers? It is easy as this sentence, designers -for interactive agencies/web development companies will not deploy their deliverables to the client. Developers are forced to takeover the designers outcomes and create real applications or products. So, at the end of the day, how will carry the whole pressure? Who will have to understand the client needs and the designer approach to deliver the expected result?</p>
<p>So, what happen when you came into a company where developers and creative are working together? A lot of things could happen, but the most probably will be a formal and tangible separation of the teams. The cold war has begun and the PM will have to deal with it as a double agent.</p>
<p>Below some tips for those who has to deal with this.</p>
<ul>
<li>Designers are not coders / Coders are not designers. Are you or your senior management considering this option? Are you crazy? Designers are guys with an open mind -they have to. They should bring light when nobody else can give you a little spark. On the other hand Coders are those guys that do not create a square but resolve your needs with success. One thing is about create from scratch, other thing is to use the tools to deploy solutions -languages, frameworks, and formal products. Keep it as it is. Do not reduce costs using a CODEsigner, a coder that knows how to use Paint <em>IS NOT A DESIGNER. </em>There are few Titans that will walk between these two worlds, if you have them, lucky you!</li>
<li>Define with the senior management the business model. It could be whatever it be, that address your company needs. However, take a look to the ones I present below
<ul>
<li>One team, one soul. Bring developers and designers to work together. Push them as a unit, make them feel as all are involved. Most of the time, agencies give creative designers flexibility that will cost long nights for developers, while Software companies will reduce more than needed the importance of their work resulting in motivation issues and poor creative design quality. As PM you can get involve and takeover those team members (I don&#8217;t want to use the word <em>resources</em>) avoiding those situations. Get time to know the creative process, push them since the beginning -the most part of the creative guys will be lazy at that phase. Measure their time, keep the whole team under constant medium pressure to avoid relax/stress situations. Once the team get used to it, the pressure will not exists more than in their own minds and desire for deliver.</li>
<li>Providing code development. Developers can be providers for creative. Offshore teams will work great with this approach. You will reduce the risk at development side. However you probably will have to spend more with your team leaders. If those guys are not like the Musketeers -all for one and one for all- you are lost. Provider model will give you some freedom within the teams but during integration process you will need real experts to avoid technical/creative issue or change.</li>
<li>Providing creative assets. This one is my favorite. Let creative do their work -whatever it is, they do it and developers will not be involved. Set unmovable dates for delivery and let your coding team use those assets. Be formal during the assets&#8217; specs definition. Do not let creative set the dates, be a extra formal PM. With some time you will get the enough experience to understand why creative ask for a lot of time and do their work in a quarter of that.</li>
<li>Limited creative. The most amazing hit from coders was to create the templates. Templates are great!, they give the designers enough freedom to make their changes, but not too much to screw everything. <strong>Templating</strong> if possible is the greatest solution. Your coders will have time to do their work and will share with the designers the integration responsibility. -Of course, this is not the case for the most of the agencies, they will feel your are cutting out their freedom and they will say: &#8220;<em>Our strength is our creative freedom</em>&#8220;, so you will have to sell this idea.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2008/03/the-interactive-project-execution-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Modeling business needs for software projects</title>
		<link>http://www.simpleprojectz.com/2008/03/modeling-business-needs-for-a-software-project/</link>
		<comments>http://www.simpleprojectz.com/2008/03/modeling-business-needs-for-a-software-project/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 01:49:21 +0000</pubDate>
		<dc:creator>Alberto Dominguez, PMP</dc:creator>
				<category><![CDATA[SW Development]]></category>
		<category><![CDATA[business analyst]]></category>
		<category><![CDATA[business need]]></category>
		<category><![CDATA[process]]></category>
		<category><![CDATA[requirement]]></category>

		<guid isPermaLink="false">http://www.simpleprojectz.com/?p=6</guid>
		<description><![CDATA[One of the most complicated things in the whole word is to get the business needs that will drive a software project to address or support a company strategy. This whole science has been supported by a new company role named Business Analyst. This person could be the hero or the villain, depending on how [...]]]></description>
			<content:encoded><![CDATA[<p>One of the most complicated things in the whole word is to get the business needs that will drive a software project to address or support a company strategy. This whole science has been supported by a new company role named Business Analyst. This person could be the hero or the villain, depending on how happy is the client and how clear are the requirements gathered.</p>
<p>First, you have a nice client -keep in mind you should be starting a project and everybody is happy; you as a provider, are a kind of new toy <img src='http://www.simpleprojectz.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> -. Most of the times clients are confused about their needs or have a lot of needs that are not properly presented to the provider -this could be extremely dangerous. On the other hand you should have as designer/business analyst a team waiting for your directions. So how you deal with this pressure and ensure a good project start? I present you five points that could be helpful.</p>
<ol>
<li>Customer is always right! NO, NO, NO, NO. Have you ever seen a woman with a lot of money in a new useless/stuffy store? A little boy in a candy store with 100 dollars? Ok, first of all, bring your expertise and experience, be the mentor of the client, give them what they want but take your time understanding the root causes of those needs. Pay attention to the client, how he/she/they communicate the needs.</li>
<li>Spend time with your client to know their needs. This is a common item, if you want to know your client needs, you must spend time with them, not in meetings but good quality time -I hate the <strong>meetingitis</strong> syndrome.</li>
<li>Bring help. At this point you should be thinking &#8220;I&#8217;m the man&#8221; and your boss should be thinking the same -probably because they don&#8217;t want to pay more. However, any doubt during the business needs gathering process will mean hundreds or thousands of hours wasted because that little misconception. There is a lot of ways to bring help, thought expert consultants, through team empowerment -from client and vendor teams- and my favorite: from the community (geek Internet knowledge community  -they are not always right but probably will have a lot of help and feedback for <strong>free!.</strong></li>
<li>Share with all (the <a href="http://en.wikipedia.org/wiki/Wiki" target="_blank">Wiki</a> model). As certified <a href="http://www.pmi.org" target="_blank">PMP</a> I know that the key of the leadership is communication. An effective way to  delivery quality design documentation -for example, business use cases, use cases, interaction diagrams or even the hated wireframes (a horrible invention of something that is not similar to reality but should represent it&#8230; in some how!) &#8211; is to involve the team since the beginning. My personal recommendation, use a <a href="http://en.wikipedia.org/wiki/Wiki" target="_blank">Wiki</a> software to share with all in a simple way -Does <a href="http://www.wikipedia.org" target="_blank">Wikipedia</a> the biggest online dictionary sounds familiar? Do you know you can participate too and improve or add your own definitions?</li>
<li>Be formal. The previous point was about to share, but you cannot post a letter or send an email every time you have an idea or new requirement defined. Be smart, be formal, keep in mind your work is not only about define needs, is about defined the correct needs in a clear way. So my suggestion is: do not reinvent use templates, spend time customizing your owns or check in the company records. Let the team participate but keep the power and control. <strong>TIP</strong>: good templates can be found at <a href="http://readyset.tigris.org/" target="_blank">ReadySET</a> for free.</li>
</ol>
<p>There is a lot of knowledge that you can use, share and improve. Projects are not always the same, clients are not always the same, success not only depends on how good/excellent you do your work but for sure, you are reducing the risk and increasing the chances to be a hero.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.simpleprojectz.com/2008/03/modeling-business-needs-for-a-software-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

