Liferay Interview Questions and Answers
by Anuradha, on Mar 29, 2018 2:35:36 PM
Q1. What is meant by Liferay ?
Ans: 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.
Q2. What is Portal?
Ans: 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.
Q3. What is Portlet?
Ans: Portlet is single application fragment on Portal.
Q4. What is Liferay portal and how it differs from other portals IBM WCM,Web logic?
Ans:
- 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
Q5. WHAT IS LIFERAY HOOK?
Ans:
- Liferay portal come with bundle where default built in portlets exist.
- If any customisation require in JSP or portal.properties we go by hook.
- Hook is hot deployable.
- Liferay document suggest wherever possible we should use Hook instead ext.
- Because it is more future version compatible, It is hot deployable.
Some common scenario in which we use Hook.
- When you have to perform a custom action on portal startup
- When you have to perform a custom action on user login
- When you need to overwrite or extend portal JSPs
- When you need to modify portal properties
- When you need to replace a portal service with your own implementation.
Q6. is Liferay is JSR-168 compliant or JSR-286?
Ans: JSR – 286
Q7. Which all methods JSR-286 supports?
Ans: init(),render(),processAction(),processEvent(),serveResource(),destroy()
Q8. Which JSR-286 portlet class extends?
Ans: GenericPortet
Q9. What Is A Liferay Theme? What Are The Advantages Of Using Them?
Ans: 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.
Q10. What class LiferayMVCPortlet extends?
Ans: LiferayPortlet -> GenericPortlet
Q11. Explain The Permission System in Liferay ?
Ans: 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.
Q12. What are architectures of theme?
Ans: 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
Q13. What is Portlet Name space and why it is important ? how do you get portlet namespace in JSP?
Ans:
- 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/>
Q14. In Portlet URL, what is p_p_lifecycle?
Ans: 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.
Q15. How To Apply Workflow With Custom Entity And Round Robin Assignment In Liferay DXP?
Ans: 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.
- 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.
- 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.
- To make it visible for Workflow Configuration Screen,
- Define asset render class for custom entity.
- Define asset render factory class.
- 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.
- To configure it in Control Panel,
- Go to control panel >> workflow configuration, check your custom entity and apply workflow.