• LOGIN
  • No products in the cart.

Liferay Interview Questions and Answers

What is a Liferay Portal?

By and large, a web-based interface speaks to a web application that gives a solitary purpose of access to an assortment of data.

The usefulness of an entrance can be broadened effectively by making custom applications that can run inside an entry. These applications are called portlets.

For running portlets, you need an application server that can run a portlets holder spec (JSR168 or JSR286). There are many free and endeavor entrance items accessible.

Liferay entryway is an open-source gateway and underneath is the advantages of utilizing Liferay entry:

  • Content of the executives’ system(Documents, Articles).
  • 2-stage,3-arrange work processes, and distributing.
  • Sites and association premise pages.
  • Integration with the outsider like LDAP, Solr, SSO(CAS, Siteminder).
  • Portlets identified with Wiki’s, News, Finance, Social, Workflow, Collaboration.
  • Compatible with various Operating frameworks, databases and APP servers.
  • Compatible with UI advances and web administrations.
  • Compatible with various contents like PHP, Ruby, Grails, Python.
  • Support of hot sending highlight.

What is a Portlet?

The Liferay entryway accompanies diverse portlets as a matter of course. These portlets are only unique little applications running in the instance(portal). Portlets are pluggable programming parts that are overseen in an online interface.

When all is said in done words, you can call them as various indexes as portlets produce sections of markup code that are amassed into an entrance. So an entry page is shown as an assortment of the portlet, these numerous little applications together making a page of the site and these all pages together make one network or endeavor gateway. Henceforth a portlet (or assortment of portlets) takes after an online application that is facilitated in an entryway.

The portlet is a little application to satisfy the necessity of a specific area. Entomb portlet correspondence is upheld under the Liferay gateway. Portlet underpins hot sending highlight of Liferay Portal.

What is the contrast between Hook, EXT and Portlet?

Liferay gives 3 different ways to expand the usefulness of a Liferay entrance. Every one of the manners in which fits is useful for various needs.

Snare

Liferay entrance accompanies a group where all the default worked in portlets exist. Normally if any customization required regarding JSP (UI) and entrance properties. We have to pass by Hook execution. The snare is bolstered by hot arrangements. Liferay documentation recommends that – Whenever potential, snares ought to be utilized instead of Ext modules, as they are hot-deployable and progressively forward good.

  • Some normal situations that require the utilization of a snare are
  • When you need to play out a custom activity on entryway startup
  • When you need to play out a custom activity on client login
  • When you have to overwrite or expand entry JSPs
  • When you have to change entry properties
  • When you have to supplant an entryway administration with your own execution.

EXT

Liferay EXT Plugins are the most dominant approach to expand the entry usefulness. In the event that any customization required in the center level classes, at that point it very well may be done through EXT, for instance, LDAP clients and client bunches import adjustment. be that as it may, here in EXT, the restart would be required.

EXT Plugins ought to be utilized distinctly on the off chance that the entry usefulness can not be expanded utilizing Portlet of Hooks. The EXT modules are intricate to create and may cause support issues on the off chance that you are attempting to overhaul.

From Liferay reports, The fundamental use cases in which an Ext module might be utilized are:

  • Customizations to portal.properties (that isn’t bolstered by Hook Plugins)
  • Customizing and making changes to the Struts Actions for gateway
  • Customizations of the Liferay beans proclaimed in Liferay’s Spring records
  • Adding JSPs that are referenced from entrance properties that must be transformed from an ext module (make certain to check if the property can be adjusted from a snare module before doing this)
  • Direct overwriting of a class (not prescribed except if it’s carefully important)

Portlet

Portlets are the most widely recognized and least demanding approach to broaden and give custom usefulness to a Liferay entrance. This is a little application to satisfy the necessity of a certain area. It is essentially a lot of code(Java Files, JSP, CSS, Java Scripts and so forth.). The portlet is bolstered by the hot organization.

