Showing posts with label Liferay Bundle. Show all posts
Showing posts with label Liferay Bundle. Show all posts

Saturday, October 21, 2017

Differences between Liferay Module and Liferay Plugin

The objective of this article is providing the major differences between Liferay Module and Liferay Plugin.

Before understand difference we must have basic idea of OSGi and Liferay 7 Fundamentals.
Follow Liferay DXP/7 Tutorial to get more information.




Liferay Modules
Liferay Plugins

Introduced in Liferay 7

Introduced since Liferay Started.
From Liferay 4.x to Liferay 7/DXP


Liferay Modules are based on OSGi framework

Liferay Plugins based traditional Java web application framework. Like we use more J2EE web application Frameworks.


Liferay Module will run in OSGi Run Time Environment.


Liferay Plugins run in Traditional Application Servers such as Tomcat, JBoss , Glassfish


Liferay Module we can call it as OSGi bundles and packaged as JAR file.


Liferay Plugins are web applications and packaged as WAR files.

Liferay Module provides the dynamic component injection with help OSGi so that we can make most of the features as independent components and can easily inject into the other components when it required.


Liferay plugins are like independent web applications we cannot share anything between two web applications. It is more coupled. If we want share some classes we have to put these jar files in some global class loaders then only other web application can use that classes.


We can avoid all the problems of class loader issues.


We can see more class loader issues.

No Class Definition Found, Class Not Found Run time errors completely vanished in the runtime.


We frequently experience No Class Definition Found, Class Not Found Run time errors in the runtime.


Liferay Modules have different types like Portlet Modules, Hook Modules.
Themes and Layouts partially support modularity.


Liferay plugins have different types such as portlets, themes, ext, layout and hooks.

Liferay Modules developed based on OSGi Framework and it used the several framework to develop modules such as Declarative Services (DS), Apache Blueprint and OSGi API.


Liferay Plugins uses the J2EE web application frameworks such as Struts, Spring, Liferay MVC, JSF and other web application frameworks.


Liferay Modules followed 3-tier architecture application development such as Persistence, Service and Presentation layered architecture.


Liferay Plugins uses the same 3-tier architecture application development such as Persistence, Service and Presentation layers architecture.


Usually Liferay Module development we separated each Layer as Independent Modules
Persistence Tier Module
Service Tier Module
Web Tier Module


Liferay Plugins Development all 3 tiers packaged as single WAR file.

Liferay Modules support the dynamic deployment feature and we can stop and start module without un-deploy the module.


Liferay Plugins we must un-deploy the war file from server to remove features.


Liferay Modules uses the Apache Gogo shell Command Line Interface (CLI) to manage the Liferay Modules in the OSGi run time environment. Like stop, start, activate and deactivate.

Liferay Portal Admin screen also have to manage these Liferay modules.


Liferay plugins does not have any Command Line Interface to un-deploy the bundles and we have to removed plugin war files from servers.

Some Enterprise Application Servers have administrative feature to do these things.

Liferay Portal Admin screen also have option to manage these Liferay plugins.



Liferay modules are available in Liferay Portal Server Bundle inside OSGI directory once the module is deployed.


All Liferay Plugins are available in Liferay Portal Server webapps directory.

Liferay Module have important configuration file METAINF which is like module deployment configuration file have more information used by OSGi run time environment.


Liferay Plugins have web.xml file and used by Portlet/Servlet containers.


Liferay portlet module all xml configuration files information turn into Declarative Services (DS) Component properties. Like portlet.xml, liferay-portlet.xml and liferay-display.xml files tags and values.



Liferay Plugins used the XML configuration such as portlet.xml, liferay-portlet.xml and liferay-display.xml

If the Liferay Application have more features then we divided into multiple independent modules and these modules can communicate each other very easy in OSGi environment.


Modularity is not that easy in Liferay Plugins development so we have to keep all the files in single WAR file.

Liferay Module introduced new tool called BLADE CLI to develop Liferay Modules.


Liferay Plugins have Plugins SDK to develop Liferay Applications.


Liferay Modules have several tools such as Liferay IDE, Liferay Studio, BLADE CLI


Liferay Plugins have tools such as Liferay IDE, Liferay Studio.


Liferay Module support GRADLE and MAVEN build environment.


Liferay Plugins support ANT and MAVEN build environment.


Liferay Modules used the Liferay Workspace concept to manage the application and its configuration across the platforms.


Liferay Plugins uses the Plugins SDK to develop and manage the plugins.


Liferay Modules used the OSGi API, Declarative Services and Apache Blueprint framework. So we have limited choice to use popular we application framework like Spring. Liferay still not fully supporting Spring Modules, it means we have to use the WAR deployment.



