Package com.jeecms.cms.entity.main

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


      for (Integer rid : roleIds) {
        user.addToRoles(cmsRoleMng.findById(rid));
      }
    }
    if (channelIds != null) {
      Channel channel;
      for (Integer cid : channelIds) {
        channel = channelMng.findById(cid);
        channel.addToUsers(user);
      }
    }
    if (siteIds != null) {
      CmsSite site;
      for (int i = 0, len = siteIds.length; i < len; i++) {
View Full Code Here


      channel.getUsers().remove(user);
    }
    user.getChannels().clear();
    // 添加
    if (channelIds != null) {
      Channel channel;
      for (Integer cid : channelIds) {
        channel = channelMng.findById(cid);
        channel.addToUsers(user);
      }
    }
    unifiedUserMng.update(bean.getId(), password, bean.getEmail());
    return user;
  }
View Full Code Here

    CmsSite site = CmsUtils.getSite(request);
    Integer siteId = site.getId();
    CmsUser user = CmsUtils.getUser(request);
    Integer userId = user.getId();
    // 栏目
    Channel c;
    if (cid != null) {
      c = channelMng.findById(cid);
    } else {
      c = null;
    }
    // 模型
    CmsModel m;
    if (c != null) {
      m = c.getModel();
    } else {
      m = cmsModelMng.getDefModel();
      // TODO m==null给出错误提示
      if (m == null) {
        throw new RuntimeException("default model not found!");
      }
    }
    // 模型项列表
    List<CmsModelItem> itemList = cmsModelItemMng.getList(m.getId(), false,
        false);
    // 栏目列表
    List<Channel> channelList;
    Set<Channel> rights;
    if (user.getUserSite(siteId).getAllChannel()) {
      // 拥有所有栏目权限
      rights = null;
    } else {
      rights = user.getChannels(siteId);
    }
    if (c != null) {
      channelList = c.getListForSelect(rights, true);
    } else {
      List<Channel> topList = channelMng.getTopListByRigth(userId,
          siteId, true);
      channelList = Channel.getListForSelect(topList, rights, true);
    }

    // 专题列表
    List<CmsTopic> topicList;
    if (c != null) {
      topicList = cmsTopicMng.getListByChannel(c.getId());
    } else {
      topicList = new ArrayList<CmsTopic>();
    }
    // 内容模板列表
    List<String> tplList = getTplContent(site, m, null);
View Full Code Here

    Integer siteId = site.getId();
    CmsUser user = CmsUtils.getUser(request);
    // 内容
    Content content = manager.findById(id);
    // 栏目
    Channel channel = content.getChannel();
    // 模型
    CmsModel m = channel.getModel();
    // 模型项列表
    List<CmsModelItem> itemList = cmsModelItemMng.getList(m.getId(), false,
        false);
    // 栏目列表
    Set<Channel> rights;
    if (user.getUserSite(siteId).getAllChannel()) {
      // 拥有所有栏目权限
      rights = null;
    } else {
      rights = user.getChannels(siteId);
    }

    List<Channel> topList = channelMng.getTopList(site.getId(), true);
    List<Channel> channelList = Channel.getListForSelect(topList, rights,
        true);

    // 专题列表
    List<CmsTopic> topicList = cmsTopicMng
        .getListByChannel(channel.getId());
    Set<CmsTopic> topics = content.getTopics();
    for (CmsTopic t : topics) {
      if (!topicList.contains(t)) {
        topicList.add(t);
      }
View Full Code Here

  private WebErrors validateAdd(Integer cid, HttpServletRequest request) {
    WebErrors errors = WebErrors.create(request);
    if (cid == null) {
      return errors;
    }
    Channel c = channelMng.findById(cid);
    if (errors.ifNotExist(c, Channel.class, cid)) {
      return errors;
    }
    Integer siteId = CmsUtils.getSiteId(request);
    if (!c.getSite().getId().equals(siteId)) {
      errors.notInSite(Channel.class, cid);
      return errors;
    }
    return errors;
  }
View Full Code Here

    CmsSite site = CmsUtils.getSite(request);
    bean.setSite(site);
    if (errors.ifNull(channelId, "channelId")) {
      return errors;
    }
    Channel channel = channelMng.findById(channelId);
    if (errors.ifNotExist(channel, Channel.class, channelId)) {
      return errors;
    }
    if (channel.getChild().size() > 0) {
      errors.addErrorCode("content.error.notLeafChannel");
    }
    return errors;
  }
