Package org.apache.commons.chain

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


         if (cmd == null)
            throw new Exception("No 'displayResource' command found");
         ctx.put("path", currentPath);
         ctx.put("cache-control-max-age", getServletConfig().getInitParameter("cache-control-max-age"));
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         e.printStackTrace(); //NOSONAR
         throw new ServletException(e);
View Full Code Here


         {
            // Set the portal classloader to get all the resources defined within the portal context
            Thread.currentThread().setContextClassLoader(pcClassLoader);
            hasChanged = true;
         }        
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         log.error("An error occurs while executing the command " + commandName, e);
         throw new ServletException(e);
View Full Code Here

      ctx.put("name", "testProperty");
      ctx.put("propertyType", PropertyType.TYPENAME_STRING);
      ctx.put("values", "testValue");
      ctx.put("multiValued", Boolean.FALSE);

      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      save.execute(ctx);

   }
View Full Code Here

      ctx.put("multiValued", Boolean.FALSE);

      c.execute(ctx);

      Command save = cservice.getCatalog().getCommand("save");
      save.execute(ctx);

   }

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

   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");

      assertTrue(nodes.getSize() > 0);
View Full Code Here

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

      c.execute(ctx);

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

      c.execute(ctx);

      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", "foo");
      cmd.execute(ctx);
   }
}
View Full Code Here

         if (cmd == null)
            throw new Exception("No 'displayResource' command found");
         ctx.put("path", currentPath);
         ctx.put("cache-control-max-age", getServletConfig().getInitParameter("cache-control-max-age"));
         cmd.execute(ctx);
      }
      catch (Exception e)
      {
         e.printStackTrace(); //NOSONAR
         throw new ServletException(e);
View Full Code Here

            jd = jobDefinitionManager.getJobDefinitionByName(jobName);
            if (jd != null)
            {
                jd.setTerminatedWithError(false);
            }
            cmd.execute(ctx);
            log.info("job executed successfully [{}]", jobName);

        }
        catch (Exception 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.