or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

bean-management.mddatabase-orm.mddatabase-upgrades.mdframework-integration.mdindex.mdlifecycle-events.mdportlet-framework.mdservice-layer.mdtemplate-processing.mdutility-services.mdweb-security.md
tile.json

tessl/maven-com-liferay-portal--com-liferay-portal-impl

Core implementation module containing the fundamental services, utilities, and infrastructure components for the Liferay Digital Experience Platform.

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
mavenpkg:maven/com.liferay.portal/com.liferay.portal.impl@113.1.x

To install, run

npx @tessl/cli install tessl/maven-com-liferay-portal--com-liferay-portal-impl@113.1.0

index.mddocs/

Liferay Portal Implementation

Core implementation module containing the fundamental services, utilities, and infrastructure components for the Liferay Digital Experience Platform. This module provides essential backend functionality including user management, authentication, authorization, database access layers, service implementations, and integration points for the broader Liferay ecosystem.

Package Information

  • Package Name: com.liferay.portal.impl
  • Package Type: maven
  • Language: Java
  • Installation: Maven dependency or OSGi bundle deployment
  • Bundle Symbolic Name: com.liferay.portal.impl
  • Bundle Version: 113.1.2

Core Imports

For dependency injection and bean access:

import com.liferay.portal.bean.BeanLocatorImpl;
import com.liferay.portal.bean.BeanPropertiesImpl;
import java.util.Map;

For database and Hibernate integration:

import com.liferay.portal.dao.orm.hibernate.SessionFactoryImpl;
import com.liferay.portal.dao.orm.hibernate.SessionImpl;
import com.liferay.portal.dao.orm.hibernate.DynamicQueryFactoryImpl;

For lifecycle and event handling:

import com.liferay.portal.events.GlobalStartupAction;
import com.liferay.portal.events.LoginPreAction;
import com.liferay.portal.events.ServicePreAction;

Basic Usage

// Bean location and property access
BeanLocatorImpl beanLocator = new BeanLocatorImpl();
Object bean = beanLocator.locate("myBeanName");

BeanPropertiesImpl beanProps = new BeanPropertiesImpl();
String value = beanProps.getString(bean, "propertyName");

// Database operations using Hibernate integration
SessionFactoryImpl sessionFactory = new SessionFactoryImpl();
SessionImpl session = (SessionImpl) sessionFactory.openSession();

DynamicQueryFactoryImpl queryFactory = new DynamicQueryFactoryImpl();
DynamicQueryImpl query = (DynamicQueryImpl) queryFactory.forClass(MyEntity.class);

// Template processing with FreeMarker
// Template engine integration for dynamic content generation

// Service layer operations
// Access to portal services through standardized interfaces

Architecture

The Liferay portal-impl module is structured around several key architectural patterns:

  • Interface Implementation Pattern: Concrete implementations of portal-kernel interfaces providing the actual functionality
  • Factory Pattern: Extensive use of factory classes for creating service objects and maintaining loose coupling
  • Spring Integration: Heavy dependency injection and lifecycle management through Spring Framework
  • Hibernate ORM: Comprehensive database abstraction with custom types, dialects, and property accessors
  • Event-Driven Architecture: Lifecycle events and actions for portal startup, shutdown, authentication, and request processing
  • OSGi Bundle: Modular architecture with clearly defined exported packages and service boundaries

Capabilities

Bean Management & Dependency Injection

Spring-based dependency injection system providing bean location, property access, and Velocity template integration for the portal framework.

public class BeanLocatorImpl implements BeanLocator {
    public Object locate(String name) throws BeanLocatorException;
    public <T> Map<String, T> locate(Class<T> clazz) throws BeanLocatorException;
    public String[] getNames();
    public Class<?> getType(String name);
    public ClassLoader getClassLoader();
    public ApplicationContext getApplicationContext();
    public void destroy();
}

public class BeanPropertiesImpl implements BeanProperties {
    // Property getters with default values
    public boolean getBoolean(Object bean, String param);
    public boolean getBoolean(Object bean, String param, boolean defaultValue);
    public String getString(Object bean, String param);
    public String getString(Object bean, String param, String defaultValue);
    public int getInteger(Object bean, String param);
    public int getInteger(Object bean, String param, int defaultValue);
    public long getLong(Object bean, String param);
    public double getDouble(Object bean, String param);
    public float getFloat(Object bean, String param);
    public Object getObject(Object bean, String param);
    
    // Silent variants (no logging on errors)
    public boolean getBooleanSilent(Object bean, String param);
    public String getStringSilent(Object bean, String param);
    public int getIntegerSilent(Object bean, String param);
    // ... more silent variants
    
