@Override
    public void transform(DDMFormFieldValue ddmFormFieldValue) throws PortalException {

      Value value = ddmFormFieldValue.getValue();

      for (Locale locale : value.getAvailableLocales()) {
        String valueString = value.getString(locale);

        JSONObject jsonObject = JSONFactoryUtil.createJSONObject(valueString);

        long groupId = GetterUtil.getLong(jsonObject.get("groupId"));
        long layoutId = GetterUtil.getLong(jsonObject.getLong("layoutId"));
        boolean privateLayout = jsonObject.getBoolean("privateLayout");

        Layout layout = _layoutLocalService.getLayout(groupId, privateLayout, layoutId);

        Element entityElement = _portletDataContext.getExportDataElement(_stagedModel);

        _portletDataContext.addReferenceElement(
            _stagedModel,
            entityElement,
            layout,
            PortletDataContext.REFERENCE_TYPE_DEPENDENCY,
            true);
      }
    }
    @Override
    public void transform(DDMFormFieldValue ddmFormFieldValue) throws PortalException {

      Value value = ddmFormFieldValue.getValue();

      for (Locale locale : value.getAvailableLocales()) {
        String valueString = value.getString(locale);

        JSONObject jsonObject = JSONFactoryUtil.createJSONObject(valueString);

        Layout importedLayout = fetchImportedLayout(_portletDataContext, jsonObject);

        if (importedLayout == null) {
          continue;
        }

        value.addString(locale, toJSON(importedLayout));
      }
    }
    @Override
    public void transform(DDMFormFieldValue ddmFormFieldValue) throws PortalException {

      Value value = ddmFormFieldValue.getValue();

      for (Locale locale : value.getAvailableLocales()) {
        String valueString = value.getString(locale);

        JSONObject jsonObject = JSONFactoryUtil.createJSONObject(valueString);

        long groupId = GetterUtil.getLong(jsonObject.get("groupId"));
        String uuid = jsonObject.getString("uuid");

        if ((groupId == 0) || Validator.isNull(uuid)) {
          continue;
        }

        FileEntry fileEntry = _dlAppService.getFileEntryByUuidAndGroupId(uuid, groupId);

        if (_exportReferencedContent) {
          StagedModelDataHandlerUtil.exportReferenceStagedModel(
              _portletDataContext,
              _stagedModel,
              fileEntry,
              _portletDataContext.REFERENCE_TYPE_DEPENDENCY);
        } else {
          Element entityElement = _portletDataContext.getExportDataElement(_stagedModel);

          _portletDataContext.addReferenceElement(
              _stagedModel,
              entityElement,
              fileEntry,
              PortletDataContext.REFERENCE_TYPE_DEPENDENCY,
              true);
        }
      }
    }