Total Pageviews

Sunday, June 23, 2013

Customizing Database Column Size


In most on the real life implementations, we need to use different datatype and and their sizes in database tables. As in Liferay, tables are created at the time of portlet deployment with the help of SQL generated by building of service.xml file, so we need to put all the table attribute information in configuration so that it can create table with the customized settings. The size of String is 75 by default. For customizing the same, we have to modify the portlet-model-hints.xml file. This file is available in META-INF directory inside src. To customizing the column size, we have to do the following:

Lest see the sample service.xml file:

Now we are going to modify the 'schoolName' and 'schoolDescription' attributes:

Now, after the deployment and creation of the table when you'll see table description, the 'schoolName' attribute will be of String type where as the 'schoolDescription' will be of varchar. Great! Indeed, but How the miracle happened? well, its not the magic, if length given in the model hints is greater than 4000 then the column type is converted in Varchar or Text automatically by Liferay but if length less than or equal to 4000 then column type will be String.

Saturday, June 8, 2013

Enabling SSL in Liferay6.1.1-Jboss7.1.1 Bundle

My last post was about SSL in Liferay-Tomcat bundle. In the array, my this post about enabling SSL in Liferay-Jboss 7 bundle, in standalone mode. (We'll discuss about standalone and domain mode of Jboss in the next post)

Similarly there are two parts, first creating of certificates and another is configuration. For SSL certificate creation you can see my previous post. Now lets talk about settings. Go to the \liferay-portal-6.1.1-ce-ga2\jboss-7.1.1\standalone\configuration\ and open the standalone.xml file and follow the following steps:

  1. Search for "urn:jboss:domain:web:1.1" and replace the <subsystem> ... </subsystem> contents with following:
    Again the password and certificate-key-file value will depend on your inputs at the time of certificate creation and default home directory.
  2. Scroll further down and look for <interfaces> ... </interfaces> entry and replace whole with the following:
  3. Now you the next block you will see will be of <socket-binding-group>, again replace the <socket-binding-group> ... </socket-binding-group> with the following:
That's it. Now start the server and use https://localhost:8181:/web/guest/ and enjoy! :)

You can download sample standalone.xml from here.