Package com.jeecms.cms.entity.main

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


    Session session = getSession();
    ScrollableResults channels = finder.createQuery(session).setCacheMode(
        CacheMode.IGNORE).scroll(ScrollMode.FORWARD_ONLY);
    int count = 0;
    CmsSite site;
    Channel c;
    PageInfo info;
    Writer out = null;
    Template tpl;
    String real, filename;
    File f, parent;
    int quantity, totalPage;
    if (data == null) {
      data = new HashMap<String, Object>();
    }
    while (channels.next()) {
      c = (Channel) channels.get(0);
      site = c.getSite();
      FrontUtils.frontData(data, site, null, null, null);
      // 如果是外部链接或者不需要生产静态页,则不生成
      if (!StringUtils.isBlank(c.getLink()) || !c.getStaticChannel()) {
        continue;
      }
      // 没有内容或者有子栏目,则只生成一页
      int childs = childsOfChannel(c.getId());
      if (!c.getModel().getHasContent()) {
        totalPage = 1;
      } else {
        if (c.getListChild()) {
          quantity = childs;
        } else {
          if(!c.getListChild() && childs > 0){
            quantity=contentsOfParentChannel(c.getId());
          }else{
            quantity = contentsOfChannel(c.getId());
          }
        }
        if (quantity <= 0) {
          totalPage = 1;
        } else {
          totalPage = (quantity - 1) / c.getPageSize() + 1;
        }
      }
      for (int i = 1; i <= totalPage; i++) {
        filename = c.getStaticFilename(i);
        real = realPathResolver.get(filename.toString());
        f = new File(real);
        parent = f.getParentFile();
        if (!parent.exists()) {
          parent.mkdirs();
        }
        tpl = conf.getTemplate(c.getTplChannelOrDef());
        String urlStatic = c.getUrlStatic(i);
        info = URLHelper.getPageInfo(filename.substring(filename
            .lastIndexOf("/")), null);
        FrontUtils.frontPageData(i, info.getHref(), info
            .getHrefFormer(), info.getHrefLatter(), data);
        FrontUtils.putLocation(data, urlStatic);
View Full Code Here


    int count = 0;
    int totalPage;
    String url, real;
    File file, parent;
    Content c;
    Channel chnl;
    CmsSite site;
    PageInfo info;
    Template tpl;
    Writer out = null;
    if (data == null) {
      data = new HashMap<String, Object>();
    }
    while (contents.next()) {
      c = (Content) contents.get(0);
      chnl = c.getChannel();
      // 如果是外部链接或者不生成静态页面,则不生成
      if (!StringUtils.isBlank(c.getLink()) || !chnl.getStaticContent()) {
        continue;
      }
      // 如果不需要生成静态页面,则不生成
      if(!c.getNeedRegenerate()){
        continue;
View Full Code Here

  }
 
  public boolean contentStatic(Content c, Configuration conf,
      Map<String, Object> data) throws IOException, TemplateException {
    // 如果是外部链接或者不生成静态页面,则不生成
    Channel chnl = c.getChannel();
    if (!StringUtils.isBlank(c.getLink()) || !chnl.getStaticContent()) {
      return false;
    }
    // 如果不需要生成静态页面,则不生成
    if(!c.getNeedRegenerate()){
      return false;
View Full Code Here

  }
 
  public CmsGroup save(CmsGroup bean,Integer[] viewChannelIdss, Integer[] contriChannelIds){
    bean.init();
    dao.save(bean);
    Channel c;
    if (viewChannelIdss != null && viewChannelIdss.length > 0) {
      for (Integer cid : viewChannelIdss) {
        c = channelMng.findById(cid);
        bean.addToViewChannels(c);
      }
View Full Code Here

    //清除
    for(Channel channel:contriChannels){
      channel.getContriGroups().remove(bean);
    }
    bean.getContriChannels().remove(bean);
    Channel c;
    if (viewChannelIds != null && viewChannelIds.length > 0) {
      for (Integer cid : viewChannelIds) {
        c = channelMng.findById(cid);
        bean.addToViewChannels(c);
      }
View Full Code Here

  public List<CmsWorkLoadStatistic> statistic(Integer channelId,
      Integer reviewerId, Integer authorId, Date beginDate, Date endDate,
      CmsWorkLoadStatisticGroup group, CmsWorkLoadStatisticDateKind kind) {
    Long count;
    CmsWorkLoadStatistic bean;
    Channel channel = null;
    CmsUser author = null;
    CmsUser reviewer = null;
    Date begin = beginDate;
    Date end = null;
    int add = 1;
View Full Code Here

        pageSize);
  }

  @Transactional(readOnly = true)
  public Channel findById(Integer id) {
    Channel entity = dao.findById(id);
    return entity;
  }
View Full Code Here

      Integer[] userIds, Integer parentId, Map<String, String> attr) {
    // 更新主表
    Updater<Channel> updater = new Updater<Channel>(bean);
    bean = dao.updateByUpdater(updater);
    // 更新父栏目
    Channel parent;
    if (parentId != null) {
      parent = findById(parentId);
    } else {
      parent = null;
    }
View Full Code Here

    }
    return bean;
  }

  public Channel deleteById(Integer id) {
    Channel entity = dao.findById(id);
    for (CmsGroup group : entity.getViewGroups()) {
      group.getViewChannels().remove(entity);
    }
    for (CmsGroup group : entity.getContriGroups()) {
      group.getContriChannels().remove(entity);
    }
    entity = dao.deleteById(id);
    return entity;
  }
View Full Code Here

  }

  @Transactional(readOnly = true)
  public List<CmsTopic> getListByChannel(Integer channelId) {
    List<CmsTopic> list = dao.getGlobalTopicList();
    Channel c = channelMng.findById(channelId);
    list.addAll(dao.getListByChannelIds(c.getNodeIds()));
    return list;
  }
View Full Code Here

TOP

Related Classes of com.jeecms.cms.entity.main.Channel

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.