Package org.apache.commons.chain

Examples of org.apache.commons.chain.Command.execute()


   public void testGetNodes() throws Exception
   {

      Command c = cservice.getCatalog().getCommand("getNodes");
      ctx.put("currentNode", "/");
      c.execute(ctx);

      assertTrue(ctx.get("result") instanceof NodeIterator);
      NodeIterator nodes = (NodeIterator)ctx.get("result");

      // System.out.println("> getNodes >> "+nodes.getSize());
View Full Code Here


      ctx.put("currentNode", "/");
      ctx.put("path", "resource");
      ctx.put("data", "Node data");
      ctx.put("mimeType", "text/html");

      c.execute(ctx);

      System.out.println(">>> Resource >>> " + ctx.get("result"));

      Command save = cservice.getCatalog().getCommand("save");
      ctx.put("path", "/");
View Full Code Here

      System.out.println(">>> Resource >>> " + ctx.get("result"));

      Command save = cservice.getCatalog().getCommand("save");
      ctx.put("path", "/");
      save.execute(ctx);

   }

   public void testGetNodeChain() throws Exception
   {
View Full Code Here

   public void testGetNodeChain() throws Exception
   {
      Command cmd = cservice.getCatalog().getCommand("retrieveNodeCommand");
      ctx.put("currentNode", "/");
      ctx.put("path", "test");
      cmd.execute(ctx);

      System.out.println("RESULT >>>>>> " + ctx.get("result"));

   }
}
View Full Code Here

        ServletWebContext context =
            new ServletWebContext(getServletContext(), request, response);
        Command command = catalog.getCommand("COMMAND_MAPPER");
        try {
            command.execute(context);
        } catch (Exception e) {
            throw new ServletException(e);
        }

    }
View Full Code Here

     */
    public boolean execute(Context context) throws Exception {

        Command command = getCommand(context);
        if (command != null) {
            boolean result = (command.execute(context));
            if (isIgnoreExecuteResult()) {
                return false;
            }
            return result;
        } else {
View Full Code Here

        if (attribute == null) {
            request.setAttribute(CATALOG_DEFAULT, theCatalog);
        }
        Command command = theCatalog.getCommand(this.command);
        try {
            command.execute(context);
        } catch (Exception e) {
            throw new ServletException(e);
        }

    }
View Full Code Here

        String value = request.getParameter(getParameter());

        // Map to the Command specified by the extra path info
        Catalog catalog = (Catalog) context.get(getCatalogKey());
        Command command = catalog.getCommand(value);
        return (command.execute(context));

    }


}
View Full Code Here

        }

        // Map to the Command specified by the extra path info
        Catalog catalog = (Catalog) context.get(getCatalogKey());
        Command command = catalog.getCommand(pathInfo);
        return (command.execute(context));

    }


}
View Full Code Here

        if (attribute == null) {
            request.setAttribute(CATALOG_DEFAULT, theCatalog);
        }
        Command command = theCatalog.getCommand(this.command);
        try {
            command.execute(context);
        } catch (Exception e) {
            throw new ServletException(e);
        }

    }
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.