Interface DDL


@ProviderType public interface DDL
Represents a utility class used by DDL applications.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String[]
     
  • Method Summary

    Modifier and Type
    Method
    Description
    com.liferay.portal.kernel.json.JSONObject
    getRecordJSONObject(DDLRecord record, boolean latestRecordVersion, Locale locale)
    Returns the localized value of the record as a JSON Object.
    com.liferay.portal.kernel.json.JSONArray
    Returns the localized record set as a JSON Array.
    com.liferay.portal.kernel.json.JSONArray
    getRecordsJSONArray(List<DDLRecord> ddlRecords, boolean latestRecordVersion, Locale locale)
    Returns the records of the locale as a JSON Array.
    updateRecord(long recordId, long recordSetId, boolean mergeFields, boolean checkPermission, com.liferay.portal.kernel.service.ServiceContext serviceContext)
    Updates the record according to the form parameters passed in the request.
  • Field Details

    • SELECTED_FIELD_NAMES

      static final String[] SELECTED_FIELD_NAMES
  • Method Details

    • getRecordJSONObject

      com.liferay.portal.kernel.json.JSONObject getRecordJSONObject(DDLRecord record, boolean latestRecordVersion, Locale locale) throws Exception
      Returns the localized value of the record as a JSON Object. If the latest version of the record is requested, it is transformed regardless of its workflow status.
      Parameters:
      record - the record to transform
      latestRecordVersion - whether the latest version of the record is to be transformed regardless of its workflow status, even if it's in a pending or draft state.
      locale - a locale to use to retrieve the localized values of the record
      Returns:
      the localized value of the record as a JSON Object
      Throws:
      Exception - if an unexpected exception occurred
    • getRecordSetJSONArray

      com.liferay.portal.kernel.json.JSONArray getRecordSetJSONArray(DDLRecordSet recordSet, Locale locale) throws Exception
      Returns the localized record set as a JSON Array.
      Parameters:
      recordSet - the record set to transform
      locale - a locale to use to retrieve the localized values of the record set
      Returns:
      the localized record set as a JSON Array
      Throws:
      Exception - if an unexpected exception occurred
    • getRecordsJSONArray

      com.liferay.portal.kernel.json.JSONArray getRecordsJSONArray(List<DDLRecord> ddlRecords, boolean latestRecordVersion, Locale locale) throws Exception
      Returns the records of the locale as a JSON Array. The JSON array contains a list of record JSON Objects. If the latest version of the records is requested, the records are transformed regardless of workflow status.
      Parameters:
      ddlRecords - the ddlRecords to transform
      latestRecordVersion - whether the latest version of each record is to be transformed regardless of its workflow status, even if the record is in a pending or draft state.
      locale - a locale used to retrieve the localized values of the record
      Returns:
      the records of the locale as a JSON Array
      Throws:
      Exception - if an unexpected exception occurred
      See Also:
    • updateRecord

      DDLRecord updateRecord(long recordId, long recordSetId, boolean mergeFields, boolean checkPermission, com.liferay.portal.kernel.service.ServiceContext serviceContext) throws Exception
      Updates the record according to the form parameters passed in the request. The request parameters are wrapped in the service context parameter. If a record matching the record ID doesn't exist, a new record is added. Otherwise, the existing record is updated.
      Parameters:
      recordId - the record ID to update
      recordSetId - the record set ID of the record
      mergeFields - whether to perform the merge operation for the existing record. If true, all missing localized record values are updated for the existing record.
      checkPermission - whether to use the permission checker to validate credentials
      serviceContext - the service context to be applied
      Returns:
      the record
      Throws:
      Exception - if an unexpected exception occurred