Skip to content

What is Liferay

Liferay 7.4 is the latest DXP (Digital Experience Platform) version from Liferay, built on OSGi (Open Service Gateway Initiative) architecture. As a Liferay developer, you’ll work with a modular, enterprise-grade platform for building digital experiences, portals, intranets, and custom web applications.

graph TD
    A[Liferay 7.4 Architecture] --> B[OSGi Container]
    A --> C[Modularity]
    A --> D[Microservices]
    A --> E[APIs]
    B --> F[Bundles]
    C --> G[Modules]
    D --> H[Service Builder]
    E --> I[REST/SOAP/GraphQL]

Liferay 7.4 uses OSGi for:

  • Dynamic module system
  • Service registry
  • Lifecycle management
  • Dependency management

A standard Liferay workspace contains:

liferay-workspace/
├── configs/
├── gradle/
├── modules/
│ ├── apps/
│ ├── core/
│ └── themes/
├── themes/
└── build.gradle

The building blocks of Liferay applications:

classDiagram
    class Module {
        +bnd.bnd
        +build.gradle
        +src/main/java
        +src/main/resources
    }
    Module --> ServiceComponent : contains
    Module --> API : exposes

Liferay’s ORM and service generation tool:

  1. Define entities in service.xml
  2. Run gradle buildService
  3. Service Builder generates:
    • Model classes
    • Persistence layer
    • Service layers
    • API interfaces

Traditional portlet development approach:

@Component(
immediate = true,
property = {
"javax.portlet.name=" + MyPortletKeys.MY_PORTLET,
"mvc.command.name=/my/action"
},
service = MVCActionCommand.class
)
public class MyActionCommand implements MVCActionCommand {
// Your action code
}

Liferay 7.4 supports multiple approaches:

  • Traditional: JSP, FreeMarker
  • Modern: React, Angular, Vue.js via Liferay JS Toolkit
  • Web Components: Using Clay UI and Metal.js

Liferay 7.4 provides extensive headless delivery:

sequenceDiagram
    Client->>+Liferay: GET /o/api/resource
    Liferay->>+Service: Process request
    Service-->>-Liferay: Return data
    Liferay-->>-Client: JSON/XML response

Customizable workflow engine:

  • Kaleo workflow engine
  • Create custom workflow handlers
  • Integrate with external systems
  • Elasticsearch integration
  • Custom document fields
  • Search facets and filters
  1. Install Liferay Workspace
  2. Configure Gradle properties
  3. Set up target platform
graph LR
    A[Create Module] --> B[Implement Logic]
    B --> C[Build/Deploy]
    C --> D[Test]
    D --> E[Debug]
    E --> F[Iterate]
  • Local development (Docker/Standalone)
  • On-premise servers
  • Cloud (Liferay DXP Cloud)
  • Extend core services using OSGi components
  • Override JSPs with module fragments
  • Create custom field types
  • Develop custom asset renderers
  • Cluster-aware coding
  • Caching strategies
  • Database optimization
  • Frontend performance
  • Implement permission checking
  • Secure service endpoints
  • Validate all inputs
  • Follow OWASP guidelines
  • Eclipse-based IDE
  • Code templates
  • Debugging tools
Terminal window
blade create -t mvc-portlet -p com.example.my.portlet my-portlet-project

For runtime inspection and management:

g! lb | grep my.module
g! services | grep MyService
  1. Unit tests (JUnit/Mockito)
  2. Integration tests (Arquillian)
  3. UI tests (Selenium)
  4. Performance tests (JMeter)

When upgrading from previous versions:

  1. Analyze deprecated APIs
  2. Convert plugins to OSGi modules
  3. Update dependencies
  4. Test compatibility
my-custom-module/
├── bnd.bnd
├── build.gradle
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── com/example/
│ │ │ ├── constants/
│ │ │ ├── portlet/
│ │ │ └── service/
│ │ └── resources/
│ │ ├── META-INF/
│ │ │ └── resources/
│ │ └── service.properties
│ └── test/
└── service.xml
graph TB
    A[Code Commit] --> B[Build]
    B --> C[Unit Tests]
    C --> D[Integration Tests]
    D --> E[Package]
    E --> F[Deploy to Test]
    F --> G[UI Tests]
    G --> H[Production]

As a Liferay 7.4 developer, you’re working with a powerful, modular platform that requires understanding of:

  • OSGi concepts
  • Modern web development
  • Service-oriented architecture
  • Headless delivery
  • Cloud-native principles

The platform offers flexibility but requires disciplined development practices to leverage its full potential.