Showing posts with label Liferay7 Blade. Show all posts
Showing posts with label Liferay7 Blade. Show all posts
Monday, 8 August 2016
Monday, 1 August 2016
23:49
Creating portlet in Liferay7 using blade - OSGI
j\
Create Portlet in Liferay7, Deploy Portlet in Liferay7, Liferay 7, Liferay Advanced Search, Liferay Eclipse, Liferay7, Liferay7 Blade, Liferay7 Eclipse SDK
5 comments
How to Create and Deploy a new Portlet using Blade
To create modules using blade is quite simple. It is as good as creating the portlets using the command line tool of liferay SDK. To create the modules using the Blade you need to first install Blade. For knowing how to install blade please refer to my previous blog post on blade-installation-for-liferay7.
Once you had installed blade on your machine, you need to navigate to the directory where you need to create the portlet.
To create a module/portlet using blade, following the minimal command
blade create [OPTIONS] <NAME>
blade create My-Sample-Portlet
The above command will create a new portlet with default configurations and a controller with the name MySamplePortlet.
blade create -t mvcportlet -p com.liferay.docs.mvcportlet.portlet -c MyMvcPortlet my-mvc-portlet-project
The above command will create a new project in the current with the name my-mvc-portlet-project. Because we are using the template mvcportlet this project will be created as a MVCPortlet Project, and the module will be having the Controller which will extend the MVCPortlet.java. The controller class will be in the package com.liferay.docs.mvcportlet.portlet and the name of the controller will be MyMvcPortlet.
Once the above command is punched in cmd, the below screen will come up. This will initially download the Gradel distribution as the build process will be using gradle.
Once completed the below screen will come up with a message that Create the project my-mvc-portlet-project using the mvcportlet template in <DIRECTORY>
Once created we can import the above project into eclipse using the import of eclipse. Click on Import->Liferay Module Projects
Click on the browse and provide the location of project.
Once imported the project will come up in the below shown structure. This verifies that the project has been created successfully.
Blade deploy
Now the next step is how to deploy the module/portlet into liferay. To do that it is easy, we just need to write the blade deploy command. This will search for the running instance of liferay on that machineand will deploy this module into the same.
blade deploy
blade deploy <PORT> - Will deploy in a liferay instance running on an specific port.
Below the image that shows that the Build is successfull and Portlet/module has been Started.
We can also see in the eclipse Console as shown below that the portlet/module is available for use. Here STARTED means available for use.
How to create portlet Using Blade in Liferay7
How to deploy portlet in Liferay7
Saturday, 30 July 2016
10:47
Blade installation for Liferay7
j\
Liferay 7, Liferay Eclipse, Liferay Eclipse SDK, Liferay7, Liferay7 Blade, liferay7 Blade Installation, Liferay7 Eclipse, Liferay7 Eclipse SDK, Liferay7 installation
5 comments
BLADE Installation for Liferay7
Blade is used to create the OSGI modules for liferay. Though liferay has provided the module support by the plugin SDK, but the modules created by blade can be used with any IDE or any other development environment. Blade is a command line tool that is used to create the modules for liferay 7.
The best and easiest way to install the blade is using the JAR file. This JAR can be installed using the JPM (JAVA PACKAGE MANAGER)
How to install Blade for Liferay7
- Now run the following command in command prompt c:\Downloads>java -jar biz.aQute.jpm.run.jar -g init
- It will get install the JPM in C:\JPM4J
- Now run this command. C:\JPM4J\bin> jpm platform path -a . This will add the jpm command in ENV-User Variable so that this can be used in commad prompt.
- Now add the C:\JPM4J\bin in system variable PATH
- Run the following command from C:\JPM4J\bin, so that the Blade can be installed, C:\JPM4J\bin>jpm install -f https://liferay-test-01.ci.cloudbees.com/job/liferay-blade-cli/lastSuccessfulBuild/artifact/com.liferay.blade.cli/generated/com.liferay.blade.cli.jar
- Once the Blade is installed successfully you can verify the same by running the blade version command.
Blade provides a set of command line tools that can be used to create, update, deploy, start etc a module.
- version-- Display Blade version.
- create-- Creates a new Liferay module project from available templates.
- deploy-- Builds and deploy the module for Liferay framework. It detects the current running liferay7 instance and deploy the module in the same.
- gw-- Executes the Gradle commands using the Gradle Wrapper, if found, else it would not be executed.
- init-- Initializes a new Liferay Workspace.
- install-- Installs a bundle into Liferay’s module framework.
- help-- Gives help on a specific command.
- server-- Starts or stops server defined by your Liferay project.
- open-- Opens or imports a file or project in Liferay IDE.
- migrateTheme-- Migrates a Plugins SDK theme to a new workspace theme project, this is useful when you are migrating the themes.
- samples-- Will create a sample project of Blade.
- update-- Will update the Blade to current version of Blade
Subscribe to:
Comments (Atom)