Liferay likewise has a commercial center where a lot of valuable portlets are accessible for download and these portlets can contribute by anybody on the planet. We as of late contributed a Speed perusing portlet and a My IP Address portlet right now free use by Liferay network.

What are the differences between Portlet and Servlet?

A Portlet container is built on top Servlet container.

What JSR form Liferay actualizes? Why JSR similarity is significant while picking an entrance?

JSR is a “Java Specification Request”. Liferay Portal is created to stick to JSR 168 and JSR 286 particulars.

This particular is made by the board of trustees of JEE entrance merchants. This determination is intended to accomplish interoperability between various entries and portlets.

Liferay bolsters basically underneath JSRs.

JSR-168(Portlet 1.0)

JSR-286(Portlet 2.0)

JSR-127(JSF 1.0)

JSR-170

JSR-314(JSF 2.0)

JSR-329

Why these models are characterized?

These models are characterized to help entrance clients (end clients). Before these gauges were conceived, entry client was required to utilize one entryway and there was no simple method to switch between various gateway merchants. Prior gateway was very merchant explicit and all usefulness were created utilizing restrictive API, innovation and programming procedures. The JSR 168 and JSR 286 norms have characterized the way portlets can be built up that will help clients in since quite a while ago run.

Advantages of Following JSR Standards

Adhering to these benchmarks will guarantee that there is no merchant lock-in. Any way this can be ensured just when the portlets are created adhering to the guidelines.

What is a Portlet Lifecycle?

Following is the portlet lifecycle:

  • init(): It essentially introduces the portlet.
  • render(): It takes the HTML yield to User Interface. It essentially renders the view in term of JSP/HTML code and shows into the particular portlet.
  • Destroy: This strategy deals with discharging portlet assets.

What Is The Difference Between View Mode And Edit Mode Of Portlets?

The methods of a portlet are normally identified with the kinds of tasks a client can perform on the portlet. A view mode is the place clients are permitted to do peruse just tasks, while in alter mode client can include/update the information in the portlet.

Each portlet mode has a technique which handles it:

doView()

doEdit()

doHelp()

These techniques will contain for the most part our “traffic coordinating” rationale, which is mindful to choose what see the client needs to see.

When the view has been resolved, we will advance on to strategies that really actualize that view.

For standard portlet see modes have two perspectives:

The default sees which shows the rundown of things.

The structure, where clients will, for the most part, do the include and alter activity.

Right now the client can alter the specific thing, which is called alter the method of a portlet.

What Is A Liferay Theme? What Are The Advantages Of Using Them?

Liferay topics are the best approach to modify the look and feel of a Liferay gateway page. The topics are extendable parts that can be conveyed independently on entry and each page on the entryway can pick an alternate topic (whenever required).

Topics are an extremely incredible approach to run various sites from a solitary entry. You can have numerous sites on a solitary Liferay gateway with an entirely unexpected look and feel. This permits you to be remarkable simultaneously spare great deal assets on-site facilitating.

A lot of organizations use Liferay for making numerous novel sites with the assistance of exceptional subjects that can be effectively created.

Topics are additionally accessible from the commercial centers.

For creating individually, we have an alternative of utilizing VM pages(Velocity formats). Liferay gives the element to send the various topics into the entrance the same as portlets war documents. So the number of subjects we can be sent into Liferay entrance and we can additionally choose those topics for UI according to the prerequisite of end client for a various site or association pages.

How to Use LDAP Authentication with Liferay?

LDAP is a lightweight index that gets to the convention that is most normally utilized for verification and approval of clients. LDAP principally comprises clients and user groups of any association with certain search channels like DN sections. In the control board of Liferay, we have an alternative to giving the LDAP settings with the goal that entry can contact the outsider like LDAP and bring the necessary clients and gatherings according to given mappings.

For instance, the Active catalog is an LDAP execution that can store clients. Liferay bolster joining of any LDAP usage through its administrator control board.

We have to give the settings in control board – > entrance settings – > LDAP

