Sunday 13 September 2015

Scenario based liferay interview question and answer


Question :Is it possible to set a session time out for a portlet which is different from other portlets and the Liferay portal?


Answer :: 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.
Question :How will you build a portlet that can be added only single or multiple times in to the portal application?


Answer :: 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
Question :The service builder can also build WSDL for you. What is the benefit of this feature provided by Liferay?


Answer :: 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
Question :There is a JRE shipped with Liferay package, do we not need a JDK and what is the purpose of bundled JRE?


Answer :: The JDK is required to create liferay portlets but the JRE is required for running the portlets
Question :How will you setup a clustered Liferay portal on 5 servers available to you?


Answer :: Clustering involves not only clustering server but also configuring various services within Liferay. A complete guide for Liferay clustering is available Clustering Liferay Tutorial.
Question :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)?


Answer :: 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.
Question :What all other portals have you heard of? How do you compare them to Liferay?


Answer :: Other vendors have also rolled out portals which are reference implementation of JSR 286. The list includes:

Question :Can I run my Struts 1.3 based legacy application as a portlet application? How?


Answer :: 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.
Question :Do you know how to update your setup of Liferay 5.2.3 to Liferay 6?
Saturday, May 18, 2013, Posted by Admin/Anonomous

Answer :: 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.
Ads by OffersWizardAd Options
Question :Suppose a client is pursuing a Liferay based solution to their requirements, what non-functional clarifications will you ask from the customer?


Answer :: 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
Question :Can you list down various tools and frameworks used by Liferay? e.g. It uses Lucene for search


Answer :: 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,
Question :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?


Answer :: 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.
Question :What is hot deployment feature of Liferay? Where will you place your portlets for them to be deployed without server restart?
Saturday, May 18, 2013, Posted by Admin/Anonomous

Answer :: : 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.
Question :How to control the category in which the liferay portlet created by me will be displayed?


Answer :: The category of liferay portlet can be controlled by using liferay-display.xml. The category is configured by adding the following: < category name="category.admin"> ... < display>
Question :How will you make the user to go from one JSP to another JSP page in a portlet?


Answer :: The hyper links to other JSP pages should be encoded using renderURL tags as shown below:  
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.

Question :There are 1000 users using the portlet developed by you, how will you take care of transaction management.


Answer :: 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.
Question :What improvements would you like to see in Liferay 6 portal?
Saturday, May 18, 2013, Posted by Admin/Anonomous

Answer :: There is no end to what features a CMS server can provide…
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.
  Mount multiple repositories (e.g. Liferay, Alfresco, Documentum) while maintaining a common UI. Website planning and upd ....
Ads by OffersWizardAd Options
Question :What steps will you follow to change the layout and theme of the portal pages?


Answer :: Follow this excellent guide for Liferay theme and layout customization
Question :What is the purpose of portal-ext.properties?


Answer :: : 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
Question :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?


Answer :: 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.
Question :What is service.xml and how will you use Liferay service builder?


Answer :: 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.
Question :What is the difference between view and edit modes of a portlet?


Answer :: 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.

Question :What are the various ways in which you can customize the default behavior of Liferay that ships to you?


Answer :: One can customize Liferay by writing:
Portlets
Themes
  Layout Templates 
  Webs
  Hooks


No comments:

Post a Comment