示例#1
0
  public void setName(String name, Locale locale, Locale defaultLocale) {
    String languageId = LocaleUtil.toLanguageId(locale);
    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);

    if (Validator.isNotNull(name)) {
      setName(
          LocalizationUtil.updateLocalization(
              getName(), "Name", name, languageId, defaultLanguageId));
    } else {
      setName(LocalizationUtil.removeLocalization(getName(), "Name", languageId));
    }
  }
示例#2
0
  public void setNameMap(Map<Locale, String> nameMap, Locale defaultLocale) {
    if (nameMap == null) {
      return;
    }

    setName(
        LocalizationUtil.updateLocalization(
            nameMap, getName(), "Name", LocaleUtil.toLanguageId(defaultLocale)));
  }
示例#3
0
  @Override
  public void setModelAttributes(Map<String, Object> attributes) {
    String uuid = (String) attributes.get("uuid");

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

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

    if (templateId != null) {
      setTemplateId(templateId);
    }

    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 classNameId = (Long) attributes.get("classNameId");

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

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

    if (classPK != null) {
      setClassPK(classPK);
    }

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

    if (templateKey != null) {
      setTemplateKey(templateKey);
    }

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

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

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

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

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

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

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

    if (mode != null) {
      setMode(mode);
    }

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

    if (language != null) {
      setLanguage(language);
    }

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

    if (script != null) {
      setScript(script);
    }
  }
示例#4
0
 public void setName(String name, Locale locale) {
   setName(name, locale, LocaleUtil.getDefault());
 }
 @SuppressWarnings("unused")
 public void prepareLocalizedFieldsForImport(Locale defaultImportLocale) throws LocaleException {
   setName(getName(defaultImportLocale), defaultImportLocale, defaultImportLocale);
   setDescription(getDescription(defaultImportLocale), defaultImportLocale, defaultImportLocale);
 }