示例#1
0
 /**
  * 更新网站基础设置,同时更新WebConstants中变量
  *
  * @param form
  */
 @Transactional
 public void updateGeneralOption(GeneralOption form) {
   optionsService.updateOptionValue(OptionConstants.TITLE, form.getTitle());
   optionsService.updateOptionValue(OptionConstants.SUBTITLE, form.getSubtitle());
   optionsService.updateOptionValue(OptionConstants.DESCRIPTION, form.getDescription());
   optionsService.updateOptionValue(OptionConstants.KEYWORDS, form.getKeywords());
 }
示例#2
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;
  }