<?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>Liferay Latino Blog &#187; desarrollo</title>
	<atom:link href="http://www.lrlatinoblog.com.ar/tag/desarrollo/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.lrlatinoblog.com.ar</link>
	<description>La comunidad latina de Liferay</description>
	<lastBuildDate>Sat, 19 Nov 2011 18:47:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Maven</title>
		<link>http://www.lrlatinoblog.com.ar/2009/12/16/maven/</link>
		<comments>http://www.lrlatinoblog.com.ar/2009/12/16/maven/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 03:33:08 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com.ar/?p=113</guid>
		<description><![CDATA[A partir de la version 5.3 de Liferay, va a haber soporte oficial para maven.  En el este post Liferay Maven SDK publicado en el día de ayer en Liferay, se realiza una pequeña explicación de como se crea portlets &#8230; <a href="http://www.lrlatinoblog.com.ar/2009/12/16/maven/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A partir de la version 5.3 de Liferay, va a haber soporte oficial para maven.  En el este post <a href="http://www.liferay.com/web/mika.koivisto/blog/-/blogs/liferay-maven-sdk" target="_blank">Liferay Maven SDK</a> publicado en el día de ayer en Liferay, se realiza una pequeña explicación de como se crea portlets como plugins con Maven.</p>
<p>También se esta trabajando para crear themes, hooks y layouts.</p>
<p>Para trabajar con Liferay 5.2 existe actualmente una implementación para crear portles en <a href="http://wiki.github.com/azzazzel/liferay-maven-sdk/" target="_blank">GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2009/12/16/maven/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>34 trucos para diseñadores y desarrolladores web</title>
		<link>http://www.lrlatinoblog.com.ar/2009/11/27/34-trucos-para-disenadores-y-desarrolladores-web/</link>
		<comments>http://www.lrlatinoblog.com.ar/2009/11/27/34-trucos-para-disenadores-y-desarrolladores-web/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 03:56:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[Diseño]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com.ar/?p=99</guid>
		<description><![CDATA[En xyberneticos me entero de una guia de 34 trucos para diseñadores y desarrolladores web; esta guia tiene muchos tips interesantes a tener en cuenta. Este es el link.]]></description>
			<content:encoded><![CDATA[<p>En <a title="xyberneticos" href="http://xyberneticos.com/" target="_blank">xyberneticos</a> me entero de una guia de 34 trucos para diseñadores y desarrolladores web; esta guia tiene muchos tips interesantes a tener en cuenta.</p>
<p>Este es el <a title="34 trucos para diseñadores y desarrolladores web" href="http://www.webanddesigners.com/34-cheat-sheets-for-web-designers-and-developers" target="_blank">link</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2009/11/27/34-trucos-para-disenadores-y-desarrolladores-web/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PortletURL en JavaScript</title>
		<link>http://www.lrlatinoblog.com.ar/2008/12/22/portleturl-en-javascript/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/12/22/portleturl-en-javascript/#comments</comments>
		<pubDate>Tue, 23 Dec 2008 03:40:40 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=71</guid>
		<description><![CDATA[Una funcionalidad que acabo de descubrir en el Blog de Liferay es crear el PortletUrl en JavaScript. Un ejemplo de PortletUrl es: http://localhost:8080/web/guest/home?p_p_id=EDITAR_CUENTA&#038;p_p_lifecycle=0&#038;p_p_state=maximized&#038;p_p_mode=view&#038;_EDITAR_CUENTA_struts_action=%2Feditar_cuenta%2Fview Aca le estoy pasando el portlet id, el estado del portlet, la fase del ciclo de vida, &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/12/22/portleturl-en-javascript/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Una funcionalidad que acabo de descubrir en el Blog de Liferay es crear el PortletUrl en JavaScript.</p>
<p>Un ejemplo de PortletUrl es:</p>
<p>http://localhost:8080/web/guest/home?p_p_id=EDITAR_CUENTA&#038;p_p_lifecycle=0&#038;p_p_state=maximized&#038;p_p_mode=view&#038;_EDITAR_CUENTA_struts_action=%2Feditar_cuenta%2Fview</p>
<p>Aca le estoy pasando el portlet id, el estado del portlet, la fase del ciclo de vida, la acción de struts a ejecutar y 1 parametro (podrian ser muchos más).  Anteriormente la manipulación de esta url era medio complicada, ya que solo se podia generar a traves de JAVA o mediante una concatenación kilometrica de varios strings.  Con esta funcion nos proporciona mayor flexibilidad a la hora de programar.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot;&gt;
var portletURL = new Liferay.PortletURL(_PHASE);
portletURL.setParameter(&quot;key1&quot;, &quot;value&quot;);
portletURL.setParameter(&quot;key2&quot;, &quot;value&quot;);
portletURL.setPortletId(_PORTLET_ID);
&lt;/script&gt;
&nbsp;
&lt;a href=&quot;javascript: portletURL.toString()&quot;&gt;Go to&lt;/a&gt;</pre></div></div>

<p>Los valores que puede tomar _PHASE son:</p>
<ul>
<li>ACTION_PHASE</li>
<li>RENDER_PHASE</li>
<li>RESOURCE_PHASE</li>
</ul>
<p>También existen los siguientes métodos que permiten crear el PortletUrl según _PHASE:</p>
<ul>
<li>Liferay.PortletURL.createActionURL();</li>
<li>Liferay.PortletURL.createRenderURL();</li>
<li>Liferay.PortletURL.createResourceURL();</li>
</ul>
<p>Estos son los métodos restantes de la clase Liferay.PortletURL:</p>
<ul>
<li>setCopyCurrentRenderParameters: function(copyCurrentRenderParameters);</li>
<li>setDoAsUserId: function(doAsUserId);</li>
<li>setEncrypt: function(encrypt);</li>
<li>setEscapeXML: function(escapeXML);</li>
<li>setLifecycle: function(lifecycle);</li>
<li>setName: function(name);</li>
<li>setParameter: function(key, value);</li>
<li>setPlid: function(plid);</li>
<li>setPortletConfiguration: function(portletConfiguration);</li>
<li>setPortletId: function(portletId);</li>
<li>setPortletMode: function(portletMode);</li>
<li>setResourceId: function(resourceId);</li>
<li>setSecure: function(secure);</li>
<li>setWindowState: function(windowState);</li>
<li>toString: function();</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/12/22/portleturl-en-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Crear una comunidad</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/20/crear-una-comunidad/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/20/crear-una-comunidad/#comments</comments>
		<pubDate>Thu, 20 Nov 2008 09:41:39 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[comunidades]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=59</guid>
		<description><![CDATA[A continuación esta el codigo que nos permite crear una comunidad a partir de una comunidad existente, Obtener comunidad template Group templateGroup = GroupLocalServiceUtil.getGroupByFriendlyUrl&#40;&#34;/template&#34;&#41;; Crear una comunidad String name = ParamUtil.getString&#40;actionRequest, &#34;name&#34;&#41;; String description = ParamUtil.getString&#40;actionRequest, &#34;description&#34;&#41;; String friendlyURL = &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/20/crear-una-comunidad/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A continuación esta el codigo que nos permite crear una comunidad a partir de una comunidad existente,</p>
<p><strong>Obtener comunidad template</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">Group</span> templateGroup <span style="color: #339933;">=</span> GroupLocalServiceUtil.<span style="color: #006633;">getGroupByFriendlyUrl</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/template&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Crear una comunidad</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #003399;">String</span> name <span style="color: #339933;">=</span> ParamUtil.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span>actionRequest, <span style="color: #0000ff;">&quot;name&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> description <span style="color: #339933;">=</span> ParamUtil.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span>actionRequest, <span style="color: #0000ff;">&quot;description&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span> friendlyURL <span style="color: #339933;">=</span> ParamUtil.<span style="color: #006633;">getString</span><span style="color: #009900;">&#40;</span>actionRequest, <span style="color: #0000ff;">&quot;friendlyURL&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">Group</span> newGroup <span style="color: #339933;">=</span> GroupServiceUtil.<span style="color: #006633;">addGroup</span><span style="color: #009900;">&#40;</span>name, description,
GroupImpl.<span style="color: #006633;">TYPE_COMMUNITY_PRIVATE</span>, StringPool.<span style="color: #006633;">BLANK</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Copiar la configuración del LayoutSet</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">LayoutSet publicLayoutSet <span style="color: #339933;">=</span> LayoutSetLocalServiceUtil.<span style="color: #006633;">getLayoutSet</span><span style="color: #009900;">&#40;</span>templateGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
LayoutSetServiceUtil.<span style="color: #006633;">updateLookAndFeel</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span>, publicLayoutSet.<span style="color: #006633;">getThemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, publicLayoutSet
.<span style="color: #006633;">getColorSchemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, publicLayoutSet.<span style="color: #006633;">getCss</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
LayoutSetServiceUtil.<span style="color: #006633;">updateLookAndFeel</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span>, publicLayoutSet.<span style="color: #006633;">getWapThemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, publicLayoutSet
.<span style="color: #006633;">getWapColorSchemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, StringPool.<span style="color: #006633;">BLANK</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
LayoutSet privateLayoutSet <span style="color: #339933;">=</span> LayoutSetLocalServiceUtil.<span style="color: #006633;">getLayoutSet</span><span style="color: #009900;">&#40;</span>templateGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
LayoutSetServiceUtil.<span style="color: #006633;">updateLookAndFeel</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span>, privateLayoutSet.<span style="color: #006633;">getThemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, privateLayoutSet
.<span style="color: #006633;">getColorSchemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, privateLayoutSet.<span style="color: #006633;">getCss</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
LayoutSetServiceUtil.<span style="color: #006633;">updateLookAndFeel</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>,
<span style="color: #000066; font-weight: bold;">false</span>, privateLayoutSet.<span style="color: #006633;">getWapThemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, privateLayoutSet
.<span style="color: #006633;">getWapColorSchemeId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, StringPool.<span style="color: #006633;">BLANK</span>, <span style="color: #000066; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Definir que copiar</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">Map<span style="color: #339933;">&lt;</span>String, <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;;</span> parameterMap <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span>String, <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">PERMISSIONS</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">USER_PERMISSIONS</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">PORTLET_DATA</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">PORTLET_SETUP</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">PORTLET_ARCHIVED_SETUPS</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">PORTLET_USER_PREFERENCES</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
parameterMap.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span>PortletDataHandlerKeys.<span style="color: #006633;">THEME</span>,
<span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Boolean</span>.<span style="color: #000066; font-weight: bold;">TRUE</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Exportar datos de la comunidad template</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> publicOriginalGroup <span style="color: #339933;">=</span> LayoutServiceUtil.<span style="color: #006633;">exportLayouts</span><span style="color: #009900;">&#40;</span>
templateGroupId, <span style="color: #000066; font-weight: bold;">false</span>, parameterMap, <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000066; font-weight: bold;">byte</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> privateOriginalGroup <span style="color: #339933;">=</span> LayoutServiceUtil.<span style="color: #006633;">exportLayouts</span><span style="color: #009900;">&#40;</span>
templateGroupId, <span style="color: #000066; font-weight: bold;">true</span>, parameterMap, <span style="color: #000066; font-weight: bold;">null</span>, <span style="color: #000066; font-weight: bold;">null</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Importar datos a la nueva comunidad</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">LayoutServiceUtil.<span style="color: #006633;">importLayouts</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">false</span>,
parameterMap, publicOriginalGroup<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
LayoutServiceUtil.<span style="color: #006633;">importLayouts</span><span style="color: #009900;">&#40;</span>newGroup.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>, <span style="color: #000066; font-weight: bold;">true</span>,
parameterMap, privateOriginalGroup<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/20/crear-una-comunidad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Portlet de sistema</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/19/portlet-de-sistema/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/19/portlet-de-sistema/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 14:38:35 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[configuracion]]></category>
		<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[portlet]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=56</guid>
		<description><![CDATA[En varias ocasiones tuve el requerimiento de no mostrar algunos portlets en la lista de portlets disponibles para ser agregados a una página, y este ocultamiento no se podia hacer mediante permisos porque el usuario tenia que usar el portlet &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/19/portlet-de-sistema/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>En varias ocasiones tuve el requerimiento de no mostrar algunos portlets en la lista de portlets disponibles para ser agregados a una página, y este ocultamiento no se podia hacer mediante permisos porque el usuario tenia que usar el portlet y no debia tirar el error de que el portlet no estaba disponibles.  Entonces me di cuenta de que algunos portlets del core de Liferay no estaban disponibles para ser agregados a una página, por ejemplo el portlet de Look and Feel, el My Account o el del Page Setting.  Para esto hay que declarar al portlet como portlet de sistema en liferay-portlet.xml.</p>
<p><strong>liferay-portlet.xml</strong></p>

<div class="wp_syntax"><div 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;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>MIPORTLET<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;system<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>;rue<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/system</span>&lt;</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></pre></div></div>

<p>Desde otro portlet vamos a llamar a MIPORTLET</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;%</span>
&nbsp;
PortletURL miPortletURL <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> PortletURLImpl<span style="color: #009900;">&#40;</span>
request, <span style="color: #0000ff;">&quot;MIPORTLET&quot;</span>, plid, PortletRequest.<span style="color: #006633;">ACTION_PHASE</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
miPortletURL.<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>
miPortletURL.<span style="color: #006633;">setPortletMode</span><span style="color: #009900;">&#40;</span>PortletMode.<span style="color: #006633;">VIEW</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
miPortletURL.<span style="color: #006633;">setParameter</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;struts_action&quot;</span>, <span style="color: #0000ff;">&quot;/miportlet/view&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #339933;">%&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>a href<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;%= miPortletURL %&gt;&quot;</span><span style="color: #339933;">&lt;</span>IR A MI PORTLET<span style="color: #339933;">&lt;/</span>a<span style="color: #339933;">&gt;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/19/portlet-de-sistema/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mostrar un portlet en un PopUp</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/12/mostrar-un-portlet-en-un-popup/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/12/mostrar-un-portlet-en-un-popup/#comments</comments>
		<pubDate>Thu, 13 Nov 2008 02:27:07 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[portlet]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=34</guid>
		<description><![CDATA[Armo la URL &#60;portlet:renderURL windowState=&#34;&#60;%= LiferayWindowState.EXCLUSIVE.toString() %&#62;&#34; var=&#34;url&#34;&#62; &#60;portlet:param name=&#34;struts_action&#34; value=&#34;/miportlet/popupview&#34; /&#62; &#60;/portlet:actionURL&#62; Llamo al POPUP &#60;script type=&#34;text/javascript&#34;&#62; function mostrar_popup() { var _dialog = Liferay.Popup( { width: 700, modal: true, message: '&#60;div class=&#34;loading-animation&#34; /&#62;', position: ['center', 100], title: &#60;liferay-ui:message key&#34;popup-title&#34;/&#62;, &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/12/mostrar-un-portlet-en-un-popup/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Armo la URL</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>portlet<span style="color: #339933;">:</span>renderURL windowState<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;&lt;%= LiferayWindowState.EXCLUSIVE.toString() %&gt;&quot;</span> var<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;url&quot;</span><span style="color: #339933;">&gt;</span>
   <span style="color: #339933;">&lt;</span>portlet<span style="color: #339933;">:</span>param name<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;struts_action&quot;</span> value<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;/miportlet/popupview&quot;</span> <span style="color: #339933;">/&gt;</span>
<span style="color: #339933;">&lt;/</span>portlet<span style="color: #339933;">:</span>actionURL<span style="color: #339933;">&gt;</span></pre></div></div>

<p><strong>Llamo al POPUP</strong></p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">script</span> <span style="color: #000066;">type</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;text/javascript&quot;</span>&gt;</span>
   function mostrar_popup() {
      var _dialog = Liferay.Popup( 	{
      width: 700,
      modal: true,
      message: '<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span> <span style="color: #000066;">class</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;loading-animation&quot;</span> <span style="color: #66cc66;">/</span>&gt;</span>',
      position: ['center', 100],
      title: <span style="color: #009900;">&lt;liferay-ui:message key<span style="color: #ff0000;">&quot;popup-title&quot;</span><span style="color: #66cc66;">/</span>&gt;</span>,
      resizable: false,
      draggable: false,
      onClose: function() {
         // se ejecuta cuando el portle se cierra
      }
   });
&nbsp;
   jQuery.ajax( {
      url: &quot;<span style="color: #009900;">&lt;%<span style="color: #66cc66;">=</span> url %&gt;</span>&quot;,
      success: function(message) {
         _dialog.html(message);
      }
   });
}
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">script</span>&gt;</span>
&nbsp;
<span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;javascript:mostrar_popup();&quot;</span>&gt;</span>mostrar popup<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">a</span>&gt;</span></pre></div></div>

<p>Al definir el estado de la ventana como exclusivo, el resultado de la respuesta solamente va a ser el contenido del portlet al cual se invoca.</p>
<p><strong>Ejemplo:</strong></p>
<p><a href="http://www.lrlatinoblog.com.ar/wp-content/uploads/2008/11/mostrar-popup.png"><br />
<img class="alignnone size-medium wp-image-54" title="mostrar-popup" src="http://www.lrlatinoblog.com.ar/wp-content/uploads/2008/11/mostrar-popup-300x208.png" alt="" width="300" height="208" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/12/mostrar-un-portlet-en-un-popup/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Redirigir a una página despúes de registrarse</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/11/redirigir-a-una-pagina-despues-de-registrarse/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/11/redirigir-a-una-pagina-despues-de-registrarse/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 17:43:23 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=36</guid>
		<description><![CDATA[Para redirigir a una página de una comunidad después de registrarse en Liferay, hay que agregar un Evento, entonces vamos a hacer lo siguiente: portal-ext.properties login.events.post=com.liferay.portal.events.MyLoginPostAction,\ com.liferay.portal.events.DefaultLandingPageAction MyLoginPostAction.java package com.liferay.portal.events; &#160; import .... &#160; public class MyLoginPostAction extends Action &#123; &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/11/redirigir-a-una-pagina-despues-de-registrarse/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Para redirigir a una página de una comunidad después de registrarse en Liferay, hay que agregar un Evento, entonces vamos a hacer lo siguiente:</p>
<p><strong>portal-ext.properties</strong></p>

<div class="wp_syntax"><div class="code"><pre class="properties" style="font-family:monospace;"><span style="color: #000080; font-weight:bold;">login.events.post</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">com.liferay.portal.events.MyLoginPostAction,\</span>
com.liferay.portal.events.DefaultLandingPageAction</pre></div></div>

<p><strong>MyLoginPostAction.java</strong></p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">package</span> <span style="color: #006699;">com.liferay.portal.events</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">import</span> ....
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> MyLoginPostAction <span style="color: #000000; font-weight: bold;">extends</span> <span style="color: #003399;">Action</span> <span style="color: #009900;">&#123;</span>
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000000; font-weight: bold;">static</span> Log _log <span style="color: #339933;">=</span> LogFactory.<span style="color: #006633;">getLog</span><span style="color: #009900;">&#40;</span>MyLoginPostAction.<span style="color: #000000; font-weight: bold;">class</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> run<span style="color: #009900;">&#40;</span>HttpServletRequest req, HttpServletResponse res<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> ActionException <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
         <span style="color: #003399;">Group</span> group <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">getGroup</span><span style="color: #009900;">&#40;</span>req<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000000; font-weight: bold;">this</span>.<span style="color: #006633;">setLastPath</span><span style="color: #009900;">&#40;</span>group, req<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><span style="color: #003399;">Exception</span> 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>e<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
         <span style="color: #000000; font-weight: bold;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> ActionException<span style="color: #009900;">&#40;</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;">private</span> <span style="color: #000066; font-weight: bold;">void</span> getGroup<span style="color: #009900;">&#40;</span>HttpServletRequest req<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000000; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">null</span><span style="color: #339933;">;</span>
   <span style="color: #009900;">&#125;</span>
&nbsp;
   <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">void</span> setLastPath<span style="color: #009900;">&#40;</span><span style="color: #003399;">Group</span> group, HttpServletRequest req<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> PortalException, <span style="color: #003399;">SystemException</span> <span style="color: #009900;">&#123;</span>
      <span style="color: #000066; font-weight: bold;">long</span> defaultPlid <span style="color: #339933;">=</span> LayoutLocalServiceUtil.<span style="color: #006633;">getDefaultPlid</span><span style="color: #009900;">&#40;</span>group.<span style="color: #006633;">getGroupId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      Layout defaultLayout <span style="color: #339933;">=</span> LayoutLocalServiceUtil.<span style="color: #006633;">getLayout</span><span style="color: #009900;">&#40;</span>defaultPlid<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      HttpSession ses <span style="color: #339933;">=</span> req.<span style="color: #006633;">getSession</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      Map<span style="color: #339933;">&lt;</span>String, <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span> params <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> HashMap<span style="color: #339933;">&lt;</span>String, <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      params.<span style="color: #006633;">put</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;p_l_id&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#123;</span> <span style="color: #003399;">Long</span>.<span style="color: #006633;">toString</span><span style="color: #009900;">&#40;</span>defaultLayout.<span style="color: #006633;">getPlid</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      LastPath lastPath <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> LastPath<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;/c&quot;</span>, <span style="color: #0000ff;">&quot;/portal/layout&quot;</span>, params<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
      ses.<span style="color: #006633;">setAttribute</span><span style="color: #009900;">&#40;</span>WebKeys.<span style="color: #006633;">LAST_PATH</span>, lastPath<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>En este caso va a redirigir a la primer página publica de la comunidad y si esta no existe la redirige a la primer página privada.</p>
<p>Esto también puede ser para redirigir a una organización o a la página de un usuario.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/11/redirigir-a-una-pagina-despues-de-registrarse/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Configurar las preferencias de los Portlets</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/10/configurar-las-preferencias-de-los-portlets/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/10/configurar-las-preferencias-de-los-portlets/#comments</comments>
		<pubDate>Tue, 11 Nov 2008 02:25:33 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[configuracion]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[desarrollo]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=24</guid>
		<description><![CDATA[En primer lugar vamos a crear un portlet con el Plugin SDK y luego vamos a editar el archivo $SDK_HOME/docroot/WEB-INF/portlet.xml. En este caso vamos a ver la configuración del Portlet RSS para tener un ejemplo concreto para ver, luego de &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/10/configurar-las-preferencias-de-los-portlets/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>En primer lugar vamos a crear un portlet con el Plugin SDK y luego vamos a editar el archivo <strong>$SDK_HOME/docroot/WEB-INF/portlet.xml</strong>.</p>
<p>En este caso vamos a ver la configuración del Portlet RSS para tener un ejemplo concreto para ver, luego de agregar las propiedades vamos a ver como obtenemos dichos valores.</p>

<div class="wp_syntax"><div 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;portlet-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>RSS<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>RSS<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>com.liferay.portlet.StrutsPortlet<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;init-param<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>view-action<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>/rss/view<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;/init-param<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;expiration-cache<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/expiration-cache<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;/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>com.liferay.portlet.StrutsResourceBundle<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-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>urls<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>http://rss.news.yahoo.com/rss/tech<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;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://csmonitor.com/rss/scitech.rss<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;value<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>http://partners.userland.com/nytRss/technology.xml<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>items-per-channel<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>2<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;security-role-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;role-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>power-user<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/role-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security-role-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;security-role-ref<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
          <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;role-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>user<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/role-name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span> 
     <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/security-role-ref<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></pre></div></div>

<p>En ese caso hemos creado 2 preferencias, <strong>urls</strong> y <strong>items-per-channel</strong></p>
<p>Para obener estos valores hay que hacer:</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">PortletPreferences porttletPreferences <span style="color: #339933;">=</span> renderRequest.<span style="color: #006633;">getPortletPreferences</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> urls <span style="color: #339933;">=</span> porttletPreferences.<span style="color: #006633;">getValues</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;urls&quot;</span>, <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #003399;">String</span><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</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: #000066; font-weight: bold;">long</span> ipc <span style="color: #339933;">=</span> GetterUtil.<span style="color: #006633;">getLong</span><span style="color: #009900;">&#40;</span>portletPreferences.<span style="color: #006633;">getValue</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;items-per-channel&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/10/configurar-las-preferencias-de-los-portlets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Crear un Portlet con el Plugins SDK</title>
		<link>http://www.lrlatinoblog.com.ar/2008/11/08/crear-un-portlet-con-el-plugins-sdk/</link>
		<comments>http://www.lrlatinoblog.com.ar/2008/11/08/crear-un-portlet-con-el-plugins-sdk/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 15:20:13 +0000</pubDate>
		<dc:creator>joyola83</dc:creator>
				<category><![CDATA[desarrollo]]></category>
		<category><![CDATA[General]]></category>
		<category><![CDATA[portlet]]></category>

		<guid isPermaLink="false">http://www.lrlatinoblog.com/?p=3</guid>
		<description><![CDATA[Para crear un portlet vamos a utilizar la versión 5.1.2 de Liferay, y requerimos los siguientes componentes: ANT 1.7 JAVA MySQL (opcional) liferay-portal-tomcat-5.5-5.1.2 liferay-plugins-sdk-5.1.2 Liferay se puede descargar desde http://sourceforge.net/projects/lportal/. Paso a seguir: Variables de entorno SDK_HOME=/home/joyola/desarrollo/liferay/liferay-plugins-sdk-5.1.2 TOMCAT_HOME=/home/joyola/desarrollo/liferay/liferay-portal-tomcat-5.5-5.1.2 Configuracion del &#8230; <a href="http://www.lrlatinoblog.com.ar/2008/11/08/crear-un-portlet-con-el-plugins-sdk/">Sigue leyendo <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Para crear un portlet vamos a utilizar la versión 5.1.2 de Liferay, y requerimos los siguientes componentes:</p>
<ol>
<li>ANT 1.7</li>
<li>JAVA</li>
<li>MySQL (opcional)</li>
<li>liferay-portal-tomcat-5.5-5.1.2</li>
<li>liferay-plugins-sdk-5.1.2</li>
</ol>
<p>Liferay se puede descargar desde <a href="http://sourceforge.net/projects/lportal/" target="_blank">http://sourceforge.net/projects/lportal/</a>.</p>
<p><strong>Paso a seguir:<br />
</strong></p>
<ul>
<li><em><strong>Variables de entorno</strong></em></li>
</ul>
<p>SDK_HOME=/home/joyola/desarrollo/liferay/liferay-plugins-sdk-5.1.2<br />
TOMCAT_HOME=/home/joyola/desarrollo/liferay/liferay-portal-tomcat-5.5-5.1.2</p>
<ul>
<li><strong><em>Configuracion del SDK</em></strong></li>
</ul>
<p>Creamos el archivo: $SDK_HOME/build.${user.name}.properties.  Todas la propiedades utilizadas aca, sobreescriben el valor por default de las propiedades del archivo build.properties.</p>
<p>A continuación se especifican aquellas propiedades necesarias para comenzar.</p>

<div class="wp_syntax"><div class="code"><pre class="properties" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Specify the paths to an unzipped Tomcat 5.5.x bundle.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #000080; font-weight:bold;">app.server.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">$<span style="">&#123;</span>project.dir<span style="">&#125;</span>/../liferay-portal-tomcat-5.5-5.1.2</span>
<span style="color: #000080; font-weight:bold;">app.server.portal.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">$<span style="">&#123;</span>app.server.dir<span style="">&#125;</span>/webapps/ROOT</span>
<span style="color: #000080; font-weight:bold;">app.server.classes.portal.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">$<span style="">&#123;</span>app.server.portal.dir<span style="">&#125;</span>/WEB-INF/classes</span>
<span style="color: #000080; font-weight:bold;">app.server.lib.portal.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">$<span style="">&#123;</span>app.server.portal.dir<span style="">&#125;</span>/WEB-INF/lib</span>
<span style="color: #000080; font-weight:bold;">app.server.lib.global.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;">$<span style="">&#123;</span>app.server.dir<span style="">&#125;</span>/common/lib/ext</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Plugins will be deployed to this directory. Make sure that Liferay is</span>
<span style="color: #808080; font-style: italic;"># also set to scan this directory.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #000080; font-weight:bold;">auto.deploy.dir</span><span style="color: #000000;">=</span><span style="color: #008000; font-weight:bold;"><span style="font-weight: bold;">$<span style="">&#123;</span>user.home<span style="">&#125;</span></span>/liferay/deploy</span></pre></div></div>

<ul>
<li><em><strong>Crear el portlet</strong></em></li>
</ul>
<p>Ejecutamos el comando: $SDK_HOME/portlets/create.sh miportlet &#8220;Mi Portlet&#8221;<br />
Este comando tiene 2 parametros:</p>
<ol>
<li>Portlet Id</li>
<li>Display name</li>
</ol>
<ul>
<li><em><strong>Tasks más utilizados</strong></em></li>
</ul>
<ol>
<li>clean: elimina los archivos generados por los otros comandos</li>
<li>compile: compila los java</li>
<li>war: genera el war</li>
<li>deploy: compila, genera el war y lo copia al directorio deploy</li>
</ol>
<ul>
<li><em><strong>Ejecutamos el deploy</strong></em></li>
</ul>
<p>En el directorio $SDK_HOME/portles/miportlet-portlet, ejecutamos el comando: <strong>ant deploy</strong></p>
<p>Acá tenemos un problema con esta versión, el archivo <strong>build.xml</strong> no es copiado cuando se crea el portlet.  Por lo tanto tenemos que copiar el <strong>build.xml</strong> de una versión anterior del plugin, también es necesario agregar el <strong>build.xml</strong> al portlet.zip para que la proxima vez que creamos un portlet no tengamos este mismo error.</p>
<ul>
<li><em><strong>Tomcat</strong></em></li>
</ul>
<p>Iniciamos el TOMCAT, para esto ejecutamos el comando:<br />
$TOMCAT_HOME/bin/startup.sh</p>
<ul>
<li><em><strong>Agregamos el portlet a una página</strong></em></li>
</ul>
<ol>
<li>Entar a http://localhost:8080/c/portal/login</li>
<li>Usuario: test@liferay.com y Password: test</li>
<li>Ir al dock, hacer click en Add Portlet</li>
<li>Buscar el nuevo portlet</li>
<li>Hacer click sobre add</li>
</ol>
<p>Links:</p>
<p><a href="http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Plugins+SDK" target="_blank">http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Plugins+SDK</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.lrlatinoblog.com.ar/2008/11/08/crear-un-portlet-con-el-plugins-sdk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