    // Property manipulation
    public void copyProperties(Object source, Object target);
    public <T> T deepCopyProperties(Object source) throws Exception;
    public void setProperty(Object bean, String param, Object value);
    public void setPropertySilent(Object bean, String param, Object value);
    public void setProperties(Object bean, HttpServletRequest request);
}

Bean Management

Database & ORM Layer

Comprehensive Hibernate ORM integration with custom types, property accessors, database dialects, and dynamic query building capabilities.

public class SessionFactoryImpl implements SessionFactory {
    public Session openSession();
    public Session getCurrentSession();
}

public class DynamicQueryFactoryImpl implements DynamicQueryFactory {
    public DynamicQuery forClass(Class<?> clazz);
    public DynamicQuery forClass(Class<?> clazz, ClassLoader classLoader);
}

public interface DynamicQuery {
    public DynamicQuery add(Criterion criterion);
    public DynamicQuery addOrder(Order order);
    public List<Object> list();
}

Database & ORM

Lifecycle Events & Actions

Event-driven system handling portal startup, shutdown, authentication, session management, and service request processing.

public class GlobalStartupAction extends Action {
    public void run(HttpServletRequest request, HttpServletResponse response);
}

public class LoginPreAction extends Action {
    public void run(HttpServletRequest request, HttpServletResponse response);
}

public class SessionCreateAction extends SessionAction {
    public void run(HttpSession session);
}

Lifecycle Events

Service Layer

Core portal services providing business logic implementations, HTTP endpoints, and permission checking capabilities.

// Service implementations for portal entities
// HTTP-specific service endpoints and utilities  
// Permission checking implementations for security

Service Layer

Web Layer & Security

Servlet implementations, request filters, authentication verification, and security utilities for web request processing.

// Core servlet implementations and utilities
// Request processing filters
// Authentication verification filters
// Security-related language and utility classes

Web Layer & Security

Template Processing

Template engine integrations including FreeMarker support and generic template processing utilities for dynamic content generation.

// FreeMarker template engine integration
// Generic template processing utilities

Template Processing

Utility Services

Core utilities including formatting, minification, file operations, XML processing, and portal-specific utility implementations.

// Configuration management, file operations, localization
// Text and content formatting utilities
// CSS and JavaScript minification
// File upload processing
// XML processing and manipulation

Utility Services

Portlet Framework

Complete portlet framework implementation including containers, request/response handling, asset management, and document library functionality.

// Core portlet framework implementations
// Asset framework implementations
// Document Library portlet implementations
// Expando (custom fields) implementations

Portlet Framework

Database Upgrades

Version-specific database migration utilities supporting upgrades between Liferay 7.x versions with schema transformation capabilities.

// Utilities for database schema upgrades
// Version-specific upgrade implementations

Database Upgrades

Framework Integration

Spring Framework configuration, development tools, plugin management, and hot deployment capabilities.

// Spring Framework integration and configuration
// Development and build tools
// Hot deployment functionality for plugins
// Plugin management and deployment utilities

Framework Integration

Database Support

The portal-impl module provides comprehensive database support through custom Hibernate dialects:

  • IBM DB2 - Enterprise database support with optimized dialect
  • HSQL Database - Embedded database support for development and testing
  • MariaDB/MySQL - Open source database support with MariaDB-specific optimizations
  • Oracle 10g+ - Enterprise Oracle support with version-specific features
  • Microsoft SQL Server 2005/2008+ - Microsoft database support with multiple version compatibility

Integration Points

The exported API provides extensive integration capabilities for:

  • Authentication Systems - Custom authentication mechanisms and security providers
  • Template Engines - FreeMarker integration and generic template processing
  • Database Connectivity - Multiple database backend support with custom dialects
  • Plugin Systems - Hot deployment and plugin lifecycle management
  • Asset Management - Content and media asset handling with storage backends
  • Document Storage - Flexible document storage implementations
  • Search Functionality - Content indexing and search capabilities
  • Upgrade Procedures - Database schema migration and version upgrade support
  • Enterprise Integration - Spring Framework, web services, and enterprise patterns

Error Handling

The portal-impl module handles various types of exceptions and errors:

  • Database Exceptions - Hibernate-specific exceptions and transaction management
  • Authentication Errors - Login failures, permission denied, session timeouts
  • Template Errors - FreeMarker processing exceptions and template compilation errors
  • Plugin Deployment Errors - Hot deployment failures and plugin lifecycle exceptions
  • Service Exceptions - Business logic exceptions and validation errors

Common error handling patterns include comprehensive logging, exception transformation, and graceful degradation for non-critical failures.