Liferay 7.0 and Blade Tools
With Liferay 7.0 coming out in a very few short months, developers will have to spend time familiarizing themselves with the new features and frameworks that come along with it. One such change is the OSGi framework and with it the development of components and modules. Gone are the days of creating specific plugin types such as portlets and hooks through the Liferay Developer Studio. Developers now only have to create a module that contains components.
How do we Create Portlets?
As stated before, Liferay 7.0 will use modules and components as the ONLY plugin type. While you still can deploy old plugin type WAR files to 7.0, you will not get the benefits of an OSGi module plugin such as modularity. To better understand Liferay 7.0, lets give a breif description of modules and components.
Module Key Points
- Modules are the basic plugin type in Liferay ( must contain Java classes and a valid manifest)
- A module contains any combination of code and resources
- Modules are identified by a unique name and version number
- Multipe versions of the same module can be deployed concurrently
A module is a self-contained unit that can be deployed in Liferay. A module contains Java classes, Resources (Such as JSPs and Properies files), and is packaged as a JAR file. That's right, once it is packaged as a JAR file, it is ready for deployment, no more WAR files.
All modules must also have a unique identifire, which is determined by the module name + module version.
Components are objects that provide a feature or functionality:
- Shell command
All components are contained inside modules and modules can contain one or many components.
In Lifeay 7.0, if we were to create a Portlet with a Service, we could contain both components inside of a single module
Or we could put each component inside of its own module
You might be wondering, if we no longer create specific plugin types, then how do we build and deploy hooks, portlets, or ext's to liferay? This will all be handled now with Blade Tools. Blade Tools is the easiest way for Liferay Developers to create modules. While Liferay will still support the Plugins SDK, Blade Tools will let developers create Liferay 7.0 projects with any IDE.
Blade tools is a repository that contains the templates required to create modules for ServiceBuilders, Hooks (Such as Index Post Processors and filters), blueprints for Portlet development as well as Portlet Configurations and much more. These templates can be found at https://github.com/rotty3000/blade and here is the Introduction to Blade Tools.
As of now, there is no connection between the Liferay Plugin SDK and these templates. The only way to get them is to pull them from the repository and Liferay has mentioned that they would like to make these templates more accessable in the future. In the next blog, we will be showing how one can create a simple portlet in Liferay 7.0.