public void setDescription(String description, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(description)) {
      setDescription(
          LocalizationUtil.updateLocalization(
              getDescription(), "Description", description, languageId, defaultLanguageId));
    } else {
      setDescription(
          LocalizationUtil.removeLocalization(getDescription(), "Description", languageId));
    }
  }
  public void setDescriptionMap(Map<Locale, String> descriptionMap, Locale defaultLocale) {
    if (descriptionMap == null) {
      return;
    }

    Locale[] locales = LanguageUtil.getAvailableLocales();

    for (Locale locale : locales) {
      String description = descriptionMap.get(locale);

      setDescription(description, locale, defaultLocale);
    }
  }
Пример #3
0
  @Override
  public void setDescriptionMap(Map<Locale, String> descriptionMap, Locale defaultLocale) {
    if (descriptionMap == null) {
      return;
    }

    setDescription(
        LocalizationUtil.updateLocalization(
            descriptionMap,
            getDescription(),
            "Description",
            LocaleUtil.toLanguageId(defaultLocale)));
  }
 public void setDescription(String description, Locale locale) {
   setDescription(description, locale, LocaleUtil.getDefault());
 }
Пример #5
0
 @Override
 @SuppressWarnings("unused")
 public void prepareLocalizedFieldsForImport(Locale defaultImportLocale) throws LocaleException {
   setName(getName(defaultImportLocale), defaultImportLocale, defaultImportLocale);
   setDescription(getDescription(defaultImportLocale), defaultImportLocale, defaultImportLocale);
 }
Пример #6
0
  @Override
  public void setModelAttributes(Map<String, Object> attributes) {
    String uuid = (String) attributes.get("uuid");

    if (uuid != null) {
      setUuid(uuid);
    }

    Long structureId = (Long) attributes.get("structureId");

    if (structureId != null) {
      setStructureId(structureId);
    }

    Long groupId = (Long) attributes.get("groupId");

    if (groupId != null) {
      setGroupId(groupId);
    }

    Long companyId = (Long) attributes.get("companyId");

    if (companyId != null) {
      setCompanyId(companyId);
    }

    Long userId = (Long) attributes.get("userId");

    if (userId != null) {
      setUserId(userId);
    }

    String userName = (String) attributes.get("userName");

    if (userName != null) {
      setUserName(userName);
    }

    Date createDate = (Date) attributes.get("createDate");

    if (createDate != null) {
      setCreateDate(createDate);
    }

    Date modifiedDate = (Date) attributes.get("modifiedDate");

    if (modifiedDate != null) {
      setModifiedDate(modifiedDate);
    }

    Long parentStructureId = (Long) attributes.get("parentStructureId");

    if (parentStructureId != null) {
      setParentStructureId(parentStructureId);
    }

    Long classNameId = (Long) attributes.get("classNameId");

    if (classNameId != null) {
      setClassNameId(classNameId);
    }

    String structureKey = (String) attributes.get("structureKey");

    if (structureKey != null) {
      setStructureKey(structureKey);
    }

    String name = (String) attributes.get("name");

    if (name != null) {
      setName(name);
    }

    String description = (String) attributes.get("description");

    if (description != null) {
      setDescription(description);
    }

    String xsd = (String) attributes.get("xsd");

    if (xsd != null) {
      setXsd(xsd);
    }

    String storageType = (String) attributes.get("storageType");

    if (storageType != null) {
      setStorageType(storageType);
    }

    Integer type = (Integer) attributes.get("type");

    if (type != null) {
      setType(type);
    }
  }