Package com.dotmarketing.portlets.workflows.model

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



      WorkflowAPI wapi = APILocator.getWorkflowAPI();
      String wfActionId = (String) contentletFormData.get("wfActionId");
      if(wfActionId!= null){
        WorkflowAction action = null;
        try{
          action = APILocator.getWorkflowAPI().findAction(wfActionId, user);
        }
        catch(Exception e){

        }
        if(action != null
            && ! action.requiresCheckout()
            && APILocator.getContentletAPI().canLock(currentContentlet, user)){

            if(currentContentlet.isLocked())
                APILocator.getContentletAPI().unlock(currentContentlet, user, false);
View Full Code Here


    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);
View Full Code Here

    WebContext ctx = WebContextFactory.get();
        User usr = getUser(ctx.getHttpServletRequest());
    Contentlet c = null;
    WorkflowAPI wapi = APILocator.getWorkflowAPI();
    try {
      WorkflowAction action = wapi.findAction(wfActionId, usr);
      if (action == null) {
        throw new ServletException("No such workflow action");
      }
      c = APILocator.getContentletAPI().find(wfConId, usr, false);
      c.setStringProperty("wfActionId", action.getId());
      c.setStringProperty("wfActionComments", wfActionComments);
      c.setStringProperty("wfActionAssign", wfActionAssign);

      c.setStringProperty("wfPublishDate", wfPublishDate);
      c.setStringProperty("wfPublishTime", wfPublishTime);
View Full Code Here

    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    try {
      int order = Integer.parseInt(o);
      //anyone with permission the workflowscheme portlet can reoirder actions
      WorkflowAction action = wapi.findAction(actionId, APILocator.getUserAPI().getSystemUser());

        wapi.reorderAction(action, order);
    } catch (Exception e) {
      Logger.error(this.getClass(), e.getMessage(), e);
      writeError(response, e.getMessage());
View Full Code Here

    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    try {

      WorkflowAction action = wapi.findAction(actionId, APILocator.getUserAPI().getSystemUser());
      WorkflowStep step = wapi.findStep(action.getStepId());

     
     
     
      wapi.deleteAction(action);
View Full Code Here

    if (actionNextAssign != null && actionNextAssign.startsWith("role-")) {
      actionNextAssign = actionNextAssign.replaceAll("role-", "");
    }
    String actionCondition = request.getParameter("actionCondition");
    String stepId = request.getParameter("stepId");
    WorkflowAction newAction = new WorkflowAction();

    boolean isNew = true;
    try {

      WorkflowAction origAction = APILocator.getWorkflowAPI().findAction(actionId, APILocator.getUserAPI().getSystemUser());
      BeanUtils.copyProperties(newAction, origAction);
      if(origAction !=null || !origAction.isNew()){
        isNew=false;
      }
    } catch (Exception e) {
     
      Logger.debug(this.getClass(), "Unable to find action" + actionId);
View Full Code Here

    WorkflowAPI wapi = APILocator.getWorkflowAPI();

    Contentlet c = null;
    // execute workflow
    try {
      WorkflowAction action = wapi.findAction(wfActionId, getUser());
      if (action == null) {
        throw new ServletException("No such workflow action");
      }

     
     
      // if the worflow requires a checkin
      if(action.requiresCheckout()){
        c = APILocator.getContentletAPI().checkout(wfContentletId, getUser(), true);
        c.setStringProperty("wfActionId", action.getId());
        c.setStringProperty("wfActionComments", wfActionComments);
        c.setStringProperty("wfActionAssign", wfActionAssign);
       
        c.setStringProperty("wfPublishDate", wfPublishDate);
        c.setStringProperty("wfPublishTime", wfPublishTime);
        c.setStringProperty("wfExpireDate", wfExpireDate);
        c.setStringProperty("wfExpireTime", wfExpireTime);
        c.setStringProperty("wfNeverExpire", wfNeverExpire);
        c.setStringProperty("whereToSend", whereToSend);
        c = APILocator.getContentletAPI().checkin(c, getUser(), true);
      }
     
      // if the worflow requires a checkin
      else{
        c = APILocator.getContentletAPI().find(wfContentletId, getUser(), false);
        //c = APILocator.getContentletAPI().findContentletByIdentifier(wfContentletId,false,APILocator.getLanguageAPI().getDefaultLanguage().getId(), getUser(), true);
        c.setStringProperty("wfActionId", action.getId());
        c.setStringProperty("wfActionComments", wfActionComments);
        c.setStringProperty("wfActionAssign", wfActionAssign);
       
        c.setStringProperty("wfPublishDate", wfPublishDate);
        c.setStringProperty("wfPublishTime", wfPublishTime);
View Full Code Here

    String wfActionAssign = request.getParameter("wfActionAssign");
    String wfActionComments = request.getParameter("wfActionComments");
    String wfActionId = request.getParameter("wfActionId");
    String wfCons = request.getParameter("wfCons");
    WorkflowAPI wapi = APILocator.getWorkflowAPI();
    WorkflowAction action = null;
    try{
      action = wapi.findAction(wfActionId, getUser());
      if (action == null) {
        throw new ServletException("No such workflow action");
      }
    }
    catch(Exception e){
      Logger.error(this.getClass(), e.getMessage(), e);
      writeError(response, e.getMessage());
      return;
    }

    StringTokenizer st = new StringTokenizer(wfCons, ",");
    String x = null;
    while(st.hasMoreTokens()){
      try{
         x = st.nextToken();
        if(!UtilMethods.isSet(x)){
          continue;
        }

        Identifier id = APILocator.getIdentifierAPI().find(x);

       
        Contentlet con = null;
        try{
          con = APILocator.getContentletAPI().findContentletByIdentifier(id.getId(), false, APILocator.getLanguageAPI().getDefaultLanguage().getId(), getUser(), false);
        }
        catch(Exception e){
         
         
        }
       
        if(con == null || ! UtilMethods.isSet(con.getInode())){
          List<Language> langs = APILocator.getLanguageAPI().getLanguages();
          for(Language lang : langs){
            con = (Contentlet) APILocator.getContentletAPI().findContentletByIdentifier(id.getId(), false, lang.getId(), getUser(), false);
            if(con != null && UtilMethods.isSet(con.getInode())){
              break;
            }
          }
        }
       
        if(action.requiresCheckout()){

          Contentlet c = APILocator.getContentletAPI().checkout(con.getInode(), getUser(), true);
 
          c.setStringProperty("wfActionId", action.getId());
          c.setStringProperty("wfActionComments", wfActionComments);
          c.setStringProperty("wfActionAssign", wfActionAssign);
         
          c = APILocator.getContentletAPI().checkin(c, getUser(), true);
        }
        else{
          con.setStringProperty("wfActionId", action.getId());
          con.setStringProperty("wfActionComments", wfActionComments);
          con.setStringProperty("wfActionAssign", wfActionAssign);
         
          wapi.fireWorkflowNoCheckin(con, getUser());
         
View Full Code Here

  public void renderAction(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    String actionId=request.getParameter("actionId");

    try {
      WorkflowAction action = APILocator.getWorkflowAPI().findAction(actionId, getUser());
      if(UtilMethods.isSet( action.getCondition())){
       
        Context ctx= VelocityWebUtil.getVelocityContext(request, response);
        Writer out = response.getWriter();
       
        VelocityUtil.getEngine().evaluate(ctx, out,"WorkflowVelocity:" + action.getName(), action.getCondition());
        return;
       
      }
      else{
       
View Full Code Here

    } catch (Exception e) {
      throw new DotDataException(e.getLocalizedMessage());
    }
    order = (order < 0) ? 0 : (order >= actions.size()) ? actions.size()-1 : order;
    for (int i = 0; i < actions.size(); i++) {
      WorkflowAction a = actions.get(i);
      if (action.equals(a)) {
        continue;
      }
      newActions.add(a);
    }
    newActions.add(order, action);
    int newOrder = 0;
    for(WorkflowAction a : newActions){
      a.setOrder(newOrder++);

      saveAction(a);
    }

  }
View Full Code Here

TOP

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

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.