Package org.drools.repository.remoteapi

Examples of org.drools.repository.remoteapi.RestAPI


        doAuthorizedAction(req,
                res,
                new Command() {
                    public void execute() throws Exception {
                        res.setContentType("text/html");
                        RestAPI api = getAPI();
                        String comment = req.getHeader("Checkin-Comment");
                        api.post(req.getRequestURI(),
                                req.getInputStream(),
                                (comment != null) ? comment : "");
                        res.getWriter().write("OK");
                    }
                });
View Full Code Here


            IOException {
        doAuthorizedAction(req,
                res,
                new Command() {
                    public void execute() throws Exception {
                        RestAPI api = getAPI();
                        String qString = req.getQueryString();
                        String ur = req.getRequestURI();
                        if (qString != null && qString.length() > 0) {
                            ur = ur + '?' + qString;
                        }
                        Response apiRes = api.get(ur);
                        res.setContentType("application/x-download");
                        res.setHeader("Content-Disposition",
                                "attachment; filename=data;");
                        apiRes.writeData(res.getOutputStream());
                        res.getOutputStream().flush();
View Full Code Here

        doAuthorizedAction(req,
                res,
                new Command() {
                    public void execute() throws Exception {
                        res.setContentType("text/html");
                        RestAPI api = getAPI();
                        String comment = req.getHeader("Checkin-Comment");
                        Calendar lastMod = getModified(req.getHeader("Last-Modified"));
                        api.put(req.getRequestURI(),
                                lastMod,
                                req.getInputStream(),
                                (comment != null) ? comment : "");
                        res.getWriter().write("OK");
                    }
View Full Code Here

        doAuthorizedAction(req,
                res,
                new Command() {
                    public void execute() throws Exception {
                        res.setContentType("text/html");
                        RestAPI api = getAPI();
                        api.delete(req.getRequestURI());
                        res.getWriter().write("OK");
                    }
                });
    }
View Full Code Here

                    }
                });
    }

    RestAPI getAPI() {
        return new RestAPI(rulesRepository);
    }
View Full Code Here

                          final HttpServletResponse res) throws ServletException,
                                                       IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          res.setContentType( "text/html" );
          RestAPI api = getAPI();
          String comment = req.getHeader("Checkin-Comment");
          api.post(req.getRequestURI(), req.getInputStream(), (comment != null)? comment : "");
          res.getWriter().write( "OK" );
      }
        });
    }
View Full Code Here

    protected void doGet(final HttpServletRequest req,
                         final HttpServletResponse res) throws ServletException,
                                                 IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          RestAPI api = getAPI();
          String qString = req.getQueryString();
          String ur = req.getRequestURI();
          if (qString != null && qString.length() > 0) {
            ur = ur + '?' + qString;
          }
          Response apiRes = api.get(ur);
              res.setContentType( "application/x-download" );
              res.setHeader( "Content-Disposition",
                             "attachment; filename=data;");
          apiRes.writeData(res.getOutputStream());
          res.getOutputStream().flush();
View Full Code Here

    protected void doPut(final HttpServletRequest req, final HttpServletResponse res)
        throws ServletException, IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          res.setContentType( "text/html" );
          RestAPI api = getAPI();
          String comment = req.getHeader("Checkin-Comment");
          Calendar lastMod = getModified(req.getHeader("Last-Modified"));
          api.put(req.getRequestURI(), lastMod, req.getInputStream()(comment != null)? comment : "");
          res.getWriter().write( "OK" );
      }
        });
    }
View Full Code Here

    protected void doDelete(final HttpServletRequest req, final HttpServletResponse res)
        throws ServletException, IOException {
        doAuthorizedAction(req, res, new A() {
      public void a() throws Exception {
          res.setContentType( "text/html" );
          RestAPI api = getAPI();
          api.delete(req.getRequestURI());
          res.getWriter().write( "OK" );
      }
        });
    }
View Full Code Here

    }

  }

  RestAPI getAPI()  {
    return new RestAPI(getRepository());
  }
View Full Code Here

TOP

Related Classes of org.drools.repository.remoteapi.RestAPI

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.