Package com.jeecms.cms.entity.main

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


    WebErrors errors = WebErrors.create(request);
    CmsSite site = CmsUtils.getSite(request);
    if (vldExist(id, site.getId(), errors)) {
      return errors;
    }
    Content content = manager.findById(id);
    // TODO 是否有编辑的数据权限。
    // 是否有审核后更新权限。
    if (!content.isHasUpdateRight()) {
      errors.addErrorCode("content.error.afterCheckUpdate");
      return errors;
    }
    return errors;
  }
View Full Code Here


    errors.ifEmpty(ids, "ids");
    for (Integer id : ids) {
      if (vldExist(id, site.getId(), errors)) {
        return errors;
      }
      Content content = manager.findById(id);
      // TODO 是否有编辑的数据权限。
      // 是否有审核后删除权限。
      if (!content.isHasDeleteRight()) {
        errors.addErrorCode("content.error.afterCheckDelete");
        return errors;
      }

    }
View Full Code Here

  private boolean vldExist(Integer id, Integer siteId, WebErrors errors) {
    if (errors.ifNull(id, "id")) {
      return true;
    }
    Content entity = manager.findById(id);
    if (errors.ifNotExist(entity, Content.class, id)) {
      return true;
    }
    if (!entity.getSite().getId().equals(siteId)) {
      errors.notInSite(Content.class, id);
      return true;
    }
    return false;
  }
View Full Code Here

  }

  @Transactional(readOnly = true)
  public List<Content> getListByIdsForTag(Integer[] ids, int orderBy) {
    if (ids.length == 1) {
      Content content = findById(ids[0]);
      List<Content> list;
      if (content != null) {
        list = new ArrayList<Content>(1);
        list.add(content);
      } else {
View Full Code Here

        excludeId, titleImg, recommend, title, orderBy, first, count);
  }

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

      Integer[] viewGroupIds, String[] attachmentPaths,
      String[] attachmentNames, String[] attachmentFilenames,
      String[] picPaths, String[] picDescs, Map<String, String> attr,
      Integer channelId, Integer typeId, Boolean draft, CmsUser user,
      boolean forMember) {
    Content entity = findById(bean.getId());
    // 执行监听器
    List<Map<String, Object>> mapList = preChange(entity);
    // 更新主表
    Updater<Content> updater = new Updater<Content>(bean);
    bean = dao.updateByUpdater(updater);
View Full Code Here

    afterChange(bean, mapList);
    return bean;
  }

  public Content check(Integer id, CmsUser user) {
    Content content = findById(id);
    // 执行监听器
    List<Map<String, Object>> mapList = preChange(content);
    ContentCheck check = content.getContentCheck();
    byte userStep = user.getCheckStep(content.getSite().getId());
    byte contentStep = check.getCheckStep();
    byte finalStep = content.getChannel().getFinalStepExtends();
    // 用户审核级别小于当前审核级别,则不能审核
    if (userStep < contentStep) {
      return content;
    }
    check.setRejected(false);
    // 上级审核,清除退回意见。自我审核不清除退回意见。
    if (userStep > contentStep) {
      check.setCheckOpinion(null);
    }
    check.setCheckStep(userStep);
    // 终审
    if (userStep >= finalStep) {
      content.setStatus(ContentCheck.CHECKED);
      // 终审,清除退回意见
      check.setCheckOpinion(null);
      //终审,设置审核者
      check.setReviewer(user);
      check.setCheckDate(Calendar.getInstance().getTime());
View Full Code Here

    }
    return beans;
  }

  public Content reject(Integer id, CmsUser user, Byte step, String opinion) {
    Content content = findById(id);
    Integer siteId = content.getSite().getId();
    byte userStep = user.getCheckStep(siteId);
    byte contentStep = content.getCheckStep();
    // 用户审核级别小于当前审核级别,则不能退回
    if (userStep < contentStep) {
      return content;
    }
    // 执行监听器
    List<Map<String, Object>> mapList = preChange(content);
    ContentCheck check = content.getContentCheck();
    if (!StringUtils.isBlank(opinion)) {
      check.setCheckOpinion(opinion);
    }
    check.setRejected(true);
    // 退回稿件一律为未终审
    content.setStatus(ContentCheck.CHECKING);

    if (step != null) {
      // 指定退回级别,不能大于自身级别
      if (step < userStep) {
        check.setCheckStep(step);
View Full Code Here

    }
    return beans;
  }

  public Content cycle(Integer id) {
    Content content = findById(id);
    // 执行监听器
    List<Map<String, Object>> mapList = preChange(content);
    content.setStatus(ContentCheck.RECYCLE);
    // 执行监听器
    afterChange(content, mapList);
    return content;
  }
View Full Code Here

    }
    return beans;
  }

  public Content recycle(Integer id) {
    Content content = findById(id);
    // 执行监听器
    List<Map<String, Object>> mapList = preChange(content);
    byte contentStep = content.getCheckStep();
    byte finalStep = content.getChannel().getFinalStepExtends();
    if (contentStep >= finalStep && !content.getRejected()) {
      content.setStatus(ContentCheck.CHECKED);
    } else {
      content.setStatus(ContentCheck.CHECKING);
    }
    // 执行监听器
    afterChange(content, mapList);
    return content;
  }
View Full Code Here

TOP

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

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.