Examples of CmsSite


Examples of com.jeecms.cms.entity.main.CmsSite

   * @param model
   * @return
   */
  @RequestMapping(value = "/", method = RequestMethod.GET)
  public String index(HttpServletRequest request, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_INDEX, TPL_INDEX);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

  }

  public String channel(String path, int pageNo, String[] params,
      PageInfo info, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    Channel channel = channelMng.findByPathForTag(path, site.getId());
    if (channel == null) {
      log.debug("Channel path not found: {}", path);
      return FrontUtils.pageNotFound(request, response, model);
    }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

    if (content == null) {
      log.debug("Content id not found: {}", id);
      return FrontUtils.pageNotFound(request, response, model);
    }
    CmsUser user = CmsUtils.getUser(request);
    CmsSite site = content.getSite();
    Set<CmsGroup> groups = content.getViewGroupsExt();
    int len = groups.size();
    // 需要浏览权限
    if (len != 0) {
      // 没有登录
      if (user == null) {
        return FrontUtils.showLogin(request, model, site);
      }
      // 已经登录但没有权限
      Integer gid = user.getGroup().getId();
      boolean right = false;
      for (CmsGroup group : groups) {
        if (group.getId().equals(gid)) {
          right = true;
          break;
        }
      }
      if (!right) {
        String gname = user.getGroup().getName();
        return FrontUtils.showMessage(request, model, GROUP_FORBIDDEN,
            gname);
      }
    }
    String txt = content.getTxtByNo(pageNo);
    // 内容加上关键字
    txt = cmsKeywordMng.attachKeyword(site.getId(), txt);
    Paginable pagination = new SimplePage(pageNo, 1, content.getPageCount());
    model.addAttribute("pagination", pagination);
    FrontUtils.frontPageData(request, model);
    model.addAttribute("content", content);
    model.addAttribute("channel", content.getChannel());
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

   * @return 返回“页面没有找到”的模板
   */
  public static String pageNotFound(HttpServletRequest request,
      HttpServletResponse response, Map<String, Object> model) {
    response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    CmsSite site = CmsUtils.getSite(request);
    frontData(request, model, site);
    return getTplPath(request, site.getSolutionPath(), TPLDIR_COMMON,
        PAGE_NOT_FOUND);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

   * @param model
   * @return
   */
  public static String showSuccess(HttpServletRequest request,
      Map<String, Object> model, String nextUrl) {
    CmsSite site = CmsUtils.getSite(request);
    frontData(request, model, site);
    if (!StringUtils.isBlank(nextUrl)) {
      model.put("nextUrl", nextUrl);
    }
    return getTplPath(request, site.getSolutionPath(), TPLDIR_COMMON,
        SUCCESS_PAGE);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

   * @return
   */
  public static String showError(HttpServletRequest request,
      HttpServletResponse response, Map<String, Object> model,
      WebErrors errors) {
    CmsSite site = CmsUtils.getSite(request);
    frontData(request, model, site);
    errors.toModel(model);
    return getTplPath(request, site.getSolutionPath(), TPLDIR_COMMON,
        ERROR_PAGE);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

   *            进行国际化处理
   * @return
   */
  public static String showMessage(HttpServletRequest request,
      Map<String, Object> model, String message, String... args) {
    CmsSite site = CmsUtils.getSite(request);
    frontData(request, model, site);
    model.put(MESSAGE, message);
    if (args != null) {
      model.put(ARGS, args);
    }
    return getTplPath(request, site.getSolutionPath(), TPLDIR_COMMON,
        MESSAGE_PAGE);
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

    query.setCacheable(cacheable);
    return (CmsSite) query.uniqueResult();
  }

  public CmsSite findById(Integer id) {
    CmsSite entity = get(id);
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

    getSession().save(bean);
    return bean;
  }

  public CmsSite deleteById(Integer id) {
    CmsSite entity = super.get(id);
    if (entity != null) {
      getSession().delete(entity);
    }
    return entity;
  }
View Full Code Here

Examples of com.jeecms.cms.entity.main.CmsSite

  public static final String VOTE_RESULT = "tpl.voteResult";

  @RequestMapping(value = "/vote_result.jspx", method = RequestMethod.GET)
  public String result(Integer voteId, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    CmsVoteTopic vote = cmsVoteTopicMng.findById(voteId);
    model.addAttribute("vote", vote);
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_SPECIAL, VOTE_RESULT);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.