Iteanz Interview Questions | Latest Technologies Interview Questions

Liferay Interview Questions and Answers

Written by Bharathkumar | Sep 10, 2022 8:35:33 AM

1.What is meant by Liferay ?
Liferay is an open source JSR 286 compliant portal and social platform, written in Java. It provides fully functional built-in portlets (60+) and also various integration points to seamlessly integrate with other third-party softwares like Alfresco, Sharepoint etc.

2.What is Portal?
Portal is platform to create web applications where portal provides commonly used features such as user  management, authentication, sites, web content management to avoid creating from scratch. Portal assembles multiple portlet applications to form a page.

3.What is Portlet?
Portlet is single application fragment on Portal.

4.What is Liferay portal and how it differs from other portals IBM WCM,Web logic?

  • Liferay Portal is platform contains common applications used to create 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

5.WHAT IS LIFERAY HOOK?

    1. Liferay portal come with bundle where default built in portlets exist.
    2. If any customisation require in JSP or portal.properties we go by hook.
    3. Hook is hot deployable.
    4. Liferay document suggest wherever possible we should use Hook instead ext.
    5. Because it is more future version compatible, It is hot deployable.

Some common scenario in which we use Hook.

  1. When you have to perform a custom action on portal startup
  2. When you have to perform a custom action on user login
  3. When you need to overwrite or extend portal JSPs
  4. When you need to modify portal properties
  5.  When you need to replace a portal service with your own implementation.

6.is Liferay is JSR-168 compliant or JSR-286?
JSR – 286

7.Which all methods JSR-286 supports?
init(),render(),processAction(),processEvent(),serveResource(),destroy()

8.Which JSR-286 portlet class extends?
GenericPortet

9.What Is A Liferay Theme? What Are The Advantages Of Using Them?
Liferay themes are the way to customize look and feel of a Liferay portal page.

  • It is hot deployable plugin provide by Liferay.
  • The themes are extendable components that can be deployed separately on a portal and each page on the portal can choose a different theme.
  • Themes are really powerful way to run multiple websites from a single portal.
  • You can host multiple websites on a single Liferay portal with totally different look and feel
  • The same time save lot resources on website hosting.
  • A lot of companies use Liferay for creating multiple unique websites with the help of extraordinary themes that can be easily developed.
  • Themes are also available from marketplace.
  • For developing on our own, we have option of using VM pages(Velocity templates).
  • Liferay provides the feature to deploy the different themes into the portal same like portlets war files.
  • Number of themes we can be deployed into Liferay portal and we can further select those themes for user interface as per the requirement of end user for different site or organization interface as per the requirement of end user for different site or organization pages.
  • We are using CSS, JavaScript and Velocity for it.
  • Liferay are built on top of two base themes, named _unstyledand _styled. Theme.
  • The _diffs folder must mirror the parent theme’s directory structure.
  • Since you’ll only customize the parts of your theme that differ from the parent theme, place only the folders and files you’ll customize there.
  • For example, to customize the navigation, copy navigation.vm
  • deep-blue-theme/docroot/_diffs/templates folder (you may have to create this folder first). You can then open this file and customize it to your liking.

10.What class LiferayMVCPortlet extends?
LiferayPortlet -> GenericPortlet

11.Explain The Permission System in Liferay ?
Liferay’s permission system uses a flexible mechanism that defines the actions that a given user can perform within the context of the portal or a specific portlet.
Portal and portlet developers break down the operations that can be performed in the portal or portlet into distinct actions.
The act of granting the ability to perform an action to a specific role is the act of granting a permission.
In Liferay, permissions are not granted to directly to users. Instead, permissions are granted to roles. Roles, in turn, can be assigned to specific users, sites, organizations, or user groups.

12.What are architectures of theme?
Archietecture

Docroot

– diffs

css

images

js

templates

css

– aui

(many directories)

images

(many directories)

js

main.js

templates

– init_custom.vm

– navigation.vm

– portal_normal.vm

– portal_pop_up.vm

– portlet.vm

WEB-INF/

-liferay-look-and-feel.xml

-liferay-plugin-package.properties

 13.What is Portlet Name space and why it is important ? how do you get portlet namespace in JSP?

  • Portlet namespace is portlet Id
  • p_p_id parameters also contains portlet namespace
  • portlet name space is prefixed with url parameters, so that portlet container will identify the parameters belongs what portlet
  • In  JSP:
    • <%  String nameSpace=  renderResponse.getNamespace() %>
    • <portlet-namespace/>

14.In Portlet URL, what is p_p_lifecycle?

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

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

15.How To Apply Workflow With Custom Entity And Round Robin Assignment In Liferay DXP?

Organizations use workflows to coordinate tasks between people and synchronize data between systems, with the ultimate goal of improving organizational efficiency, responsiveness and profitability. Liferay Digital Experience Platform provides an opportunity for enterprises to boost their businesses with co-ordinated workflows.

Liferay DXP provides easy integration of workflow on various out of the box assets like blog, wiki, users, web contents, document etc. However, in many scenarios, business need to implement workflow on custom entities. Liferay DXP platform provides support for this. In short, you can implement workflow on your own entities by following below steps.

  1. To make the Custom Entity as Asset Type,
    • Insert asset entry reference in service.xml for the custom entity.
    • Add columns workflow status, user idand date in custom entity definition.
    • While adding custom entity, add entry of it in asset local service.
  2. To make it available for Workflow,
    • Define workflow handler class.
    • Implement update statusmethod in workflow handler class to update the status of workflow as per the task assignment.
  3. To make it visible for Workflow Configuration Screen,
    • Define asset render class for custom entity.
    • Define asset render factory class.
  4. To start Workflow,
    • Add start workflow instancemethod while adding custom entity or any event on which workflow should start.
    • Add method for updating assets in asset local service.
  5. To configure it in Control Panel,
    • Go to control panel >> workflow configuration, check your custom entity and apply workflow.