We can use any J2EE popular web application frameworks such as Spring, Struts and JSF.

Liferay Modules provides the Micro services Architecture based applications.


To bring Micro services Architecture we have to depend on other frameworks such as Spring Micro Services.


Liferay Modules have dynamic component development feature so we can easily turn on and off the feature at any point of time with minimal effort.


Liferay Plugins not like Dynamic Component Development so bunch of feature in one plugin application. If we remove one plugin, it can turn off many features.


Liferay Modules can provide easy way deployment process and we can move easily from one environment to other with minimal effort. Liferay Workspace provided this capability.



Liferay Plugin Deployment process and moving from one environment to other tedious. We do not have any special mechanism like Liferay Workspace.

Liferay Modules uses the Bndtools to develop and build the modules. We have BLADE CLI, Liferay IDE, GRADLE and MAVEN are used the Bndtools internally.



Liferay Plugins follow the J2EE web application development so MAVEN Liferay Plugin or Liferay IDE handle the Development and Deployment.



Author

Saturday, October 14, 2017

Liferay DXP/7 BLADE CLI Introduction and Its Commands

Liferay DXP/7 have exciting features and one of the major architectural change is to support OSGi modularity framework.

Follow the below article to know more information about Liferay DXP/7 Modularity introduction.



Now Liferay DXP/7 Application development through OSGi bundles and it has followed the OSGi specification.

Follow Liferay DXP/7 Tutorial to get more information.

Liferay DXP/7 introduced module development tool called BLADE CLI. BLADE is a Command Line Interface have set of commands to create Liferay DXP/7 modules and its deployment into the Liferay OSGi run time environment.

Bootstrapped Liferay Advanced Development Environment shortly we call it as BLDAE. It is very easy to install and very flexible to use and create Liferay Modules.

BLADE have implemented based on Gradle build tool. Behind the scene, BLADE uses the Bndtools framework to create and deploy OSGi bundles.  Finally, we can say BLADE is based on the Gradle flavor Bndtools.


BLADE have provided the human readable commands to create Liferay modules. BLADE consist of several Module Templates to create Liferay 7 Application modules like portlet module, hook module and theme module. It also have commands to access sample projects and deploy into OSGi runtime.

 BLADE tools have commands to create Liferay 7 module and we can use any Development IDE to edit the code then deploy through BLADE CLI commands. Installation of BLADE tool and Module creation process will be explained in the future articles. Once we installed the BLADE, we can issue the predefined commands to create and deploy the modules.


The following are the set of BLADE CLI commands its description.

deploy:
Deploy commands will build and deploy the modules into Liferay OSGi environment. Usually deploy commands works similar to previous liferay MAVEN deploy but it’s in OSGi way. It will compile, build and package the module and place the module jar file into Liferay Portal deploy directory. Once the module jar file place in deploy directory then Liferay hot deploy process will handle subsequent steps to make the available of module to end user.

convert:
Convert previous Plugins SDK plugins to OSGi modules. Usually Liferay 7 have concept called Liferay Workspace.  It convert Plugins project to Workspace project based on Gradle.
As we know that Liferay DXP/7 based on OSGi and all Liferay 7 application, make it as modules. However, we already have Plugin Environment to develop Liferay previous versions applications so convert toll make it plugins to modules.

create:
Create command used to create new Liferay Application Module based on available module templates. BLADE has provided several module templates to create different types such as portlet, hook and them modules. These commands have several option so choose appropriate template.

gw:
gw is Gradle Wrapper on top of Gradle build to make work easier for developer to run Gradle build commands.

init:
Liferay has introduced Liferay Workspace to manage the Liferay modules and it’s easy to shift one place to other place. Init command will initialize the Liferay Workspace it means it will create directory structure to accommodate modules, related properties and liferay portal server instance.  All will be created once we use init command.

install:
This command install a liferay bundle into Liferay OSGi runtime environment. Bundle is packaged OSGi jar file, which run in OSGi runtime.

help:
Help commands will shows help information like list of available commands and its options.

open:
Open command open or import file in Liferay IDE and open project as well.

samples:
Samples project generated sample projects in Liferay Workspace. Liferay have provided sample project for the developers to understand more about Liferay module development.
Sample command will access those samples from repository and downloaded into local Liferay Workspace. We can edit, deploy and test the sample modules.

server:
This command start Liferay Portal Server Instance, which reside in Liferay Workspace bundle directory.

sh:
Sh command connect to Apache Gogo shell console to manage OSGi bundles which are available in OSGi runtime.


update:
Update command will update to latest versions when new version is available.

version:
It will display BLADE CLI version information.

Author

Recent Posts

Recent Posts Widget

Popular Posts