This will require LDAP URL, username, secret phrase, clients search channels mappings, bunches search channels mapping and so forth.

What Is Portal-ext properties File? How This Can Be Configured And Used In Liferay?

Liferay Portal accompanies default setups that are put away in the portal.Property record. You can utilize entryway ext.properties record to supersede the qualities in the portal.properties document.

This permits you a spotless method to keep your own duplicate of designs that can be utilized outside the entryway simultaneously you can without much of a stretch redesign the gateway.

What Is Inter-portlet Communication? Why Is It Required To Use JSR Style Inter-portlet Communication?

Now and then we have the necessity where we have to build up a correspondence in the middle of two portlets, for instance, any activity is done in one portlet diverting the end client to other portlets where an outcome is showing according to activity done on the first portlet.

So right now we need to utilize Liferay between portlet correspondence instrument which serve the activity performed by end client in one portlet and give the outcome to the second portlet where the activity result should be shown. We can say that it takes a shot at the striker-catcher instrument.

JSR style entombs portlet correspondence guarantees that your portlets are getting down to business on some other JSR agreeable entryway server. In the event that you utilize a Liferay explicit approach to convey between portlets than you will most likely be unable to send and run the equivalent portlet war on another JSR agreeable gateway (for example Apache Pluto)

What Is A Liferay Portal Instance?

Liferay entrance ships with the one Liferay entry tomcat wrap which is fully operational in any server with certain database settings. We can have more than one Liferay examples running from one database.

Liferay Portal permits you to run more than one entrance example on a solitary server. The Portal Instances page of the control board lets you deal with these cases. Information for every entry occurrence is kept discrete. All entryway information, in any case, is kept in a similar database.

Every entrance example requires its own area name. Liferay will guide clients to the correct entry occasion dependent on this area name. So before you arrange an example, we have to design its space name in our system first. At the point when we are prepared to include an occurrence, click the Instances tab – > Add button.

It will be incited for four fields and a checkbox:

Web ID: A general show is to utilize the space name for this. It’s a client created an ID for the case.

Virtual Host: Put the space name you arranged in your system here. At the point when clients are coordinated to your Liferay server by means of this area name, Liferay will at that point have the option to send them to the best possible entrance case.

Mail Domain: Enter the space name for the mail to have for this case. Liferay will utilize this to send email warnings from the entryway.

Max Users: Enter the greatest quantities of client accounts you might want your gateway occasion to help.

Active: Use this checkbox to pick whether to make a functioning or a dormant entry example.

Presently we have to click Save. Presently explore to the gateway utilizing a new area name. We will see that it seems as though a clean introduction of Liferay. This is our new entry occurrence which would now be able to be ready for action.

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

At the hour of formation of any site, we have to give area names which further accept it as site space name. We have to give the specific space name as required through the control board of Liferay entry. A single example of Liferay Portal underpins the facilitating of at least two space names by means of communities(sites).

At the point when we will go to control board – > Site settings – > we can give the site URL, subtleties like the site(community) portrayal, participation type, dynamic status, and virtual host.

How Can I Configure Liferay To Use Email Address As User Name Instead Of Screen Name?

We can set this from control board – > gateway settings – > Authentication – > LDAP – > How do clients confirm?. Here we can choose whatever we require from an email address, screen name or client ID. At the hour of LDAP confirmation, we have to give the required LDAP mappings which essentially peruses every one of the subtleties identified with clients and user groups from the LDAP catalog and import into Liferay entry. At the hour of this association with the outsider, we have to give the necessary field like validation ought to be by email address or screen name or client ID.

How To Customize The Behavior Of Liferay Default Out Of The Box Portlets (for example Record View, Calendar, Blog, Wiki Etc)?

In the event that we need any customization, identified with JSP and UI then we can execute this utilizing Hooks. Liferay entryway accompanies a pack where all the default worked in portlets exist. On the off chance that any customization required in the center level classes, at that point it tends to be done through EXT, for instance, LDAP clients and client bunches import change. in any case, here in EXT, the restart would be required.

