Examples of ActionResult


Examples of org.jahia.bin.ActionResult

            NodeIterator n = action.getNodes();
            while (n.hasNext()) {
                JCRNodeWrapper actionNode = (JCRNodeWrapper) n.next();
                String actionName = actionNode.getProperty("j:action").getString();
                ActionResult r = callAction(request, actionName);
            }
        } catch (RepositoryException e) {

        }
        return "ok";
View Full Code Here

Examples of org.jahia.bin.ActionResult

        // Check in
        versionManager.checkin(pollNode.getPath());
        // Check in poll node
        versionManager.checkin(answerNode.getPath());

        return new ActionResult(HttpServletResponse.SC_OK, null, generateJSONObject(pollNode));
    }
View Full Code Here

Examples of org.jahia.bin.ActionResult

                actionNode = nodeWrapper;
            }
        }
        if (actionNode != null && actionNode.hasProperty("node")) {
            Node n = actionNode.getProperty("node").getNode();
            return new ActionResult(HttpServletResponse.SC_OK, n.getPath());
        }
        return new ActionResult(HttpServletResponse.SC_OK);
    }
View Full Code Here

Examples of org.jahia.bin.ActionResult

*/
public class ResultsAction extends Action {
     private transient static Logger logger = org.slf4j.LoggerFactory.getLogger(VoteAction.class);

    public ActionResult doExecute(HttpServletRequest req, RenderContext renderContext, Resource resource, JCRSessionWrapper session, Map<String, List<String>> parameters, URLResolver urlResolver) throws Exception {
     return new ActionResult(HttpServletResponse.SC_OK, null, VoteAction.generateJSONObject(renderContext.getMainResource().getNode()));
    }
View Full Code Here

Examples of org.qzerver.model.agent.action.providers.ActionResult

        throws ActionResultMarshallerException
    {
        Preconditions.checkNotNull(actionResultClass, "Action result class is null");
        Preconditions.checkNotNull(result, "Result data array is null");

        ActionResult actionResult;
        try {
            actionResult = objectMapper.readValue(result, actionResultClass);
        } catch (IOException e) {
            String message = "Fail to unmarshall action result for identifier " + actionResultClass;
            throw new ActionResultMarshallerException(message, e);
View Full Code Here

Examples of org.qzerver.model.agent.action.providers.ActionResult

        if (alreadyExists != null) {
            throw new IllegalStateException("Action is already perfomed for execution=#" + scheduleExecutionId);
        }

        // Execute action
        ActionResult actionResult;

        try {
            actionResult = actionExecutor.execute(actionDefinition, scheduleExecutionId, address);
            if (actionResult == null) {
                String message = String.format("Action result is null for execution=#[%d] and node=[%s]",
                    scheduleExecutionId, address);
                throw new NullPointerException(message);
            }
        } finally {
            executionTracker.remove(scheduleExecutionId);
        }

        // Marshall execution result
        byte[] actionResultData = actionResultMarshaller.marshall(actionResult);

        // Compose the result record
        ActionAgentResult actionAgentResult = new ActionAgentResult();
        actionAgentResult.setSucceed(actionResult.isSucceed());
        actionAgentResult.setData(actionResultData);

        return actionAgentResult;
    }
View Full Code Here

Examples of webwork.dispatcher.ActionResult

       aRequest.setAttribute("webwork.request_url", aRequest.getRequestURL());

       ServletActionContext.setContext(aRequest, aResponse, getServletContext(), actionName);

       gd.prepareValueStack();
       ActionResult ar = null;
       try
       {
           gd.executeAction();
           ar = gd.finish();
       }
       catch (Throwable e)
       {
           log.warn("Could not execute action:" + e.getMessage());
            try
            {
                aResponse.sendError(404, "Could not execute action [" + actionName + "]:" + e.getMessage() + getHTMLErrorMessage(e));
            }
            catch (IOException e1)
            {
            }
       }

       if (ar != null && ar.getActionException() != null)
       {
         log.warn("Could not execute action:" + ar.getActionException().getMessage());
         //log.error("Could not execute action", ar.getActionException());
         try
         {
           aResponse.sendError(500, ar.getActionException().getMessage() + getHTMLErrorMessage(ar.getActionException()));
         }
         catch (IOException e1)
         {
         }
       }

      // check if no view exists
      if (ar != null && ar.getResult() != null && ar.getView() == null && !ar.getResult().equals(Action.NONE)) {
          try
          {
              aResponse.sendError(404, "No view for result [" + ar.getResult() + "] exists for action [" + actionName + "]");
          }
          catch (IOException e)
          {
          }
      }

      if (ar != null && ar.getView() != null && ar.getActionException() == null)
      {
          String view = ar.getView().toString();
          log.debug("Result:" + view);

          RequestDispatcher dispatcher = null;
          try
          {
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.