<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>Liferay.com</title>
  <link rel="alternate" href="" />
  <subtitle>Liferay.com</subtitle>
  <entry>
    <title>Create an upgrade process in 6.2</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24808331" />
    <author>
      <name>Roberto Díaz</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24808331</id>
    <updated>2013-05-18T20:09:11Z</updated>
    <published>2013-05-16T23:27:17Z</published>
    <summary type="html">&lt;h1&gt;
	Introduction&lt;/h1&gt;
&lt;hr&gt;
&lt;p&gt;
	Recently I've been working in some new features regarding to internacionalization the name and description of DLFileEntryType entity. I create all the logic and everithing was fine. Everthing went smoothly.&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;Due I was changing a DB table I had to create an upgrade process &amp;nbsp;and the things became a litle bit hard (it's my very fist time creating an upgrade)... Why? Because I found &amp;nbsp;an absolute lack of &amp;nbsp;updated documentation about this kind of process.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;It's true that I found a few wikis but it was a little messy (It was very funny to see five core engineers in the LA office triying to decode the [obsolete] documentation, true story...) So I've decided to create my fist blog entry regarding&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	But first of all... &lt;strong&gt;What is an upgrade process??&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;&lt;strong&gt;What we try to do in a upgrade process is guarantee that Liferay can upgrade from any previous version to any newer version&lt;/strong&gt;. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;We can see this in the following example.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;I'm going to explain (based in the &amp;nbsp;develop I made) the whole process, explaining how did I upgrade the &amp;nbsp;DLFileEntryType entity by adding a new column called fileEntryTypeKey and changing the name and the description columns introducing localization properties.&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;
	Step 1 - Modify an entity&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	The first thing to do is to perfome all the required changes in the entity. It will give you the basis for the rest of the process. Not very much to explain, edit the service.xml ...&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594368.js"&gt;&lt;/script&gt;
&lt;p&gt;
	...Then run...&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594393.js"&gt;&lt;/script&gt;
&lt;p&gt;
	... and modifiy the Impl classes you need. Nothing special&lt;/p&gt;
&lt;h2&gt;
	Step 2 - Change .ftl if needed&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	If the entity has some default objects (i.e. DLFileentryType has 5 default types) maybe you'll need to change its &lt;em&gt;.ftl&lt;/em&gt; file :&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594437.js"&gt;&lt;/script&gt;