What Is Liferay Service Builder? Is There Any Alternative To Use Service Builder? What Are The Advantages And Disadvantages Of Using It?

Liferay administration manufacturer is fundamentally used to make the administration layers for any business rationale execution. From the engineering perspective, it is very helpful as it used to make all the administration layers programmed. Assume we need to build up a portlet, for this, we have to compose all the necessary execution classes, utility classes, and other required classes. Administration manufacturer is utilized to make every one of these classes for the engineer, where they can include their business rationale further and process the information and render the yield to see according to the prerequisite.

According to the favorable position, this administration manufacturer will make the entire structure of the administration layers for designers essentially. It truly causes them to compose the code and their rationale in administration developer made model executions and administration usage classes. These classes accompany typical CRUD (make, update and delete)operations. For a designer, no compelling reason to include anything extra as entire assistance and utility layers are as of now got made by administration developer. It truly accelerates the development procedure.

Administration developer requires service.xml which is having a portion of the necessary sections. Every one of the sections is essentially called substance, which is having its essential key fields with some other required fields. On the off chance that we need to execute request and discoverer technique, we can actualize it by utilizing this service.xml.

Every substance makes a table into Liferay arranged database with the given segment names and their sorts. We can make service.xml related neighborhood administration and remote-administration by setting them esteem as “genuine”. At the point when we would run this fabricate administration like underneath, this would make all the administration layers(implementation, utility and so on.) where the engineer can compose their necessary business rationale further. Formation of all the administration classes would be finished by the build.xml, we have to manufacture administrations utilizing this XML document into Ant perspective on IDE.

How To Set The Display Category Of A Custom Built Liferay Portlet?

We can set the presentation class like underneath referenced Liferay-display.xml. Assume we have created one portlet where the portlet ID we have given. We have to enter the exclusively incorporated Liferay portlet with the certain classes like name “category.cms”, “category.collaboration” and so on. By doing this exclusively fabricated Liferay portlet would come in the required class by tapping the include application highlight of Liferay as there would be a significant number of portlets under various classifications. So beneath the label, we have to enter for the passage of a portlet into a certain class.

<display>

<category name=”category.cms”>

<portlet id=”20″/>

</category>

</display>

How To Support Internationalization (i18n) On Liferay Portlets? How Do You Support Multiple Languages Without Writing Java Code In Liferay?

We can bolster internationalization (i18n) on Liferay portlets and all through this entire Liferay entrance. We have to give whatever language we have to help into Liferay gateway. This is mostly perused the area’s number and give the accessible language like en_US(English), SG(Singapore), zh_CN(simple Chinese), zh_TW(traditional Chinese), ja_JP(Japanese).

Similarly to offer help of various dialects without composing java code in Liferay, we can utilize Locales this all through the entrance, portlet, snares, and topics. This section we can give into the same gateway ext.properties which Liferay entryway would peruse and give all the interpretation appropriately.

locales=en_US,zh_CN,zh_TW,ja_JP,ko_KR

On the off chance that we are keeping in touch with some custom messages in out code, at that point we have to give the beneath property records additionally according to the called language and utilizing of Locales would change over it appropriately. We can utilize LocaleUtil in our code which will change over the specific message given in language records.

For instance, we need the asset category title in multi dialects then we have to utilize this asset category.getTitle(locale). So here whatever district we have referenced before would be in real life and pick the given title name from certain area related language. property document.

Language_en_US.properties

Language_zh_CN.properties

Language_zh_TW.properties

What Are The Advantages Of Using Tomcat Bundle Of Liferay Against Other App Servers (for example JBoss, Glassfish Or Others)?

It is conceivable to utilize Liferay
with Liferay IDE with other then tomcat server packages, however, there are a
few highlights or advantages that won’t be accessible:

Local shroud server connector that
supports propelling and troubleshooting.

Organization by means of include/expel
modules wizard would not be accessible.

