Package com.thinkgem.jeesite.modules.cms.entity

Examples of com.thinkgem.jeesite.modules.cms.entity.Site


  public static List<Site> getSiteList(){
    @SuppressWarnings("unchecked")
    List<Site> siteList = (List<Site>)CacheUtils.get(CMS_CACHE, "siteList");
    if (siteList == null){
      Page<Site> page = new Page<Site>(1, -1);
      page = siteService.find(page, new Site());
      siteList = page.getList();
      CacheUtils.put(CMS_CACHE, "siteList", siteList);
    }
    return siteList;
  }
View Full Code Here


    for (Site site : getSiteList()){
      if (site.getId().equals(id)){
        return site;
      }
    }
    return new Site(id);
  }
View Full Code Here

  public static List<Category> getMainNavList(String siteId){
    @SuppressWarnings("unchecked")
    List<Category> mainNavList = (List<Category>)CacheUtils.get(CMS_CACHE, "mainNavList_"+siteId);
    if (mainNavList == null){
      Category category = new Category();
      category.setSite(new Site(siteId));
      category.setParent(new Category("1"));
      category.setInMenu(Category.SHOW);
      Page<Category> page = new Page<Category>(1, -1);
      page = categoryService.find(page, category);
      mainNavList = page.getList();
View Full Code Here

   * @param param  预留参数,例: key1:'value1', key2:'value2' ...
   */
  public static List<Category> getCategoryList(String siteId, String parentId, int number, String param){
    Page<Category> page = new Page<Category>(1, number, -1);
    Category category = new Category();
    category.setSite(new Site(siteId));
    category.setParent(new Category(parentId));
    if (StringUtils.isNotBlank(param)){
      @SuppressWarnings({ "unused", "rawtypes" })
      Map map = JsonMapper.getInstance().fromJson("{"+param+"}", Map.class);
    }
View Full Code Here

   *          orderBy 排序字符串
   * @return
   */
  public static List<Article> getArticleList(String siteId, String categoryId, int number, String param){
    Page<Article> page = new Page<Article>(1, number, -1);
    Article article = new Article(new Category(categoryId, new Site(siteId)));
    if (StringUtils.isNotBlank(param)){
      @SuppressWarnings({ "rawtypes" })
      Map map = JsonMapper.getInstance().fromJson("{"+param+"}", Map.class);
      if (new Integer(1).equals(map.get("posid")) || new Integer(2).equals(map.get("posid"))){
        article.setPosid(String.valueOf(map.get("posid")));
View Full Code Here

   * @param param  预留参数,例: key1:'value1', key2:'value2' ...
   * @return
   */
  public static List<Link> getLinkList(String siteId, String categoryId, int number, String param){
    Page<Link> page = new Page<Link>(1, number, -1);
    Link link = new Link(new Category(categoryId, new Site(siteId)));
    if (StringUtils.isNotBlank(param)){
      @SuppressWarnings({ "unused", "rawtypes" })
      Map map = JsonMapper.getInstance().fromJson("{"+param+"}", Map.class);
    }
    link.setDelFlag(Link.DEL_FLAG_NORMAL);
View Full Code Here

  /**
   * 网站首页
   */
  @RequestMapping
  public String index(Model model) {
    Site site = CmsUtils.getSite(Site.defaultSiteId());
    model.addAttribute("site", site);
    model.addAttribute("isIndex", true);
    return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex";
  }
View Full Code Here

//    return page;
  }
 
  @Transactional(readOnly = false)
  public void save(Category category) {
    category.setSite(new Site(Site.getCurrentSiteId()));
    category.setParent(this.get(category.getParent().getId()));
    String oldParentIds = category.getParentIds(); // 获取修改前的parentIds,用于更新子节点的parentIds
    category.setParentIds(category.getParent().getParentIds()+category.getParent().getId()+",");
        if (StringUtils.isNotBlank(category.getViewConfig())){
            category.setViewConfig(StringEscapeUtils.unescapeHtml4(category.getViewConfig()));
View Full Code Here

  @RequestMapping(value = "index-{siteId}${urlSuffix}")
  public String index(@PathVariable String siteId, Model model) {
    if (siteId.equals("1")){
      return "redirect:"+Global.getFrontPath();
    }
    Site site = CmsUtils.getSite(siteId);
    // 子站有独立页面,则显示独立页面
    if (StringUtils.isNotBlank(site.getCustomIndexView())){
      model.addAttribute("site", site);
      model.addAttribute("isIndex", true);
      return "modules/cms/front/themes/"+site.getTheme()+"/frontIndex"+site.getCustomIndexView();
    }
    // 否则显示子站第一个栏目
    String firstCategoryId = CmsUtils.getMainNavList(siteId).get(0).getId();
    return "redirect:"+Global.getFrontPath()+"/list-"+firstCategoryId+Global.getUrlSuffix();
  }
View Full Code Here

  @RequestMapping(value = "list-{categoryId}${urlSuffix}")
  public String list(@PathVariable String categoryId, @RequestParam(required=false, defaultValue="1") Integer pageNo,
      @RequestParam(required=false, defaultValue="15") Integer pageSize, Model model) {
    Category category = categoryService.get(categoryId);
    if (category==null){
      Site site = CmsUtils.getSite(Site.defaultSiteId());
      model.addAttribute("site", site);
      return "error/404";
    }
    model.addAttribute("site", category.getSite());
    // 2:简介类栏目,栏目第一条内容
View Full Code Here

TOP

Related Classes of com.thinkgem.jeesite.modules.cms.entity.Site

Copyright © 2018 www.massapicom. 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.