OSGi Modules
1. API
Section titled “1. API”Command: blade create -t api [name]
Purpose: Creates a standalone API module to expose interfaces or utilities for other modules.
Use Case: Define shared interfaces, DTOs, or utilities consumed by multiple modules (e.g., OSGi services).
2. Control Menu Entry
Section titled “2. Control Menu Entry”Command: blade create -t control-menu-entry [name]
Purpose: Adds custom entries to Liferay’s Control Menu (top-right gear icon).
Use Case: Add shortcuts (e.g., “Admin Tools”) to the Control Menu for specific roles.
3. Form Field
Section titled “3. Form Field”Command: blade create -t form-field [name]
Purpose: Extends Liferay Forms with custom field types.
Use Case: Create reusable form fields (e.g., a color picker or geo-location input).
4. Fragment
Section titled “4. Fragment”Command: blade create -t fragment [name]
Purpose: Creates a Liferay Fragment project for reusable UI components.
Use Case: Build drag-and-drop content fragments (e.g., banners, FAQs) for Page Builder.
5. JS Theme
Section titled “5. JS Theme”Command: blade create -t js-theme [name]
Purpose: Generates a JavaScript-based theme using Liferay’s Theme Builder.
Use Case: Modern theme development with npm/webpack (replaces traditional Freemarker themes).
6. JS Widget
Section titled “6. JS Widget”Command: blade create -t js-widget [name]
Purpose: Creates a JavaScript portlet (Widget) using React/Vue/Angular.
Use Case: Build lightweight, framework-based portlets with liferay-portal.js.
7. Layout Template
Section titled “7. Layout Template”Command: blade create -t layout-template [name]
Purpose: Defines custom page layouts (e.g., 2-column, grid-based).
Use Case: Design reusable layouts for pages in Liferay Sites.
8. Modules Ext
Section titled “8. Modules Ext”Command: blade create -t modules-ext [name]
Purpose: Extends or overrides Liferay core modules (OSGi components).
Use Case: Modify core behavior (e.g., override JournalArticleLocalService).
9. MVC Portlet
Section titled “9. MVC Portlet”Command: blade create -t mvc-portlet [name]
Purpose: Generates a traditional JSP-based portlet (Liferay MVC).
Use Case: Legacy portlet development with JSPs and Portlet API.
10. NPM Angular Portlet
Section titled “10. NPM Angular Portlet”Command: blade create -t npm-angular-portlet [name]
Purpose: Scaffolds an Angular-based portlet using Liferay’s JS Toolkit.
Use Case: Build Angular apps integrated into Liferay (e.g., admin UIs).
11. NPM React Portlet
Section titled “11. NPM React Portlet”Command: blade create -t npm-react-portlet [name]
Purpose: Creates a React-based portlet with Liferay’s JS Toolkit.
Use Case: Modern React apps embedded in Liferay (most popular JS approach).
12. NPM VueJS Portlet
Section titled “12. NPM VueJS Portlet”Command: blade create -t npm-vuejs-portlet [name]
Purpose: Scaffolds a Vue.js portlet using Liferay’s JS Toolkit.
Use Case: Vue.js applications within Liferay.
13. Panel App
Section titled “13. Panel App”Command: blade create -t panel-app [name]
Purpose: Adds custom entries to Liferay’s Product Menu (left sidebar).
Use Case: Admin panels (e.g., “Analytics Dashboard”) for specific roles.
14. Portlet Configuration Icon
Section titled “14. Portlet Configuration Icon”Command: blade create -t portlet-configuration-icon [name]
Purpose: Adds icons to a portlet’s configuration menu (wrench icon).
Use Case: Custom actions (e.g., “Export Data”) in portlet configuration.
15. Portlet Provider
Section titled “15. Portlet Provider”Command: blade create -t portlet-provider [name]
Purpose: Dynamically contributes portlets to Liferay’s Add Panel.
Use Case: Show/hide portlets based on context (e.g., permissions).
16. Portlet Toolbar Contributor
Section titled “16. Portlet Toolbar Contributor”Command: blade create -t portlet-toolbar-contributor [name]
Purpose: Adds buttons to a portlet’s toolbar (e.g., “Publish”).
Use Case: Extend default portlet actions (e.g., custom “Share” button).
17. REST
Section titled “17. REST”Command: blade create -t rest [name]
Purpose: Creates a REST service using JAX-RS.
Use Case: Expose Liferay data via REST APIs (e.g., /api/users).
18. REST Builder
Section titled “18. REST Builder”Command: blade create -t rest-builder [name]
Purpose: Generates REST APIs from OpenAPI (Swagger) YAML files.
Use Case: Design-first API development with automatic scaffolding.
19. Service
Section titled “19. Service”Command: blade create -t service [name]
Purpose: Creates an OSGi service (declarative or programmatic).
Use Case: Business logic encapsulation (e.g., UserNotificationService).
20. Service Builder
Section titled “20. Service Builder”Command: blade create -t service-builder [name]
Purpose: Scaffolds a Service Builder project for database operations.
Use Case: CRUD apps with generated persistence layers (e.g., *LocalService).
21. Service Wrapper
Section titled “21. Service Wrapper”Command: blade create -t service-wrapper [name]
Purpose: Overrides/extends existing Liferay OSGi services.
Use Case: Modify core services (e.g., logging or validation hooks).
22. Simulation Panel Entry
Section titled “22. Simulation Panel Entry”Command: blade create -t simulation-panel-entry [name]
Purpose: Adds entries to Liferay’s Device Simulation panel.
Use Case: Custom device profiles (e.g., “Kiosk Mode”).
23. Spring MVC Portlet
Section titled “23. Spring MVC Portlet”Command: blade create -t spring-mvc-portlet [name]
Purpose: Generates a Spring MVC-based portlet.
Use Case: Portlets using Spring Framework (alternative to Liferay MVC).
24. Template Context Contributor
Section titled “24. Template Context Contributor”Command: blade create -t template-context-contributor [name]
Purpose: Injects variables into FreeMarker/Soy templates.
Use Case: Add dynamic data to themes or fragments (e.g., userTimeZone).
25. Theme
Section titled “25. Theme”Command: blade create -t theme [name]
Purpose: Creates a traditional Freemarker-based theme.
Use Case: Custom site styling (legacy alternative to JS themes).
26. Theme Contributor
Section titled “26. Theme Contributor”Command: blade create -t theme-contributor [name]
Purpose: Adds resources (CSS/JS) to all themes.
Use Case: Global styling/scripts (e.g., corporate fonts).
Key Notes:
Section titled “Key Notes:”- Modern vs. Legacy: Prefer OSGi (e.g.,
mvc-portlet) over WAR-based modules. - JavaScript: Use
npm-react-portletorjs-widgetfor modern UIs. - Extensibility: Modules like
service-wrapperorcontrol-menu-entryenable customization.