Examples of CommentEntity


Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

    this.message = message;
  }
 
  protected Object execute(CommandContext commandContext, TaskEntity task) {
    String userId = Authentication.getAuthenticatedUserId();
    CommentEntity comment = new CommentEntity();
    comment.setUserId(userId);
    comment.setType(CommentEntity.TYPE_COMMENT);
    comment.setTime(ClockUtil.getCurrentTime());
    comment.setTaskId(taskId);
    comment.setProcessInstanceId(processInstanceId);
    comment.setAction(Event.ACTION_ADD_COMMENT);
   
    String eventMessage = message.replaceAll("\\s+", " ");
    if (eventMessage.length()>163) {
      eventMessage = eventMessage.substring(0, 160)+"...";
    }
    comment.setMessage(eventMessage);
   
    comment.setFullMessage(message);
   
    commandContext
      .getCommentManager()
      .insert(comment);
   
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

        throw new ActivitiException(getSuspendedExceptionMessage());
      }
    }
   
    String userId = Authentication.getAuthenticatedUserId();
    CommentEntity comment = new CommentEntity();
    comment.setUserId(userId);
    comment.setType( (type == null)? CommentEntity.TYPE_COMMENT : type );
    comment.setTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime());
    comment.setTaskId(taskId);
    comment.setProcessInstanceId(processInstanceId);
    comment.setAction(Event.ACTION_ADD_COMMENT);
   
    String eventMessage = message.replaceAll("\\s+", " ");
    if (eventMessage.length()>163) {
      eventMessage = eventMessage.substring(0, 160)+"...";
    }
    comment.setMessage(eventMessage);
   
    comment.setFullMessage(message);
   
    commandContext
      .getCommentEntityManager()
      .insert(comment);
   
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

*/
  @Override
