Following are the answer to 50 Liferay Interview Questions that I had posted earlier. I got so many requests that I thought it would be better to provide the answers.

The answers given below may not be complete and are brief so that they set the direction of your thought. There is not much documentation available for Liferay so you will have to explore the server and play with the server to know more about it.

Note: Answers to following question numbers will be added later. I thought of sharing the answers at the earliest.
9 12 19 22 23 28 29 30 32 41 43 47 48 49 50

1) What are the various ways in which you can customize the default behavior of Liferay that ships to you?
Ans) One can customize Liferay by writing:
Portlets
Themes
Layout Templates
Webs
Hooks

2) What is the difference between a Liferay Hook and Liferay EXT?
Ans:Hook:
Hooks is a feature to catch hold of the properties and JSP files into an instance of the portal as if catching them with a hook. Hook plugins are more powerful plugins that come to complement portlets, themes, layout templates, and web modules. A hook plugin is always combined with a portlet plugin. For instance, the portlet social-portlet is a portlet plugin for Social Office with hooks. In general, hooks would be very helpful tools to customize the portal without touching the code part of the portal. In addition, you would use hooks to provide patches for the portal systems or social office products.
source:Liferay Portal 6 Enterprise Intranets

EXT:
EXT is used to customize and extend the Liferay portal. EXT builds a new ROOT webapp and replaces by a huge build mechanism your existing Liferay portal.
The Liferay EXT Environment is where you would ideally make changes to the portal itself. In other words, this is where you customize or “extend” the portal. You may ask, “Why can’t we just make the changes to the portal source directly?” The answer is that you technically CAN, but if and when you have to upgrade, you will have a tough time sorting out what is out-of-the-box and what is customized. EXT Environment keeps things separate.

3) Suppose I want to customize the behavior of Calendar portlet that comes out of the box with Liferay, how can I do that?
Ans: The behavior of Calendar portlet can be modified using EXT or write a separate Calendar portlet meeting the user requirements.

4) How will you configure Liferay to authenticate users from LDAP?
Ans: Go to configuring liferay with LDAP

5) What is inter portlet communication and how can that be achieved?
Ans: Inter portlet communication (IPC) was introduced in JSR 286
More reading:

http://www.liferay.com/web/james.min/blog/-/blogs/241107

http://www.liferay.com/community/wiki/-/wiki/Main/Inter-portlet+communication

6) What is the difference between view and edit modes of a portlet?
Ans: view mode is what is displayed a user logs in to the liferay portal and various portlets are displayed to him.
edit mode is the configuration options that are displayed when the edit button is clicked on the portlet.

7) What is service.xml and how will you use Liferay service builder?
Ans: service.xml is a configuration file which consists the details for database entities that are used in a portlet. The service builder uses the service.xml to generate the DAO/DTO classes for a portlet.
service.xml is also used by the Liferay server to create the database tables and columns for entities mentioned in service.xml.

8 ) Suppose I have a portlet written for Liferay 5.2.3 and I want to run it on Liferay 6, how can I do that? What if I get some spring and hibernate related exceptions with Liferay 6?
Ans: It is very difficult to find the technology updates done in Liferay versions. The plugins SDK was modified in Liferay 6 so if your Liferay 5.3 portlet doesn’t run properly on Liferay 6 then it is better to write a new portlet for Liferay 6 rather than trying to modify the portlet or source code for Liferay 6.

9) There is a requirement from the client that out of 4 portlets that you have written only 2 should be visible to a particular category of users. How will you achieve that? What if some fields in the remaining 2 portlets have also to be controlled based on user role?
Ans:

10) What is the purpose of portal-ext.properties?
Ans: portal-ext.properties contains various configuration parameters. These settings can be modified or further settings can be added. For example, there is no existing section for database pool in portal-ext.properties but one can add the same as described in question 25.

11) What steps will you follow to change the layout and theme of the portal pages?
Ans: Follow this excellent guide for Liferay theme and layout customization

12) Suppose I want to change the background color of the footer in Liferay, what steps should I follow?

13) Which JSR is being implemented by Liferay?
Ans: JSR 286 which is the reference for Portals from Oracle.

