Determining Data Entities

Here you’ll create the Distributor Application object in four steps:

  1. Add the Distributor Application object
  2. Configure the object
  3. Add a custom field
  4. Publish the object

Create the Distributor Application object.

After publishing the object definition, you can practice using the Distributor Application object to create entries.

Adding the Distributor Application Object

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

  2. Click Add ( Add Button ).

  3. Enter these details:

    FieldValue
    LabelDistributor Application
    Plural LabelDistributor Applications
    Object NameDistributorApplication
    Storage TypeDefault

    Enter a label, plural label, object name, and storage type.

  4. Click Save.

    This creates a draft object definition with these system fields:

    • createDate
    • creator
    • externalReferenceCode
    • id
    • modifiedDate
    • status

    Liferay creates an object draft.

Configuring the Object

Object definitions include configuration options for modifying their general details, behavior, and available features. For example, you can determine how each object’s data is scoped, where users can access it in the UI, and whether to maintain a history of entry events.

Configure Distributor Application as follows:

  1. Begin editing the object definition draft.

  2. Change the definition’s ERC (External Reference Code). Consistent, human-readable ERCs can help you move object definitions between instances and reference them via APIs.

    • Click Edit (Edit Button).
    • Replace the UUID with C_DISTRIBUTOR_APPLICATION.
    • Click Save.

    Update the definition's ERC to C_DISTRIBUTOR_APPLICATION.

  3. In the Details tab, configure these settings:

    FieldValue
    Entry Display > Title FieldID
    Scope > ScopeCompany
    Scope > Panel Category KeyControl Panel > Object
    Account Restriction > ActiveFalse
    Account Restriction > Account Restricted FieldN/A
    Configuration > Show WidgetTrue
    Configuration > Enable CategorizationTrue
    Configuration > Enable CommentsFalse
    Configuration > Enable Entry HistoryFalse

    This configures the Distributor Application to store data by instance and appear in the Global Menu ( Global Menu ) according to its panel category key (i.e., Control Panel → Objects). Additionally, users can add the object to site pages as a widget and assign tags and categories to Distributor Application entries.

  4. Click Save.

Adding a Custom Field

Before you can publish an object definition, it must have at least one field.

  1. Go to the Fields tab.

  2. Click Add ( Add Button ).

  3. Enter these values:

    FieldValue
    LabelApplicant Name
    Field NameapplicantName
    TypeText
    MandatoryTrue
    Accept Unique Values OnlyFalse

    Add these values for the field.

  4. Click Save.

    The new field appears in the Fields tab with the Custom badge.

    Confirm the custom field appears in the Fields tab.

Publishing the Distributor Application Object

When you publish custom objects, Liferay creates a database table for storing data entries. Publishing also registers the object with the OSGi framework, integrates it with Liferay’s core features (e.g., permissions, workflow, headless), and provides a basic user interface.

  1. Go to the object’s Details tab.

  2. Click Publish.

    In the Details tab, click Publish.

This activates Distributor Application and creates a database table with the applicantName field along with the default system fields. See Publishing Object Drafts for more information on what happens during publishing.

Using Distributor Applications

Now that Distributor Application is published, you can begin using it:

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

    Access the application in the Global Menu under Control Panel > Objects.

  2. Click Add ( Add Button ).

  3. Enter an applicant name and click Save.

  4. Return to the Distributor Applications page to verify successful entry creation.

    Here entries appear in a table that includes the object’s custom field alongside the id, status, and author system fields.

    The application page for Distributor Application uses a default table view.

  5. Click Actions (Actions Button) for the entry and select Delete.

  6. Practice creating, updating, and removing entries before moving forward.

You can also use the REST APIs generated for Distributor Application during publishing to create, edit, query, and remove entries. These APIs are available at the c/distributorapplications path. See Headless Framework Integration for a complete list of available APIs and Custom Object API Basics for an introductory tutorial.

Liferay generates REST APIs for Distributor Application.

Now that the object is defined, you can add more fields to collect the necessary applicant information.

Next: Adding Fields to the Distributor Application Object

Relevant Concepts

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy