<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Portal Development's Weblog</title>
	<atom:link href="http://portaldevelopment.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://portaldevelopment.wordpress.com</link>
	<description>Blog about Portal Development and portal-related information</description>
	<lastBuildDate>Tue, 15 Nov 2011 18:40:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='portaldevelopment.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Portal Development's Weblog</title>
		<link>http://portaldevelopment.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://portaldevelopment.wordpress.com/osd.xml" title="Portal Development&#039;s Weblog" />
	<atom:link rel='hub' href='http://portaldevelopment.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Theme&#8217;s Deployment Descriptor Generation</title>
		<link>http://portaldevelopment.wordpress.com/2009/05/10/themes-deployment-descriptor-generation/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/05/10/themes-deployment-descriptor-generation/#comments</comments>
		<pubDate>Sun, 10 May 2009 12:43:40 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Liferay 5.1.2]]></category>
		<category><![CDATA[Theme]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=120</guid>
		<description><![CDATA[Last week, I had a task to modify theme&#8217;s deployment descriptor ( web.xml ) file. Since Liferay&#8217;s compression filter doesn&#8217;t work on Weblogic application server, we created our own compression filter, and need to added it to the theme, in order to enable compression for *.js and *.css files. I thought this would be easy [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=120&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Last week, I had a task to modify theme&#8217;s deployment descriptor ( web.xml ) file. Since Liferay&#8217;s compression filter doesn&#8217;t work on Weblogic application server, we created our own compression filter, and need to added it to the theme, in order to enable compression for *.js and *.css files.</p>
<p>I thought this would be easy and simple task, just modify theme&#8217;s web.xml. But after generating the theme using plugins SDK, I realized that web.xml is not created, even though I already generated war file. So how could I modify web.xml file ?</p>
<p><span id="more-120"></span></p>
<p>After a few experiments, I just knew that web.xml is generated on the fly, during theme deployment. So there&#8217;s a java class that responsible for this task, that iscom.liferay.portal.tools.ThemeDeployer. I just inspected the code, and I found out that to add our own modification to web.xml, I just need to modify getExtraContent method.</p>
<p>Here is the snippet of the method :</p>
<p><pre class="brush: java;">
	protected String getExtraContent(
			double webXmlVersion, File srcFile, String displayName)
		throws Exception {

		StringBuilder sb = new StringBuilder();

		String extraContent = super.getExtraContent(
			webXmlVersion, srcFile, displayName);

		sb.append(extraContent);

		// HeaderFilter

		sb.append(&quot;&lt;filter&gt;&quot;);
		sb.append(&quot;&lt;filter-name&gt;Header Filter&lt;/filter-name&gt;&quot;);
		sb.append(&quot;&lt;filter-class&gt;&quot;);
		sb.append(&quot;com.liferay.portal.kernel.servlet.PortalClassLoaderFilter&quot;);
		sb.append(&quot;&lt;/filter-class&gt;&quot;);
		sb.append(&quot;&lt;init-param&gt;&quot;);
		sb.append(&quot;&lt;param-name&gt;filter-class&lt;/param-name&gt;&quot;);
		sb.append(&quot;&lt;param-value&gt;&quot;);
		sb.append(&quot;com.liferay.portal.servlet.filters.header.HeaderFilter&quot;);
		sb.append(&quot;&lt;/param-value&gt;&quot;);
		sb.append(&quot;&lt;/init-param&gt;&quot;);
		sb.append(&quot;&lt;init-param&gt;&quot;);
		sb.append(&quot;&lt;param-name&gt;Cache-Control&lt;/param-name&gt;&quot;);
		sb.append(&quot;&lt;param-value&gt;max-age=172801, public&lt;/param-value&gt;&quot;);
		sb.append(&quot;&lt;/init-param&gt;&quot;);
		sb.append(&quot;&lt;init-param&gt;&quot;);
		sb.append(&quot;&lt;param-name&gt;Expires&lt;/param-name&gt;&quot;);
		sb.append(&quot;&lt;param-value&gt;172801&lt;/param-value&gt;&quot;);
		sb.append(&quot;&lt;/init-param&gt;&quot;);
		sb.append(&quot;&lt;/filter&gt;&quot;);

</pre></p>
<p>Some of you may ask, is it possible just to add web.xml to WEB-INF folder directly, before building the theme ? Yes, it is possible. And you may ask again, so why need to modify ThemeDeployer class ? Because if you manually create your own web.xml, you have to remember to rename the theme ID and other attributes on web.xml. And in environment where build process is done automatically, it&#8217;s not convenient to do things manually, and always to remind your developers to modify the file whenever they create a new theme. </p>
<p>You may want to look at com.liferay.portal.tools.PortletDeveloper class for portlet&#8217;s deployment descriptor created in plugins SDK environment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/120/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/120/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/120/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=120&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/05/10/themes-deployment-descriptor-generation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Language Localization</title>
		<link>http://portaldevelopment.wordpress.com/2009/04/19/language-localization/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/04/19/language-localization/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 11:26:55 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Localization]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=112</guid>
		<description><![CDATA[There are three ways to get localized language / text in Liferay. This is usually refers to get a value from content/Language*.properties by using a key. You can get this value from the following  files : From java class From jsp page From javascript file For java classes, you can get localized text / content [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=112&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>There are three ways to get localized language / text in Liferay. This is usually refers to get a value from content/Language*.properties by using a key. You can get this value from the following  files :</p>
<ol>
<li>From java class</li>
<li>From jsp page</li>
<li>From javascript file</li>
</ol>
<p><span id="more-112"></span>For java classes, you can get localized text / content from Language*.properties by using com.liferay.portal.kernel.language.LanguageUtil class. There are a few methods there to get localized text, for example :</p>
<p><pre class="brush: java;">

     LanguageUtil.get(locale, key);

</pre></p>
<p>You can just pass the locale and the key, then you&#8217;ll get localized text.</p>
<p>In jsp file, you can use the same class to get localized text, where you can pass the locale, or pageContext. You can also use &lt;liferay-ui message&gt; tag if you prefer to use taglib.Taglib definition can be found on /util-taglib/src/META-INF/liferay-ui.tld file.</p>
<p>In javascript file, you can get localized text by calling language servlet in com.liferay.portal.servlet.LanguageServlet class using AJAX. But Liferay already make our life easier by providing javascript API for this. You can just call <pre class="brush: jscript;">Liferay.Language.get(&quot;your-language-key&quot;) </pre></p>
<p>. This javascript API is defined in portal-web/docroot/html/js/liferay/language.js file. This javascript will automatically detect your locale, so you only need to pass your key.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=112&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/04/19/language-localization/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Liferay Integration with OpenSSO</title>
		<link>http://portaldevelopment.wordpress.com/2009/04/19/liferay-integration-with-opensso/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/04/19/liferay-integration-with-opensso/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 11:00:16 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=107</guid>
		<description><![CDATA[Liferay integration with OpenSSO has many challenges if you never do it before. This challenges come from OpenSSO package itself, from application server (Tomcat), and from Liferay itself. Things you have to take attention when doing integration : From OpenSSO itself : Make sure you download the latest version ( I used opensso 8.0 enterprise) [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=107&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Liferay integration with OpenSSO has many challenges if you never do it before. This challenges come from OpenSSO package itself, from application server (Tomcat), and from Liferay itself.</p>
<p>Things you have to take attention when doing integration :</p>
<p><span id="more-107"></span></p>
<p>From OpenSSO itself :</p>
<ol>
<li>Make sure you download the latest version ( I used opensso 8.0 enterprise)</li>
<li>Make sure you use FQDN ( Fully Qualified Domain Name ) for your machine, and when configuring your OpenSSO. For example, don&#8217;t use &#8216;localhost&#8217; or &#8217;127.0.0.1&#8242;, instead edit your host file on your operating system, and give it FQDN name, for example,  opensso.example.com. Small tutorial on how to install and configure OpenSSO available <a href="http://wikis.sun.com/display/OpenSSO/getstarted" target="_blank">here</a>.</li>
<li>After I finished configuration, there&#8217;s always &#8220;redirect loop&#8221; error after I do authentication in OpenSSO. This problem can be solved by changing a property value in OpenSSO as described <a href="http://wikis.sun.com/display/OpenSSO/J2EEAgentTrouble#J2EEAgentTrouble-redirecterrors" target="_blank">here</a>.</li>
</ol>
<p>From application server itself, you can&#8217;t use Tomcat 5.5 for Liferay-OpenSSO integration because there&#8217;s a bug in Tomcat 5.5. This is described in this <a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/2506294?_19_redirect=%2Fweb%2Fguest%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fweb%252Fguest%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryIds%3D243728%26_19_keywords%3Dopensso" target="_blank">thread</a>.</p>
<p>From Liferay itself, I saw that there&#8217;s a bug in Liferay 5.1.2 for OpenSSO integration. This bug can be fixed by patching a Java sourcecode from Liferay&#8217;s SVN as described <a href="http://forums.sun.com/thread.jspa?threadID=5349111" target="_blank">here</a>. For me, I simply use Liferay 5.2.0 so I didn&#8217;t encounter this issue.</p>
<p>References :</p>
<ol>
<li><a href="http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/OpenSSO%20Integration" target="_blank">OpenSSO Integration</a> from Liferay&#8217;s Wiki</li>
<li><a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/2343793#_19_message_2482097" target="_blank">OpenSSO-Liferay</a> integration experience in Liferay&#8217;s forum.</li>
</ol>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/107/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/107/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/107/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=107&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/04/19/liferay-integration-with-opensso/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Bugs in ServiceBuilder</title>
		<link>http://portaldevelopment.wordpress.com/2009/04/19/bugs-in-servicebuilder/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/04/19/bugs-in-servicebuilder/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 08:52:10 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/2009/04/19/bugs-in-servicebuilder/</guid>
		<description><![CDATA[There are two bugs in Liferay&#8217;s 5.1.2 service builder The first bug I found is, whenever I setup ext-environment and using service builder to generate service layer without remote service (remote=&#8221;false&#8221; in service.xml). Liferay generates remoting-servlet-ext.xml file under ext/ext-web/WEB-INF with no beans at all. So generated content only &#60;beans/&#62; tag, since there&#8217;s no bean generated. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=95&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="zemanta-pixie">There are two bugs in Liferay&#8217;s 5.1.2 service builder</p>
<ol>
<li> The first bug I found is, whenever I setup ext-environment and using service builder to generate service layer without remote service (remote=&#8221;false&#8221; in service.xml). Liferay generates remoting-servlet-ext.xml file under ext/ext-web/WEB-INF with no beans at all. So generated content only &lt;beans/&gt; tag, since there&#8217;s no bean generated. However in ServiceBuilder.java, it always expects &lt;/beans&gt; closing tag. This can be seen on line 2171 ServiceBuilder.java</li>
</ol>
<p><span id="more-95"></span></p>
<p><pre class="brush: java;">
          x = content.indexOf(&quot;&lt;/beans&gt;&quot;);
       </pre></p>
<p>Related error message is like this : </p>
<p><pre class="brush: xml;">
[java] java.lang.StringIndexOutOfBoundsException: String index out of range: -1
[java] at java.lang.String.substring(String.java:1768)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder._createRemotingXml(ServiceBuilder.java:2165)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.&lt;init&gt;(ServiceBuilder.java:971)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.&lt;init&gt;(ServiceBuilder.java:390)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:157)
</pre><br />
To fix this bug, just simply add the following line below those line :</p>
<p><pre class="brush: java;">
			if(x&lt;0){
				x=content.indexOf(&quot;&lt;beans/&gt;&quot;);
			}
     </pre></p>
<p>2.  Another bug was found by one member of Liferay&#8217;s forum, Alex Wallace. This bug happens when you have &#8216;service&#8217; word in your package name (package-path) in your service.xml.  This bug is described in <a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1322482?_19_redirect=%2Fweb%2Fguest%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fweb%252Fguest%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F239390%26_19_breadcrumbsCategoryId%3D239390%26_19_breadcrumbsMessageId%3D0%26_19_searchCategoryId%3D239390%26_19_searchCategoryIds%3D0%26_19_threadId%3D0%26_19_tabs1TabsScroll%3D%26_19_keywords%3D%2522service%2Bbuilder%2522%2BAND%2B%2522java.lang.NullPointerException%2522" target="_blank">this </a>message board&#8217;s topic, along with the fix.</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/95/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/95/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/95/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=95&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/04/19/bugs-in-servicebuilder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing database column size using model-hints in Liferay</title>
		<link>http://portaldevelopment.wordpress.com/2009/03/21/changing-database-column-size-using-model-hints-in-liferay/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/03/21/changing-database-column-size-using-model-hints-in-liferay/#comments</comments>
		<pubDate>Sat, 21 Mar 2009 17:27:40 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Liferay 5.1.2]]></category>
		<category><![CDATA[model-hints]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=78</guid>
		<description><![CDATA[I had a task to modify Liferay&#8217;s core table column size, to make the column wider. Just to make it simple, the table that was going to be modified was User_ table ( User entity as the corresponding entity ), the column was emailAddress. I wanted to change the emailAddress column width to be 100. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=78&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I had a task to modify Liferay&#8217;s core table column size, to make the column wider. Just to make it simple, the table that was going to be modified was User_ table ( User entity as the corresponding entity ), the column was emailAddress. I wanted to change the emailAddress column width to be 100. I was thinking &#8220;What are the options to do this, and what are the consequences?&#8221;.<br />
<span id="more-78"></span><!--more--><br />
So I found in Liferay&#8217;s Wiki <a href="http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Customize+DB+Column+Sizes">this </a> article. It explains you what is model-hints, and how you can use it to modify your table&#8217;s size column. To make it short, model-hints is a facility in Liferay to help ServiceBuilder to identify what is the column size and data type. This information is being used by ServiceBuilder to generate SQL script for the core portal, and for your entities ( if you use ServiceBuilder in ext environment to generate the entity ). It&#8217;s also needed to define the length of input form in your jsp file if you use liferay-ui taglib.</p>
<p>From the Wiki&#8217;s article, I found that to modify the column size is easy. Just re-define the entity and the column in ext-model-hints.xml, run the servicebuilder, and you&#8217;re good to go. So here is my modification to ext-model-hints.xml.<br />
<pre class="brush: xml;">
 	&lt;model name=&quot;com.liferay.portal.model.User&quot;&gt;
		&lt;field name=&quot;emailAddress&quot; type=&quot;String&quot;&gt;
			&lt;hint name=&quot;max-length&quot;&gt;200&lt;/hint&gt;
		&lt;/field&gt;
	&lt;/model&gt;
</pre></p>
<p>After that, I run ServiceBuilder. The service.xml that I used to run ServiceBuilder didn&#8217;t contain User entity definition. And after running the ServiceBuilder, I found out that the SQL script didn&#8217;t get modified by ServiceBuilder. So I tried to create a new service.xml, copy User entity definition from portal&#8217;s service.xml, and run ServiceBuilder. So what happened after that ? ServiceBuilder generated error&#8230;. hohoho&#8230;. I removed all the references in User&#8217;s service.xml, re-run ServiceBuilder, the error was gone. I checked the sql script ( portal-tables.sql ), the column size was changed as I expected.</p>
<p>So, was it done ? Not really. Because after I run ServiceBuilder for User entity, all the classes and interfaces were generated again in ext environment, along with hibernate mapping and Spring bean definition in ext-hbm.xml and ext-spring.xml.  So what is the problem with that ? The problem is, I have to copy all User&#8217;s Impl classes and interfaces to ext environment, copy hibernate mapping from portal-hbm.xml to ext-hbm.xml. Another problem is with references from User entity to other entities.<br />
So, from my point of view, this is not worth the effort. Unless you just want to change the display-width of your input field, then you just need to modify model-hints without having to redefine the entity in service.xml again. </p>
<p>So, what did I do to solve the problem ? I just redefine model-hints, and then changed the portal-tables.sql script manually. This portal-tables.sql script is a base script to generate database specific script located in ${your-ext-root}/sql/create and ${your-ext-root}/sql/create-minimal folder. After that, I went to ${your-ext-root}/sql, run the build-db ant target, so all the database specific script changed accordingly.</p>
<p>I think this solution is not really useful and take too much time. I prefer to use Liferay&#8217;s SQL script for the first time, do some modification (whether it&#8217;s column size or additional custom tables ), back up the script as template for production, rather than count on SQL script generated by ServiceBuilder. You would ask, why you choose that approach ? One reason I have in mind is, not all SQL script can be found in Liferay&#8217;s generated script. If you put Lucene&#8217;s index and JackRabbit&#8217;s repository in database rather than in filesystem, the SQL script generated for these are not found in Liferay&#8217;s generated script. That&#8217;s why I think it&#8217;s better to use Liferay&#8217;s generated script 1 time in the beginning, do modification, let Liferay create table definition for Lucene and JackRabbit repository, and back it up as SQL script for production system. </p>
<p>References :<br />
<a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message/1964183?_19_redirect=%2Fweb%2Fguest%2Fcommunity%2Fforums%2F-%2Fmessage_boards%2Fsearch%3F_19_redirect%3D%252Fweb%252Fguest%252Fcommunity%252Fforums%252F-%252Fmessage_boards%252Fcategory%252F243728%26_19_breadcrumbsCategoryId%3D243728%26_19_searchCategoryIds%3D243728%26_19_keywords%3Dmodel-hints">forum question 1</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/78/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/78/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/78/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=78&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/03/21/changing-database-column-size-using-model-hints-in-liferay/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>How to create portlet using Plugins-SDK and Eclipse</title>
		<link>http://portaldevelopment.wordpress.com/2009/01/06/how-to-create-portlet-using-plugins-sdk-and-eclipse/</link>
		<comments>http://portaldevelopment.wordpress.com/2009/01/06/how-to-create-portlet-using-plugins-sdk-and-eclipse/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 07:44:36 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Liferay 5.1.2]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=55</guid>
		<description><![CDATA[In this article, I&#8217;ll teach you to create a portlet as plugin ( portlet plugin is a portlet that will be deployed using separate war file, quite different from ext approach). There are two ways to do this : Using Liferay&#8217;s plugins SDK Using Eclipse alone. Let&#8217;s start Using Liferay&#8217;s plugins SDK : This approach [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=55&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article, I&#8217;ll teach you to create a portlet as plugin ( portlet plugin is a portlet that will be deployed using separate war file, quite different from ext approach). There are two ways to do this :</p>
<ol>
<li>Using Liferay&#8217;s plugins SDK</li>
<li>Using Eclipse alone.</li>
</ol>
<p>Let&#8217;s start</p>
<ol>
<li><span id="more-55"></span><strong>Using Liferay&#8217;s plugins SDK</strong> : This approach has some advantages, that Plugins SDK would generate all necessary files(liferay-display.xml,liferay-portlet.xml, portlet.xml, etc) and directory structure for your portlet, so you just need to modify the files to suit your needs.  One disadvantage of this approach is, if you want to compile and create WAR using Plugins SDK&#8217;s ant task, you have to follow their directory structure, i.e. there should be folder docroot, and html. Of course you can change this if you want to edit the ant task.I won&#8217;t describe the steps again, as it&#8217;s already described <a href="http://www.liferay.com/web/guest/community/wiki/-/wiki/Main/Plugins+SDK" target="_blank">here</a> . If you use Liferay 5.1.2, don&#8217;t forget to replace portlet.zip with the one <a href="http://www.liferay.com/web/guest/community/wiki?p_p_id=36&amp;p_p_lifecycle=0&amp;p_p_state=normal&amp;p_p_mode=view&amp;p_p_col_id=column-2&amp;p_p_col_count=1&amp;_36_struts_action=%2Fwiki%2Fview_page_attachments&amp;_36_nodeName=Main&amp;_36_title=Plugins+SDK" target="_blank">here</a>. Otherwise you&#8217;ll have error.</li>
<li><strong>Using Eclipse alone : </strong>with this approach, you don&#8217;t need to depend on Plugins SDK. You just need to have Eclipse IDE installed, along with WTP (Web Tools Platform) Plugins. You need WTP plugins to import WAR file from sample portlet, modify the files and add your source, and later export it as a WAR file. Here are the steps ( I assume your Eclipse is ready, with WTP installed) :</li>
</ol>
<ul style="text-align:left;">
<li>Download sample portlet that you like. ( If you want to create Struts portlet, you can download the sample from <a href="http://www.robisoft.com/software/hellostruts-portlet-5.1.2.1.war" target="_blank">here</a> ).</li>
<li>Import the WAR file into Eclipse</li>
<li>Resolve dependencies. If you use Tomcat as app server, and your Tomcat already installed Liferay portal, you can create user libraries that includes these directories (and jar files inside these directories) : $TOMCAT_HOME/common/lib, $TOMCAT_HOME/common/lib/ext, $TOMCAT_HOME/webapps/ROOT/WEB-INF/lib</li>
</ul>
<p>Now, you need to edit some configuration files under your $PROJECT/WebContent as follows :</p>
<ul>
<li>liferay-display.xml : You need to modify this file to categorize your portlet under a category.</li>
<li>liferay-plugin-package.properties : You need to modify this file to add library dependencies for your portlet. For example, if your portlet depends on displaytag.jar, you don&#8217;t need to add displaytag.jar manually to your $PROJECT_HOME/WebContent/WEB-INF/lib. Instead, you just need to add on your liferay-plugin-package.properties like this :
<pre>
<pre>
<pre><pre class="brush: xml;"> portal.dependency.jars=\
commons-logging.jar,\
displaytag.jar,\
commons-logging,\
commons-lang,\
commons-collections,\
commons-beanutils,\
log4j.jar
</pre></pre>
</pre>
</pre>
</li>
</ul>
<p><strong> </strong>Don&#8217;t forget to add your &#8216;tag library description&#8217; ( tld ) into this file as well, like this</p>
<pre>
<pre><pre class="brush: xml;">portal.dependency.tlds=struts-bean.tld,struts-html.tld,struts-logic.tld,struts-tiles.tld,displaytag.tld </pre></pre>
</pre>
<p>For struts portlet, you don&#8217;t need to add struts.jar into this file.</p>
<ul>
<li>liferay-plugin-package.xml : To give description about your portlet, i.e. license, liferay version, author, etc.</li>
<li>liferay-portlet.xml : liferay-specific portlet description.</li>
<li>portlet.xml : &#8216;deployment descriptor&#8217; of the portlet</li>
<li>struts-config.xml, tiles-defs.xml ( If you use struts and tiles ). If you use bean:write tag, don&#8217;t forget to add resources to your struts-config.xml, for example like this
<pre>
<pre><pre class="brush: xml;">&lt;message-resources parameter=&quot;content.test.Language&quot; /&gt;</pre></pre>
</pre>
<p>Don&#8217;t forget to add your language files(Language.properties, Language_en.properties, Language_*.properties)  under content.test package below your source folder.</li>
<li>web.xml : You don&#8217;t need to modify this one, except for special case.</li>
</ul>
<p>Now you&#8217;re ready to program your portlet. You don&#8217;t need to depend on Plugins SDK to compile and package your portlet into WAR, since you can do this using Eclipse.</p>
<p>Happy programming !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/55/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/55/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/55/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=55&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2009/01/06/how-to-create-portlet-using-plugins-sdk-and-eclipse/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>How to display journal content inside a portlet</title>
		<link>http://portaldevelopment.wordpress.com/2008/10/09/how-to-display-journal-content-inside-a-portlet/</link>
		<comments>http://portaldevelopment.wordpress.com/2008/10/09/how-to-display-journal-content-inside-a-portlet/#comments</comments>
		<pubDate>Thu, 09 Oct 2008 07:53:42 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[liferay 5.1.1]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=16</guid>
		<description><![CDATA[Sometimes you want a portlet contains some texts from journal article, so user can easily edit the text. In that case you have to modify the presentation file of your portlet ( whether it&#8217;s a JSP file, VM, etc ), to display the content. You can use com.liferay.portlet.journalcontent.util.JournalContentUtil class to display the content. Assume that [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=16&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometimes you want a portlet contains some texts from journal article, so user can easily edit the text. In that case you have to modify the presentation file of your portlet ( whether it&#8217;s a JSP file, VM, etc ), to display the content. You can use com.liferay.portlet.journalcontent.util.JournalContentUtil class to display the content. Assume that you use JSP for your presentation and you use ext environment for your portlet, here are the steps to do it :</p>
<ol>
<li>Include /html/portlet/init.jsp on your portlet&#8217;s JSP.</li>
<li>Include com.liferay.portlet.journalcontent.util.JournalContentUtil in your JSP file</li>
<li>Get your journal article&#8217;s id</li>
<li>Call getContent method of JournalContentUtil inside the JSP</li>
</ol>
<p>Let&#8217;s go to the details.</p>
<p><span id="more-16"></span></p>
<p>Include /html/portlet/init.jsp on your portlet&#8217;s JSP like this :</p>
<pre>
<pre><pre class="brush: java;">

&lt;%@ include file=&quot;/html/portlet/init.jsp&quot; %&gt;

</pre></pre>
</pre>
<p>Include JournalContentUtil on your JSP file, like this</p>
<pre><pre class="brush: java;">
&lt;%@ page import=&quot;com.liferay.portlet.journalcontent.util.JournalContentUtil&quot; %&gt;
</pre>
</pre>
<p>Create your journal article, after you save your article, Liferay will generate an id for your article. Take note of this id, so we can use on our method call as argument later in our JSP page.</p>
<p>Now on your portlet&#8217;s JSP, create a code like this</p>
<pre>
<pre><pre class="brush: java;">
&lt;div id=&quot;journal-article-import&quot; &gt;		  
&lt;%
  String articleId =  &quot;13734&quot;;  // this is Journal Article's Id
  String languageId = LanguageUtil.getLanguageId( renderRequest );
  String content = JournalContentUtil.getContent(  themeDisplay.getPortletGroupId(), articleId, languageId, themeDisplay);
%&gt;
&lt;%= content %&gt;  
&lt;/div&gt;
</pre></pre>
<p>themeDisplay is implicit variable inside page context, that is set using Liferay's custom tag ;.</p>
<p>The definition of this custom tag can be seen on liferay-theme.tld. Here is the related content of liferay-theme.tld</p>
<pre><pre class="brush: xml;">

	&lt;tag&gt;
		&lt;name&gt;defineObjects&lt;/name&gt;
		&lt;tag-class&gt;com.liferay.taglib.theme.DefineObjectsTag&lt;/tag-class&gt;
		&lt;tei-class&gt;com.liferay.taglib.theme.DefineObjectsTei&lt;/tei-class&gt;
		&lt;body-content&gt;empty&lt;/body-content&gt;
	&lt;/tag&gt;

</pre></pre>
</pre>
<p>So if you want to find out what are other implicit variables that was set whenever you include /html/portlet/init.jsp, you can take a look at com.liferay.taglib.theme.DefineObjectsTag class.</p>
<p>Done. Tested on Liferay 5.1.1</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=16&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2008/10/09/how-to-display-journal-content-inside-a-portlet/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Liferay Portal : How to change portlet look and feel on every page</title>
		<link>http://portaldevelopment.wordpress.com/2008/06/23/liferay-portal-how-to-change-portlet-look-and-feel-on-every-page/</link>
		<comments>http://portaldevelopment.wordpress.com/2008/06/23/liferay-portal-how-to-change-portlet-look-and-feel-on-every-page/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 10:16:51 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Liferay 4.3.3]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=14</guid>
		<description><![CDATA[Liferay Portal A few days ago I had a task to update portlet title in &#8216;Sign-in&#8217; Portlet, from &#8216;Sign-in&#8217; into &#8216;myGeco for Consultant&#8217; and the background colour to #f6f6f6. If I only used &#8216;Sign-in&#8217; portlet in 1 page, then this task would be easily done by login as admin and changing the look and feel. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=14&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<h1>Liferay Portal</h1>
<p>A few days ago I had a task to update portlet title in &#8216;Sign-in&#8217; Portlet, from &#8216;Sign-in&#8217; into &#8216;myGeco for Consultant&#8217; and the background colour to #f6f6f6. If I only used &#8216;Sign-in&#8217; portlet in 1 page, then this task would be easily done by login as admin and changing the look and feel. But the problem is, I have so many pages, and almost every page is including this &#8216;Sign-in&#8217; portlet. So the question is, how to update all the look-and-feel the effective way, not changing them one by one ?</p>
<p>Would it be possible to update directly into database ? And if possible, how to do it ?</p>
<p>So here are the steps to do it :</p>
<p>1. Create desired look and feel on 1 portlet in 1 page, save it. All the look and feel will be saved into database.</p>
<p>2. Find out what is the portletId, and pageId ( plid ).</p>
<p>3. From the database, select the portlet preference value for that portletId and pageId.</p>
<p>4. Update all pages that contains that portlet with new portlet preference.<br />
On the first step, you need to update the look and feel on the portlet manually, and save it. This value will be saved into table portletpreferences, so we can use this value later to update all pages that contain that portlet.</p>
<p>On the second step, you need the portletid and pageid (plid) to do select from portletpreferences table. How do you find this portletid and pageid ? You can login as admin, and mouseover above &#8216;Minimize&#8217; icon. You&#8217;ll find a javascript link like this :</p>
<p><pre class="brush: xml;">

javascript: minimizePortlet('10701', '58', false, '');

</pre></p>
<p>It means, the plid is 10701, the portletid is 58. Now you can do select into portletpreferences table by doing query like this :</p>
<p><pre class="brush: sql;">

select preferences from portletpreferences where plid=10701 and portletId='58';

</pre></p>
<p>Now, you&#8217;ve got the value you want, just update all the pages that contains portletId=&#8217;58&#8242; with this value :</p>
<p><pre class="brush: sql;">

update portletpreferences set preferences='preferences_value_of_your_portlet' where portletId='58';

</pre></p>
<p>Done. Tested on Liferay 4.3.3</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/portaldevelopment.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/portaldevelopment.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=14&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2008/06/23/liferay-portal-how-to-change-portlet-look-and-feel-on-every-page/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Sending email in Liferay Portal</title>
		<link>http://portaldevelopment.wordpress.com/2008/06/16/sending-email-in-liferay-portal/</link>
		<comments>http://portaldevelopment.wordpress.com/2008/06/16/sending-email-in-liferay-portal/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 05:16:07 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Developers]]></category>
		<category><![CDATA[Liferay 4.3.3]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=12</guid>
		<description><![CDATA[Sometime in your portlet you want to have sending email capability. You can use JavaMail API, but actually Liferay already provide utility class to send email, so we don&#8217;t have to play with direct JavaMail API. Here are the steps to send email in Liferay : 1. Configure your SMTP provider, user id, and password [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=12&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Sometime in your portlet you want to have sending email capability. You can use JavaMail API, but actually Liferay already provide utility class to send email, so we don&#8217;t have to play with direct JavaMail API.</p>
<p>Here are the steps to send email in Liferay :</p>
<p>1. Configure your SMTP provider, user id, and password on your application server</p>
<p>2. Use the MailEngine utility class to send email.</p>
<p>In this article, we&#8217;ll use Tomcat as our application server, and use Gmail as SMTP. You have to add information about SMTP host, user id, and password on resource configuration file under $tomcat_home\conf\Catalina\localhost\ROOT.xml.</p>
<p>Comment out resource name &#8220;mail/MailSession&#8221;, and add your mailsession configuration. So the ROOT.xml would be like this :</p>
<p><pre class="brush: xml;">

    &lt;!-- Commented out
    &lt;Resource
        name=&quot;mail/MailSession&quot;
        auth=&quot;Container&quot;
        type=&quot;javax.mail.Session&quot;
        mail.imap.host=&quot;localhost&quot;
        mail.pop3.host=&quot;localhost&quot;
        mail.smtp.host=&quot;localhost&quot;
        mail.store.protocol=&quot;imap&quot;
        mail.transport.protocol=&quot;smtp&quot;
    /&gt;
    --&gt;

   &lt;Resource
                        name=&quot;mail/MailSession&quot;
                        auth=&quot;Container&quot;
                        type=&quot;javax.mail.Session&quot;
                        mail.imap.host=&quot;localhost&quot;
                        mail.pop.host=&quot;localhost&quot;
                        mail.store.protocol=&quot;imap&quot;
                        mail.transport.protocol=&quot;smtp&quot;
                        mail.smtp.host=&quot;smtp.gmail.com&quot;
                        mail.smtp.port=&quot;465&quot;
                        mail.smtp.auth=&quot;true&quot;
                        mail.smtp.starttls.enable=&quot;true&quot;
                        mail.smtp.user=&quot;your_user_id&quot;
                        password=&quot;your_password&quot;
                        mail.smtp.socketFactory.class=&quot;javax.net.ssl.SSLSocketFactory&quot;
      /&gt;

</pre></p>
<p>Now we go to step 2.  Class com.liferay.util.mail.MailEngine has send method, which is overrided with a few arguments. If you just want to send email with body, subject, and 1 recipient, you can just use MailEngine.send(String from, String to, String subject, String body) like this  :</p>
<p><pre class="brush: java;">

String from = &quot;sender@host.com&quot;;

String to = &quot;recipient@host.com&quot;;

String subject=&quot;This is email title&quot;;

String body=&quot;Hello World, this is my first email&quot;;

MailEngine.send(from, to, subject, body);

</pre></p>
<p>If you want to add attachment to your email, or you want to add Cc, or send email in html format, you can use more complex send method from MailEngine class, such as</p>
<p><pre class="brush: java;">
send( InternetAddress from, InternetAddress[] to, InternetAddress[] cc,
            InternetAddress[] bcc, String subject, String body,
            boolean htmlFormat, InternetAddress[] replyTo, String messageId,
            String inReplyTo, File[] attachments);

</pre></p>
<p>Done. Tested on Liferay 4.3.3</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/portaldevelopment.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/portaldevelopment.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=12&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2008/06/16/sending-email-in-liferay-portal/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
		<item>
		<title>Features of an Enterprise Portal</title>
		<link>http://portaldevelopment.wordpress.com/2008/06/14/features-of-an-enterprise-portal/</link>
		<comments>http://portaldevelopment.wordpress.com/2008/06/14/features-of-an-enterprise-portal/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 19:15:04 +0000</pubDate>
		<dc:creator>portaldevelopment</dc:creator>
				<category><![CDATA[For Business Users, Managers, and Decision Makers]]></category>
		<category><![CDATA[Portal Features]]></category>

		<guid isPermaLink="false">http://portaldevelopment.wordpress.com/?p=11</guid>
		<description><![CDATA[In this article, I'd like to discuss about features of enterprise portal. What are standard features for enterprise portal, and what features provided by Liferay as one of enterprise portals.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=11&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article, I&#8217;d like to discuss about features of enterprise portal. What are standard features for enterprise portal, and what features provided by Liferay as one of enterprise portals. ..(to be continued)</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/portaldevelopment.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/portaldevelopment.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/portaldevelopment.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/portaldevelopment.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/portaldevelopment.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=portaldevelopment.wordpress.com&amp;blog=3386220&amp;post=11&amp;subd=portaldevelopment&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://portaldevelopment.wordpress.com/2008/06/14/features-of-an-enterprise-portal/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">portaldevelopment</media:title>
		</media:content>
	</item>
	</channel>
</rss>
