Package com.dotmarketing.portlets.workflows.model

Examples of com.dotmarketing.portlets.workflows.model.WorkflowTask



  private void _viewWorkflowTask(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    WorkflowTaskForm taskform = (WorkflowTaskForm) form;
    BeanUtils.copyProperties(taskform, task);
    if (task.getDueDate() != null) {
      Calendar cal = GregorianCalendar.getInstance();
      cal.setTime(task.getDueDate());
      taskform.setDueDateDay(String.valueOf(cal.get(Calendar.DATE)));
      taskform.setDueDateMonth(String.valueOf(cal.get(Calendar.MONTH)));
      taskform.setDueDateYear(String.valueOf(cal.get(Calendar.YEAR)));
    }
  }
View Full Code Here



  private void _addWorkflowComment(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String comment = req.getParameter ("comment");
    WorkflowComment taskComment = new WorkflowComment ();
    taskComment.setComment(comment);
    taskComment.setCreationDate(new Date());
    taskComment.setPostedBy(user.getUserId());
    taskComment.setWorkflowtaskId(task.getId());
    wfAPI.saveComment(taskComment);

    String changeDesc = LanguageUtil.get(user, "edit_worflow.history.comment.added") + comment;
    _logWorkflowTaskHistory(task, user, changeDesc);
View Full Code Here

  }

  private void _addFileToWorkflow(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String fileToAttachInode = req.getParameter ("file_inode");
View Full Code Here

  }

  private void _removeFileToWorkflow(ActionRequest req, ActionResponse res,
      PortletConfig config, ActionForm form, User user) throws Exception {

    WorkflowTask task = (WorkflowTask) req.getAttribute(WebKeys.WORKFLOW_TASK_EDIT);
    ActionRequestImpl reqImpl = (ActionRequestImpl) req;
    ActionResponseImpl resImpl  = (ActionResponseImpl) res;
    HttpServletRequest httpReq= reqImpl.getHttpServletRequest();
    HttpServletResponse httpRes= resImpl.getHttpServletResponse();
    String fileToAttachInode = req.getParameter ("file_inode");
View Full Code Here

  }



  private void _retrieveWorkflowTask(ActionRequest req, String webkey) throws Exception {
    WorkflowTask webAsset = (WorkflowTask) wfAPI.findTaskById(req.getParameter("inode"));
    req.setAttribute(webkey, webAsset);
  }
View Full Code Here

    return "This actionlet will complety delete all workflow task information, including history for the content item and reset the content items workflow state.  It will also STOP all further subaction processing";
  }
  @Override
  public void executeAction(WorkflowProcessor processor,Map<String,WorkflowActionClassParameter>  params) throws WorkflowActionFailureException {
    WorkflowTask task = processor.getTask();
    task.setStatus(null);
    try {
      APILocator.getWorkflowAPI().deleteWorkflowTask(task);

      processor.setTask(null);
    } catch (DotDataException e) {
View Full Code Here

   
  }

   protected WorkflowTask getTask(Contentlet contentlet){
   
      WorkflowTask task = null;
      try {
        String taskId = (String) cache.get(contentlet.getIdentifier(), TASK_GROUP);
        task = (WorkflowTask) cache.get(taskId, TASK_GROUP);
      } catch (Exception e) {
        Logger.debug(this.getClass(), e.getMessage());
View Full Code Here

      processor.getContentlet().setStringProperty("wfActionId", processor.getAction().getId());



      WorkflowTask task = processor.getTask();
      if(task != null){
        Role r = APILocator.getRoleAPI().getUserRole(processor.getUser());
        if(task.isNew()){

          task.setCreatedBy(r.getId());
          task.setWebasset(processor.getContentlet().getIdentifier());
          if(processor.getWorkflowMessage() != null){
            task.setDescription(processor.getWorkflowMessage());
          }
        }
        task.setTitle(processor.getContentlet().getTitle());
        task.setModDate(new java.util.Date());
        if(processor.getNextAssign() != null)
          task.setAssignedTo(processor.getNextAssign().getId());
        task.setStatus(processor.getNextStep().getId());

        saveWorkflowTask(task,processor);
        if(processor.getWorkflowMessage() != null){
          WorkflowComment comment = new WorkflowComment();
          comment.setComment(processor.getWorkflowMessage());

          comment.setWorkflowtaskId(task.getId());
          comment.setCreationDate(new Date());
          comment.setPostedBy(r.getId());
          saveComment(comment);
        }
      }
View Full Code Here

    }
  }

  private void updateTask(WorkflowProcessor processor) throws DotDataException{
    WorkflowTask task = processor.getTask();
    task.setModDate(new java.util.Date());
    if(task.isNew()){
      Role r = APILocator.getRoleAPI().getUserRole(processor.getUser());
      task.setCreatedBy(r.getId());
      task.setTitle(processor.getContentlet().getTitle());
    }


    if(processor.getWorkflowMessage() != null){
      WorkflowComment comment = new WorkflowComment();
      comment.setComment(processor.getWorkflowMessage());
      comment.setWorkflowtaskId(task.getId());
      saveComment(comment);
    }

  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.portlets.workflows.model.WorkflowTask

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.