14) What improvements would you like to see in Liferay 6 portal?
Ans: There is no end to what features a CMS server can provide. For good and valid points read the following which are the changes done in Liferay 6.1.
a) Documents, video, audio, images, and other media types are now stored in a single unified library.
“Speaking my language”—For each document type (i.e., financial report, surveillance video, etc.) administrators can customize metadata (i.e., author, reporting period, etc.) into terms familiar to the end user.
b) Mount multiple repositories (e.g. Liferay, Alfresco, Documentum) while maintaining a common UI.
Website planning and updating made easy—Multiple teams can work on several variations of a site simultaneously (e.g. Halloween, Thanksgiving, Christmas variations) and schedule publication dates for each.
c) Enhanced staging means automatic versioning with history, undo support at the site and page level, and preview based on scheduled publications.
d) Specific pages and page areas can be designated as user customizeable
Dynamic site templates become an option—changes to the parent template force changes on any associated children sites.
e) Users can create Sites without the need to designate ties to Organizations or Communities.
Direct links between web content enables users to specify relationships, such as linking an invitation list to a Christmas party calendar event.
f) Data lists can be published as workflow-enabled forms that capture information such as an RSVP, tasks tracking and managing issues.
g) Open participation is encouraged in 6.1—users who have yet to create Liferay accounts can still rate content and have their say in forums, message boards, and wikis.

15) There are 1000 users using the portlet developed by you, how will you take care of transaction management.
Ans: There is no need to worry about transaction management when using the Liferay server. The server itself takes care of transactions. The code generated using Service Builder can also be used with the need to think about transaction management.

16) A client has two different portal applications for Sales and HR department. The client wants to run these portal applications on same server but with separate URL’s like http://[ip]:[port]/sales and http://[ip]:[port]/hr. How will you achieve that?
Ans: Two instances of the server can be made to run on single machine which will make the two instances to run on different ports but with same IP address. The configuration for running multiple Liferay servers on single machine is dependent upon the server being used like Tomcat, JBoss and GlassFish etc.
The steps to run multiple Tomcat instances on Linux are given Run Multiple Tomcat Instances.

17) What are the minimum Java methods one needs to override in order to write a portlet?
Ans: One needs to override the doView(RenderRequest renderRequest, RenderResponse renderResponse) method after overriding the MVCPortlet class.

18) How will you make the user to go from one JSP to another JSP page in a portlet?
Ans: The hyper links to other JSP pages should be encoded using renderURL tags as shown below:

<portlet:renderurl><portlet:param name="jspPage" value="/myPage.jsp"></portlet:param></portlet:renderurl>

The use of these render tags causes the next JSP page to open within the portlet window. If the links don’t use render tags then the next JSP will open in a new window/tab in the web browser.

19) While building a service using service builder, what is the purpose of specifying remoteservice=true in service.xml?

20) How to control the category in which the liferay portlet created by me will be displayed?
Ans: The category of liferay portlet can be controlled by using liferay-display.xml. The category is configured by adding the following:

<display>
 <category name="category.admin">
 <portlet id="9" ></portlet>
 <portlet id="40" ></portlet>
 <portlet id="79" ></portlet>
 <portlet id="80" ></portlet>
 </category>
 <category name="category.cms">
 <category name="category.alfresco">
 <portlet id="91" ></portlet>
 </category>
 </category>
...
<display>

21) What is hot deployment feature of Liferay? Where will you place your portlets for them to be deployed without server restart?
Ans: Hot deployment of Liferay portlets allows one to deploy/re-deploy portlets without the need to restart the Liferay server. For hot deployment one can use the deploy target of ANT build script that ships with Liferay or use Eclipse plugin which also internally uses this ANT script.

22) Does Liferay support email notifications out of the box for portlets involving workflow?

23) What is the purpose of mode and persistence packages which are created by the Liferay service builder?

24) If there are 3 portlets and all of them need to talk to different database systems (say MysSQL, Oracle and SQL Server) because of some legacy application requirements. How will you make them connect to different databases?
Ans: Liferay server doesn’t support multiple database connectivity out of the box. One needs to use JDBC or other database interaction technologies in order to use different databases for various portlets.

