Package com.dotmarketing.portlets.workflows.model

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


                        new Permission(
                                publish.getPermissionType(),
                                publish.getId(),
                                APILocator.getRoleAPI().loadCMSAnonymousRole().getId(),
                                PermissionAPI.PERMISSION_USE) }));
        WorkflowActionClass publishlet=new WorkflowActionClass();
        publishlet.setActionId(publish.getId());
        publishlet.setClazz(com.dotmarketing.portlets.workflows.actionlet.PublishContentActionlet.class.getCanonicalName());
        publishlet.setName("publish");
        publishlet.setOrder(1);
        APILocator.getWorkflowAPI().saveActionClass(publishlet);
       
        // a test structure with that scheme
        Structure st=new Structure();
        st.setName("Rest test st "+salt);
View Full Code Here


    BeanUtils.copyProperties(action, row);
    return action;
  }

  private WorkflowActionClass convertActionClass(Map<String, Object> row) throws IllegalAccessException, InvocationTargetException {
    final WorkflowActionClass actionClass = new WorkflowActionClass();

    row.put("clazz", row.get("clazz"));

    row.put("myOrder", row.get("my_order"));
    row.put("actionId", row.get("action_id"));
View Full Code Here

  public void saveActionClass(WorkflowActionClass actionClass) throws DotDataException,AlreadyExistException {

    boolean isNew = true;
    if (UtilMethods.isSet(actionClass.getId())) {
      try {
        final WorkflowActionClass test = this.findActionClass(actionClass.getId());
        if (test != null) {
          isNew = false;
        }
      } catch (final Exception e) {
        Logger.debug(this.getClass(), e.getMessage(), e);
View Full Code Here

      db.loadResult();
    }

    // update workflowScheme mod date
    WorkflowActionClass actionClass = findActionClass(param.getActionClassId());
    WorkflowAction action = findAction(actionClass.getActionId());
    WorkflowStep step = findStep(action.getStepId());
    WorkflowScheme scheme = findScheme(step.getSchemeId());
    saveScheme(scheme);
  }
View Full Code Here

        db.setSQL(sql.DELETE_ACTION_CLASS_PARAM_BY_ID);
        db.addParam(param.getId());
        db.loadResult();
       
        // update scheme mod date
        WorkflowActionClass clazz = findActionClass(param.getActionClassId());
        WorkflowAction action = findAction(clazz.getActionId());
        WorkflowStep step = findStep(action.getStepId());
        WorkflowScheme scheme = findScheme(step.getSchemeId());
        saveScheme(scheme);
    }
View Full Code Here

    String o = request.getParameter("order");
    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    try {
      int order = Integer.parseInt(o);
      WorkflowActionClass actionClass = wapi.findActionClass(actionClassId);
      wapi.reorderActionClass(actionClass, order);
    } catch (Exception e) {
     
      // dojo sends this Ajax method "reorder Actions" calls, which fail.  Not sure why
      //Logger.error(this.getClass(), e.getMessage(), e);
View Full Code Here

    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    try {

      WorkflowActionClass actionClass = wapi.findActionClass(actionClassId);
      wapi.deleteActionClass(actionClass);
    } catch (Exception e) {
      Logger.error(this.getClass(), e.getMessage(), e);
      writeError(response, e.getMessage());
    }
View Full Code Here

    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    String actionId = request.getParameter("actionId");
    String actionName = request.getParameter("actionletName");
    String clazz = request.getParameter("actionletClass");
    WorkflowActionClass wac = new WorkflowActionClass();

    try {
      WorkflowAction action = wapi.findAction(actionId, APILocator.getUserAPI().getSystemUser());
      List<WorkflowActionClass> classes = wapi.findActionClasses(action);
      if (classes != null) {
        wac.setOrder(classes.size());
      }
      wac.setClazz(clazz);
      wac.setName(actionName);
      wac.setActionId(actionId);
      wapi.saveActionClass(wac);

      response.getWriter().println(wac.getId() + ":" + wac.getName());
    } catch (Exception e) {
      Logger.error(this.getClass(), e.getMessage(), e);
      writeError(response, e.getMessage());
    }
  }
View Full Code Here

  public void save(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    try {
      String actionClassId = request.getParameter("actionClassId");
      WorkflowActionClass wac = wapi.findActionClass(actionClassId);
      WorkFlowActionlet actionlet = wapi.findActionlet(wac.getClazz());
      List<WorkflowActionletParameter> params = actionlet.getParameters();
      Map<String, WorkflowActionClassParameter> enteredParams = wapi.findParamsForActionClass(wac);
      List<WorkflowActionClassParameter> newParams = new ArrayList<WorkflowActionClassParameter>();     
      String userIds = null;
      for (WorkflowActionletParameter expectedParam : params) {       
        WorkflowActionClassParameter enteredParam = enteredParams.get(expectedParam.getKey());
        if (enteredParam == null) {
          enteredParam = new WorkflowActionClassParameter();
        }
        enteredParam.setActionClassId(wac.getId());
        enteredParam.setKey(expectedParam.getKey());
        enteredParam.setValue(request.getParameter("acp-" + expectedParam.getKey()));
        newParams.add(enteredParam);
        userIds = enteredParam.getValue();
        //Validate userIds or emails
        String errors = expectedParam.hasError(userIds);
        if(errors != null){
          writeError(response, errors);
          return;
        }   
      }     
      wapi.saveWorkflowActionClassParameters(newParams);
      response.getWriter().println(wac.getId() + ":" + wac.getName());
    } catch (Exception e) {
      Logger.error(this.getClass(), e.getMessage(), e);
      writeError(response, e.getMessage());
    }
  }
View Full Code Here

            }

            wapi.saveAction(newAction, permissions);

      if(isNew){
        WorkflowActionClass wac = new WorkflowActionClass();
        wac.setActionId(newAction.getId());
        wac.setClazz(NotifyAssigneeActionlet.class.getName());
        wac.setName(NotifyAssigneeActionlet.class.newInstance().getName());
        wac.setOrder(0);
        wapi.saveActionClass(wac);
       
      }
     
     
View Full Code Here

TOP

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

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.