<?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; comunidades</title>
	<atom:link href="http://www.lrlatinoblog.com.ar/tag/comunidades/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>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>
	</channel>
</rss>