25) Can you configure the database connection pool created by Liferay?
Ans: One can configure database connection pool by editing portal-ext.properties by adding the following snipped. The portal-ext.properties file is present in [tomcat_home]/webapps/ROOT/WEB-INF/classes/

    #
    # Liferay can use C3PO, DBCP, or Primrose for connection pooling. See
    # com.liferay.portal.dao.jdbc.util.DataSourceFactoryBean for the actual
    # implementation. It is important to understand the strengths and weaknesses
    # of each provider so that you can choose the best one that fits your
    # deployment scenario. Provider specific properties can also be passed along
    # directly to the provider. For example, the property
    # "jdbc.default.acquireIncrement" is read by C3PO, the property
    # "jdbc.default.maxActive" is read by DBCP, and the property
    # "jdbc.default.base" is read by Primrose.
    #
    # The default provider is C3PO.
    #
    jdbc.default.liferay.pool.provider=c3po
    #jdbc.default.liferay.pool.provider=dbcp
    #jdbc.default.liferay.pool.provider=primrose

    #
    # The following properties will be read by C3PO if Liferay is configured to
    # use C3PO in the property "jdbc.default.liferay.pool.provider". See
    # http://www.mchange.com/projects/c3p0/index.html#configuration for a list
    # of additional fields used by C3PO for configuring database connections.
    #
    jdbc.default.acquireIncrement=5
    jdbc.default.connectionCustomizerClassName=com.liferay.portal.dao.jdbc.pool.c3p0.PortalConnectionCustomizer
    jdbc.default.idleConnectionTestPeriod=60
    jdbc.default.maxIdleTime=3600
    jdbc.default.maxPoolSize=100
    jdbc.default.minPoolSize=10
    jdbc.default.numHelperThreads=3
    #jdbc.default.transactionIsolation=1

    #
    # The following properties will be read by DBCP if Liferay is configured to
    # use DBCP in the property "jdbc.default.liferay.pool.provider". See
    # http://commons.apache.org/dbcp/configuration.html for a list of additional
    # fields used by DBCP for configuring database connections.
    #
    #jdbc.default.defaultTransactionIsolation=READ_UNCOMMITTED
    jdbc.default.maxActive=100
    jdbc.default.minIdle=10
    jdbc.default.removeAbandonedTimeout=3600

    #
    # The following properties will be read by Primrose if Liferay is configured
    # to use Primrose in the property "jdbc.default.liferay.pool.provider". See
    # http://www.primrose.org.uk/primrose3/primroseConfig.html for a list of
    # additional fields used by Primrose for configuring database connections.
    #
    jdbc.default.base=100
    #jdbc.default.connectionTransactionIsolation=TRANSACTION_READ_UNCOMMITTED
    jdbc.default.idleTime=1800000
    jdbc.default.numberOfConnectionsToInitializeWith=10

26) Can you list down various tools and frameworks used by Liferay? e.g. It uses Lucene for search
Ans: One can go through the source code of Liferay and list the toll and technologies being used. I am listing my list here:
Struts, Vaadin, Lucene, Solr, Log4j, ANT, Axis, Apache Commons, Freemarker, EHCache, Hibernate, jFreeChart, JSPWiki, Xerces, Velocity, Spring, SLF4j, Quartz, POI, HyperSonic, Xalan, Ajax, HTML, JavaScript, Java, CSS,

27) Suppose a client is pursuing a Liferay based solution to their requirements, what non-functional clarifications will you ask from the customer?
Ans: The non-functional requirements to look out for are:
a) Automated Startup on booting server
b) Automated database backup
c) Concurrent access to users
d) Ability to add more user roles

28) Is there a build number associated to a portlet assigned by the service builder? Where can we find the current build number?

29) Have you tried the Liferay 6 Eclipse plugin? What all limitations have you found?

30) How do you log events in a portlet? Do I need to configure Log4J for every portlet or is there a common place where one can configure Log4J so that all Liferay portlets can use logging API?

31) Do you know how to update your setup of Liferay 5.2.3 to Liferay 6?
Ans: Liferay website itself lists the steps for upgrading from 5.2.3 to Liferay 6. One should be though aware of how to take database backup and how to patch Liferay in general.

32) Can I run my Struts 1.3 based legacy application as a portlet application? How?
Ans: Yes it is possible to convert legacy application into a portlet by making the legacy application to follow the requirements of a Liferay plugin and then deploying the same on Liferay server.

