Publishing Object Definitions in Marketplace
You can publish object definitions packaged as Client Extensions to Liferay Marketplace.
Prerequisites:
-
A Liferay instance where the Object Definition exists.
-
A configured Object ready for export.
-
Access to the Client Extension Workspace.
Exporting and Preparing the Object Definition JSON
-
Open the Global Menu (
), go to the Control Panel tab, and click Objects. -
Export the object definition JSON.
-
In your project, create a file named
00-object-definition.batch-engine-data.jsoninside thebatchfolder. -
Add this structure to the file:
{ "configuration": { "taskItemDelegateName": "DEFAULT", "className": "com.liferay.object.admin.rest.dto.v1_0.ObjectDefinition", "parameters": { "containsHeaders": "true", "updateStrategy": "UPDATE", "createStrategy": "UPSERT", "onErrorFail": "false" } }, "items": [] } -
Add the exported object definition JSON to the
"items"array. -
Save the file.
Adding List Type Entries (Picklists)
If your object definition depends on Picklists, include them in a separate batch file within the same batch folder.
-
Open the Global Menu (
), go to the Control Panel tab, and click Picklists. -
Follow the regular flow to export the picklist.
-
Create a new file named
01-list-type-entry.batch-engine-data.json. -
Add this structure to the file:
{ "configuration": { "className": "com.liferay.headless.admin.list.type.dto.v1_0.ListTypeDefinition", "parameters": { "containsHeaders": "true", "createStrategy": "UPSERT", "onErrorFail": "false", "taskItemDelegateName": "DEFAULT", "updateStrategy": "UPDATE" } }, "items": [ // your exported Picklist json ] } -
Save the file.
Adding Object Folders
If your object definitions are organized into Folders, you can bundle them as well.
-
Create a new file named
02-object-folder.batch-engine-data.jsoninside thebatchfolder. -
Add this structure to the file:
{ "configuration": { "className": "com.liferay.object.admin.rest.dto.v1_0.ObjectFolder", "parameters": { "containsHeaders": "true", "createStrategy": "UPSERT", "onErrorFail": "false", "taskItemDelegateName": "DEFAULT", "updateStrategy": "UPDATE" } }, "items": [ { "externalReferenceCode": "Sample Folder", "label": { "en_US": "Sample Folder" }, "name": "Sample Folder" } ] } -
Save the file.
To associate an object definition with a folder, set the "objectFolderExternalReferenceCode" field in the object definition JSON. Once deployed, these folders are located in Control Panel → Objects → Folders.
Creating the Client Extension
-
Create a folder in your workspace for the object definition Client Extension:
mkdir project-name-batchcd project-name-batch -
Create a
client-extension.yamlfile with the configuration:assemble: - from: batch into: batch project-name-batch: name: Project Name Batch oAuthApplicationHeadlessServer: project-name-batch-oahs type: batch project-name-batch-oahs: .serviceAddress: localhost:8080 .serviceScheme: http name: Project Name Batch OAuth Application Headless Server scopes: - Liferay.Headless.Batch.Engine.everything - Liferay.Object.Admin.REST.everything type: oAuthApplicationHeadlessServer -
Move the exported Object Definition JSON files into a
batchfolder.
Building the Extension Package
Build your Batch Client Extension Package using the standard flow, ensuring you include these configurations:
-
Run
./gradlew buildfrom the root of your workspace.This command generates a deployable
.zipfile in thedistdirectory. -
Follow the regular flow to publish the Client Extension as an application in Marketplace.
ImportantTo publish object definitions you must choose Object Definition when selecting a category and Low Code Configuration as the app type.
-
Submit the application for approval.