Examples of CmsSite


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

  @RequestMapping(value = "/guestbook.jspx", method = RequestMethod.POST)
  public void submit(Integer siteId, Integer ctgId, String title,
      String content, String email, String phone, String qq,
      String captcha, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) throws JSONException {
    CmsSite site = CmsUtils.getSite(request);
    CmsUser member = CmsUtils.getUser(request);
    if (siteId == null) {
      siteId = site.getId();
    }
    JSONObject json = new JSONObject();
    try {
      if (!imageCaptchaService.validateResponseForID(session
          .getSessionId(request, response), captcha)) {
View Full Code Here

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

        .getLocaleResolver(request);
    if (localeResolver == null) {
      throw new IllegalStateException(
          "  No LocaleResolver found: not in a DispatcherServlet request? ");
    }
    CmsSite site = CmsUtils.getSite(request);
    String newLocale = site.getLocaleFront();
    LocaleEditor localeEditor = new LocaleEditor();
    localeEditor.setAsText(newLocale);
    localeResolver.setLocale(request, response, (Locale) localeEditor
        .getValue());
    // Proceed in any case.
View Full Code Here

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

  @RequestMapping(value = "/rss.jspx", method = RequestMethod.GET)
  public String rss(HttpServletRequest request, HttpServletResponse response,
      ModelMap model) {
    response.setContentType("text/xml;charset=UTF-8");
    CmsSite site = CmsUtils.getSite(request);
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_SPECIAL, RSS_TPL);
  }
View Full Code Here

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

   */
  @RequestMapping(value = "/csi_custom.jspx")
  public String custom(String tpl, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    log.debug("visit csi custom template: {}", tpl);
    CmsSite site = CmsUtils.getSite(request);
    // 将request中所有参数保存至model中。
    model.putAll(RequestUtils.getQueryParams(request));
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(site.getSolutionPath(), TPLDIR_CSI_CUSTOM,
        tpl);
  }
View Full Code Here

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

  @RequestMapping("/flow_statistic.jspx")
  public void flowStatistic(HttpServletRequest request,
      HttpServletResponse response, String page, String referer) {
    if (!StringUtils.isBlank(page)) {
      String ip = RequestUtils.getIpAddr(request);
      CmsSite site = CmsUtils.getSite(request);
      String sessionId = RequestUtils.getRequestedSessionId(request);
      cmsSiteFlowCache.flow(site, ip, sessionId, page, referer);
      ResponseUtils.renderJson(response, "true");
    } else {
      ResponseUtils.renderJson(response, "false");
View Full Code Here

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

public class FrontContextInterceptor extends HandlerInterceptorAdapter {
  @Override
  public boolean preHandle(HttpServletRequest request,
      HttpServletResponse response, Object handler)
      throws ServletException {
    CmsSite site = null;
    List<CmsSite> list = cmsSiteMng.getListFromCache();
    int size = list.size();
    if (size == 0) {
      throw new RuntimeException("no site record in database!");
    } else if (size == 1) {
View Full Code Here

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

  public static final String TPL_ADSPACE = "tpl.adspace";

  @RequestMapping(value = "/ad.jspx")
  public String ad(Integer id, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    if (id != null) {
      CmsAdvertising ad = cmsAdvertisingMng.findById(id);
      model.addAttribute("ad", ad);
    }
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_CSI, TPL_AD);
  }
View Full Code Here

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

  }

  @RequestMapping(value = "/adspace.jspx")
  public String adspace(Integer id, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    if (id != null) {
      CmsAdvertisingSpace adspace = cmsAdvertisingSpaceMng.findById(id);
      List<CmsAdvertising> adList = cmsAdvertisingMng.getList(id, true);
      model.addAttribute("adspace", adspace);
      model.addAttribute("adList", adList);
    }
    FrontUtils.frontData(request, model, site);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_CSI, TPL_ADSPACE);
  }
View Full Code Here

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

  public static final String TAGS_DETAIL = "tpl.tagDetail";

  @RequestMapping(value = "/tag*.jspx", method = RequestMethod.GET)
  public String index(HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    FrontUtils.frontData(request, model, site);
    FrontUtils.frontPageData(request, model);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_SPECIAL, TAGS_INDEX);
  }
View Full Code Here

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

  }

  @RequestMapping(value = "/tag/{path}.jspx", method = RequestMethod.GET)
  public String tags(@PathVariable String path, HttpServletRequest request,
      HttpServletResponse response, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    if (StringUtils.isBlank(path)) {
      return FrontUtils.pageNotFound(request, response, model);
    }
    int index = path.indexOf("_");
    int pageNo, id;
    try {
      if (index != -1) {
        id = Integer.valueOf(path.substring(0, index));
        pageNo = Integer.valueOf(path.substring(index + 1, path
            .length()));
      } else {
        id = Integer.valueOf(path);
        pageNo = 1;
      }
    } catch (NumberFormatException e) {
      return FrontUtils.pageNotFound(request, response, model);
    }
    ContentTag tag = contentTagMng.findById(id);
    if (tag == null) {
      return FrontUtils.pageNotFound(request, response, model);
    }
    model.addAttribute("tag", tag);
    model.addAttribute(FrontUtils.PAGE_NO, pageNo);
    FrontUtils.frontData(request, model, site);
    FrontUtils.frontPageData(request, model);
    return FrontUtils.getTplPath(request, site.getSolutionPath(),
        TPLDIR_SPECIAL, TAGS_DETAIL);
  }
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.