public void createIdentityLinkComment(String taskId, String userId, String groupId, String type, boolean create, boolean forceNullUserId) {
    if(isHistoryEnabled()) {
      String authenticatedUserId = Authentication.getAuthenticatedUserId();
      CommentEntity comment = new CommentEntity();
      comment.setUserId(authenticatedUserId);
      comment.setType(CommentEntity.TYPE_EVENT);
      comment.setTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());
      comment.setTaskId(taskId);
      if (userId!=null || forceNullUserId) {
        if(create) {
          comment.setAction(Event.ACTION_ADD_USER_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_USER_LINK);
        }
        comment.setMessage(new String[]{userId, type});
      } else {
        if(create) {
          comment.setAction(Event.ACTION_ADD_GROUP_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_GROUP_LINK);
        }
        comment.setMessage(new String[]{groupId, type});
      }
      getSession(CommentEntityManager.class).insert(comment);
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

  @Override
  public void createProcessInstanceIdentityLinkComment(String processInstanceId, String userId, String groupId, String type, boolean create, boolean forceNullUserId) {
    if(isHistoryEnabled()) {
      String authenticatedUserId = Authentication.getAuthenticatedUserId();
      CommentEntity comment = new CommentEntity();
      comment.setUserId(authenticatedUserId);
      comment.setType(CommentEntity.TYPE_EVENT);
      comment.setTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());
      comment.setProcessInstanceId(processInstanceId);
      if (userId!=null || forceNullUserId) {
        if(create) {
          comment.setAction(Event.ACTION_ADD_USER_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_USER_LINK);
        }
        comment.setMessage(new String[]{userId, type});
      } else {
        if(create) {
          comment.setAction(Event.ACTION_ADD_GROUP_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_GROUP_LINK);
        }
        comment.setMessage(new String[]{groupId, type});
      }
      getSession(CommentEntityManager.class).insert(comment);
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

*/
  @Override
public void createAttachmentComment(String taskId, String processInstanceId, String attachmentName, boolean create) {
    if (isHistoryEnabled()) {
      String userId = Authentication.getAuthenticatedUserId();
      CommentEntity comment = new CommentEntity();
      comment.setUserId(userId);
      comment.setType(CommentEntity.TYPE_EVENT);
      comment.setTime(Context.getProcessEngineConfiguration().getClock().getCurrentTime());
      comment.setTaskId(taskId);
      comment.setProcessInstanceId(processInstanceId);
      if(create) {
        comment.setAction(Event.ACTION_ADD_ATTACHMENT);
      } else {
        comment.setAction(Event.ACTION_DELETE_ATTACHMENT);
      }
      comment.setMessage(attachmentName);
      getSession(CommentEntityManager.class).insert(comment);
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

   * if history is enabled.
   */
  public void createIdentityLinkComment(String taskId, String userId, String groupId, String type, boolean create) {
    if(isHistoryEnabled()) {
      String authenticatedUserId = Authentication.getAuthenticatedUserId();
      CommentEntity comment = new CommentEntity();
      comment.setUserId(authenticatedUserId);
      comment.setType(CommentEntity.TYPE_EVENT);
      comment.setTime(ClockUtil.getCurrentTime());
      comment.setTaskId(taskId);
      if (userId!=null) {
        if(create) {
          comment.setAction(Event.ACTION_ADD_USER_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_USER_LINK);
        }
        comment.setMessage(new String[]{userId, type});
      } else {
        if(create) {
          comment.setAction(Event.ACTION_ADD_GROUP_LINK);
        } else {
          comment.setAction(Event.ACTION_DELETE_GROUP_LINK);
        }
        comment.setMessage(new String[]{groupId, type});
      }
      getSession(CommentManager.class).insert(comment);
    }
  }
View Full Code Here

Examples of org.activiti.engine.impl.persistence.entity.CommentEntity

   * if history is enabled.
   */
  public void createAttachmentComment(String taskId, String processInstanceId, String attachmentName, boolean create) {
    if (isHistoryEnabled()) {
      String userId = Authentication.getAuthenticatedUserId();
      CommentEntity comment = new CommentEntity();
      comment.setUserId(userId);
      comment.setType(CommentEntity.TYPE_EVENT);
      comment.setTime(ClockUtil.getCurrentTime());
      comment.setTaskId(taskId);
      comment.setProcessInstanceId(processInstanceId);
      if(create) {
        comment.setAction(Event.ACTION_ADD_ATTACHMENT);
      } else {
        comment.setAction(Event.ACTION_DELETE_ATTACHMENT);
      }
      comment.setMessage(attachmentName);
      getSession(CommentManager.class).insert(comment);
    }
  }
View Full Code Here

Examples of org.camunda.bpm.engine.impl.persistence.entity.CommentEntity

    }

    ensureNotNull("Message", message);

    String userId = commandContext.getAuthenticatedUserId();
    CommentEntity comment = new CommentEntity();
    comment.setUserId(userId);
    comment.setType(CommentEntity.TYPE_COMMENT);
    comment.setTime(ClockUtil.getCurrentTime());
    comment.setTaskId(taskId);
    comment.setProcessInstanceId(processInstanceId);
    comment.setAction(Event.ACTION_ADD_COMMENT);

    String eventMessage = message.replaceAll("\\s+", " ");
    if (eventMessage.length() > 163) {
      eventMessage = eventMessage.substring(0, 160) + "...";
    }
    comment.setMessage(eventMessage);

    comment.setFullMessage(message);

    commandContext
      .getCommentManager()
      .insert(comment);
View Full Code Here

Examples of org.vosao.entity.CommentEntity

  @Override
  public CommentEntity addComment(String name, String content,
      PageEntity page) {

    ConfigEntity config = VosaoContext.getInstance().getConfig();
    CommentEntity comment = new CommentEntity(name, content,
        new Date(), page.getFriendlyURL());
    getDao().getCommentDao().save(comment);
    getBusiness().getSystemService().getPageCache().remove(
        page.getFriendlyURL());
    List<String> toAddresses = StrUtil.fromCSV(config.getCommentsEmail());
View Full Code Here

Examples of org.vosao.entity.CommentEntity

    return b.toString();
  }

  private boolean isChangeGranted(List<Long> ids) {
    if (ids.size() > 0) {
      CommentEntity comment = getDao().getCommentDao().getById(ids.get(0));
      ContentPermissionEntity permission = getContentPermissionBusiness()
          .getPermissioncomment.getPageUrl(),
              VosaoContext.getInstance().getUser());
      if (permission != null) {
        return permission.isChangeGranted();
      }
    }   
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.