View Full Code Here

    CmsTopic topic = manager.findById(id);
    // 模板
    List<String> tplList = getTplList(request, site, topic.getTplContent());
    // 栏目
    Integer siteId;
    Channel channel = topic.getChannel();
    if (channel != null) {
      siteId = channel.getSite().getId();
    } else {
      siteId = site.getId();
    }
    List<Channel> topList = channelMng.getTopList(siteId, true);
    List<Channel> channelList = Channel.getListForSelect(topList, null,
View Full Code Here

  @RequestMapping("/channel/v_add.do")
  public String add(Integer root, Integer modelId,
      HttpServletRequest request, ModelMap model) {
    CmsSite site = CmsUtils.getSite(request);
    Channel parent = null;
    if (root != null) {
      parent = manager.findById(root);
      model.addAttribute("parent", parent);
      model.addAttribute("root", root);
    }
    // 模型
    CmsModel m = cmsModelMng.findById(modelId);
    // 栏目模板列表
    List<String> channelTplList = getTplChannel(site, m, null);
    // 内容模板列表
    List<String> contentTplList = getTplContent(site, m, null);
    // 模型项列表
    List<CmsModelItem> itemList = cmsModelItemMng.getList(modelId, true,
        false);
    List<CmsGroup> groupList = cmsGroupMng.getList();
    // 浏览会员组列表
    List<CmsGroup> viewGroups = groupList;
    // 投稿会员组列表
    Collection<CmsGroup> contriGroups;
    if (parent != null) {
      contriGroups = parent.getContriGroups();
    } else {
      contriGroups = groupList;
    }
    // 管理员列表
    Collection<CmsUser> users;
    if (parent != null) {
      users = parent.getUsers();
    } else {
      users = cmsUserMng.getAdminList(site.getId(), false, false, null);
    }
    model.addAttribute("channelTplList", channelTplList);
    model.addAttribute("contentTplList", contentTplList);
View Full Code Here

    }
    if (root != null) {
      model.addAttribute("root", root);
    }
    // 栏目
    Channel channel = manager.findById(id);
    // 当前模板,去除基本路径
    int tplPathLength = site.getTplPath().length();
    String tplChannel = channel.getTplChannel();
    if (!StringUtils.isBlank(tplChannel)) {
      tplChannel = tplChannel.substring(tplPathLength);
    }
    String tplContent = channel.getTplContent();
    if (!StringUtils.isBlank(tplContent)) {
      tplContent = tplContent.substring(tplPathLength);
    }
    // 父栏目
    Channel parent = channel.getParent();
    // 模型
    CmsModel m = channel.getModel();
    // 栏目列表
    List<Channel> topList = manager.getTopList(site.getId(), false);
    List<Channel> channelList = Channel.getListForSelect(topList, null,
        channel, false);

    // 栏目模板列表
    List<String> channelTplList = getTplChannel(site, m, channel
        .getTplChannel());
    // 内容模板列表
    List<String> contentTplList = getTplContent(site, m, channel
        .getTplContent());
    List<CmsGroup> groupList = cmsGroupMng.getList();
    // 模型项列表
    List<CmsModelItem> itemList = cmsModelItemMng.getList(m.getId(), true,
        false);
    // 浏览会员组列表、浏览会员组IDS
    List<CmsGroup> viewGroups = groupList;
    Integer[] viewGroupIds = CmsGroup.fetchIds(channel.getViewGroups());
    // 投稿会员组列表
    Collection<CmsGroup> contriGroups;
    if (parent != null) {
      contriGroups = parent.getContriGroups();
    } else {
      contriGroups = groupList;
    }
    // 投稿会员组IDS
    Integer[] contriGroupIds = CmsGroup.fetchIds(channel.getContriGroups());
    // 管理员列表
    Collection<CmsUser> users;
    if (parent != null) {
      users = parent.getUsers();
    } else {
      users = cmsUserMng.getAdminList(site.getId(), false, false, null);
    }
    // 管理员IDS
    Integer[] userIds = channel.getUserIds();
View Full Code Here

  private boolean vldExist(Integer id, Integer siteId, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    Channel entity = manager.findById(id);
    if (errors.ifNotExist(entity, Channel.class, id)) {
      return true;
    }
    if (!entity.getSite().getId().equals(siteId)) {
      errors.notInSite(Channel.class, id);
      return true;
    }
    return false;
  }
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.