Example #1
0
  public PostOption getPostOption() {
    PostOption option = new PostOption();
    option.setMaxshow(
        NumberUtils.toInteger(optionsService.getOptionValue(OptionConstants.MAXSHOW), 10));
    option.setAllowComment(
        Boolean.parseBoolean(optionsService.getOptionValue(OptionConstants.ALLOW_COMMENT)));
    option.setDefaultCategory(optionsService.getOptionValue(OptionConstants.DEFAULT_CATEGORY_ID));

    return option;
  }
Example #2
0
  public EMailSender getMailOption() {
    EMailSender option = new EMailSender();
    option.setHost(optionsService.getOptionValue("mail_host"));
    if (!StringUtils.isBlank(option.getHost())) {
      option.setPort(Integer.parseInt(optionsService.getOptionValue("mail_port")));
      option.setUsername(optionsService.getOptionValue("mail_username"));
      option.setPassword(optionsService.getOptionValue("mail_password"));
    } else {
      option = null;
    }

    return option;
  }
Example #3
0
  /**
   * 从数据库中获取站点通用设置,不存在时返回null
   *
   * @return
   */
  public GeneralOption getGeneralOption() {
    GeneralOption form = new GeneralOption();
    form.setTitle(optionsService.getOptionValue(OptionConstants.TITLE));
    if (!StringUtils.isBlank(form.getTitle())) {
      form.setSubtitle(optionsService.getOptionValue(OptionConstants.SUBTITLE));
      form.setDescription(optionsService.getOptionValue(OptionConstants.DESCRIPTION));
      form.setKeywords(optionsService.getOptionValue(OptionConstants.KEYWORDS));
      form.setWeburl(optionsService.getOptionValue("weburl"));
    } else {
      form = null;
    }

    return form;
  }