Liferay Interview Questions

Ratings:
(4.7)
Views:2652
Banner-Img
  • Share this blog:

In this blog, we have compiled a comprehensive list of Liferay Interview Questions to help you prepare for your next Liferay interview. Whether you are a seasoned Liferay Developer, or administrator, or just beginning your journey with Liferay, these questions cover a wide range of topics and will provide you with valuable insights into the platform.

From fundamental concepts to more advanced topics, these interview questions are designed to test your understanding of Liferay's Architecture, features, customization capabilities, security, performance optimization, and more. By familiarizing yourself with these questions and their answers, you'll gain the confidence and knowledge necessary to excel in your Liferay interview.

So, let's dive into the world of Liferay and explore these insightful interview questions to help you land your dream job or take your career to the next level!

In this article, we will cover the following:

Most Frequently Asked Liferay Interview Questions

Liferay Interview Questions

Q1) What is a Liferay Portal?

Ans: In general, a web portal represents a web application that provides a single point of access to a variety of information.

The functionality of a portal can be extended very easily by creating custom applications that can run inside a portal. These applications are called portlets.

For running portlets, you need an application server that can run a portlet container spec (JSR168 or JSR286). There are dozens of free and enterprise portal products available.

Liferay portal is an open-source portal and below are the benefits of using Liferay portal:

  • Content management system (Documents, Articles).
  • 2-stage, 3-stage workflows, and publishing.
  • Social networking. 4) Sites and organization basis pages.
  • Integration with third parties like LDAP, Solr, SSO(CAS, Siteminder).
  • Portlets related to Wiki, News, Finance, Social, Workflow, and Collaboration.
  • Compatible with different Operating systems, databases and APP servers.
  • Compatible with UI technologies and web services.
  • Compatible with different scripts like PHP, Ruby, Grails, and Python.
  • Support of hot deployment feature.

Q2) What is a Portlet?

Ans: Liferay portal comes with different portlets by default. These portlets are nothing but different small applications running in the instance (portal). Portlets are pluggable software components that are managed in a web portal.

In general words, you can call them as different catalogs as portlets produce fragments of markup code that are aggregated into a portal. So a portal page is displayed as a collection of the portlet, these multiple small applications together making a page of the site and these all pages together makes one community or enterprise portal. Hence a portlet (or collection of portlets) resembles a web-based application that is hosted in a portal.

A portlet is a small application to fulfill the requirement of a certain domain. Inter portlet communication is supported under the Liferay portal. Portlet supports the hot deployment feature of Liferay Portal.

Q3) What is the Liferay portal and how it differs from other portals IBM WCM, Web logic?

Ans: 

  • Liferay Portal is a platform contains common applications used to create a web application
  • Liferay provides a development framework with highly customization components for building a site.
  • Liferay Portal can be used for content management, be it web content management
  • Liferay Portal offers a rich collaborative application suite with:
    • Calendars
    • Blogs
    • Wikis
    • Workflow
    • User Management
Inclined to build a profession as Liferay Developer? Then here is the blog post on, exploring Liferay Training

Q4) Is Liferay, JSR-168 compliant or JSR-286?

Ans: JSR – 286

Q5) Which all methods JSR-286 supports?

Ans: init(),render(),processAction(),processEvent(),serveResource(),destroy()

Q6) Which JSR-286 portlet class extends?

Ans: GenericPortet

Q7) What class does LiferayMVCPortlet extend?

Ans: LiferayPortlet -> GenericPortlet

Q8) What are the differences between Portlet and Servlet?

Ans: A Portlet container is built on top Servlet container.

Q9) What is the difference between a Liferay Hook and Liferay EXT?

Ans: 

Hook:

The hook 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 web app and replaces it with a huge build mechanism on 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.

Q10) What is the difference between the view and edit modes of a portlet?

Ans: View mode is what has 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.

Q11) What is service.xml and how will you use the Liferay service builder?

Ans: service.xml is a configuration file that consists of 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.

Q12) Can I run my Struts 1.3-based legacy application as a portlet application? How?

Ans: Yes it is possible to convert the legacy application into a portlet by making the legacy application follow the requirements of a Liferay plugin and then deploying the same on the Liferay server.

Q13) 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.

Q14) What other portals have you heard of? How do you compare them to Liferay?

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

  • Apache JetSpeed
  • JBoss GateIn
  • Oracle WebLogic Portal
  • IBM Websphere Portal
  • SAP NetWeaver

Liferay DXP Interview Questions

Q15) What is a Portlet Lifecycle?

Ans: Following is the portlet lifecycle:

Init(): It mainly initializes the portlet.

Render(): It takes the HTML output to User Interface. It mainly renders the view in terms of JSP/HTML code and shows it into the respective portlet.

Destroy(): This method takes care of releasing the portlet resources.

Q16) What Is A Liferay Portal Instance?

Ans: Liferay portal ships with the one Liferay portal tomcat bundle which is up and running on any server with certain database settings. We can have more than one Liferay instance running from one database.