33) Is it a good design to meet the customer requirements by creating a single portlet or splitting them into multiple portlets? What criteria will you use to split the functionality into multiple portlets?
Ans: It is better to split multiple requirements into individual portlets and the use inter-portlet communication for meeting the business requirements. The advantage of splitting functionality is enhanced usability, reduced coupling, better maintainability. Using the typical requirements, one can create separate portlets for Create, Modify, View, Delete and Search of each entity but you should have the user in confidence before making any UI decisions.

34) What advantages do you see in running the Liferay portal application on a application server like JBoss than running it on a web server like Tomcat?
Ans: The decision about using application or web server is totally dependent on the fact that some portlets may be using EJB/JMS and hence would require application server instead of web server. As far as Liferay is concerned, there is no difference in features provided by Liferay depending upon server.

35) What all other portals have you heard of? How do you compare them to Liferay?
Ans: Other vendors have also rolled out portals which are reference implementation of JSR 286. The list includes:
Apache JetSpeed
JBoss GateIn
Oracle WebLogic Portal
IBM Websphere Portal
SAP NetWeaver

36) How will you implement i18n in a portal application? What if you want the user to choose his language preference?

Ans: Follow the excellent guide on Liferay Internationalization

37) There is a portlet application for managing images similar to Flickr. The user wants to see the images in full screen. Will Liferay allow you to do that?
Ans: The full screen option can be displayed for any portlet by adding

<maximize-edit>true</maximize-edit>

to the corresponding liferay-portlet.xml of the particular portlet.

38) I have a war file of the portlet which is created using service builder, what is the difference between pasting this war file in the deploy folder of Liferay and application folder of server (like webapps in case of Tomcat)?
Ans: Pasting the portlet in the deploy folder of liferay will cause it to be deployed into the application folder of the server automatically when the server is started.
Copying the portlet war file to application folder of server will also cause the war file to deployed as portlet.

The only difference is that the ant script has deploy target which causes the portlet war to be copied to the deploy folder of liferay server.

39) How will you setup a clustered Liferay portal on 5 servers available to you?
Ans: Clustering involves not only clustering server but also configuring various services within Liferay. A complete guide for Liferay clustering is available Clustering Liferay Tutorial.

40) How much user base can Liferay support without affecting performance?
Ans: There are official numbers released by Liferay as shown below:

41) There is a JRE shipped with Liferay package, do we not need a JDK and what is the purpose of bundled JRE?
Ans: The JDK is required to create liferay portlets but the JRE is required for running the portlets

42) Suppose there is a requirement from client to implement search functionality in Liferay portlet, does Liferay provides any API out of the box to support search?

43) What are the various ways in which one can override the default behavior of Liferay?

44) The service builder can also build WSDL for you. What is the benefit of this feature provided by Liferay?
Ans: Using the build WSDL target of ANT, one can deploy the portlet as a web service. JSR 286 uses the term Web Services for Remote Portals. The steps to create a web service portlet can be found Liferay Web Service portlets.

45) How will you build a portlet that can be added only single or multiple times in to the portal application?
Ans: The instanceable flag should be set to true in liferay-portlet.xml present in the WEB-INF directory of every portlet application.
If the value for this flag is false then a portlet can be added only once in the portal page

46) Is it possible to set a session time out for a portlet which is different from other portlets and the Liferay portal?
Ans: No every portlet can not be configured to have a different session timeout interval than the portal itself. If a portlet should not work after some amount of inactive time period then it can be managed using Ajax calls and keeping track of inactive time in portlet code.

47) What is the flow of HTTP request in Liferay?
48) The JSPPortlet.java extends  the MVCPortlet.java class. What purpose does MVCPortlet.java fulfill?

49) How do you perform Junit tests on your portlet? How do tackle the dependency on the MVCPortlet.java?
50) Is it mandatory to have the view logic in view.jsp? Can one configure some other JSP (say MyJSP.jsp) to be default view page than view.jsp?