Auto redeployment dependent on changes
to extend assets.

Which One Is Best To Start In A Clean Setup?

Liferay pack with the tomcat
application server is the best one to begin in a spotless arrangement.

How Do You Perform Junit Tests On Your Portlet?

Junit tests are there to check the code for the most part by giving the estimation of any technique input parameter, how the strategy would work and gives the qualities.

open class MyEmployeeTest {

ClassPathXmlApplicationContext setting = new ClassPathXmlApplicationContext(

“ApplicationContext-service.xml”);

open void testMyMethod() {

UserService employeeService = (UserService) context.getBean(“userService”);

/Provide the client Id as 101581

Client = storeService.findUserByUserId(1234);

/get the representative

Set representative = user.getEmployeesForUserId();

System.out.println(“Employee Name : “+employee.getName());

}

}

How Will You Configure A Portlet That Can Be Added Multiple Times On A Portal Page?

One property is there in portlet.xml which is as per the following:

<instanceable>true</instanceable>

by utilizing the worth genuine and bogus we can design a porter that can be included on various occasions an entrance page.

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

We can redo the Liferay Search highlight, relies on our prerequisite by beneath two different ways.

Snare: If changes are required according to the view side like we have to change the query output structure see then we can compose the Hook to alter it.

EXT: If changes are required according to deeply usefulness like we have to change the inquiry question term, we can actualize EXT.

How Can You Integrate Liferay With An External Content Management System (for example In the open air) ?

Liferay goes client qualifications through CMIS to the in the open air so as to interface. To empower this in Liferay, we have to enter following underneath property in entrance ext.properties which will permit Liferay to store a secret key in session.

session.store.password=true

Likewise, one more thing we have to think about is that Liferay passes signed in client’s qualifications to CMIS Repository (which is in the open air here) as depicted previously. This means userid/secret word in Liferay must match userid/secret phrase in Alfresco. In the open air as a matter, of course, utilizes a login id (which is like screen-name in Liferay) to validate the client. So we have to make Liferay likewise confirm utilizing screen name by making the following section into entry ext.properties.

company.security.auth.type=screenName

So we have to begin Liferay. Login as director and go to the control board. we have to go to Document and Media which will raise a screen where we have to tap on Add – > New Repository. this will bring one screen where we fundamentally give association subtleties to interface with Alfresco like beneath.

Name: Give any name you need to
provide for your store to see in Liferay. For instance, I will give Alfresco
vault’s name.

Depiction: A concise portrayal of it.

Vault Type: We can associate either utilizing AtomPub or utilizing web administrations.

AtomPub URL: This will be the CMIS store URL where our in the open air is running. For our situation, it’s eventual http://localhost:8080/in the open air/administration/programming interface/cmis (Note: if there should be an occurrence of Alfresco 4.0, it will be http://host:port/in the open air/cmisatom).

Archive ID: It is essentially used to associate with a particular vault in case we have numerous storehouses accessible. In the event that we don’t enter a repositoryId, at that point it will simply search for the principal store utilizing the given parameters and set it to that.

How To Setup A Liferay Cluster From Scratch?

We have to arrange underneath properties in our entrance ext.properties(this is for one example spoke to by 1p, same properties we have to include for the second occasion additionally spoke to by 2p) and some necessary IP addresses.

#cluster designs – these settings are for group

net.sf.ehcache.configurationResourceName=/myehcache/sleep clustered.xml

dl.store.file.system.root.dir=/webapps/document_library_cluster

#other settings for a bunch

liferay.home=/webapps/liferay-1p/liferay-gateway 6.1.10-ee-ga1/

lucene.dir=/webapps/liferay-1p/liferay-gateway 6.1.10-ee-ga1/information/lucene

cluster.link.enabled=true

lucene.replicate.write=true

multicast.group.address[“cluster-interface control”]=239.255.4.1

February 2, 2020
GoLogica Technologies Private Limited  © 2019. All rights reserved.