&lt;h2&gt;
	Step 3 - Create some UpgradeProcess classes&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	Go to the proper version UpgradeProcess[XXX].java file (for us it's UpgradeProcess_6_2_0.java) and search for the right Upgrade[XXX].java (in this case is UpgradeDocumentLibrary). In this class (wich extends UpgradeProcess) you must introduce and override the doUpgrade() method like this:&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594494.js"&gt;&lt;/script&gt;
&lt;p&gt;
	As you can see we are directly using pure sql to perform the database upgrade. This clauses are surrounded by a try&amp;hellip;catch that calls the method upgradeTable(few params) if something goes wrong...&lt;/p&gt;
&lt;p&gt;
	Let's see that method deeply:&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594550.js"&gt;&lt;/script&gt;
&lt;p&gt;
	In there we are creating an UpgradeTable.java instance and we pass some values regarding the table we are modifiying. We get this values from an autogenerated class called XXXTable.java (DLFileEntryTypeTable.java for us).&lt;/p&gt;
&lt;h2&gt;
	Step 4 - Create the [XXX]Table class&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	Create this class is as simple as make its skeleton, modify portlet-model-hints.xml to define the configuraiton of the columns...&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594784.js"&gt;&lt;/script&gt;
&lt;p&gt;
	...and then run...&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594592.js"&gt;&lt;/script&gt;
&lt;p&gt;
	This is the generated class:&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594598.js"&gt;&lt;/script&gt;
&lt;h2&gt;
	Step 5 - Create some logic to format and persist the current data&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	The last method that we can see in doUpgrade() is:&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594622.js"&gt;&lt;/script&gt;
&lt;p&gt;
	Here we are getting the previous values and we pass them to...&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5594630.js"&gt;&lt;/script&gt;
&lt;p&gt;
	...where we will reuse them in the modified table.&lt;/p&gt;
&lt;h2&gt;
	Step 6 - Regenerate all the service and TEST!&lt;/h2&gt;
&lt;hr&gt;
&lt;p&gt;
	This is the final step. All you got to do:&lt;/p&gt;
&lt;script src="https://gist.github.com/robertoDiaz/5595862.js"&gt;&lt;/script&gt;
&lt;h2&gt;
	VERY IMPORTANT!!&lt;/h2&gt;
&lt;p&gt;
	Run &lt;script src="https://gist.github.com/robertoDiaz/5595907.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	Doing this you could be sure you are not breaking the default data.&lt;/p&gt;
&lt;p&gt;
	And that's all!!!&lt;/p&gt;</summary>
    <dc:creator>Roberto Díaz</dc:creator>
    <dc:date>2013-05-16T23:27:17Z</dc:date>
  </entry>
  <entry>
    <title>Managing Liferay through the Gogo shell</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24728195" />
    <author>
      <name>Miguel Pastor Olivar</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24728195</id>
    <updated>2013-05-15T00:04:24Z</updated>
    <published>2013-05-14T21:46:33Z</published>
    <summary type="html">&lt;p&gt;
	I have done a huge refactor for most of our OSGi related work, moving the majority of its components to the Liferay plugins SDK. Everything except the graphical admin UI is already in the master branch of the &lt;a href="https://github.com/liferay/liferay-plugins"&gt;official repo&lt;/a&gt; so you can play with it; we would love to hear your feedback.&lt;/p&gt;
&lt;p&gt;
	My goal with this post is to show you how create a new OSGi bundle in the plugins SDK using a practical example: &lt;strong&gt;extending the OSGi shell&lt;/strong&gt; (we have spoken about it &lt;a href="http://www.liferay.com/web/raymond.auge/blog/-/blogs/liferay-osgi-and-shell-access-via-gogo-shell"&gt;sometime ago&lt;/a&gt;). Let's try to do it:&lt;/p&gt;
&lt;h2&gt;
	Basic project structure&lt;/h2&gt;
&lt;p&gt;
	Currently there is no target in the SDK which allows you to create a bundle (I will push it soon) so you can use this example (or the other modules as &lt;a href="https://github.com/liferay/liferay-plugins/tree/master/shared/http-service-shared"&gt;http-service-shared&lt;/a&gt; or l&lt;a href="https://github.com/liferay/liferay-plugins/tree/master/shared/log-bridge-shared"&gt;og-bridge-shared&lt;/a&gt;) as the basic skeleton for your tests:&lt;/p&gt;
&lt;p style="text-align: center;"&gt;
	&lt;img alt="Basic OSGi bundle skeleton" src="http://www.liferay.com/documents/7715976/0/BasicOSGiBundleSkeleton.png/92827e75-e094-4853-abc9-d5e1418ebb64?t=1368569019315" style="width: 291.0px;height: 350.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	As you can see, the structure is very simple; let my try to highlight the main OSGi related points:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		All the new OSGi plugins will be based in the great &lt;a href="http://www.aqute.biz/Code/Bnd"&gt;bnd tool&lt;/a&gt;&amp;nbsp;. You can configure all your bundle requirement through the &lt;strong&gt;bnd.bnd&lt;/strong&gt; file
	&lt;li&gt;
		The &lt;strong&gt;build.xml&lt;/strong&gt; of the plugin must import the &lt;strong&gt;build-common-osgi-plugin.xml&lt;/strong&gt; build file: &lt;code&gt;&amp;lt;import file=&amp;quot;../../build-common-osgi-plugin.xml&amp;quot; /&amp;gt;&lt;/code&gt;&lt;span style="line-height: 1.5;"&gt;&amp;nbsp;&lt;/span&gt;
&lt;/ul&gt;
&lt;p&gt;
	As I have told you before I will include an Ant target to create this basic skeletons, but, until then, you need to do this by hand. Sorry about that :(.&lt;/p&gt;
&lt;h2&gt;
	Writing Gogo shell custom commands&lt;/h2&gt;
&lt;p&gt;
	As we have stated at the beginning of the post, we are going to write a bunch of custom commands for the Gogo shell. As you will see, this is an extremely easy task.&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;This commands can be created using a simple OSGi service with a couple of custom properties. We will use the OSGi declarative services approach in order to register our commands (Liferay already includes an implementation of the Declarative Services specification in the final bundle, so you don't need to deploy it by yourself).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;At this point, we are ready to write our first command: the ListUsersCommand:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/migue/5580178.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;The @Component annotation let us to define a new OSGi service in an extremely easy way. The Gogo commands are registered in the console using the properties &lt;strong&gt;osgi.command.function&lt;/strong&gt; and the &lt;strong&gt;osgi.command.scope.&amp;nbsp;&lt;/strong&gt;The first one establishes the name of the namespace where the command will be allocated (in order to prevent name collisions) while the latter specifies the name of the command. It is important to note that the Declarative Service annotations I am using does not support inheritance, so everything you declare in a base class will not be inherited down in the hierarchy.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;And, how do I write the implementation of my new command? You just need to write a new public method named as the value written in the &lt;strong&gt;osgi.command.function&lt;/strong&gt;. If your command needs some argument you will need to specify as a parameter of your method (an the console will do the coercion of the basic types). In our example we are creating a usermanagment namespace, with a command called listByCompany which expects the companyId (long) as the unique parameter.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;Easy, isn't it?&lt;/span&gt;&lt;/p&gt;
&lt;h2&gt;
	Consuming Liferay services&lt;/h2&gt;
&lt;p&gt;
	I would like to highlight the implementation of the listByCompany command (I am sure you have already guessed the previous command retrieves all the users of a certain company).&lt;/p&gt;
&lt;p&gt;
	In order to get all this info we need to call the corresponding method in the users service. We could do something like &lt;em&gt;UserLocalServiceUtil.getCompanyUsers(companyId)&lt;/em&gt; but this is not a good approach, so we are to going to get all the benefits of having all the Liferay services as OSGi services. We just need to grab a reference to the &lt;strong&gt;UserLocalService&lt;/strong&gt; bean:&lt;/p&gt;
&lt;pre class="line-pre" style="font-size: 12.0px;line-height: 16.0px;font-family: Consolas , &amp;quot;Liberation Mono&amp;quot; , Courier , monospace;white-space: pre;width: 744.0px;margin-top: 0.0px;margin-bottom: 0.0px;padding: 0.0px;color: rgb(0,0,0);background-color: rgb(255,255,255);"&gt;
&lt;/pre&gt;
&lt;div class="line" id="file-listuserscommand-java-LC30"&gt;
	&lt;code&gt;&lt;span class="nd"&gt;@Reference&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="line" id="file-listuserscommand-java-LC31"&gt;
	&lt;code&gt;&lt;span class="kd" style="font-weight: bold;"&gt;public&lt;/span&gt; &lt;span class="kt" style="color: rgb(68,85,136);font-weight: bold;"&gt;void&lt;/span&gt; &lt;span class="nf" style="color: rgb(153,0,0);font-weight: bold;"&gt;setUserLocalService&lt;/span&gt;&lt;span class="o" style="font-weight: bold;"&gt;(&lt;/span&gt;&lt;span class="n" style="color: rgb(51,51,51);"&gt;UserLocalService&lt;/span&gt; &lt;span class="n" style="color: rgb(51,51,51);"&gt;userLocaService&lt;/span&gt;&lt;span class="o" style="font-weight: bold;"&gt;)&lt;/span&gt; &lt;span class="o" style="font-weight: bold;"&gt;{&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="line" id="file-listuserscommand-java-LC32"&gt;
	&lt;code&gt;&lt;span class="n" style="color: rgb(51,51,51);"&gt;&amp;nbsp; &amp;nbsp;_userLocalService&lt;/span&gt; &lt;span class="o" style="font-weight: bold;"&gt;=&lt;/span&gt; &lt;span class="n" style="color: rgb(51,51,51);"&gt;userLocaService&lt;/span&gt;&lt;span class="o" style="font-weight: bold;"&gt;;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="line" id="file-listuserscommand-java-LC33"&gt;
	&lt;code&gt;&lt;span class="o" style="font-weight: bold;"&gt;}&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	&lt;code&gt;&lt;span style="line-height: 1.5;"&gt;protected UserLocalService _userLocalService;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2 class="line"&gt;
	Building and running the bundle&lt;/h2&gt;
&lt;div class="line"&gt;
	Once we have written our command we need to build our final artifact: just type &lt;code&gt;ant jar&lt;/code&gt;&amp;nbsp;in the project folder and you will get the final jar file into the dist folder. Before deploying our new bundle let's connect to the Gogo shell in order to check which bundles we have already installed:&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line" style="text-align: center;"&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/7715976/0/GogoShellInstalledBundles.png/c43de98a-3c41-460f-aea0-96797cd3655e?t=1368572253900" style="width: 604.0px;height: 237.0px;"&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	As you see, we have already a bunch of bundles running but nothing about the new commands we are writing. What commands are currently available in the console? Just type &lt;em&gt;help&lt;/em&gt; in the console&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line" style="text-align: center;"&gt;
	&lt;img alt="Gogo shell available commands" src="http://www.liferay.com/documents/7715976/0/GogoShellAvailableCommands.png/e294b63e-1151-4a50-8ebb-0603c5d50946?t=1368572559154" style="width: 173.0px;height: 719.0px;"&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	Now we have to deploy our new bundle. To do that, we just need to copy it to the folder &lt;em&gt;$liferay.home/data/osgi/deploy&lt;/em&gt; (it is the default folder, you can change it in the properties). You can use the deploy Ant task our just copy the folder into the previous folder. Once the bundle is deployed we should see it in the bundles list:&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line" style="text-align: center;"&gt;
	&lt;img alt="Available bundles once the custom command has been installed" src="http://www.liferay.com/documents/7715976/0/GogoShellInstalledBundlesCustomCommand.png/e765370c-69e7-4412-a9c6-b202c9399ca1?t=1368574279217" style="width: 607.0px;height: 261.0px;"&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	Take a look to the last line; you will see our bundle has been deployed and it is, hopefully, running. Let's see which commands we do have available once our new bundle is already installed.&lt;/div&gt;
&lt;div class="line" style="text-align: center;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line" style="text-align: center;"&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/7715976/0/GogoShellAvailableCommandsCustomCommandInstalled.png/d52bcc42-0158-40a4-abd6-8e8c6831cbea?t=1368574544046" style="width: 232.0px;height: 702.0px;"&gt;&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	Do you see the last two lines? These are the commands we have written (in this post we only have described one command, you can find the other one in the companion source code). So, if I type &lt;code&gt;listByCompany ID_OF_A_COMPANY (mine is 10153)&lt;/code&gt; (since there is no collision I don't need to prefix the command with the namespace) you should get an output similar to this:&lt;/div&gt;
&lt;div class="line"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div class="line"&gt;
	&lt;div&gt;
		&lt;code&gt;&lt;cite&gt;&lt;span style="line-height: 1.5;"&gt;Users of the company 10153&lt;/span&gt;&lt;/cite&gt;&lt;/code&gt;&lt;/div&gt;
	&lt;div&gt;
		&lt;code&gt;&lt;cite&gt;&amp;nbsp; &amp;nbsp; User default@liferay.comwith id 10157&lt;/cite&gt;&lt;/code&gt;&lt;/div&gt;
	&lt;div&gt;
		&lt;code&gt;&lt;cite&gt;&amp;nbsp; &amp;nbsp; User test@liferay.comwith id 10195&lt;/cite&gt;&lt;/code&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Along this post we have seen how we can extend the Gogo shell creating new commands, consuming Liferay services and building a basic OSGi bundle in the plugins SDK. It is not a big deal but I think it is a good starting point to get used to the new OSGi abilities. Hopefully I will be able to push some more complex examples in the near future.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		You can find the whole source code in the &lt;strong&gt;shared/gogo-commands-shared&lt;/strong&gt; folder at my &lt;a href="https://github.com/migue/liferay-plugins/tree/osgi-gogo-commands"&gt;plugins repo&lt;/a&gt;.&lt;/div&gt;
&lt;/div&gt;</summary>
    <dc:creator>Miguel Pastor Olivar</dc:creator>
    <dc:date>2013-05-14T21:46:33Z</dc:date>
  </entry>
  <entry>
    <title>Mavenize Liferay Plugins SDK - Using Maven</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24695846" />
    <author>
      <name>Kamesh Sampath</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24695846</id>
    <updated>2013-05-14T04:27:40Z</updated>
    <published>2013-05-14T04:27:21Z</published>
    <summary type="html">&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div class="ExternalClass44785586EC394E9F8B168C586A4CB38D" style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	&lt;h2 id="Overview" style="font-size: 1.5em;"&gt;
		&lt;span style="font-size: large;"&gt;Overview&lt;/span&gt;&lt;/h2&gt;
	&lt;p&gt;
		When working with&amp;nbsp;&lt;a href="http://www.liferay.com/"&gt;Liferay&lt;/a&gt;&amp;nbsp;projects using&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-projects/liferay-ide"&gt;Liferay IDE&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-portal/additional-files"&gt;Plugins SDK&lt;/a&gt;&amp;nbsp;it becomes highly difficult to manage dependencies, as&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-projects/liferay-ide"&gt;Liferay IDE&lt;/a&gt;&amp;nbsp;or&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-portal/additional-files"&gt;Plugins SDK&lt;/a&gt;&amp;nbsp;by default uses&amp;nbsp;&lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt;&amp;nbsp;for building and deploying, though Liferay does support&amp;nbsp;&lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;&amp;nbsp;based Plugins but as a seasoned Liferay Developer we will be inclined to use&amp;nbsp;&lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt;&amp;nbsp;preferred to&amp;nbsp;&lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;.&lt;br&gt;
		The problem rather I call it a difficulty arises when,&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			The number of dependencies for our Portlet project increases and we need to maintain a version based configuration
		&lt;li&gt;
			We need to use or integrate our Portlet application with an existing Maven based application from an Organizational build repository
	&lt;/ul&gt;
	&lt;p&gt;
		In this article we will look at how we can use&amp;nbsp;&lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt;&amp;nbsp;dependency management in&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-portal/additional-files"&gt;Plugins SDK&lt;/a&gt;&amp;nbsp;by still using the default&amp;nbsp;&lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt;&amp;nbsp;based Liferay SDK build, you can use any of your existing Liferay Plugins SDK project which has external dependencies.&lt;/p&gt;
	&lt;h2 id="TechnicalPlatform" style="font-size: 1.5em;"&gt;
		&lt;span style="font-size: large;"&gt;Technical Platform&lt;/span&gt;&lt;/h2&gt;
	&lt;p&gt;
		I have tested this application on the following technical platform, this works irrespective of Operating System.&lt;/p&gt;
	&lt;table class="mceItemTable" style="cursor: default;"&gt;
		&lt;tbody&gt;
			&lt;tr&gt;
				&lt;th style=""&gt;
					Software&lt;/th&gt;
				&lt;th style=""&gt;
					Version&lt;/th&gt;
				&lt;th style=""&gt;
					Download Link&lt;/th&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					Liferay CE Portal Server (Tomcat)&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					6.0.x&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					&lt;a href="http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-tomcat-6.0.6-20110225.zip/download"&gt;http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-portal-tomcat-6.0.6-20110225.zip/download&lt;/a&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					Liferay CE Plugins&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					SDK 6.0.x&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					&lt;a href="http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-plugins-sdk-6.0.6-20110225.zip/download"&gt;http://sourceforge.net/projects/lportal/files/Liferay%20Portal/6.0.6/liferay-plugins-sdk-6.0.6-20110225.zip/download&lt;/a&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					Apache Ant&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					1.7.x or above, preferred 1.8.x&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					&lt;a href="http://ant.apache.org/bindownload.cgi"&gt;http://ant.apache.org/bindownload.cgi&lt;/a&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					Apache Maven&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					2.2.1 or above, preferred 3.0.3&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					&lt;a href="http://maven.apache.org/download.html"&gt;http://maven.apache.org/download.html&lt;/a&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					Apache Maven Ant Tasks&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					2.2.1 or above&lt;/td&gt;
				&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
					&lt;a href="http://maven.apache.org/ant-tasks/download.html"&gt;http://maven.apache.org/ant-tasks/download.html&lt;/a&gt;&lt;/td&gt;
			&lt;/tr&gt;
		&lt;/tbody&gt;
	&lt;/table&gt;
	&lt;div class="note" style="background-color: rgb(255,255,206);border: 1.0px solid rgb(240,192,0);margin: 20.0px;padding: 0.0px 6.0px;"&gt;
		The Server distribution is not required for the subject of the article it&amp;rsquo;s preferred to have as the Liferay Plugins SDK might/will use some dependencies from the server distribution&lt;/div&gt;
	&lt;h2 id="Setup" style="font-size: 1.5em;"&gt;
		&amp;nbsp;&lt;/h2&gt;
	&lt;h3 id="Installation" style="font-size: 1.17em;"&gt;
		&lt;span style="font-size: large;"&gt;Setup and Installation&lt;/span&gt;&lt;/h3&gt;
	&lt;p&gt;
		Assuming that you have downloaded and installed the above mentioned softwares, for the sake of convenience we will use the following variable names for respective installation DIR&amp;rsquo;s,&lt;/p&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;b&gt;$LIFERAY_HOME&lt;/b&gt;&amp;nbsp;- the home directory where Liferay server is installed e.g. C:\lportal-6.0.6
		&lt;li&gt;
			&lt;b&gt;$LIFERAY_SDK_HOME&lt;/b&gt;&amp;nbsp;- the home directory where Liferay server is installed e.g. C:\liferay-plugins-sdk-6.0.6
		&lt;li&gt;
			&lt;b&gt;$ANT_HOME&lt;/b&gt;&amp;nbsp;- the home directory where ANT is installed e.g. C:\apache-ant-1.8.2
		&lt;li&gt;
			&lt;b&gt;$M3_HOME&lt;/b&gt;&amp;nbsp;- the home directory where Maven 2.2.x is installed e.g. C:\apache-maven-3.03
	&lt;/ul&gt;
	&lt;p&gt;
		Now copy the&amp;nbsp;&lt;b&gt;maven-ant-tasks-2.1.3.jar&lt;/b&gt;&amp;nbsp;to $ANT_HOME/lib&lt;/p&gt;
	&lt;h3 id="Implementation" style="font-size: 1.17em;"&gt;
		&lt;span style="font-size: large;"&gt;Implementation&lt;/span&gt;&lt;/h3&gt;
	&lt;p&gt;
		Let&amp;rsquo;s use the Liferay IDE to create a new Portlet plug-in look at&amp;nbsp;&lt;a href="http://www.liferay.com/community/wiki/-/wiki/Main/Plugins+SDK"&gt;Using Liferay Maven SDK&lt;/a&gt;&amp;nbsp;or you can import the attached Liferay Google Maps demo project in to your workspace,&lt;br&gt;
		Open the build.xml of the project that has been created, by default the project build template looks like&lt;/p&gt;
	&lt;pre style="font-size: 12.0px;line-height: 18.0px;font-family: Consolas , Monaco , monospace;"&gt;
&amp;nbsp;&lt;/pre&gt;
	&lt;p&gt;
		Now to Mavenize the default ANT build.xml we do the following,&lt;/p&gt;
	&lt;ol&gt;
		&lt;li&gt;
			Add the xmlns:artifact=&amp;rdquo; antlib:org.apache.maven.artifact.ant&amp;rdquo; to the element of the orginal build.xml
		&lt;li&gt;
			Create a new ant target called &amp;ldquo;copy-dependencies&amp;rdquo;, this step is crucial, you can have any name for the target but then what the target does is important. This target will download (only time only) and copy the dependencies to docroot/WEB-INF/lib folder
		&lt;li&gt;
			Add an ant call to &amp;ldquo;deploy&amp;rdquo; target within the &amp;ldquo;copy-dependencies&amp;rdquo;, this will enable the build.xml to follow the default Portlet application building and deploying post copying the dependencies
		&lt;li&gt;
			Make the copy dependencies as the default target for the project
	&lt;/ol&gt;
	&lt;p&gt;
		A example of build.xml with above configurations is available&amp;nbsp;&lt;a href="https://gist.github.com/1119898"&gt;here&lt;/a&gt;&lt;/p&gt;
	&lt;pre style="font-size: 12.0px;line-height: 18.0px;font-family: Consolas , Monaco , monospace;"&gt;
&amp;nbsp;&lt;/pre&gt;
	&lt;p&gt;
		Observe the&amp;nbsp;&lt;i&gt;artifact:dependencies&lt;/i&gt;&amp;nbsp;task portions those are important pieces of mavenizing our ant build. We add the dependencies to the project the same way we add them in Maven pom.xml with little bit of variation to the syntax.&lt;/p&gt;
	&lt;p&gt;
		After this once you execute the build in Portlets plug-in directory, it will first download the dependency jars if it does not exist in to the local Maven repository and they will added to the&amp;nbsp;&lt;i&gt;docroot/WEB-INF/lib&lt;/i&gt;&amp;nbsp;directory when&amp;nbsp;&lt;i&gt;copy-dependencies&lt;/i&gt;&amp;nbsp;target is called, which also includes call to the Liferay default&amp;nbsp;&lt;i&gt;deploy&lt;/i&gt;&amp;nbsp;target&lt;/p&gt;
	&lt;p&gt;
		Voila! Now we are able to use the Maven dependency management with Liferay Plugins SDK default Ant build system. I hope this article has helped you, for further reading you can check the following links,&lt;/p&gt;
&lt;/div&gt;
&lt;ul style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	&lt;li&gt;
		&lt;a href="http://maven.apache.org/ant-tasks/index.html"&gt;Maven Ant Tasks Documentation&lt;/a&gt;
	&lt;li&gt;
		&lt;a href="http://www.liferay.com/community/wiki/-/wiki/Main/Liferay+Maven+SDK"&gt;Liferay Maven SDK&lt;/a&gt;
&lt;/ul&gt;</summary>
    <dc:creator>Kamesh Sampath</dc:creator>
    <dc:date>2013-05-14T04:27:21Z</dc:date>
  </entry>
  <entry>
    <title>HOW-TO Clear Liferay Cache</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24695828" />
    <author>
      <name>Kamesh Sampath</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24695828</id>
    <updated>2013-05-14T04:26:24Z</updated>
    <published>2013-05-14T04:26:13Z</published>
    <summary type="html">&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	I was learning on how to implement the &amp;nbsp;export and import functionality on Liferay, initially I thought it to be rather a tedious job but thanks to Liferay API/Framework which made my job easier with&amp;nbsp;&lt;a href="http://www.liferay.com/community/wiki/-/wiki/Main/Portlet+DataHandlers" target="_blank" title="Liferay Portlet Data Handlers"&gt;Liferay Portlet Data Handlers&lt;/a&gt;&amp;nbsp;thanks to&amp;nbsp;&lt;a href="http://www.liferay.com/web/jorge.ferrer"&gt;Jorge Ferrer&lt;/a&gt;&amp;nbsp;who gave me an insight to the API/Framework and how to use the same. All I was required to do is just create a class that extends from BasePortletDataHandler and have it configured via the liferay-portlet.xml&lt;/p&gt;
&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	But this activity lead to an&amp;nbsp;interesting&amp;nbsp;learning,&amp;nbsp;initially&amp;nbsp;when I implemented this I saw that data was getting exported/imported without any errors but then I see that its not refreshing the UI immediately after the import. This kind of annoyed me for long time .. thanks to&amp;nbsp;&lt;a href="http://www.liferay.com/web/raymond.auge" target="_blank"&gt;Raymond Auge&lt;/a&gt;&amp;nbsp;for is timely insight that we need to clear the cache for the same to be refreshed.. so started my next task on hunting the class which can do the job..&lt;/p&gt;
&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	The initial analysis started with me doing the manual task of clearing the caches via the Portal Control Panel using the&amp;nbsp;&lt;strong&gt;Server Administration --&amp;gt; Resources (tab) --&amp;gt; Actions panel&amp;nbsp;&lt;/strong&gt;where we have the action buttons that will clear the cache held by Database, Virtual Machine both local and clustered... &amp;nbsp;when i did this sequence of actions after my Import, i see the data getting refreshed instantly.. &amp;nbsp;so whats next ? finding out the class that did these jobs, when back tracing from the Server Admin page i landed up in the class EditServerAction, there I got the following three sweet little methods that can do the job for me,&lt;/p&gt;
&lt;ul style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	&lt;li&gt;
		CacheRegistryUtil.clear() &amp;nbsp;- &amp;nbsp;to clear all the Database caches
	&lt;li&gt;
		MultiVMPoolUtil.clear() &amp;nbsp; &amp;nbsp;- clearing cache across JVM clusters
	&lt;li&gt;
		WebCachePoolUtil.clear() - clearing cache in Single VM
&lt;/ul&gt;
&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
	All left with me post this findings is that i need to call the required or all methods post my successful import of the data to clear the required caches...&lt;/p&gt;</summary>
    <dc:creator>Kamesh Sampath</dc:creator>
    <dc:date>2013-05-14T04:26:13Z</dc:date>
  </entry>
  <entry>
    <title>Using liferay-ui:search-toggle - with Basic or Advanced Search only</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24695738" />
    <author>
      <name>Kamesh Sampath</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24695738</id>
    <updated>2013-05-14T04:15:25Z</updated>
    <published>2013-05-14T04:12:43Z</published>
    <summary type="html">&lt;div style="text-align: left;"&gt;
	&lt;div class="ExternalClassEA83C0DB4A3E4DCD9153C70F962ED239"&gt;
		&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
			&amp;nbsp;I was using&amp;nbsp;&lt;strong&gt;&amp;lt;liferay-ui:search-toggle&amp;gt;&lt;/strong&gt;&amp;nbsp;tag, and my requirement was to to show only advanced search and no basic search. but by default &amp;lt;liferay-ui:search-toggle&amp;gt; will show basic search unless and until user clicks the advanced search atleast once. I tried all possible ways and finally found the solution, this what i did to make my&amp;nbsp;&lt;strong&gt;&amp;lt;liferay-ui:search-toggle&amp;gt;&lt;/strong&gt;show only &amp;quot;Advanced Search&amp;quot; without &amp;quot;Basic&amp;quot; search toggle link.So what we need to do is,&lt;/p&gt;
		&lt;ol style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
			&lt;li&gt;
				We need to override the isAdvancedSearch method of the XDisplayTerms class to always return true, where &amp;quot;X&amp;quot; your class prefix e.g.ArticleDisplayTerms which extends form&amp;nbsp;&lt;strong&gt;com.liferay.portal.kernel.dao.search.DisplayTerms&lt;/strong&gt;
			&lt;li&gt;
				Update your *_search.jsp which has the &amp;lt;liferay-ui:search-toggle&amp;gt; with the following piece of code
		&lt;/ol&gt;
		&lt;table class="mceItemTable" style="cursor: default;font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;"&gt;
			&lt;tbody&gt;
				&lt;tr&gt;
					&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
						&amp;nbsp;&lt;/td&gt;
					&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
						&amp;nbsp;&lt;/td&gt;
					&lt;td style="color: rgb(0,0,0);font-family: Verdana , Arial , Helvetica , sans-serif;font-size: 11.0px;margin: 8.0px;"&gt;
						&lt;blockquote class="tr_bq"&gt;
							&lt;pre&gt;
&amp;lt;style type=&amp;quot;text/css&amp;quot;&amp;gt; &amp;nbsp; 
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;.toggle-link {display: none;}
&amp;lt;/style&amp;gt;&lt;/pre&gt;
						&lt;/blockquote&gt;
						&lt;p&gt;
							This style overriding will prevent the &amp;quot;&lt;strong&gt;&amp;lt;&amp;lt;Basic&lt;/strong&gt;&amp;quot; search link form being displayed, the next piece of&amp;nbsp; code snippet will make the &amp;quot;Advanced&amp;quot; search displayed by default, we are a kind of triggering the Search link click&lt;br&gt;
							....&lt;br&gt;
							String key = &amp;quot;&amp;lt;replace with the id of your &amp;lt;liferay-ui:search-toggle&amp;gt; tag&amp;quot;;&lt;br&gt;
							SessionClicks.put(request, key,&amp;quot;advanced&amp;quot;);&lt;br&gt;
							.....&lt;/p&gt;
					&lt;/td&gt;
				&lt;/tr&gt;
			&lt;/tbody&gt;
		&lt;/table&gt;
		&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
			The key piece of code which does sends signal to the underlying liferay code to show only&amp;nbsp;&lt;strong&gt;&amp;quot;advanced&amp;quot;&amp;nbsp;&lt;/strong&gt;is SessionClicks.put(request, key,&amp;quot;&lt;strong&gt;advanced&amp;quot;&lt;/strong&gt;);&lt;/p&gt;
		&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
			The same could be achieved when we want to display only basic search and no advanced search just by changing the &amp;quot;advanced&amp;quot; --&amp;gt; &amp;quot;basic&amp;quot;&lt;/p&gt;
		&lt;p style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;"&gt;
			That is it, once we have done with this our &amp;lt;liferay-ui:search-toggle&amp;gt; will always display only &amp;quot;Advanced&amp;quot;&amp;nbsp; or &amp;nbsp;&amp;quot;Basic&amp;quot; search&lt;/p&gt;
	&lt;/div&gt;
&lt;/div&gt;</summary>
    <dc:creator>Kamesh Sampath</dc:creator>
    <dc:date>2013-05-14T04:12:43Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Portal 6.1-CE on JBoss AS71</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24695685" />
    <author>
      <name>Kamesh Sampath</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24695685</id>
    <updated>2013-05-14T04:11:38Z</updated>
    <published>2013-05-14T04:09:22Z</published>
    <summary type="html">&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	After setting up Liferay Portal 6.1-CE on &amp;nbsp;JBoss AS7 based in this&amp;nbsp;&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/10722459" target="_blank"&gt;post&lt;/a&gt;, &amp;nbsp;i thought it was a piece of cake to deploy Liferay Portal 6.1-CE on&amp;nbsp;&lt;a href="http://www.jboss.org/jbossas" target="_blank"&gt;JBoss AS7.1&lt;/a&gt;(Thunder) but not until i found that we need to do few more updates rather changes to Liferay 6.1-JBoss CE bundle.&lt;/p&gt;
&lt;p&gt;
	Here is the list of what we need to do,&lt;/p&gt;
&lt;p&gt;
	$JBOSS_70_HOME - refers to the Liferay 6.1-CE JBoss AS 7.0.2 directory or any JBoss AS 7.0.2 directory where you have deployed Liferay Portal&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		&lt;strong&gt;Liferay Modules&lt;/strong&gt;&amp;nbsp;-- Check the $JBOSS_70_HOME/modules/com/liferay/portal/main/module.xml you will see&amp;nbsp;&lt;strong&gt;urn:jboss:module:1.0&lt;/strong&gt;,the we need to update to&amp;nbsp;&lt;strong&gt;urn:jboss:module:1.1,&amp;nbsp;&lt;/strong&gt;once one we can copy it to the $JBOSS71_HOME/modules directory
	&lt;li&gt;
		You need to repeat this for any additonal modules that you might have deployed to the JBOSSAS_70 JBoss Portal bundle
	&lt;li&gt;
		Deployment Structure (optional) -- Based on this&amp;nbsp;&lt;a href="https://community.jboss.org/message/638335" target="_blank"&gt;AS71 post&lt;/a&gt;, I understood that JBoss AS71 does not export the system module, but if we check&amp;nbsp; $JBOSS71_HOME/standalone/deployments/ROOT.war/WEB-INF/jboss-deployment-structure.xml you will see an dependency as follows,
&lt;/ol&gt;
&lt;div style="text-align: center;"&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;module name=&amp;quot;system&amp;quot; export=&amp;quot;false&amp;quot;&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;imports&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;include path=&amp;quot;com/sun/jmx&amp;quot;/&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;exclude path=&amp;quot;/**&amp;quot; /&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/imports&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: justify;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;/module&amp;gt;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: left;"&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Just remove or comment that entry&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: left;"&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div style="color: rgb(51,51,51);font-family: Georgia , &amp;quot;Times New Roman&amp;quot; , &amp;quot;Bitstream Charter&amp;quot; , Times , serif;font-size: 13.0px;line-height: 19.0px;text-align: left;"&gt;
		And that's it once we do that and try redeploying the ROOT.war (rename the ROOT.war.failed --&amp;gt; ROOT.war.dodeploy) will trigger the deployment.&lt;/div&gt;
&lt;/div&gt;</summary>
    <dc:creator>Kamesh Sampath</dc:creator>
    <dc:date>2013-05-14T04:09:22Z</dc:date>
  </entry>
  <entry>
    <title>How-To implement Pagination in Liferay</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24695623" />
    <author>
      <name>Kamesh Sampath</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24695623</id>
    <updated>2013-05-14T04:07:56Z</updated>
    <published>2013-05-14T04:00:33Z</published>
    <summary type="html">&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div style="clear: both;"&gt;
	&lt;span style="line-height: 1.5;"&gt;Liferay provides&amp;nbsp; a rich set of tag libraries that can help in implementing certain complex functionalities like search container, pagination etc.,&amp;nbsp; with few lines of code. In this blog let&amp;rsquo;s see how we can implement the same.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	For the demo purposed I used the following technical platform,&lt;/div&gt;
&lt;ul&gt;
	&lt;li&gt;
		&amp;nbsp;&amp;nbsp;Liferay Portal v6.1.CE (beta)
	&lt;li&gt;
		&amp;nbsp;Liferay Portal SDK v6.1.CE
	&lt;li&gt;
		&amp;nbsp;Apache Ant&amp;nbsp; 1.8.2
	&lt;li&gt;
		&amp;nbsp;RHEL 6.1 (Windows could also be used)
	&lt;li&gt;
		&amp;nbsp;Eclipse IDE 3.7.1 with&amp;nbsp;&lt;a href="http://www.liferay.com/downloads/liferay-projects/liferay-ide"&gt;Liferay IDE&lt;/a&gt;
&lt;/ul&gt;
&lt;h1&gt;
	Use case&lt;/h1&gt;
&lt;div&gt;
	This demo uses a very simple use case of displaying 200 list items of type ListItemModel, the ListItemModel is the model class as shown below,&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				&lt;a href="http://workspace7.files.wordpress.com/2012/05/listitemmodel_class.png?w=92"&gt;&lt;img alt="" border="0" src="http://workspace7.files.wordpress.com/2012/05/listitemmodel_class.png?w=92"&gt;&lt;/a&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				ListItemModel.java&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div align="center"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div align="center"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	This model class holds the item its id, name and description.&amp;nbsp; The application will build a Portlet that will display the Model List items with pagination as shown below,&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				&lt;a href="http://workspace7.files.wordpress.com/2012/05/pagination_img.png"&gt;&lt;img alt="" border="0" height="130" src="http://workspace7.files.wordpress.com/2012/05/pagination_img.png?w=300" width="320"&gt;&lt;/a&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				PaginationDemoPortlet&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The user should be able to paginate across 200 records with 10 records on each page with&amp;nbsp;&lt;strong&gt;Previous&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;Next&lt;/strong&gt;,&amp;nbsp;&lt;strong&gt;First&amp;nbsp;&lt;/strong&gt;and&amp;nbsp;&lt;strong&gt;Last&amp;nbsp;&lt;/strong&gt;options.&lt;/div&gt;
&lt;h1&gt;
	Implementation&lt;/h1&gt;
&lt;div&gt;
	To achieve the use case the application uses a small DAO utility class called Pagination Utility, this class will help in Querying for the records from the back end (here its mock objects), the PaginationUtlity class has only one method called getListItems(int&amp;nbsp; n) that will return &amp;lsquo;&lt;strong&gt;n&amp;rsquo;&lt;/strong&gt;&amp;nbsp;list items. The PaginationUtility class is shown below,&lt;/div&gt;
&lt;div align="center"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table align="center" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				&lt;a href="http://workspace7.files.wordpress.com/2012/05/paginationutility_class.png?w=133"&gt;&lt;img alt="" border="0" src="http://workspace7.files.wordpress.com/2012/05/paginationutility_class.png?w=133"&gt;&lt;/a&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="text-align: center;"&gt;
				PaginationUtility.java&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div align="center"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div align="center"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The following steps shows how to implement the Pagination using&amp;nbsp;&lt;strong&gt;liferay-ui&lt;/strong&gt;&amp;nbsp;&lt;a href="http://www.blogger.com/post-create.g?blogID=3010720615130522764#_ftn1" name="_ftnref1" title=""&gt;&lt;span&gt;[1]&lt;/span&gt;&lt;/a&gt;&amp;nbsp;tag, typically the code of the view page.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ol&gt;
	&lt;li&gt;
		&lt;span style="line-height: 1.5;"&gt;The first and fore most step is to define the pagination container, the&amp;nbsp;&lt;/span&gt;&lt;strong style="line-height: 1.5;"&gt;liferay-ui&lt;/strong&gt;&lt;span style="line-height: 1.5;"&gt;&amp;nbsp;1tag provides a the&amp;nbsp;&lt;/span&gt;&lt;strong style="line-height: 1.5;"&gt;search-container&lt;/strong&gt;&lt;span style="line-height: 1.5;"&gt;1&amp;nbsp;tag which could be used to initialize the container&lt;/span&gt;
&lt;/ol&gt;
&lt;div style="margin-left: 40.0px;"&gt;
	&lt;span&gt;&amp;lt;liferay-ui:search-container emptyResultsMessage=&amp;quot;there-are-no-items&amp;quot; delta=&amp;quot;10&amp;quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Parameter&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 319.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;emptyResultsMessage&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 319.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					Used to display the message to the user when no records are found, a resource bundle key could be specified for internationalization&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;nbsp;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;delta&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 319.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					the default number of items that needs to be displayed on the page&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ol style=""&gt;
	&lt;li&gt;
		The next step is to manipulate&amp;nbsp; the result and set the same in pageContext of the JSP page, this is done using the liferay-ui&amp;rsquo;s&amp;nbsp;&lt;strong&gt;search-container-results&lt;/strong&gt;1, &amp;nbsp;when manipulating the result we need to set the following pageContext variables to enable the Liferay-ui tag to process and display them,
&lt;/ol&gt;
&lt;div style="margin-left: 1.25in;"&gt;
	a.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;results&lt;/strong&gt;&amp;nbsp;&amp;ndash; the variable that will hold the subList of the entire result set with its start determined by searchContainer.getStart() and end determined by searchContainer.getEnd(), where&amp;nbsp;&lt;strong&gt;searchContainer&lt;/strong&gt;&amp;nbsp;is an implicit variable available to the page context after Step #1&lt;/div&gt;
&lt;div style="margin-left: 1.25in;"&gt;
	b.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;strong&gt;total&amp;nbsp;&lt;/strong&gt;&amp;ndash; The total result set size , in our case 200&lt;/div&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 638.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;span&gt;&amp;lt;liferay-ui:search-container-results&amp;gt;&lt;/span&gt;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;%&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; List&amp;lt;ListItemModel&amp;gt; tempResults = PaginationUtil&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .getListItems(200);&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results = ListUtil.subList(tempResults,&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchContainer.getStart(),&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; searchContainer.getEnd());&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; total = tempResults.size();&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;pageContext.setAttribute(&amp;quot;results&amp;quot;, results);&lt;/span&gt;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;pageContext.setAttribute(&amp;quot;total&amp;quot;, total);&lt;/span&gt;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %&amp;gt;&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;span&gt;&amp;lt;/liferay-ui:search-container-results&amp;gt;&lt;/span&gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ol style=""&gt;
	&lt;li&gt;
		The third step of the implementation is to define the result row which is done using the liferay-ui&amp;rsquo;s&amp;nbsp;&lt;strong&gt;search-container-row&lt;/strong&gt;&amp;nbsp; tag, this tag takes the following parameters,
&lt;/ol&gt;
&lt;div style="margin-left: 45.0pt;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Parameter&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;className&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					The model class that is contained in the result set returned by the PaginationUtil&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;nbsp;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;keyProperty&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					The primary key or unique key property that will be used or passed to various actions&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;modelVar&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					The temporary variable where the current resultset object will be stored, typically an instance of&amp;nbsp;&lt;strong&gt;className&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style="margin-left: 45.0pt;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table border="1" cellpadding="0" cellspacing="0" style="width: 578.0px;"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 578.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;lt;liferay-ui:search-container-row&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;className&lt;/span&gt;=&amp;quot;com.accenture.icos.demo.portlets.ListItemModel&amp;quot;&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span&gt;keyProperty&lt;/span&gt;=&amp;quot;id&amp;quot;&amp;nbsp;&lt;span&gt;modelVar&lt;/span&gt;=&amp;quot;listItemModel&amp;quot;&amp;gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style="margin-left: 45.0pt;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ol&gt;
	&lt;li&gt;
		&amp;nbsp;The fourth step of the implementation is to define the columns that will be displayed in the resulting table, this is done using the liferay-ui&amp;rsquo;s&amp;nbsp;&lt;strong&gt;search-container-column-text&lt;/strong&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=3010720615130522764#_ftn1" name="_ftnref1" title=""&gt;&lt;span&gt;[1]&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&amp;nbsp;this tag takes the following two properties,
&lt;/ol&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Parameter&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;&lt;span&gt;Description&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;name&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					The HTML name attribute for the table column&lt;/div&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;nbsp;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td style="width: 142.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&lt;strong&gt;property&lt;/strong&gt;&lt;/div&gt;
			&lt;/td&gt;
			&lt;td style="width: 422.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					The model property form which the value of the column needs to be set&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style="margin-left: 45.0pt;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;table align="center" border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 638.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;lt;liferay-ui:search-container-column-text&amp;nbsp;&lt;span&gt;name&lt;/span&gt;=&amp;quot;id&amp;quot;&amp;nbsp;&lt;span&gt;property&lt;/span&gt;=&amp;quot;id&amp;quot; /&amp;gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div style="margin-left: 45.0pt;"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ol style=""&gt;
	&lt;li&gt;
		The last and final step of the implementation is to define the paginator element of the results which will help in navigating across pages typically First, Next, Previous, Last etc., &amp;nbsp;this is done using the liferay-ui&amp;rsquo;s&amp;nbsp;&amp;nbsp;&lt;strong&gt;search-container-row&lt;/strong&gt;&lt;a href="http://www.blogger.com/post-create.g?blogID=3010720615130522764#_ftn1" name="_ftnref1" title=""&gt;&lt;span&gt;[1]&lt;/span&gt;&lt;/a&gt;
&lt;/ol&gt;
&lt;table border="1" cellpadding="0" cellspacing="0"&gt;
	&lt;tbody&gt;
		&lt;tr&gt;
			&lt;td style="width: 638.0px;"&gt;
				&lt;div style="margin-left: 40.0px;"&gt;
					&amp;lt;/liferay-ui:search-container-row&amp;gt;&lt;/div&gt;
			&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;div id="ftn1"&gt;
		&lt;div style="margin-left: 45.0pt;"&gt;
			&lt;a href="http://www.blogger.com/post-create.g?blogID=3010720615130522764#_ftnref1" name="_ftn1" title=""&gt;&lt;span&gt;[1]&lt;/span&gt;&lt;/a&gt;&amp;nbsp;&lt;em&gt;&lt;span&gt;The tag libraries used above also take certain other parameters, which can be used on need basis for further details please consult the Liferay TLD documentation&lt;/span&gt;&lt;/em&gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;</summary>
    <dc:creator>Kamesh Sampath</dc:creator>
    <dc:date>2013-05-14T04:00:33Z</dc:date>
  </entry>
  <entry>
    <title>Using Liferay Portal 6.1 Published in Print</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24687128" />
    <author>
      <name>Richard Sezov</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24687128</id>
    <updated>2013-05-13T20:48:02Z</updated>
    <published>2013-05-13T20:42:55Z</published>
    <summary type="html">&lt;p&gt;
	I am pleased to announce the immediate availability of the &lt;a href="http://www.lulu.com/shop/rich-sezov/using-liferay-portal-61/paperback/product-21014853.html"&gt;print edition&lt;/a&gt; of &lt;em&gt;Using Liferay Portal 6.1&lt;/em&gt;! For those of you on your toes (and you know who you are), it's actually been available since Friday, but who reads a blog entry that is published on Friday afternoon?&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="Using Liferay Portal Cover" src="http://www.liferay.com/documents/29543/11321643/using-liferay-portal-cover.jpg/8698e0da-c2dc-44b3-a6e9-87928d348954?t=1368477806076" style="width: 400.0px;height: 533.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	It's a big book. We're getting close to 700 pages now in print, and that does &lt;em&gt;not&lt;/em&gt; include the properties reference, which we think is better as an online reference than stuffed into the book (plus, we can lower the price if we excise those pages). I want to acknowledge the hard work of Liferay's Knowledge Management team for a job well done: Jim Hinkey, Stephen Kostas, Jesse Rao, and Cody Hoag. In addition to these guys, some other key contributors include James Falkner, Bruno Farache, Michael Han, Jeffrey Handa, Mark Healy, and Jonathon Omahen.&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/29543/11321643/using-liferay-portal-thick.jpg/e247b272-9644-437c-b9e5-8790c988851c?t=1368477814787" style="width: 400.0px;height: 300.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	So if you like big, thick books on your shelf, especially ones with the Liferay logo on them, why not pick one up?&lt;/p&gt;
&lt;p&gt;
	Of course, we're not stopping there. I'm in the midst of working on the styling of the epub version of the book, which we'll release next. Stay tuned!&lt;/p&gt;</summary>
    <dc:creator>Richard Sezov</dc:creator>
    <dc:date>2013-05-13T20:42:55Z</dc:date>
  </entry>
  <entry>
    <title>RE:5 tips to improve usage of the Liferay script console</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24684087" />
    <author>
      <name>Kan Zhang</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24684087</id>
    <updated>2013-05-13T19:31:28Z</updated>
    <published>2013-05-13T18:26:01Z</published>
    <summary type="html">&lt;p&gt;
	&lt;em&gt;// In reply to &lt;a href="http://www.liferay.com/web/sebastien.lemarchand/blog/-/blogs/5-tips-to-improve-usage-of-the-liferay-script-console"&gt;5 tips to improve usage of the Liferay script console&lt;/a&gt; - by &lt;a href="http://www.liferay.com/web/sebastien.lemarchand"&gt;S&amp;eacute;bastien Le Marchand&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	S&amp;eacute;bastien wrote a very good article about Liferay script console. Here is one more tip in response of the call for sharing at the end of the article. I post it as a sepreate blog entry because I cannot use Gist or format in comment area....&lt;/p&gt;
&lt;h2&gt;
	&amp;nbsp;&lt;/h2&gt;
&lt;h2&gt;
	Tip #6: Schedule your script to run as a CRON job&lt;/h2&gt;
&lt;div&gt;
	If you want to schedule your script to execute at certain times as a CRON job (One scenario can be: Run the task &amp;quot;deactivate users never logged and created since more than 2 years&amp;quot; every month.), you can use Liferay's Scheduler Engine API, like in the following example:&lt;/div&gt;
&lt;div&gt;
	The following code outputs the string &amp;quot;test&amp;quot; to a file one time per minute in the next 10 minutes:&lt;/div&gt;
&lt;div&gt;
	&lt;script src="https://gist.github.com/kzhang7/5570465.js"&gt;&lt;/script&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	You can change your job schedule by changing the parameters in CronText constructor.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	You will also need to use proper escape characters in the script.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	Note that when Liferay Scheduler Engine execute the script, the following predefined variables are not available:&lt;/div&gt;
&lt;div&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;pre&gt;
out (java.io.PrintWriter)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionRequest (javax.portlet.ActionRequest)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionResponse (javax.portlet.ActionResponse)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletConfig (javax.portlet.PortletConfig)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletContext (javax.portlet.PortletContext)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
preferences (javax.portlet.PortletPreferences)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
userInfo (java.util.Map&amp;lt;String, String&amp;gt;)
&lt;/pre&gt;
		
	&lt;/ul&gt;
&lt;/div&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Kan Zhang</dc:creator>
    <dc:date>2013-05-13T18:26:01Z</dc:date>
  </entry>
  <entry>
    <title>5 astuces pour améliorer l’usage de la console de script de Liferay</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24655563" />
    <author>
      <name>Sébastien Le Marchand</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24655563</id>
    <updated>2013-05-13T06:31:31Z</updated>
    <published>2013-05-13T01:30:15Z</published>
    <summary type="html">&lt;p&gt;
	&lt;em&gt;// The english version of this article can be found here: &lt;a href="http://www.liferay.com/web/sebastien.lemarchand/blog/-/blogs/5-tips-to-improve-usage-of-the-liferay-script-console"&gt;5 tips to improve usage of the Liferay script console&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;em style="line-height: 1.5;"&gt;&lt;span style="line-height: 1.5;"&gt;// Si vous utilisez un lecteur RSS pour lire ce billet, veuillez basculer vers la page HTML pour voir correctement les morceaux de code.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	Depuis la version 6.0, &amp;nbsp;Liferay propose une console de script int&amp;eacute;gr&amp;eacute;e dans le Control Panel. Tr&amp;egrave;s puissant, cet outil devient vite indispensable d&amp;egrave;s que l&amp;rsquo;on y a go&amp;ucirc;t&amp;eacute; (si vous ne connaissez pas encore la console de script, jetez un oeil sur &lt;a href="http://www.liferay.com/fr/web/jeffrey.handa/blog/-/blogs/6424100"&gt;l&amp;rsquo;article d&amp;rsquo;introduction&lt;/a&gt; de Jeffrey Handa).&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;Dans la suite de ce billet, je vais vous pr&amp;eacute;senter 5 astuces simples pour encore mieux profiter de la console de script.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
	&lt;span style="line-height: 1.5;"&gt;Les exemples de mise en oeuvre qui suivent sont bas&amp;eacute;s sur le langage Groovy, mais la plupart de ces astuces sont applicables avec les autres langages support&amp;eacute;s par la console de script du portail.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;h2&gt;
		Astuce n&amp;deg;1 : Mettez du HTML dans vos sorties&amp;nbsp;&lt;/h2&gt;
	&lt;div&gt;
		Il faut savoir que la sortie par d&amp;eacute;faut de la console de script est rendue directement en tant que contenu HTML. Pensez-donc &amp;agrave; int&amp;eacute;grer des balises HTML dans vos sorties pour b&amp;eacute;n&amp;eacute;ficier d&amp;rsquo;une mise en forme riche.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Exemple de script :&amp;nbsp;&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565251.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		R&amp;eacute;sultat :&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_1.png/99247e54-ae12-4246-b3c2-01b8bc24270f?t=1368401644994" style="width: 540.0px;height: 586.0px;"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Astuce n&amp;deg;2 : Affichez les exceptions dans l&amp;rsquo;interface utilisateur&amp;nbsp;&lt;/h2&gt;
	&lt;div&gt;
		&lt;div&gt;
			Lorsque une exception survient lors de l'ex&amp;eacute;cution d&amp;rsquo;un script, &amp;nbsp;le message d&amp;rsquo;erreur est toujours le m&amp;ecirc;me quelque soit l&amp;rsquo;exception et ne donne aucun d&amp;eacute;tail, ce qui oblige &amp;agrave; consulter les logs du serveur pour effectuer un diagnostique.&lt;/div&gt;
	&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_2a.png/b16318a0-b536-4b2f-846e-0e139fe96e9e?t=1368402816833"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Pour obtenir le d&amp;eacute;tail de l&amp;rsquo;exception directement dans l&amp;rsquo;interface utilisateur, encadrez l&amp;rsquo;ensemble de votre traitement par un bloc try/catch et affichez la stack trace de l&amp;rsquo;exception sur la sortie de la console (depuis la clause catch).&lt;span style="line-height: 1.5;"&gt;.&lt;/span&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Example de script :&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565253.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		R&amp;eacute;sultat :&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_2.png/2a1a5e11-7219-4d94-a76d-840fa0dea1dc?t=1368401653574" style="width: 711.0px;height: 663.0px;"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		A noter que cela ne fonctionne pas pour les erreurs li&amp;eacute;es &amp;agrave; la syntaxe du script.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Astuce n&amp;deg;3 : Exploitez les variables pr&amp;eacute;d&amp;eacute;finies&amp;nbsp;&lt;/h2&gt;
	&lt;div&gt;
		Un script ex&amp;eacute;cut&amp;eacute; depuis la console du control panel dispose des variables pr&amp;eacute;d&amp;eacute;finies suivantes :&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;pre&gt;
out (java.io.PrintWriter)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionRequest (javax.portlet.ActionRequest)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionResponse (javax.portlet.ActionResponse)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletConfig (javax.portlet.PortletConfig)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletContext (javax.portlet.PortletContext)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
preferences (javax.portlet.PortletPreferences)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
userInfo (java.util.Map&amp;lt;String, String&amp;gt;)&lt;/pre&gt;
		
	&lt;/ul&gt;
	&lt;div&gt;
		Lorsque vous &amp;eacute;crivez vos scripts, soyez conscient des possibilit&amp;eacute;s offertes par ces variables, tout particuli&amp;egrave;rement la variable &lt;code&gt;actionRequest&lt;/code&gt;, utile pour beaucoup d&amp;rsquo;appel de m&amp;eacute;thodes.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Exemple de script :&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565256.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		R&amp;eacute;sultat :&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_3.png/680c2082-d4dc-454f-af67-2e7c4ad99bb4?t=1368401661626"&gt;&lt;span style="line-height: 1.5;"&gt;.&lt;/span&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Astuce n&amp;deg;4 : Impl&amp;eacute;mentez un mode preview&lt;/h2&gt;
	&lt;div&gt;
		La console de script ne permettant pas de faire de rollback sur l&amp;rsquo;ex&amp;eacute;cution d&amp;rsquo;un script, il est tr&amp;egrave;s pratique d&amp;rsquo;int&amp;eacute;grer un mode preview pour les scripts qui modifient les donn&amp;eacute;es en base.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Ce mode &amp;quot;preview&amp;quot; consiste &amp;agrave; utiliser un flag qui d&amp;eacute;termine si les les op&amp;eacute;rations &amp;agrave; effets de bord sont ex&amp;eacute;cut&amp;eacute;es ou non, alors que les donn&amp;eacute;es parcourues sont syst&amp;eacute;matiquement trac&amp;eacute;es. Ceci permet donc de se faire une id&amp;eacute;e des donn&amp;eacute;es impact&amp;eacute;es par un script avant de faire effectivement les mises &amp;agrave; jour en base de donn&amp;eacute;es.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Exemple de script : &amp;nbsp;&amp;nbsp;&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565262.js"&gt;&lt;/script&gt;
	&lt;p&gt;
		&amp;nbsp;&lt;/p&gt;
	&lt;h2&gt;
		Astuce n&amp;deg;5 : Pr&amp;eacute;voyez une sortie fichier pour les scripts &amp;quot;longue dur&amp;eacute;e&amp;quot;&lt;/h2&gt;
	&lt;div&gt;
		Lorsque l&amp;rsquo;ex&amp;eacute;cution d&amp;rsquo;un script d&amp;eacute;passe une certaine dur&amp;eacute;e, la console ne r&amp;eacute;pond plus et retourne une erreur, alors m&amp;ecirc;me que le script peut continuer son ex&amp;eacute;cution et potentiellement mener &amp;agrave; bien l&amp;rsquo;ensemble de son traitement... Mais impossible de conna&amp;icirc;tre le statut du traitement sans la sortie correspondante !&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Pour rem&amp;eacute;dier &amp;agrave; cela, il suffit de pr&amp;eacute;voir une sortie fichier en plus de la sortie console, comme sur l&amp;rsquo;exemple ci-dessous :&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565281.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		Une fois le script initial ex&amp;eacute;cut&amp;eacute;, il est possible de lire le fichier g&amp;eacute;n&amp;eacute;r&amp;eacute; sans pour autant avoir d&amp;rsquo;acc&amp;egrave;s direct au syst&amp;egrave;me de fichier, en utilisant un second script :&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565282.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		&lt;div&gt;
			A noter que cette technique bas&amp;eacute;e sur un fichier de sortie d&amp;eacute;di&amp;eacute; est pr&amp;eacute;f&amp;eacute;rable &amp;agrave; l&amp;rsquo;utilisation d&amp;rsquo;un logger classique car elle facilite la r&amp;eacute;cup&amp;eacute;ration des donn&amp;eacute;es de sortie du script (qui seraient plus difficile &amp;agrave; isoler parmi l&amp;rsquo;ensemble des logs du portail).&amp;nbsp;&lt;/div&gt;
	&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Et vous, avez-vous des astuces &amp;agrave; propos de la console de script &amp;agrave; partager avec la communaut&amp;eacute; ? Faites en part dans les commentaires de ce billet !&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Lectures compl&amp;eacute;mentaires&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;a href="http://www.liferay.com/web/jeffrey.handa/blog/-/blogs/6424100"&gt;Working with Admin Script Console&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://www.liferay.com/web/jeffrey.handa/blog/-/blogs/custom-java-tools-for-liferay-6-0-script-engine"&gt;Custom Java Tools for Liferay 6.0 Script Engine&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="https://github.com/slemarchand/liferay-admin-scripts"&gt;Quelques exemples de scripts&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://javascripting.sourceforge.net/"&gt;Using Java as script console language&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://scalascripting.sourceforge.net/"&gt;Using Scala as script console language&lt;/a&gt;
	&lt;/ul&gt;
&lt;/div&gt;</summary>
    <dc:creator>Sébastien Le Marchand</dc:creator>
    <dc:date>2013-05-13T01:30:15Z</dc:date>
  </entry>
  <entry>
    <title>5 tips to improve usage of the Liferay script console</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24643487" />
    <author>
      <name>Sébastien Le Marchand</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24643487</id>
    <updated>2013-05-13T06:30:31Z</updated>
    <published>2013-05-11T23:35:42Z</published>
    <summary type="html">&lt;p&gt;
	&lt;em&gt;// La version fran&amp;ccedil;aise de cet article est l&amp;agrave; : &lt;a href="http://www.liferay.com/web/sebastien.lemarchand/blog/-/blogs/5-astuces-pour-ameliorer-l%E2%80%99usage-de-la-console-de-script-de-liferay"&gt;5 astuces pour am&amp;eacute;liorer l&amp;rsquo;usage de la console de script de Liferay&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;em style="line-height: 1.5;"&gt;&lt;span style="line-height: 1.5;"&gt;// If you use a RSS reader to read this post, please switch to the HTML page to correctly view the code snippets.&lt;/span&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;Since the release 6.0, Liferay provide a script console integrated into the Control Panel. Very powerful, this tool becomes fast essential for any portal administrator or developer (if you do not still know the script console, have a look on &lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;this&amp;nbsp;&lt;a href="http://www.liferay.com/fr/web/jeffrey.handa/blog/-/blogs/6424100"&gt;article&lt;/a&gt;&amp;nbsp;by&amp;nbsp;&lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;Jeffrey Handa&lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;During this post, I am going to present you 5 simple tips to take better advantage of the script console.&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;
	The following implementation samples are based on the Groovy language, but most of them are applicable with other languages supported by the portal script console.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;h2&gt;
		Tip #1: Use the HTML in your outputs&lt;/h2&gt;
	&lt;div&gt;
		You need to know that the script console default output is rendered as HTML content. Thus, think to embed HTML markup in your outputs to enjoy rich formatting.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Script example:&amp;nbsp;&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565251.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Output:&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_1.png/99247e54-ae12-4246-b3c2-01b8bc24270f?t=1368401644994" style="width: 540.0px;height: 586.0px;"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Tip #2: Show up exceptions on user interface&lt;/h2&gt;
	&lt;div&gt;
		When any exception arises during script execution, the error message is always the same and give no detail about the error. So, you need to access server logs to make a diagnostic.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_2a.png/b16318a0-b536-4b2f-846e-0e139fe96e9e?t=1368402816833"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		To show up exception details on the user interface, envelop your whole code with a try/catch block and print the stack trace on the console output (from the catch clause).&amp;nbsp;There is nevertheless a limitation:&amp;nbsp;it doesn&amp;rsquo;t work for script syntax errors.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Script example:&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565253.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		Output:&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_2.png/2a1a5e11-7219-4d94-a76d-840fa0dea1dc?t=1368401653574" style="width: 711.0px;height: 663.0px;"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Tip #3: Exploit the predefined variables&amp;nbsp;&lt;/h2&gt;
	&lt;div&gt;
		A script executed from the Control Panel can access the following predefined variables :&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;pre&gt;
out (java.io.PrintWriter)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionRequest (javax.portlet.ActionRequest)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
actionResponse (javax.portlet.ActionResponse)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletConfig (javax.portlet.PortletConfig)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
portletContext (javax.portlet.PortletContext)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
preferences (javax.portlet.PortletPreferences)&lt;/pre&gt;
		
		&lt;li&gt;
			&lt;pre&gt;
userInfo (java.util.Map&amp;lt;String, String&amp;gt;)&lt;/pre&gt;
		
	&lt;/ul&gt;
	&lt;div&gt;
		When you write your scripts, be aware of possibilities offered by these variables, particularly the &lt;code&gt;actionRequest&lt;/code&gt; variable, useful for a lot of method calls.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Script example:&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565256.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		Output:&lt;/div&gt;
	&lt;div&gt;
		&lt;img alt="" src="http://www.liferay.com/documents/9143643/24654685/5_script_console_tips_3.png/680c2082-d4dc-454f-af67-2e7c4ad99bb4?t=1368401661626"&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;h2&gt;
		Tip #4: Implement a preview mode&lt;/h2&gt;
	&lt;div&gt;
		The script console not allowing execution rollback, it&amp;rsquo;s very convenient to set up a preview mode for side-effect scripts (i.e. performing database updates).&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Ce mode &amp;quot;preview&amp;quot; consiste &amp;agrave; utiliser un flag qui d&amp;eacute;termine si les les op&amp;eacute;rations &amp;agrave; effets de bord sont ex&amp;eacute;cut&amp;eacute;es ou non, alors que les donn&amp;eacute;es parcourues sont syst&amp;eacute;matiquement trac&amp;eacute;es. Ceci permet donc de se faire une id&amp;eacute;e des donn&amp;eacute;es impact&amp;eacute;es par un script avant de faire effectivement les mise &amp;agrave; jour en base de donn&amp;eacute;es.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		This &amp;quot;preview mode&amp;quot; consists in using a flag which determines if the operations with side effects are executed or not, while the visited data are systematically printed. This thus allows to have an outline of the data impacted by the script, before effectively doing updates to database.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Script example : &amp;nbsp;&amp;nbsp;&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565262.js"&gt;&lt;/script&gt;
	&lt;p&gt;
		&amp;nbsp;&lt;/p&gt;
	&lt;h2&gt;
		Tip #5: Plan a file output for &amp;quot;long-running&amp;quot; scripts&lt;/h2&gt;
	&lt;div&gt;
		When the execution of a script exceeds a certain duration, the console doesn&amp;rsquo;t respond any more and returns an error, whereas the script can continue its execution and potentially bring to a successful conclusion... But impossible to know the status without the corresponding output!&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		To by-pass this limitation, you can set up a file output besides the console output, like in the following example:&amp;nbsp;&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565281.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		Once the initial script was executed, it is possible to read the generated &amp;nbsp;file without direct access to the file system, by using a second script:&lt;/div&gt;
	&lt;script src="https://gist.github.com/slemarchand/5565282.js"&gt;&lt;/script&gt;
	&lt;div&gt;
		Note that method based on a dedicated output file is better than using a classic logger because it&amp;rsquo;s easier to get back the script output data (which would be more difficult to isolate among all &amp;nbsp;portal logs).&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		And you, do you have some tips about script console that you can share with the community ? Let us know in the comments !&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Further reading:&lt;/div&gt;
	&lt;ul&gt;
		&lt;li&gt;
			&lt;a href="http://www.liferay.com/web/jeffrey.handa/blog/-/blogs/6424100"&gt;Working with Admin Script Console&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://www.liferay.com/web/jeffrey.handa/blog/-/blogs/custom-java-tools-for-liferay-6-0-script-engine"&gt;Custom Java Tools for Liferay 6.0 Script Engine&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="https://github.com/slemarchand/liferay-admin-scripts"&gt;Some scripts examples&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://javascripting.sourceforge.net/"&gt;Using Java as script console language&lt;/a&gt;
		&lt;li&gt;
			&lt;a href="http://scalascripting.sourceforge.net/"&gt;Using Scala as script console language&lt;/a&gt;
	&lt;/ul&gt;
&lt;/div&gt;</summary>
    <dc:creator>Sébastien Le Marchand</dc:creator>
    <dc:date>2013-05-11T23:35:42Z</dc:date>
  </entry>
  <entry>
    <title>Using custom java classes in a JSP hook</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24616204" />
    <author>
      <name>Kan Zhang</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24616204</id>
    <updated>2013-05-13T19:26:02Z</updated>
    <published>2013-05-10T20:15:39Z</published>
    <summary type="html">&lt;style type="text/css"&gt;pre {
	white-space: pre;
}
&lt;/style&gt;
&lt;h2&gt;
	Issue&lt;/h2&gt;
&lt;p&gt;
	In Liferay hook development, one common question is:&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;How to import/use/access custom java classes in a JSP hook?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	The question can be described as:&lt;/p&gt;
&lt;p&gt;
	1. Create a hook project (for example: &lt;strong&gt;sample-hook&lt;/strong&gt;)&lt;/p&gt;
&lt;p&gt;
	2. Create a custom class (for example: &lt;strong&gt;com.kzhang.CustomJavaClass&lt;/strong&gt;) in hook project.&lt;/p&gt;
&lt;p&gt;
	3. Override a Liferay portlet jsp (for example, &lt;strong&gt;html/portlet/blogs/view.jsp&lt;/strong&gt;) and try to use the &lt;strong&gt;CustomJavaClass &lt;/strong&gt;in the jsp. Liferay will throw &amp;quot;class CustomJavaClass can't be resolved to a type&amp;quot; exception or ClassNotFound exception.&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;
	Cause&lt;/h2&gt;
&lt;p&gt;
	The jsps in hook plugin is deployed to ROOT servlet context. for example, the &lt;strong&gt;html/portlet/blogs/view.jsp&lt;/strong&gt; in hook plugin will be copied to ${container.deploy.folder}/ROOT/html/portlet/blogs/view.jsp, and the origional view.jsp will be renamed as view.portal.jsp.&lt;/p&gt;
&lt;p&gt;
	The custom classes are still remains in the hook servlet context. for example, the &lt;strong&gt;com.kzhang.CustomJavaClass&lt;/strong&gt; in hook plugin will be still in ${container.deploy.folder}/sample-hook/WEB-INF/classes/com/kzhang/CustomJavaClass.class.&lt;/p&gt;
&lt;p&gt;
	In &lt;strong&gt;html/portlet/blogs/view.jsp&lt;/strong&gt; it can not find &lt;strong&gt;CustomJavaClass&lt;/strong&gt; because each servlet context can only see it's own classes and those of the parent classloaders. In our case, the &lt;strong&gt;html/portlet/blogs/view.jsp&lt;/strong&gt; is in ROOT servlet context which can not see the &lt;strong&gt;CustomJavaClass&lt;/strong&gt; in &lt;strong&gt;sample-hook&lt;/strong&gt; servlet context&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;
	Solution&lt;/h2&gt;
&lt;p&gt;
	There are some discussions in Liferay forum:&lt;br&gt;
	&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/7454307"&gt;http://www.liferay.com/community/forums/-/message_boards/message/7454307&lt;/a&gt;&lt;br&gt;
	&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/13467179"&gt;http://www.liferay.com/community/forums/-/message_boards/message/13467179&lt;/a&gt;&lt;br&gt;
	&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/21397246"&gt;http://www.liferay.com/community/forums/-/message_boards/message/21397246&lt;/a&gt;&lt;br&gt;
	&lt;a href="http://www.liferay.com/community/forums/-/message_boards/message/11508053"&gt;http://www.liferay.com/community/forums/-/message_boards/message/11508053&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	The most common solution is to use the ext plugin instead of hook plugin.&lt;/p&gt;
&lt;div class="portlet-msg-info"&gt;
	But can we avoid using the ext plugin and leave everything as a hook?&lt;/div&gt;
&lt;p&gt;
	&lt;strong&gt;Solution 1: Use Spring + PortletBeanLocatorUtil + JAVA reflection&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	Step 1. Create the custom-spring.xml in /sample-hook/docroot/WEB-INF/src/context/custom-spring.xml folder.&lt;/p&gt;
&lt;p&gt;
	Step 2. In custom-spring.xml, define the bean for your custom java class:&lt;/p&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/anonymous/5557703.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	Step 3. In web.xml, add the context-param to load the custom-spring.xml:&lt;/p&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/anonymous/5557711.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	Step 4. In custom_jsps/html/portlet/blogs/view.jsp, use PortletBeanLocatorUtil to load the custom java class:&lt;/p&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/anonymous/5557739.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;div class="portlet-msg-info" id="file-view-jsp-LC6"&gt;
	&lt;span class="c1"&gt;If your CustomJavaClass implements an interface which is accessable in ROOT servlet context,&lt;/span&gt;&lt;span class="c1"&gt; then you can cast the customJavaClass to the interface and use the class thru interface.&lt;/span&gt;&lt;span class="c1"&gt; Otherwise you will need to use JAVA reflection to dynamically invoke the methods in the custom class.&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;
	&lt;strong&gt;Solution 2: Override Struts Action and call the custom classes in Struts Action.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	Setp 1. In liferay-hook.xml, override the view action of blogs portlet:&lt;/p&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/kzhang7/5570776.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	Step 2. Create the CustomStrutsAction, invoke the custom class in CustomStrutsAction and set the result in to renderRequest attribute:&lt;/p&gt;
&lt;div class="portlet-msg-info"&gt;
	( Instead of result, you can also set the custom class in the renderRequest attribute and invoke it in jsp either by using it's Interface or use java reflection)&lt;/div&gt;
&lt;p&gt;
	&lt;script src="https://gist.github.com/kzhang7/5570764.js"&gt;&lt;/script&gt;&lt;/p&gt;
&lt;p&gt;
	Step 3. In custom_jsps/html/portlet/blogs/view.jsp, get the result from the renderRequest attribute:&lt;/p&gt;
&lt;script src="https://gist.github.com/kzhang7/5570757.js"&gt;&lt;/script&gt;</summary>
    <dc:creator>Kan Zhang</dc:creator>
    <dc:date>2013-05-10T20:15:39Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Sync Mobile 2.0</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24535690" />
    <author>
      <name>Bruno Farache</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24535690</id>
    <updated>2013-05-11T19:18:11Z</updated>
    <published>2013-05-08T22:46:18Z</published>
    <summary type="html">&lt;p&gt;
	&lt;span style="background-color: rgb(255,255,255);color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;We are pleased to announce that Sync Mobile 2.0 has been released!&lt;/span&gt;&lt;/p&gt;
&lt;div style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	In addition to having incorporated several bug fixes, this version represents the integration of noteable, new features:&lt;/div&gt;
&lt;div style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;ul&gt;
	&lt;li style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
		Tablet Support: You can, now, use Sync on your iPads and Android tablets.
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
		Revamped UI: Allows you to fully take advantage of larger screen sizes while providing for a heightened file-previewing experience.
&lt;/ul&gt;
&lt;p style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	Here are some screenshots of Sync running on an iPad:&lt;/p&gt;
&lt;p style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div style="color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;background-color: rgb(255,255,255);"&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/25798/4090923/screenshot-sync.png/987c9718-d275-4893-83cb-548db004b405?t=1368063670547" style="width: 666.0px;height: 499.0px;"&gt;&lt;/div&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/25798/4090923/screenshot-aync2.png/3d2e0f0c-64c7-4684-b1f4-8ad94dbfcc87?t=1368063686081" style="width: 666.0px;height: 499.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;span style="background-color: rgb(255,255,255);color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;You can install Sync from &lt;/span&gt;&lt;a href="https://play.google.com/store/apps/details?id=com.liferay.sync" style="font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;Google Play&lt;/a&gt;&lt;span style="background-color: rgb(255,255,255);color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;&amp;nbsp;and &lt;/span&gt;&lt;a href="https://itunes.apple.com/us/app/liferay-sync/id499558042?mt=8" style="font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;App Store&lt;/a&gt;&lt;span style="background-color: rgb(255,255,255);color: rgb(34,34,34);font-family: arial , sans-serif;font-size: 13.0px;line-height: normal;"&gt;.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;</summary>
    <dc:creator>Bruno Farache</dc:creator>
    <dc:date>2013-05-08T22:46:18Z</dc:date>
  </entry>
  <entry>
    <title>Liferay, WebSockets, and Node: Good Times!</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24534205" />
    <author>
      <name>James Falkner</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24534205</id>
    <updated>2013-05-08T23:41:56Z</updated>
    <published>2013-05-08T21:47:52Z</published>
    <summary type="html">&lt;div&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5912873/6394519/meme-small.png/55d12c8a-a940-43d7-ab2d-6dfce5f6c173?t=1368050509597" style="font-size: 12.0px;line-height: 1.5;width: 259.0px;height: 244.0px;margin: 10.0px;float: right;"&gt;Lately I've been tinkering a lot with lightweight, asynchronous, &lt;a href="http://en.wikipedia.org/wiki/Event-driven_programming"&gt;event-driven&lt;/a&gt; apps on Liferay using a variety of established techniques and frameworks. It's a nice way to build apps! After working it for a while, I wanted to share what I've learned, so put together a talk and was fortunate to be selected to attend and speak at this year's &lt;a href="http://kcdc.info"&gt;KCDC&lt;/a&gt;, and presented my learnings and a demo via a &lt;a href="http://speakerrate.com/talks/22731-asynchronous-web-programming-with-html5-websockets-and-java"&gt;presentation&lt;/a&gt; on &lt;em&gt;Event-driven Programming with Java and HTML5 WebSockets&lt;/em&gt;.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	You can find the &lt;a href="http://www.slideshare.net/schtool/asynchronous-web-programming-with-html5-websockets-and-java"&gt;slides&lt;/a&gt; on SlideShare, and the &lt;a href="https://github.com/jamesfalkner/websockets-kcdc-2013-demo"&gt;demo code&lt;/a&gt; on GitHub.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	At the end of the presentation I showed a demo, and I wanted to go into a bit more detail here. It is essentially a WebSockets demo using a &lt;a href="https://developers.google.com/maps/documentation/javascript/examples/layer-heatmap"&gt;Google Heatmap&lt;/a&gt; to visualize the location of bloggers who are blogging on a Liferay site. I used Tomcat 8.x for the &lt;a href="http://www.jcp.org/en/jsr/detail?id=356"&gt;JSR-356 WebSockets&lt;/a&gt; implementation, partly because I am comfortable it, but also because it has a bug that I wanted to use to demonstrate a point I made during the talk :) I'm pretty sure &lt;a href="http://glassfish.net"&gt;GlassFish&lt;/a&gt; doesn't suffer from this!&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
	Social Driver&lt;/h2&gt;
&lt;div&gt;
	To simulate lots of people doing activity on Liferay (and therefore generating activities for which I can listen), I re-used my Social Driver, resurrected from &lt;strong&gt;7Cogs&lt;/strong&gt;. This code spawns theads that programmatically create users and create blog entries, wiki pages, forum posts, and do other activities like vote and comment on content. It does this in separate threads, which simulates lots of people doing things on your Liferay site.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	I have covered the basics of the SocialDriver in my series of &amp;quot;7Cogs is Dead! Long Live 7Cogs!&amp;quot; posts (&lt;a href="http://www.liferay.com/web/james.falkner/blog/-/blogs/7cogs-is-dead-long-live-7cogs-"&gt;here&lt;/a&gt;, and &lt;a href="http://www.liferay.com/web/james.falkner/blog/-/blogs/part-ii-7cogs-is-dead-long-live-7cogs-"&gt;here&lt;/a&gt;), which I hope to finish off in the next couple of weeks.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
	Demo Part 1&lt;/h2&gt;
&lt;div&gt;
	In the first part of the demo, I have a &lt;a href="http://developers.google.com/maps/documentation/javascript/examples/layer-heatmap"&gt;Google Heatmap&lt;/a&gt; which visualizes the location of the fake users, based on their registered address (which is also faked). When content (blogs, wikis, forums) is created, a &lt;a href="http://www.liferay.com/documentation/liferay-portal/6.1/user-guide/-/ai/measuring-social-activity"&gt;&lt;em&gt;SocialActivity&lt;/em&gt;&lt;/a&gt; is generated. &lt;a href="https://github.com/jamesfalkner/websockets-kcdc-2013-demo/blob/master/realtime-hook/docroot/WEB-INF/src/ActivityListener.java"&gt;My hook&lt;/a&gt; listens for these events, and sends them to &lt;a href="https://github.com/jamesfalkner/websockets-kcdc-2013-demo/blob/master/realtime-hook/docroot/WEB-INF/src/ActivityWebSocketEndpoint.java"&gt;my WebSocket endpoint&lt;/a&gt;, which ships them to &lt;a href="https://github.com/jamesfalkner/websockets-kcdc-2013-demo/blob/master/realtime-portlet/docroot/view2.jsp"&gt;my client webpage&lt;/a&gt; with the Google map.&lt;/div&gt;
&lt;div&gt;
	&lt;img alt="" class="callout" src="http://www.liferay.com/documents/5912873/6394519/KCDC-Async-Final-SlideShare-1.jpg/eca0a82d-32dc-4a36-8de9-f66c0a8b4ce3?t=1368050564989" style="width: 601.0px;height: 205.0px;margin-top: 10.0px;margin-bottom: 10.0px;"&gt;&lt;/div&gt;
&lt;div&gt;
	It all works great when you have a single thread generating events. &amp;nbsp;The map builds nicely, and all is well. However, a few seconds after you start up more threads, things get weird, and WebSocket messages emitted from the server get jumbled and mixed together, causing the browser to immediately fail the websocket connection, and the client comes to a grinding halt (Liferay happily continues to create activities, though).&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
	Demo Part 2&lt;/h2&gt;
&lt;div&gt;
	In part 2 we used &lt;a href="http://www.wireshark.org/"&gt;Wireshark&lt;/a&gt; to inspect the network traffic, in an attempt to debug the problem. &amp;nbsp;Looking at the network traffic reveals that in the end, the last few WebSockets frames are mixed up / jumbled up, causing the browser to misinterpret the bytes, and fail quickly (which is nice!).&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	The problem appears to be that the code in Tomcat for sending messages down the pipe isn't multithread-safe. &amp;nbsp;Two or more threads can get into the same area of code, and send content at the same time, and this is exactly what happened here: my blog thread and my wiki thread tried to send messages to the client at the same time, and one's message was mixed in with the other, causing the browser to issue a cryptic &lt;em&gt;Could not decode a text frame as UTF-8&lt;/em&gt;. &amp;nbsp;Looking at the offending packet in Wireshark:&lt;/div&gt;
&lt;div&gt;
	&lt;img alt="" class="callout" src="http://www.liferay.com/documents/5912873/6394519/Screen+Shot+2013-05-08+at+6.23.57+PM.png/d97f96e2-5cc5-4a95-bd4c-e6bb94899597?t=1368052238360" style="width: 600.0px;height: 278.0px;margin-top: 10.0px;margin-bottom: 10.0px;"&gt;&lt;/div&gt;
&lt;div&gt;
	&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt;You can see the complete message of &lt;code&gt;{&amp;quot;address&amp;quot;:&amp;quot;Sudan&amp;quot;}&lt;/code&gt; but then some more bits that is the beginning of the next message, which the browser tries to interpret as text, and fails (it's actually the beginning of the next websocket frame).&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt;Synchronizing the code that calls into Tomcat does the trick (e.g. via &lt;/span&gt;&lt;code style="font-size: 12.0px;line-height: 1.5;"&gt;synchronized&lt;/code&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt;), but &lt;/span&gt;&lt;strong style="font-size: 12.0px;line-height: 1.5;"&gt;a)&lt;/strong&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt; I shouldn't have to do that because it's part of &lt;/span&gt;&lt;a href="http://jcp.org/aboutJava/communityprocess/pfd/jsr356/index.html" style="font-size: 12.0px;line-height: 1.5;"&gt;the spec&lt;/a&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt;&amp;nbsp;(and I think this is a bug in Tomcat)&lt;/span&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt;, and &lt;/span&gt;&lt;strong style="font-size: 12.0px;line-height: 1.5;"&gt;b)&lt;/strong&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt; Tomcat might not be the best place to scale out, especially because it's hosting Liferay already. &amp;nbsp;&lt;/span&gt;&lt;a href="http://nodejs.org/" style="font-size: 12.0px;line-height: 1.5;"&gt;Node.js&lt;/a&gt;&lt;span style="font-size: 12.0px;line-height: 1.5;"&gt; to the rescue!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
	Demo Part 3&lt;/h2&gt;
&lt;div&gt;
	Here, we let &lt;a href="http://nodejs.org/"&gt;Node&lt;/a&gt; handle the websockets broadcasts to the clients, while Tomcat and Liferay handle the portal itself.&lt;/div&gt;
&lt;div&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5912873/6394519/KCDC-Async-Final-SlideShare.jpg/e7093715-10fa-4e48-a405-af570883072a?t=1368050737130" style="width: 601.0px;height: 323.0px;margin: 10.0px;"&gt;&lt;/div&gt;
&lt;div&gt;
	The code in &lt;a href="https://github.com/jamesfalkner/websockets-kcdc-2013-demo/blob/master/realtime-hook/docroot/WEB-INF/src/node-websocket.js"&gt;my tiny node server&lt;/a&gt; (which requires &lt;a href="https://github.com/Worlize/WebSocket-Node"&gt;websockets.js&lt;/a&gt;, via &lt;code&gt;npm install websockets&lt;/code&gt;) does the trick. &amp;nbsp;It listens for messages over HTML (this could have, and probably should have been done with &lt;a href="http://redis.io/topics/pubsub"&gt;redis pub/sub&lt;/a&gt; but I was out of time), and then broadcasts them to all clients listening on the websocket. In this demo there's only one client,&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	With node in place, and click the switch on the portlet, to switch over to it and then happily start up many threads and watch our heatmap build nicely:&lt;/div&gt;
&lt;div&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5912873/6394519/Screen+Shot+2013-05-08+at+7.37.45+PM.png/587fcbf9-12fe-4a06-8e5a-2bb2e87256e1?t=1368056450886" style="width: 700.0px;height: 590.0px;margin-top: 10.0px;margin-bottom: 10.0px;"&gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;h2&gt;
	Lessons learned&lt;/h2&gt;
&lt;ul&gt;
	&lt;li&gt;
		Coding event-based, asynchronous web program is fun and exciting! There are many frameworks and technologies to make it easy, both on client and server, and if I can do it, anyone can do it :)
	&lt;li&gt;
		It's really easy to integrate awesome apps with Liferay, due to its Java heritage, rich APIs and lightweight JSON or RESTful web services.
	&lt;li&gt;
		Java EE features (like JSR-356, aka WebSockets) and other upcoming technologies in Java EE 7 will lower the Java EE learning curve even further.
&lt;/ul&gt;
&lt;div&gt;
	Enjoy!&lt;/div&gt;</summary>
    <dc:creator>James Falkner</dc:creator>
    <dc:date>2013-05-08T21:47:52Z</dc:date>
  </entry>
  <entry>
    <title>Creating A Big Media Site in Liferay</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24518511" />
    <author>
      <name>Bradley Wood</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24518511</id>
    <updated>2013-05-08T17:31:26Z</updated>
    <published>2013-05-08T16:56:41Z</published>
    <summary type="html">&lt;style type="text/css"&gt;pre.line-pre {
	max-height: 100.0%;
}
&lt;/style&gt;
&lt;p&gt;
	I wanted to prototype a site similar to an online tv and movie streaming service that isn't Netflix. I wanted to find a versital carousel that worked well with responsive (&lt;a href="http://flexslider.woothemes.com/" target="_blank"&gt;Flexslider2&lt;/a&gt;). I wanted the heading to become more of a solid background color after you scrolled down past the main carousel.&lt;/p&gt;
&lt;p&gt;
	The carousels are fluid when the window is resized.&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5053518/24518436/computer+screen.png/135a427b-84a1-410a-84ae-2e7cb10e95fe?t=1368032161544" style="width: 400.0px;height: 253.0px;"&gt;&lt;br&gt;
	&lt;span style="line-height: 1.5;"&gt;screenwidth: 1280px&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5053518/24518436/older+computer.png/2e1e3502-4419-4230-bb72-60888be7b943?t=1368032154689" style="width: 300.0px;height: 246.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	screenwidth: 1024px&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5053518/24518436/mobile.png/4bef5cd8-4841-48e4-b3e5-977ecae2fdfb?t=1368032145052" style="width: 200.0px;height: 240.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	screenwidth: 480px&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/5053518/24518436/Screen+Shot+2013-05-08+at+10.03.43+AM.png/c8d724e4-24d5-4a0e-bfa5-d1230485dc6a?t=1368032669297" style="width: 400.0px;height: 150.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	(after scroll past the main carousel the banner becomes a transparent color instead of gradient background image)&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	I loaded the additional js file for the carousel when detected&lt;/p&gt;
&lt;script src="https://gist.github.com/randombrad/5541924.js"&gt;&lt;/script&gt;
&lt;p&gt;
	In the Main Carousel.vm velocity template I tweaked some of the js.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		After the first slide is loaded I remove the loading class on the body tag.
	&lt;li&gt;
		I detect if there is a banner and toggle the banner from absolute position to fixed if the dockbar was still on the screen.
	&lt;li&gt;
		Detect the height of the carousel - #banner height then if vertical scroll is larger than that number then I add a class of changed, which replaces the background image with a background color.
&lt;/ul&gt;
&lt;script src="https://gist.github.com/randombrad/5541967.js"&gt;&lt;/script&gt;
&lt;h3&gt;
	Download and Test&lt;/h3&gt;
&lt;p&gt;
	&lt;a href="http://www.liferay.com/documents/5053518/24518436/Big+Media+War+6.1.1/7364a899-3ba9-4f4c-9803-426dfa9d9f1b?version=1.0"&gt;Download big-media-theme.war for 6.1.1+&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;a href="https://github.com/randombrad/liferay-plugins/tree/big-media"&gt;Git Branch&lt;/a&gt;&lt;/p&gt;</summary>
    <dc:creator>Bradley Wood</dc:creator>
    <dc:date>2013-05-08T16:56:41Z</dc:date>
  </entry>
  <entry>
    <title>Select Category And add Post in message board using velocity template</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24438992" />
    <author>
      <name>chirag @ India</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24438992</id>
    <updated>2013-05-07T12:25:37Z</updated>
    <published>2013-05-07T12:13:42Z</published>
    <summary type="html">&lt;p&gt;
	Hi Guys,&lt;/p&gt;
&lt;p&gt;
	It is possible to put web content of MB-category in every page rather than to display message board in every page in website .&lt;/p&gt;
&lt;p&gt;
	On selecting category, we will open a pop-up dialog box for inserting &amp;nbsp;Post in message board.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	Template Code :&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
	#set ($MBLocalService= $serviceLocator.findService(&amp;quot;com.liferay.portlet.messageboards.service.MBCategoryLocalService&amp;quot;))&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	#set($cat=$MBLocalService.getCategories($groupId))&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;form name=&amp;quot;frmmb&amp;quot; id=&amp;quot;frmmb&amp;quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;select name=&amp;quot;foo&amp;quot; id=&amp;quot;foo&amp;quot; onchange=&amp;quot;pop(this.value)&amp;quot;&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;option &amp;nbsp;value= &amp;quot;select&amp;quot;&amp;gt; &amp;nbsp;-select-- &amp;lt;/option&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	#foreach ( $c in $cat)&lt;/div&gt;
&lt;div&gt;
	&amp;lt;option &amp;nbsp;value= &amp;quot;$c.getCategoryId()&amp;quot;&amp;gt; &amp;nbsp;$c.getName() &amp;lt;/option&amp;gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	#end&lt;/div&gt;
&lt;div&gt;
	&amp;lt;/select&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;/form&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;script type=&amp;quot;text/javascript&amp;quot; charset=&amp;quot;utf-8&amp;quot;&amp;gt; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	function pop(value)&lt;/div&gt;
&lt;div&gt;
	{&lt;/div&gt;
&lt;div&gt;
	var s=value;&lt;/div&gt;
&lt;div&gt;
	alert(s);&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;AUI().ready('aui-dialog','aui-dialog-iframe','liferay-portlet-url', function(A) { &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; var url = Liferay.PortletURL.createRenderURL(); &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp;url.setPortletId(&amp;quot;19&amp;quot;); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;url.setWindowState('pop_up'); &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	url.setParameter(&amp;quot;&amp;amp;_19_struts_action=%2Fmessage_boards%2Fedit_message&amp;amp;_19_mbCategoryId=&amp;quot;);&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; window.myDialog = new A.Dialog( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; title: 'Ask a Question?', &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; width: 640, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; centered: true &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;} &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ).&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;plug( &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp;A.Plugin.DialogIframe, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; { &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; uri: url.toString()+&amp;quot;&amp;quot;+s, &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; iframeCssClass: 'dialog-iframe' &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;).render(); &amp;nbsp; &amp;nbsp; });&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	}&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;/script&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;input type=&amp;quot;button&amp;quot; &amp;nbsp;class=&amp;quot;aui-button-input aui-button-input-submit&amp;quot; &amp;nbsp;name=&amp;quot;dialog&amp;quot; value=&amp;quot;Select Catagory &amp;amp; Add Question&amp;quot; /&amp;gt;&lt;/div&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;strong style="font-size: 14.0px;line-height: 21.0px;background-color: rgb(255,255,255);"&gt;I implemented this code at&amp;nbsp;&lt;a href="http://liferay.medicalassociation.in/ask-question" style="line-height: 1.5;"&gt;http://liferay.medicalassociation.in/ask-question&lt;/a&gt;&amp;nbsp; Visit For Better Understanding .&lt;/strong&gt;&lt;/p&gt;</summary>
    <dc:creator>chirag @ India</dc:creator>
    <dc:date>2013-05-07T12:13:42Z</dc:date>
  </entry>
  <entry>
    <title>Liferay Blog Reader 1.2 released</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24412752" />
    <author>
      <name>Dejan Milojevic</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24412752</id>
    <updated>2013-05-07T18:46:13Z</updated>
    <published>2013-05-06T16:04:36Z</published>
    <summary type="html">&lt;p&gt;
	After the first release, version 1.0, with the focus on stability and the most fundamental features we released a version 1.1 with minor updates related to feedback from community. Also some functionality like opening links embedded as content in blog entries.&lt;/p&gt;
&lt;p&gt;
	Now we have released version 1.2, which is a facelift. We are very happy with the result trying to use color scheme that matches the default Liferay Portal look;&amp;nbsp; so it feels &amp;quot;like Liferay&amp;quot; for the users.&lt;/p&gt;
&lt;p&gt;
	Please get back to us with your feedback; input to our roadmap if there are features that would be nice for you to get there soon or if you have other feedback on e.g. the user interface.&lt;/p&gt;
&lt;p&gt;
	The application (at the moment supported for Android platform) can be visited on &lt;a href="https://play.google.com/store/apps/details?id=se.exertusit.blogsforliferay"&gt;Google Play via this link&lt;/a&gt;. Or you can also visit the &lt;a href="https://www.exertusit.se/products/liferay-blog-reader"&gt;product page&lt;/a&gt;.&lt;/p&gt;</summary>
    <dc:creator>Dejan Milojevic</dc:creator>
    <dc:date>2013-05-06T16:04:36Z</dc:date>
  </entry>
  <entry>
    <title>Paris Pre-Symposium Community Meeting, 5. June 2013</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24401542" />
    <author>
      <name>Olaf Kock</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24401542</id>
    <updated>2013-05-06T09:37:16Z</updated>
    <published>2013-05-06T09:35:25Z</published>
    <summary type="html">&lt;p&gt;
	Nous sommes heureux d'annoncer un pre-Symposium &amp;eacute;v&amp;egrave;nement communautraire le 5 Juin 2013 au &lt;a href="http://goo.gl/maps/XI2dF"&gt;Caveau Montpensier: 15, rue de Montpensier, 75001 Paris&lt;/a&gt;, &amp;agrave; partir de 18h00. L&amp;rsquo;&amp;eacute;v&amp;egrave;nement est gratuit et nous vous offrirons quelques boissons et snacks lors de la soir&amp;eacute;e. &lt;strong&gt;Veuillez confirmer votre pr&amp;eacute;sence&lt;/strong&gt; en commentant ci-dessous ce blog. Votre confirmation sera appr&amp;eacute;ci&amp;eacute;e et utile dans l'organisation de l'&amp;eacute;v&amp;eacute;nement.&lt;br&gt;
	&lt;strong&gt; Passez le mot aux autres ...plus nous serons, meilleur ce sera !&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	We are happy to announce a pre-Symposium Community Meeting on June 5th 2013 at &lt;a href="http://goo.gl/maps/XI2dF"&gt;Au Caveau Montpensier : 15, rue de Montpensier, 75001 Paris&lt;/a&gt;, from 18:00 onwards. Attendance is free and the first couple of rounds of drinks and snacks are on us! Please &lt;strong&gt;let us know if you plan to come&lt;/strong&gt; &amp;amp; join us by commenting below this blog post. Your confirmation will much be appreciated and helpful in planning the event.&lt;br&gt;
	&lt;strong&gt; Now, please help spread the word&amp;hellip; the more the merrier!&lt;/strong&gt;&lt;/p&gt;</summary>
    <dc:creator>Olaf Kock</dc:creator>
    <dc:date>2013-05-06T09:35:25Z</dc:date>
  </entry>
  <entry>
    <title>Creating a Portlet in 6.1 CE</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24380426" />
    <author>
      <name>Joerg Viola</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24380426</id>
    <updated>2013-05-04T10:36:29Z</updated>
    <published>2013-05-04T09:48:08Z</published>
    <summary type="html">&lt;p&gt;
	&lt;strong&gt;How do you develop a portlet for liferay? Since often asked and being ridiculously easy, I wrote down the steps here:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	In this work-through, I assume you have successfully installed Liferay 6.1 CE as well as Eclipse Indigo and the Liferay SDK IDE.&lt;/p&gt;
&lt;p&gt;
	Then you can start the standard eclipse &amp;quot;New... wizard&amp;quot; and chose to create a &amp;quot;Liferay project&amp;quot;:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New.png/44e19004-dd88-48ae-862c-af6533f12017?t=1367661082284" style="width: 553.0px;height: 530.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	Give it a name and chose &amp;quot;Portlet&amp;quot; as the plugin type:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New+Liferay+Project.png/70bc0fb5-d8a9-429c-851c-1ab7d28d93b3?t=1367661181537" style="width: 558.0px;height: 673.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	Of course, we will use the simpliest possible approach and thus choose Liferay MVC, the standard framework for creating portlets:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New+Liferay+Project-1.png/838ec543-0b19-41cc-b4a3-7d582392d7b5?t=1367661270098"&gt;&lt;/p&gt;
&lt;p&gt;
	The IDE is now creating an empty Web-Project, complete with /docroot/WEB-INF and so forth.&lt;/p&gt;
&lt;p&gt;
	Time to include the portlet. Start the &amp;quot;New Liferay portlet&amp;quot;-wizard available in the &amp;quot;New&amp;quot;-menu. Choose a meaningful name and let it subclass Liferay's &amp;quot;MVCPortlet&amp;quot;. This will save you a lot of tedious work later on:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New+Liferay+Portlet-4.png/32cc76ed-edaf-436e-9cb7-f3f8b5a7e6fe?t=1367661595757" style="width: 587.0px;height: 530.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	In the next dialog, you decide which modes (only view for the moment) your portlet will implement and whether JSPs and I18N-files are created. Click &amp;quot;Create resource bundle file&amp;quot;:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New+Liferay+Portlet-6.png/ab2b2090-3f1d-4aa5-98e4-0e26902f1c1d?t=1367661776239" style="width: 587.0px;height: 583.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	The next dialog deals which CSS and JavaScript resources (leave untouched) and categorization. I chose to display hte portlet in the &amp;quot;Collaboration&amp;quot; section as well as in the Control Panel:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/New+Liferay+Portlet-7.png/f7a9ea22-b293-4662-8201-ed5c44bf3724?t=1367661918943" style="width: 587.0px;height: 583.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	The last dialog page can be skipped. Finish the wizard. Your new project becomes populated with some default files now. Feel free to browse them:&lt;/p&gt;
&lt;p&gt;
	&lt;br&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/project.png/7681c393-c7e7-4958-9615-e9e1c57b9348?t=1367662071095" style="width: 270.0px;height: 513.0px;float: left;margin-left: 20.0px;margin-right: 20.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Language.properties will hold the I18N messages.
	&lt;li&gt;
		Task.java is the Portlet itself - more on it below.
	&lt;li&gt;
		main.css - will hold your style classes - its empty now.
	&lt;li&gt;
		view.jsp of course is the user interface.
	&lt;li&gt;
		main.js may be included to use javascript code.
	&lt;li&gt;
		WEB-INF holds a lot of configuration code - lets take a look at it later.
	&lt;li&gt;
		build.xml is the ant build script.
&lt;/ul&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	Ok! Lets deploy this portlet. Use the context menu on the project to bring up the liferay build menu:&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/Liferay+-+Task_docroot_html_task_view.jsp+-+Eclipse+-+_Users_viola_Workspaces_magnolia.png/2546cba8-372a-4231-987c-78638d11e45c?t=1367663075961" style="width: 636.0px;height: 100.0px;"&gt;&lt;/p&gt;
&lt;p&gt;
	Hit &amp;quot;all&amp;quot; or &amp;quot;deploy&amp;quot; will fire up the Plugin SDK an deploy the project into your liferay. As usual, &lt;code&gt;tail -f tomcat/logs/catalina.out&lt;/code&gt; is your friend for controlling deployment. If all runs well - and it should - you see the new portlet in the add menu of your page (don't be confused - I have deployed Social Office also and thus there is a Tasks portlet. But ours was called Task. Also, in a german installation like mine &amp;quot;collaboration&amp;quot; is called &amp;quot;Zusammenarbeit&amp;quot; ;-)&lt;/p&gt;
&lt;p&gt;
	&lt;img alt="" src="http://www.liferay.com/documents/21850233/24380437/Mobile+Web+-+ObjectCode.png/718759e9-5474-4d90-a863-b51ba8c6104c?t=1367663433831"&gt;&lt;/p&gt;
&lt;p&gt;
	The output &amp;quot;This is the Task portlet in View mode&amp;quot; is generated from /docroot/html/task/view.jsp:&lt;/p&gt;
&lt;pre&gt;
&lt;/pre&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style="margin-top: 0.0px;margin-bottom: 0.0px;font-size: 11.0px;line-height: normal;font-family: Monaco;color: rgb(73,44,250);"&gt;
	&lt;span style="color: rgb(204,114,83);"&gt;&amp;lt;%@&lt;/span&gt;&lt;span style="color: rgb(0,0,0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(77,145,145);"&gt;taglib&lt;/span&gt;&lt;span style="color: rgb(0,0,0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(149,24,143);"&gt;uri&lt;/span&gt;&lt;span style="color: rgb(0,0,0);"&gt;=&lt;/span&gt;&amp;quot;http://java.sun.com/portlet_2_0&amp;quot;&lt;span style="color: rgb(0,0,0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(149,24,143);"&gt;prefix&lt;/span&gt;&lt;span style="color: rgb(0,0,0);"&gt;=&lt;/span&gt;&amp;quot;portlet&amp;quot;&lt;span style="color: rgb(0,0,0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(204,114,83);"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 0.0px;margin-bottom: 0.0px;font-size: 11.0px;line-height: normal;font-family: Monaco;min-height: 15.0px;"&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style="margin-top: 0.0px;margin-bottom: 0.0px;font-size: 11.0px;line-height: normal;font-family: Monaco;color: rgb(77,145,145);"&gt;
	&lt;span style="color: rgb(0,146,146);"&gt;&amp;lt;&lt;/span&gt;portlet:defineObjects&lt;span style="color: rgb(0,0,0);"&gt; &lt;/span&gt;&lt;span style="color: rgb(0,146,146);"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin-top: 0.0px;margin-bottom: 0.0px;font-size: 11.0px;line-height: normal;font-family: Monaco;min-height: 15.0px;"&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p style="margin-top: 0.0px;margin-bottom: 0.0px;font-size: 11.0px;line-height: normal;font-family: Monaco;"&gt;
	This is the &lt;span style="color: rgb(0,146,146);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(77,145,145);"&gt;b&lt;/span&gt;&lt;span style="color: rgb(0,146,146);"&gt;&amp;gt;&lt;/span&gt;Task&lt;span style="color: rgb(0,146,146);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(77,145,145);"&gt;b&lt;/span&gt;&lt;span style="color: rgb(0,146,146);"&gt;&amp;gt;&lt;/span&gt; portlet in View mode.&lt;/p&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	This JSP is in turn speified as an init-parameter to the portlet in /docroot/WEB-INF/portlet.xml. Liferays MVCPortlet the uses this init-parameter to render to view mode jsp.&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	So congrats! We just deployed a portlet successfully!&lt;/div&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;</summary>
    <dc:creator>Joerg Viola</dc:creator>
    <dc:date>2013-05-04T09:48:08Z</dc:date>
  </entry>
  <entry>
    <title>Integrate Jersey RESTful with portlet project</title>
    <link rel="alternate" href="http://www.liferay.com/c/blogs/find_entry?entryId=24378387" />
    <author>
      <name>Pradip A Bhatt</name>
    </author>
    <id>http://www.liferay.com/c/blogs/find_entry?entryId=24378387</id>
    <updated>2013-05-04T04:48:55Z</updated>
    <published>2013-05-04T04:24:02Z</published>
    <summary type="html">&lt;p&gt;
	Hello All Friends...&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	Recently I have succssfully integrate Jersey Framework with my existing portlet project.&lt;/p&gt;
&lt;p&gt;
	It is very easy and very useful..&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	For this, you have to follow following steps..&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	1) Add following dependency if you are using maven, otherwise add this jars to your classpat.&lt;/p&gt;
&lt;p&gt;
	&lt;span style="line-height: 1.5;"&gt;&amp;lt;!-- Jersey --&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
	&amp;lt;dependency&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;groupId&amp;gt;com.sun.jersey&amp;lt;/groupId&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;artifactId&amp;gt;jersey-server&amp;lt;/artifactId&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;version&amp;gt;1.8&amp;lt;/version&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;/dependency&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;dependency&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;groupId&amp;gt;com.sun.jersey&amp;lt;/groupId&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;artifactId&amp;gt;jersey-json&amp;lt;/artifactId&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;version&amp;gt;1.8&amp;lt;/version&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;lt;/dependency&amp;gt;&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	2) Edit in web.xml&lt;/div&gt;
&lt;div&gt;
	&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
	&lt;div&gt;
		&amp;lt;servlet&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;servlet-name&amp;gt;jersey-serlvet&amp;lt;/servlet-name&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;servlet-class&amp;gt;&lt;span style="font-family: monospace , sans-serif;font-size: 1.0em;line-height: 1.5;background-color: rgb(247,247,249);color: rgb(51,51,51);"&gt;com.sun.jersey.config.property.packages&lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;&amp;lt;/servlet-class&amp;gt;&lt;/span&gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;init-param&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param-name&amp;gt;com.sun.jersey.config.property.packages&amp;lt;/param-name&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;!-- Here, you have to mention package name where toy are implementd service(web service)--&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param-value&amp;gt;com.hrms.admin.jersey.service&amp;lt;/param-value&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/init-param&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;init-param&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param-name&amp;gt;com.sun.jersey.api.json.POJOMappingFeature&amp;lt;/param-name&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;param-value&amp;gt;true&amp;lt;/param-value&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;/init-param&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;load-on-startup&amp;gt;1&amp;lt;/load-on-startup&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &lt;span class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/span&gt;&amp;lt;/servlet&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;lt;servlet-mapping&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;servlet-name&amp;gt;jersey-serlvet&amp;lt;/servlet-name&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;url-pattern&amp;gt;/rest/*&amp;lt;/url-pattern&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;lt;/servlet-mapping&amp;gt;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		3) Look out Web service class.&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		Example..&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		@Path(&amp;quot;/mymessage&amp;quot;)&lt;/div&gt;
	&lt;div&gt;
		public class MyWebServiceClass&lt;/div&gt;
	&lt;div&gt;
		{&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@GET&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@Path(&amp;quot;hello&amp;quot;)&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;@Produces(MediaType.APPLICATION_JSON)&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public Message myMethod()&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyMessage msg = new MyMessage();&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setName(&amp;quot;Good Day!!!&amp;quot;);&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; msg.setTitle(&amp;quot;Welcome&amp;quot;);&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return msg;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
	&lt;div&gt;
		}&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		-&amp;gt; here, we can define @Path at two level. 1) class level 2) path level.&lt;/div&gt;
	&lt;div&gt;
		-&amp;gt; so Here, i provide both ultimately url become... &amp;lt;...&amp;gt;/mymessage/hello&lt;/div&gt;
	&lt;div&gt;
		-&amp;gt;&amp;nbsp;@Produces(MediaType.APPLICATION_JSON) defines that this method returns data in JSON format.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		This is web service class where we implelent service.&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		4) Now we have to create client which call this service.&lt;/div&gt;
	&lt;div&gt;
		&amp;nbsp;&lt;/div&gt;
	&lt;div&gt;
		&lt;div&gt;
			&amp;lt;dependency&amp;gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;groupId&amp;gt;com.sun.jersey&amp;lt;/groupId&amp;gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;artifactId&amp;gt;jersey-client&amp;lt;/artifactId&amp;gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;lt;version&amp;gt;1.8&amp;lt;/version&amp;gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;lt;/dependency&amp;gt;&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		&lt;div&gt;
			I am using GSON. So..&lt;/div&gt;
		&lt;div&gt;
			&amp;nbsp;&lt;/div&gt;
		&lt;div&gt;
			&lt;div&gt;
				&amp;lt;!-- GSON --&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;lt;dependency&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;groupId&amp;gt;com.google.code.gson&amp;lt;/groupId&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;artifactId&amp;gt;gson&amp;lt;/artifactId&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;lt;version&amp;gt;1.7.1&amp;lt;/version&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;lt;/dependency&amp;gt;&lt;/div&gt;
			&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			&lt;div&gt;
				5) Client program&lt;/div&gt;
			&lt;div&gt;
				&amp;nbsp;&lt;/div&gt;
			&lt;div&gt;
				&lt;div&gt;
					public class MyClient {&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Logger log = Logger.getLogger(MyClient.class);&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;public String createClient(String url) {&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;try {&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Client client = Client.create();&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String baseURL = &amp;quot;http://localhost:8080/admin-0.0.1/rest&amp;quot;;&lt;/div&gt;
				&lt;div&gt;
					&lt;span style="line-height: 1.5;"&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;WebResource webResource = client&lt;/span&gt;&lt;span style="line-height: 1.5;"&gt;.resource(baseURL + url);&lt;/span&gt;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ClientResponse clientResponse = webResource.accept(&lt;span style="line-height: 1.5;"&gt;&amp;quot;application/json&amp;quot;).get(ClientResponse.class);&lt;/span&gt;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (clientResponse.getStatus() != 200) {&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; throw new RuntimeException(&amp;quot;Failed...... HTTP Error Code :&amp;quot;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;+ clientResponse.getStatus());&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; String output = clientResponse.getEntity(String.class);&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&amp;quot;Output from Server :&amp;quot;);&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(output);&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return output;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (Exception e) {&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.getMessage();&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; return &amp;quot;ERROR&amp;quot;;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/div&gt;
				&lt;div&gt;
					}&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					--&amp;gt; Here...&amp;nbsp;http://localhost:8080/admin-0.0.1/rest define as a Base URL. and at the time of calling any service we have to pass remaining parameter in it.&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					like..&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&lt;div&gt;
						&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyClient client = new MyClient();&lt;/div&gt;
					&lt;div&gt;
						&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;String result = client.createClient(&amp;quot;/mymessage/hello&amp;quot;);&lt;/div&gt;
				&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					So... It will return MyMessage object in JSON format.&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					&amp;nbsp;&lt;/div&gt;
				&lt;div&gt;
					Thanksssssssssssssssssssss&lt;/div&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	&lt;/div&gt;
&lt;/div&gt;</summary>
    <dc:creator>Pradip A Bhatt</dc:creator>
    <dc:date>2013-05-04T04:24:02Z</dc:date>
  </entry>
</feed>

