Become a Publisher

Publishing Object Definitions in Marketplace

You can publish object definitions packaged as Client Extensions to Liferay Marketplace.

Prerequisites:

Exporting and Preparing the Object Definition JSON

  1. Open the Global Menu (Global Menu), go to the Control Panel tab, and click Objects.

  2. Export the object definition JSON.

  3. In your project, create a file named 00-object-definition.batch-engine-data.json inside the batch folder.

  4. 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": []
             }
    
  5. Add the exported object definition JSON to the "items" array.

  6. 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.

  1. Open the Global Menu (Global Menu), go to the Control Panel tab, and click Picklists.

  2. Follow the regular flow to export the picklist.

  3. Create a new file named 01-list-type-entry.batch-engine-data.json.

  4. 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
    ]
    }
    
  5. Save the file.

Adding Object Folders

If your object definitions are organized into Folders, you can bundle them as well.

  1. Create a new file named 02-object-folder.batch-engine-data.json inside the batch folder.

  2. 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"
       }
    ]
    }
    
  3. 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 PanelObjectsFolders.

Creating the Client Extension

  1. Create a folder in your workspace for the object definition Client Extension:

    mkdir project-name-batch
    
    cd project-name-batch
    
  2. Create a client-extension.yaml file 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
    
  3. Move the exported Object Definition JSON files into a batch folder.

Building the Extension Package

Build your Batch Client Extension Package using the standard flow, ensuring you include these configurations:

  1. Run ./gradlew build from the root of your workspace.

    This command generates a deployable .zip file in the dist directory.

  2. Follow the regular flow to publish the Client Extension as an application in Marketplace.

    Important

    To publish object definitions you must choose Object Definition when selecting a category and Low Code Configuration as the app type.

  3. Submit the application for approval.