Answers to Liferay Interview Questions admin Liferay
Following are the answer to 50 Liferay Interview Questions that I had posted earlier. I got so many requests that I thought it would be better to provide the answers. The answers given below may not be complete and are brief so that they set the direction of your thought....
<p>Following are the answer to <strong><span style="font-size: medium; color: #ff0000;"><a href="http://www.javaexperience.com/50-liferay-interview-questions/" onclick="target='_blank'"><span style="color: #ff0000;">50 Liferay Interview Questions</span></a></span></strong> that I had posted earlier. I got so many requests that I thought it would be better to provide the answers. </p> <p>The answers given below may not be complete and are brief so that they set the direction of your thought. There is not much documentation available for <a href="http://www.javaexperience.com/what-is-liferay/">Liferay</a> so you will have to explore the server and play with the server to know more about it.</p> <p>Note: Answers to following question numbers will be added later. I thought of sharing the answers at the earliest. 9 12 19 22 23 28 29 30 32 41 43 47 48 49 50</p> <p><strong>1) What are the various ways in which you can customize the default behavior of Liferay that ships to you?</strong> Ans) One can customize Liferay by writing: Portlets Themes Layout Templates Webs Hooks</p> <p><strong>2) What is the difference between a Liferay Hook and Liferay EXT?</strong> Ans:<strong>Hook:</strong> Hooks is a feature to catch hold of the properties and JSP files into an instance of the portal as if catching them with a hook. Hook plugins are more powerful plugins that come to complement portlets, themes, layout templates, and web modules. A hook plugin is always combined with a portlet plugin. For instance, the portlet social-portlet is a portlet plugin for Social Office with hooks. In general, hooks would be very helpful tools to customize the portal without touching the code part of the portal. In addition, you would use hooks to provide patches for the portal systems or social office products. <em>source:Liferay Portal 6 Enterprise Intranets</em> <strong>EXT:</strong> EXT is used to customize and extend the Liferay portal. EXT builds a new ROOT webapp and replaces by a huge build mechanism your existing Liferay portal. The Liferay EXT Environment is where you would ideally make changes to the portal itself. In other words, this is where you customize or "extend" the portal. You may ask, "Why can't we just make the changes to the portal source directly?" The answer is that you technically CAN, but if and when you have to upgrade, you will have a tough time sorting out what is out-of-the-box and what is customized. EXT Environment keeps things separate.</p> <span id="more-81"></span> <p><strong>3) Suppose I want to customize the behavior of Calendar portlet that comes out of the box with Liferay, how can I do that?</strong> Ans: The behavior of Calendar portlet can be modified using EXT or write a separate Calendar portlet meeting the user requirements.</p> <p><strong>4) How will you configure Liferay to authenticate users from LDAP?</strong> Ans: Go to <a href="http://www.liferay.com/community/wiki/-/wiki/Main/LDAP" onclick="target='_blank'">configuring liferay with LDAP</a></p> <p><strong>5) What is inter portlet communication and how can that be achieved?</strong> Ans: Inter portlet communication (IPC) was introduced in JSR 286 More reading: http://www.liferay.com/web/james.min/blog/-/blogs/241107 http://www.liferay.com/community/wiki/-/wiki/Main/Inter-portlet+communication</p> <p><strong>6) What is the difference between view and edit modes of a portlet?</strong> Ans: view mode is what is displayed a user logs in to the liferay portal and various portlets are displayed to him. edit mode is the configuration options that are displayed when the edit button is clicked on the portlet.</p> <p><strong>7) What is service.xml and how will you use Liferay service builder?</strong> Ans: service.xml is a configuration file which consists the details for database entities that are used in a portlet. The service builder uses the service.xml to generate the DAO/DTO classes for a portlet. service.xml is also used by the Liferay server to create the database tables and columns for entities mentioned in service.xml.</p> <p><strong>8 ) Suppose I have a portlet written for Liferay 5.2.3 and I want to run it on Liferay 6, how can I do that? What if I get some spring and hibernate related exceptions with Liferay 6?</strong> Ans: It is very difficult to find the technology updates done in Liferay versions. The plugins SDK was modified in Liferay 6 so if your Liferay 5.3 portlet doesn't run properly on Liferay 6 then it is better to write a new portlet for Liferay 6 rather than trying to modify the portlet or source code for Liferay 6.</p> <p><strong>9) There is a requirement from the client that out of 4 portlets that you have written only 2 should be visible to a particular category of users. How will you achieve that? What if some fields in the remaining 2 portlets have also to be controlled based on user role?</strong> Ans: </p> <p><strong>10) What is the purpose of portal-ext.properties?</strong> Ans: portal-ext.properties contains various configuration parameters. These settings can be modified or further settings can be added. For example, there is no existing section for database pool in portal-ext.properties but one can add the same as described in question 25.</p> <p><strong>11) What steps will you follow to change the layout and theme of the portal pages?</strong> Ans: Follow this excellent guide for <a href="http://www.javalobby.org/articles/liferay/" onclick="target='_blank'">Liferay theme and layout customization</a></p> <p><strong>12) Suppose I want to change the background color of the footer in Liferay, what steps should I follow?</strong></p> <p><strong>13) Which JSR is being implemented by Liferay?</strong> Ans: JSR 286 which is the reference for Portals from Oracle.</p> <p><strong>14) What improvements would you like to see in Liferay 6 portal?</strong> Ans: There is no end to what features a CMS server can provide. For good and valid points read the following which are the changes done in Liferay 6.1. a) Documents, video, audio, images, and other media types are now stored in a single unified library. “Speaking my language”—For each document type (i.e., financial report, surveillance video, etc.) administrators can customize metadata (i.e., author, reporting period, etc.) into terms familiar to the end user. b) Mount multiple repositories (e.g. Liferay, Alfresco, Documentum) while maintaining a common UI. Website planning and updating made easy—Multiple teams can work on several variations of a site simultaneously (e.g. Halloween, Thanksgiving, Christmas variations) and schedule publication dates for each. c) Enhanced staging means automatic versioning with history, undo support at the site and page level, and preview based on scheduled publications. d) Specific pages and page areas can be designated as user customizeable Dynamic site templates become an option—changes to the parent template force changes on any associated children sites. e) Users can create Sites without the need to designate ties to Organizations or Communities. Direct links between web content enables users to specify relationships, such as linking an invitation list to a Christmas party calendar event. f) Data lists can be published as workflow-enabled forms that capture information such as an RSVP, tasks tracking and managing issues. g) Open participation is encouraged in 6.1—users who have yet to create Liferay accounts can still rate content and have their say in forums, message boards, and wikis.</p> <p><strong>15) There are 1000 users using the portlet developed by you, how will you take care of transaction management.</strong> Ans: There is no need to worry about transaction management when using the Liferay server. The server itself takes care of transactions. The code generated using Service Builder can also be used with the need to think about transaction management.</p> <p><strong>16) A client has two different portal applications for Sales and HR department. The client wants to run these portal applications on same server but with separate URL’s like http://[ip]:[port]/sales and http://[ip]:[port]/hr. How will you achieve that?</strong> Ans: Two instances of the server can be made to run on single machine which will make the two instances to run on different ports but with same IP address. The configuration for running multiple Liferay servers on single machine is dependent upon the server being used like Tomcat, JBoss and GlassFish etc. The steps to run multiple Tomcat instances on Linux are given <a href="http://www.javaexperience.com/run-multiple-tomcat-instances/" onclick="target='_blank'">Run Multiple Tomcat Instances</a>.</p> <p><strong>17) What are the minimum Java methods one needs to override in order to write a portlet?</strong> Ans: One needs to override the doView(RenderRequest renderRequest, RenderResponse renderResponse) method after overriding the MVCPortlet class.</p> <p><strong>18) How will you make the user to go from one JSP to another JSP page in a portlet?</strong> Ans: The hyper links to other JSP pages should be encoded using renderURL tags as shown below: 1 The use of these render tags causes the next JSP page to open within the portlet window. If the links don't use render tags then the next JSP will open in a new window/tab in the web browser.</p> <p><strong>19) While building a service using service builder, what is the purpose of specifying remoteservice=true in service.xml?</strong></p> <p><strong>20) How to control the category in which the liferay portlet created by me will be displayed?</strong> Ans: The category of liferay portlet can be controlled by using liferay-display.xml. The category is configured by adding the following: </p> 1 <p><strong>21) What is hot deployment feature of Liferay? Where will you place your portlets for them to be deployed without server restart?</strong> Ans: Hot deployment of Liferay portlets allows one to deploy/re-deploy portlets without the need to restart the Liferay server. For hot deployment one can use the deploy target of ANT build script that ships with Liferay or use Eclipse plugin which also internally uses this ANT script.</p> <p><strong>22) Does Liferay support email notifications out of the box for portlets involving workflow?</strong></p> <p><strong>23) What is the purpose of mode and persistence packages which are created by the Liferay service builder?</strong></p> <p><strong>24) If there are 3 portlets and all of them need to talk to different database systems (say MysSQL, Oracle and SQL Server) because of some legacy application requirements. How will you make them connect to different databases?</strong> Ans: Liferay server doesn't support multiple database connectivity out of the box. One needs to use JDBC or other database interaction technologies in order to use different databases for various portlets.</p> <p><strong>25) Can you configure the database connection pool created by Liferay?</strong> Ans: One can configure database connection pool by editing portal-ext.properties by adding the following snipped. The portal-ext.properties file is present in [tomcat_home]/webapps/ROOT/WEB-INF/classes/ </p> 1 <p><strong>26) Can you list down various tools and frameworks used by Liferay? e.g. It uses Lucene for search</strong> Ans: One can go through the source code of Liferay and list the toll and technologies being used. I am listing my list here: Struts, Vaadin, Lucene, Solr, Log4j, ANT, Axis, Apache Commons, Freemarker, EHCache, Hibernate, jFreeChart, JSPWiki, Xerces, Velocity, Spring, SLF4j, Quartz, POI, HyperSonic, Xalan, Ajax, HTML, JavaScript, Java, CSS,</p> <p><strong>27) Suppose a client is pursuing a Liferay based solution to their requirements, what non-functional clarifications will you ask from the customer?</strong> Ans: The non-functional requirements to look out for are: a) Automated Startup on booting server b) Automated database backup c) Concurrent access to users d) Ability to add more user roles</p> <p><strong>28) Is there a build number associated to a portlet assigned by the service builder? Where can we find the current build number?</strong></p> <p><strong>29) Have you tried the Liferay 6 Eclipse plugin? What all limitations have you found?</strong></p> <strong>30) How do you log events in a portlet? Do I need to configure Log4J for every portlet or is there a common place where one can configure Log4J so that all Liferay portlets can use logging API?</strong></p> <p><strong>31) Do you know how to update your setup of Liferay 5.2.3 to Liferay 6?</strong> Ans: Liferay website itself lists the steps for <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Upgrade%20Instructions%20from%205.2%20to%206.0" onclick="target='_blank'">upgrading from 5.2.3 to Liferay 6</a>. One should be though aware of how to take database backup and how to patch Liferay in general.</p> <p><strong>32) Can I run my Struts 1.3 based legacy application as a portlet application? How?</strong> Ans: Yes it is possible to convert legacy application into a portlet by making the legacy application to follow the requirements of a Liferay plugin and then deploying the same on Liferay server.</p> <p><strong>33) Is it a good design to meet the customer requirements by creating a single portlet or splitting them into multiple portlets? What criteria will you use to split the functionality into multiple portlets?</strong> Ans: It is better to split multiple requirements into individual portlets and the use inter-portlet communication for meeting the business requirements. The advantage of splitting functionality is enhanced usability, reduced coupling, better maintainability. Using the typical requirements, one can create separate portlets for Create, Modify, View, Delete and Search of each entity but you should have the user in confidence before making any UI decisions.</p> <p><strong>34) What advantages do you see in running the Liferay portal application on a application server like JBoss than running it on a web server like Tomcat?</strong> Ans: The decision about using application or web server is totally dependent on the fact that some portlets may be using EJB/JMS and hence would require application server instead of web server. As far as Liferay is concerned, there is no difference in features provided by Liferay depending upon server.</p> <p><strong>35) What all other portals have you heard of? How do you compare them to Liferay?</strong> Ans: Other vendors have also rolled out portals which are reference implementation of JSR 286. The list includes: Apache JetSpeed JBoss GateIn Oracle WebLogic Portal IBM Websphere Portal SAP NetWeaver</p> <p><strong>36) How will you implement i18n in a portal application? What if you want the user to choose his language preference? </strong> Ans: Follow the excellent guide on <a href="https://blogs.oracle.com/mahipal/entry/how_to_i18n_and_l10n" onclick="target='_blank'">Liferay Internationalization</a></p> <p><strong>37) There is a portlet application for managing images similar to Flickr. The user wants to see the images in full screen. Will Liferay allow you to do that?</strong> Ans: The full screen option can be displayed for any portlet by adding 1 to the corresponding liferay-portlet.xml of the particular portlet.</p> <p><strong>38) I have a war file of the portlet which is created using service builder, what is the difference between pasting this war file in the deploy folder of Liferay and application folder of server (like webapps in case of Tomcat)?</strong> Ans: Pasting the portlet in the deploy folder of liferay will cause it to be deployed into the application folder of the server automatically when the server is started. Copying the portlet war file to application folder of server will also cause the war file to deployed as portlet. The only difference is that the ant script has deploy target which causes the portlet war to be copied to the deploy folder of liferay server.</p> <p><strong>39) How will you setup a clustered Liferay portal on 5 servers available to you?</strong> Ans: Clustering involves not only clustering server but also configuring various services within Liferay. A complete guide for Liferay clustering is available <a href="http://www.liferay.com/community/wiki/-/wiki/Main/JBoss-Tomcat-Liferay+portal+Clustering+-+what+and+how" onclick="target='_blank'">Clustering Liferay Tutorial</a>.</p> <p><strong>40) How much user base can Liferay support without affecting performance?</strong> Ans: There are official numbers released by Liferay as shown below: <a href="http://www.javaexperience.com/wp-content/uploads/2012/08/liferay-users.jpg"><img class="aligncenter size-full wp-image-1332" title="liferay users" src="http://www.javaexperience.com/wp-content/uploads/2012/08/liferay-users.jpg" alt="" width="600" height="300" /></a></p> <p><strong>41) There is a JRE shipped with Liferay package, do we not need a JDK and what is the purpose of bundled JRE?</strong> Ans: The JDK is required to create liferay portlets but the JRE is required for running the portlets</p> <p><strong>42) Suppose there is a requirement from client to implement search functionality in Liferay portlet, does Liferay provides any API out of the box to support search?</strong> </p> <p><strong>43) What are the various ways in which one can override the default behavior of Liferay?</strong></p> <p><strong>44) The service builder can also build WSDL for you. What is the benefit of this feature provided by Liferay?</strong> Ans: Using the build WSDL target of ANT, one can deploy the portlet as a web service. JSR 286 uses the term Web Services for Remote Portals. The steps to create a web service portlet can be found <a href="http://www.liferay.com/community/wiki/-/wiki/Main/Creating+Liferay+6+plugin+web+service" onclick="target='_blank'">Liferay Web Service portlets</a>.</p> <p><strong>45) How will you build a portlet that can be added only single or multiple times in to the portal application?</strong> Ans: The instanceable flag should be set to true in liferay-portlet.xml present in the WEB-INF directory of every portlet application. If the value for this flag is false then a portlet can be added only once in the portal page</p> <p><strong>46) Is it possible to set a <a href="http://www.javaexperience.com/force-page-to-login-after-struts2-session-timeout/">session time out</a> for a portlet which is different from other portlets and the Liferay portal?</strong> Ans: No every portlet can not be configured to have a different session timeout interval than the portal itself. If a portlet should not work after some amount of inactive time period then it can be managed using Ajax calls and keeping track of inactive time in portlet code.</p> <p>47) What is the flow of HTTP request in Liferay? 48) The JSPPortlet.java extends  the MVCPortlet.java class. What purpose does MVCPortlet.java fulfill?</p> <p>49) How do you perform <a href="http://www.javaexperience.com/junit-test-case-lifecycle/">Junit tests</a> on your portlet? How do tackle the dependency on the MVCPortlet.java? 50) Is it mandatory to have the view logic in view.jsp? Can one configure some other JSP (say MyJSP.jsp) to be default view page than view.jsp?</p>
The following two tabs change content below.
I run this blog with lots of passion. In this website, you will find tutorials on Core Java, Spring, Struts, Web Applications, Portals and Database. Please support me and the website by sharing the posts on your facebook / twitter. You can tap the share button at the top of each post. Thanks for the support.