Liferay icon

Liferay

Liferay

Overview

This node integrates with Liferay, a popular enterprise portal platform, allowing users to interact with its APIs in two main ways: via Headless API endpoints or Object Operations. It supports authentication through Basic Auth or OAuth2.

Common scenarios include:

  • Automating content management by calling Liferay's RESTful Headless APIs.
  • Performing CRUD operations on Liferay objects using predefined object definitions and operations.
  • Integrating Liferay data and services into workflows without custom coding.

Practical examples:

  • Fetching a list of blog posts from Liferay using a Headless API endpoint.
  • Creating or updating a user profile in Liferay via an Object Operation.
  • Executing custom REST calls to any exposed Liferay Headless API endpoint with dynamic parameters.

Properties

Name Meaning
Authentication Method to authenticate with Liferay. Options: Basic Auth, OAuth2.
Liferay Base URL The base URL of the Liferay instance, e.g., http://localhost:8080.
Type Selects the type of operation: "Headless API Endpoint" for direct REST API calls, or "Object Operation" for working with Liferay object definitions.
Object Definition (Shown if Type is "Object Operation") The specific Liferay object definition to operate on, loaded dynamically based on the base URL and type.
Operation (Shown if Type is "Object Operation") The operation to perform on the selected object definition, such as create, update, delete, or get. Loaded dynamically.
Parameters (Shown if Type is "Object Operation") Parameters for the selected object operation, mapped dynamically.
Body (Shown if Type is "Object Operation" and operation is PATCH, POST, or PUT) JSON body content for the request.
REST Application (Shown if Type is "Headless API Endpoint") The Liferay REST application to call, loaded dynamically.
Endpoint (Shown if Type is "Headless API Endpoint") The specific endpoint within the selected REST application, loaded dynamically.
Method (Shown if Type is "Headless API Endpoint") HTTP method to use for the request (GET, POST, PATCH, etc.), loaded dynamically.
Parameters (Shown if Type is "Headless API Endpoint") Parameters for the selected endpoint and method, mapped dynamically.
Body (Shown if Type is "Headless API Endpoint" and method is PATCH, POST, or PUT) JSON body content for the request.

Output

The node outputs JSON data representing the response from the Liferay API call made during execution. This can be any valid JSON structure depending on the endpoint or object operation invoked, such as lists of objects, single object details, or status messages.

If the API returns binary data (not explicitly indicated in the code), it would typically be handled separately, but this node primarily deals with JSON responses.

Dependencies

  • Requires access to a Liferay instance reachable at the specified base URL.
  • Supports authentication via Basic Auth or OAuth2; appropriate credentials must be configured in n8n.
  • Dynamically loads options for object definitions, operations, REST applications, endpoints, methods, and parameters by calling internal helper functions.
  • No external npm packages beyond those bundled with n8n are required.

Troubleshooting

  • Authentication errors: Ensure that the correct authentication method is selected and credentials are properly configured. Common errors include invalid tokens or incorrect username/password.
  • Invalid base URL: Verify the Liferay base URL is correct and accessible from the n8n environment.
  • Missing or incorrect parameters: When using object operations or headless API calls, ensure all required parameters are provided and correctly formatted.
  • Unsupported HTTP methods: For some operations, only certain HTTP methods are allowed; check the method selection matches the operation.
  • Dynamic option loading failures: If dropdowns for object definitions, operations, or endpoints do not populate, verify network connectivity and that the Liferay instance exposes the necessary metadata endpoints.

Links and References

Discussion