<?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>cObaia.net &#187; PMI</title>
	<atom:link href="http://cobaia.net/categorias/pmi/feed/" rel="self" type="application/rss+xml" />
	<link>http://cobaia.net</link>
	<description>PHP, Javascript and some code around it!</description>
	<lastBuildDate>Sun, 29 Jan 2012 03:56:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>CakePHP: Check and Deal with POST Requests for AJAX and REST Applications</title>
		<link>http://cobaia.net/2011/08/cakephp-check-and-deal-with-post-requests-for-ajax-and-rest-applications/</link>
		<comments>http://cobaia.net/2011/08/cakephp-check-and-deal-with-post-requests-for-ajax-and-rest-applications/#comments</comments>
		<pubDate>Thu, 11 Aug 2011 13:21:43 +0000</pubDate>
		<dc:creator>Vinícius Krolow</dc:creator>
				<category><![CDATA[cakephp]]></category>
		<category><![CDATA[PMI]]></category>

		<guid isPermaLink="false">http://cobaia.net/?p=760</guid>
		<description><![CDATA[Several times I have to check if a request it&#8217;s really a HTTP POST and if the data of post was passed in this request too, so these controllers where I need this check always have to check the data, and type of request&#8230; To avoid repeat the code I wrote this method: 1 2 [...]]]></description>
			<content:encoded><![CDATA[<p>Several times I have to check if a request it&#8217;s really a HTTP POST and if the data of post was passed in this request too, so these controllers where I need this check always have to check the data, and type of request&#8230;</p>
<p>To avoid repeat the code I wrote this method:</p>

<div class="wp_codebox"><table><tr id="p7604"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code" id="p760code4"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _isPOST<span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/isset"><span style="color: #990000;">isset</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RequestHandler</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RequestHandler</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isPost</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;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'POST'</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;">-&gt;</span><span style="color: #004000;">redirect</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">405</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$data</span> <span style="color: #339933;">===</span> <span style="color: #009900; font-weight: bold;">true</span> <span style="color: #339933;">&amp;&amp;</span> <a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</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;">-&gt;</span><span style="color: #004000;">redirect</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">400</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<a href="http://www.php.net/exit"><span style="color: #990000;">exit</span></a><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>You can put this method in your <code>AppController</code></p>
<p>It&#8217;s really simple, but useful for me. The code just check if it&#8217;s a POST Request if it&#8217;s not, bring a HTTP CODE 405, check if the POST data it&#8217;s not empty if it is bring a HTTP CODE 400.</p>
<p>And that&#8217;s it, now you don&#8217;t need wrote codes like this anymore:</p>

<div class="wp_codebox"><table><tr id="p7605"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p760code5"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> my_action<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">RequestHandler</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">isPost</span><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: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">data</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
			<span style="color: #009900;">&#125;</span>
		<span style="color: #009900;">&#125;</span> <span style="color: #b1b100;">else</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>You have just to put this:</p>

<div class="wp_codebox"><table><tr id="p7606"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p760code6"><pre class="php" style="font-family:monospace;">	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> my_action<span style="color: #009900;">&#40;</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>_isPOST<span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>The first argument it&#8217;s a boolean one, you pass true if you want to check if the <code>$this->data</code> it&#8217;s not empty, otherwise you pass false, or pass nothing.</p>
]]></content:encoded>
			<wfw:commentRss>http://cobaia.net/2011/08/cakephp-check-and-deal-with-post-requests-for-ajax-and-rest-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web 2.0 para PM (Gerente de Projeto)</title>
		<link>http://cobaia.net/2009/03/web-20-para-pm-gerente-de-projeto/</link>
		<comments>http://cobaia.net/2009/03/web-20-para-pm-gerente-de-projeto/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 02:17:48 +0000</pubDate>
		<dc:creator>Vinícius Krolow</dc:creator>
				<category><![CDATA[gerenciamento de projetos]]></category>
		<category><![CDATA[metodologia ágil]]></category>
		<category><![CDATA[PMI]]></category>
		<category><![CDATA[scrum]]></category>

		<guid isPermaLink="false">http://cobaia.net/?p=500</guid>
		<description><![CDATA[Web 2.0 Tools For Project Management View more presentations from Douglas Tokuno. Vi aqui.]]></description>
			<content:encoded><![CDATA[<p><img style="visibility:hidden;width:0px;height:0px;" border=0 width=0 height=0 src="http://counters.gigya.com/wildfire/IMP/CXNID=2000002.0NXC/bT*xJmx*PTEyMzc3NzQzMTU2OTQmcHQ9MTIzNzc3NDU4NDI3OSZwPTEwMTkxJmQ9Jmc9MiZ*PSZvPTM*MzY4Y2YwNDM4MjQzNjViNzAxZDA2NDRhMjc2NDM4.gif" />
<div style="width:425px;text-align:left" id="__ss_1034819"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/douglastokuno/web-20-tools-for-project-management?type=powerpoint" title="Web 2.0 Tools For Project Management">Web 2.0 Tools For Project Management</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=web-20-tools-for-project-management-1234811974116287-3&#038;stripped_title=web-20-tools-for-project-management" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=web-20-tools-for-project-management-1234811974116287-3&#038;stripped_title=web-20-tools-for-project-management" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object>
<div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/douglastokuno">Douglas Tokuno</a>.</div>
</div>
<p>Vi <a href="http://tabuleirodeprojetos.net/2009/cardapios-ferramentas-gerenciamento-projetos/">aqui</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cobaia.net/2009/03/web-20-para-pm-gerente-de-projeto/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3ª Congresso Brasileiro de Gerenciamento de Projetos</title>
		<link>http://cobaia.net/2008/10/3-congresso-brasileiro-de-gerenciamento-de-pr/</link>
		<comments>http://cobaia.net/2008/10/3-congresso-brasileiro-de-gerenciamento-de-pr/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 16:42:40 +0000</pubDate>
		<dc:creator>Vinícius Krolow</dc:creator>
				<category><![CDATA[gerenciamento de projetos]]></category>
		<category><![CDATA[PMI]]></category>

		<guid isPermaLink="false">http://cobaia.net/?p=280</guid>
		<description><![CDATA[Ocorre em Porto Alegre, nos dias 22, 23 e 24, o 3ª Congresso Brasileiro de Gerenciamento de Projetos. Evento está sendo promovido, pelos capítulos brasileiros do PMI, contando com a organização do PMI-RS. O evento conta com palestras, mini-cursos e oficinas, sobre gerenciamento de projetos. Tendo como palestrantes: Robert E. Smith, PhD &#8211; Inglaterra Pesquisador [...]]]></description>
			<content:encoded><![CDATA[<p>Ocorre em Porto Alegre, nos dias 22, 23 e 24, o <a title="Congresso PMI" href="http://pmirs.org.br/congresso/">3ª Congresso Brasileiro de Gerenciamento de Projetos</a>. Evento está sendo promovido, pelos capítulos brasileiros do PMI, contando com a organização do <a title="PMI-RS" href="http://pmirs.org.br/">PMI-RS</a>.</p>
<p>O evento conta com palestras, mini-cursos e oficinas, sobre gerenciamento de projetos. Tendo como palestrantes:</p>
<ul>
<li><strong>Robert E. Smith, PhD &#8211; Inglaterra</strong><br />
Pesquisador Sênior e Professor, University College London, Consultor Científico Chefe, Plexus Planning, Presidente da RESystems Consulting</li>
<li><strong>Eduardo Fleischer &#8211; Uruguay</strong><br />
Integrante de la Directiva y ex-presidente del Capítulo Montevideo</li>
<li><strong>Liliana Buchtik &#8211; Uruguay</strong><br />
Component Mentor del PMI para el Sur de América Latina</li>
<li><strong>Ricardo Viana Vargas, Msc., PMP® &#8211; PMI GOC</strong><br />
Brazilian Member of PMI Board of Directors</li>
</ul>
<p>Entre outros palestrantes de peso, que vão fazer parte da comissão de palestrantes.</p>
<p>A inscrição para o evento pode ser feita <a title="Inscrição" href="http://pmirs.org.br/congresso/?inscricao=1">online</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://cobaia.net/2008/10/3-congresso-brasileiro-de-gerenciamento-de-pr/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