Liferay Portal allows you to run more than one portal instance on a single server. The Portal Instances page of the control panel lets you manage these instances. Data for each portal instance are kept separate. All portal data, however, is kept in the same database.

Each portal instance requires its own domain name. Liferay will direct users to the proper portal instance based on this domain name. So before you configure an instance, we need to configure its domain name in our network first. When we are ready to add an instance, click the Instances tab - > Add button.

It will be prompted for four fields and a checkbox:

  • Web ID: A general convention is to use the domain name for this. It’s a user-generated ID for the instance.
  • Virtual Host: Put the domain name you configured in your network here. When users are directed to your Liferay server via this domain name, Liferay will then be able to send them to the proper portal instance.
  • Mail Domain: Enter the domain name for the mail host for this instance. Liferay will use this to send email notifications from the portal.
  • Max Users: Enter the maximum number of user accounts you would like your portal instance to support.
  • Active: Use this checkbox to choose whether to create an active or an inactive portal instance.

Q17) How Can I Configure Two Different Domain Names (e.g. First.example.com And Second.example.com) On Liferay?

Ans: At the time of the creation of any site, we need to provide domain names that further take it as a site domain name. We need to provide a certain domain name as required through the control panel of the Liferay portal. A single instance of Liferay Portal supports the hosting of two or more domain names via communities(sites).

When we will go to the control panel -> Site settings -> we can provide the site URL, and details like the site(community) description, membership type, active status, and virtual host.

Q18) Which One Is Best To Start In A Clean Setup?

Ans: Liferay bundled with the Tomcat app server is the best one to start in a clean setup.

Q19) How Can You Customize Liferay Search Feature? What Are The APIs To Do It?

Ans: We can customize the Liferay Search feature, depending on our requirements in two ways.

Hook: If changes are required as per the view side like we need to change the search result from view then we can write the Hook to customize it.

EXT: If changes are required as per the core functionality like we need to change the search query term, we can implement EXT.

Q20) How To Setup A Liferay Cluster From Scratch?

Ans: We need to set up the below properties in our portal-ext.properties(this is for one instance represented by 1p, same properties we need to add for the second instance also represented by 2p) and some required IP addresses.

#cluster configurations - these settings are for cluster
net.sf.ehcache.configurationResourceName=/myehcache/hibernate-clustered.xml
dl.store.file.system.root.dir=/webapps/document_library_cluster
#other settings for cluster
liferay.home=/webapps/liferay-1p/liferay-portal-6.1.10-ee-ga1/
lucene.dir=/webapps/liferay-1p/liferay-portal-6.1.10-ee-ga1/data/lucene
cluster.link.enabled=true
lucene.replicate.write=true
multicast.group.address["cluster-link-control"]=239.255.4.1

Q21) What is the Use of <portlet:defineObject> and <liferaytheme:defineObject>?

Ans: These are Liferay tag libs and provide access to the below list of objects in JSP:

  • portlet: define object will provide the following variables
  • reader request and render response
  • action request and Response
  • event request and Response
  • resourceRequest and Response
  • portletConfig
  • portlet session
  • portletSessionScope
  • portlet preference
  • portlet preferences values

Liferay-theme: define object will provide the following variables

  • themeDisplay
  • company
  • user
  • realUser
  • contact
  • layout
  • layouts
  • plid
  • layoutTypePortlet
  • portletGroupId
  • permissionChecker
  • locale
  • timeZone
  • theme
  • colorScheme
  • portletDisplay

Q22) Explain IPC(Inter portlet communication).

Ans: 

  • Portlet 1.0 did not offer any standard method for portlets to communicate with each other
  • Portlet 2.0 (JSR – 286 ) addresses this issue with 2 different mechanisms for IPC.
    • Public Render Parameters
    • Portlet Events

Q23) What is the use of the PortletPreferences interface?

Ans: Portlet Preferences are properties for storing basic portlet configuration data. Administrators often use preferences to provide a customized view of a portlet to users based on preferences.

Q24) In Portlet URL, what is p_p_lifecycle?

Ans: 

p_p_lifecyle holds an integer value and represents the portlet lifecycle phase to the portlet belongs:

  • 0 means render phase
  • 1 means the action phase
  • 2 means the server resource phase.

Q25) What is the Portlet Namespace and why it is important? how do you get the portlet namespace in JSP?

Ans: 

  • Portlet namespace is portlet Id
  • p_p_id parameters also contain portlet namespace
  • portlet name space is prefixed with URL parameters so that the portlet container will identify the parameters belong to what portlet
  • In JSP:

<% String nameSpace=  getNamespace() %>

<portlet-namespace/>

You liked the article?

Like : 2

Vote for difficulty

Current difficulty (Avg): Medium

Recommended Courses

1/15

About Author
Authorlogo
Name
TekSlate
Author Bio

TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.


Stay Updated


Get stories of change makers and innovators from the startup ecosystem in your inbox