Tuesday, October 17, 2017

Liferay DXP/7 BLADE CLI Installation

BLADE CLI is Liferay DXP/7 Application Development Tool to create and deploy Liferay 7 Modules.

As we know that Liferay 7 introduces modularity to develop Liferay applications and BLADE is providing command line interface to create and deploy the application modules into Liferay Portal Module Framework.

BLADE have set of predefined commands to create different types of module to customize or create new features in Liferay Portal Environment.

It is really a different king of experience to develop Liferay OSGi bundles than regular web application development.

Please follow the below articles to know more about BLADE CLI and its commands.


Liferay have provided Liferay Workspace Installer to install BLADE CLI in our local machines. Installer is available for all kinds of OS environments like Windows, Linux and Mac. BLADE CLI is available as part of Liferay Workspace Installer. Liferay Workspace is manage the Liferay Modules and It configuration. We will more details of Liferay Workspace in the future articles.

Note:

Before Liferay Workspace Installer BLADE CLI used the Java Package Manager (JPM) to install BLADE CLI and we have other option as well that is directly download BLADE CLI java JAR file then simply execute using Java JAR command. Liferay Workspace Installer is way to install BLADE CLI and it is recommended.

Java Package Manager(JPM)


Step: 1

Go to following link to download Liferay Workspace Installer.


We can also go to Liferay IDE Download page and Select Liferay Workspace Installer in the Others Download dropdown.


Based on your Operating System download appropriate Installer and run in your machine.
The following screen shows you the Liferay Workspace Installer Download page.




Step: 2

In this example, I am showing for the Windows Operating System. Once you downloaded the Liferay Workspace Installer, double click in file then it open dialog. Click on Next


Step: 3

Here we have option to select directory for initialize the Liferay Workspace. However, here we would like to install only BLDE CLI so just select “Don’t Install Liferay Workspace Directory” then click on next.


Note:

Sometimes you can see the option to select Liferay portal Server. Either we can chose Liferay 7 Community Server bundle Or Liferay DXP server bundle.Select “Liferay Community Server Bundle” as we are using Liferay 7 Community Edition and it is free to use. If you already have Liferay DXP license then select Liferay DXP bundle.

Step: 4

Once you click on Next it will show dialog that “Setup is now to being install” then click on next.



Step: 5

Finally it installed all required thing and it shows finish dialog then click on finish. Now BLADE CLI installation is completed.



Step: 6

Once installation is completed then open Windows Command Prompt and type “blade” then you can list of commands. If you see all these commands, it means BLADE CLI successfully installed otherwise you can see 'blade' is not recognized as an internal or external command.



Now you can play with BLADE CLI commands. You can create and deploy the Liferay DXP/7 modules. Here you can find all available commands.


Note:

In this installation, we only installed BLADE CLI. It is recommended to initializing the Liferay Workspace through installer option. Liferay Workspace has provided the way to manage modules and deploy into different types of run time environment like DEV, UAT and PROD.

BLADE CLI also have command “blade init” to initialize the Liferay Workspace. We can create multiple Liferay Workspace based on our needs.

The following are the list of BLADE CLI commands.


blade convert
blade create
blade deploy
blade gw
blade help.
blade init
blade install
blade open
blade samples
blade server
blade sh
blade update.
blade version



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

Tuesday, October 10, 2017

OSGi Whiteboard Design Pattern

Design patterns plays important role in the Software Development. It will define the reusable implementation to the commonly occurred problems. Usually in software development, we can see same problem repeatedly coming in the applications. To address these common problems, expert people came up with solution called design patterns. Design patterns define the solution so that we can implement solution to address the the common problems.

Follow Liferay DXP/7 Tutorial to get more information.

Whiteboard Design pattern is commonly and wide used pattern in OSGi implementations. OSGi Service Registry implemented on White Board Design Patter.

Liferay 7 / DXP have used OSGi Declarative Services (DS) to implements Liferay application modules. It is good to know White Board design pattern and Service Registry. It will give more idea about component services and its working.

When we work with Declarative Service Framework, bundle have several components and these components depends on other components.

Usually component have services and these services shared among other components. Service Registry manage the services registration information and its dependency service information. It will manage services and its references information.

To manage these things OSGi have Service Registry that is based on Whiteboard Design Pattern.

White Board Design pattern will provide the mechanism to register the different component services and the dependency component can easily find it reference service based on their needs. Whenever new service implementation register with Service Registry then dependency will get to know the information so that it can find appropriate dependency service.

Assume Component C1 have service S1 and perform certain task, it needed other service it means service S1 depends on other component services.

Assume S1 service can have several option that can perform task, it means several component provides their services to S1 and S1 can choose any of that service to full fill the requirement. Now S1 have options like C2 component Service S2 and C3 Components Service S3.


To provide these dependency service information or reference service information we need other component so that S1 service can identify its dependent service. To provide this king information we need other component called Whiteboard or Service Registry.

When the component is activated, all the services are register with Whiteboard / Service Registry.


Now C1 component Service S1 can identify, it’s required dependent service from the Whitboard / Service Registry to complete or perform the task.

Here S1 have several option, it can choose any of the service based on its requirement. S1 will use some additional properties to identify the required service at the point of the time. Such a way whiteboard design pattern have used in OSGi to implement Service Registry.



Service Registry is key component in the OSGi implementation and OSGi Declarative Service have used Service Registry to provide dependency mechanism among the component services.  OSGi Declarative Service is core framework to develop OSGi components and its services.

Author

Recent Posts

Recent Posts Widget

Popular Posts