コード例 #1
0
  public DDMFormValues getDDMFormValues(DDMStructure ddmStructure) throws PortalException {

    if (_ddmFormValues != null) {
      return _ddmFormValues;
    }

    JournalArticle article = getArticle();

    if (article == null) {
      return _ddmFormValues;
    }

    String content = article.getContent();

    if (Validator.isNull(content)) {
      return _ddmFormValues;
    }

    JournalConverter journalConverter = getJournalConverter();

    Fields fields = journalConverter.getDDMFields(ddmStructure, content);

    if (fields == null) {
      return _ddmFormValues;
    }

    _ddmFormValues = FieldsToDDMFormValuesConverterUtil.convert(ddmStructure, fields);

    return _ddmFormValues;
  }
コード例 #2
0
ファイル: DDMImpl.java プロジェクト: hme891/liferay-portal
  @Override
  public DDMFormValues getDDMFormValues(
      long ddmStructureId, String fieldNamespace, ServiceContext serviceContext)
      throws PortalException {

    DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(ddmStructureId);

    Fields fields = getFields(ddmStructure.getStructureId(), fieldNamespace, serviceContext);

    return FieldsToDDMFormValuesConverterUtil.convert(ddmStructure, fields);
  }
コード例 #3
0
  protected long create(StorageAdapter storageAdapter, long ddmStructureId, Fields fields)
      throws Exception {

    DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(ddmStructureId);

    DDMFormValues ddmFormValues = FieldsToDDMFormValuesConverterUtil.convert(ddmStructure, fields);

    return storageAdapter.create(
        TestPropsValues.getCompanyId(),
        ddmStructureId,
        ddmFormValues,
        ServiceContextTestUtil.getServiceContext(group.getGroupId()));
  }