Examples of CommandWrapper


Examples of org.mifosplatform.commands.domain.CommandWrapper

    @Path("{requestId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String updateLoanRescheduleRequest(@PathParam("requestId") final Long requestId, @QueryParam("command") final String command,
            final String apiRequestBodyAsJson) {
        CommandWrapper commandWrapper = null;

        if (compareIgnoreCase(command, "approve")) {
            commandWrapper = new CommandWrapperBuilder().approveLoanRescheduleRequest(RescheduleLoansApiConstants.ENTITY_NAME, requestId)
                    .withJson(apiRequestBodyAsJson).build();
        }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @POST
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String createNewHoliday(final String apiRequestBodyAsJson) {

        final CommandWrapper commandRequest = new CommandWrapperBuilder().createHoliday().withJson(apiRequestBodyAsJson).build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.toApiJsonSerializer.serialize(result);
    }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

        final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(jsonApiRequest);

        CommandProcessingResult result = null;
        if (is(commandParam, "activate")) {
            final CommandWrapper commandRequest = builder.activateHoliday(holidayId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        }

        if (result == null) { throw new UnrecognizedQueryParamException("command", commandParam, new Object[] { "activate" }); }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @Path("{holidayId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String update(@PathParam("holidayId") final Long holidayId, final String jsonRequestBody) {

        final CommandWrapper commandRequest = new CommandWrapperBuilder().updateHoliday(holidayId).withJson(jsonRequestBody).build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.toApiJsonSerializer.serialize(result);
    }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @DELETE
    @Path("{holidayId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String delete(@PathParam("holidayId") final Long holidayId) {
        final CommandWrapper commandRequest = new CommandWrapperBuilder().deleteHoliday(holidayId).build();
        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        return this.toApiJsonSerializer.serialize(result);
    }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

        final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson);

        CommandProcessingResult result = null;
        if (is(commandParam, "repayment")) {
            final CommandWrapper commandRequest = builder.loanRepaymentTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "waiveinterest")) {
            final CommandWrapper commandRequest = builder.waiveInterestPortionTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "writeoff")) {
            final CommandWrapper commandRequest = builder.writeOffLoanTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "close-rescheduled")) {
            final CommandWrapper commandRequest = builder.closeLoanAsRescheduledTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "close")) {
            final CommandWrapper commandRequest = builder.closeLoanTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "undowriteoff")) {
            final CommandWrapper commandRequest = builder.undoWriteOffLoanTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        } else if (is(commandParam, "recoverypayment")) {
            final CommandWrapper commandRequest = builder.loanRecoveryPaymentTransaction(loanId).build();
            result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
        }

        if (result == null) { throw new UnrecognizedQueryParamException("command", commandParam); }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @Produces({ MediaType.APPLICATION_JSON })
    public String adjustLoanTransaction(@PathParam("loanId") final Long loanId, @PathParam("transactionId") final Long transactionId,
            final String apiRequestBodyAsJson) {

        final CommandWrapperBuilder builder = new CommandWrapperBuilder().withJson(apiRequestBodyAsJson);
        final CommandWrapper commandRequest = builder.adjustTransaction(loanId, transactionId).build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);

        return this.toApiJsonSerializer.serialize(result);
    }
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @POST
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String createOffice(final String apiRequestBodyAsJson) {

        final CommandWrapper commandRequest = new CommandWrapperBuilder() //
                .createOffice() //
                .withJson(apiRequestBodyAsJson) //
                .build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
View Full Code Here

Examples of org.mifosplatform.commands.domain.CommandWrapper

    @Path("{officeId}")
    @Consumes({ MediaType.APPLICATION_JSON })
    @Produces({ MediaType.APPLICATION_JSON })
    public String updateOffice(@PathParam("officeId") final Long officeId, final String apiRequestBodyAsJson) {

        final CommandWrapper commandRequest = new CommandWrapperBuilder() //
                .updateOffice(officeId) //
                .withJson(apiRequestBodyAsJson) //
                .build();

        final CommandProcessingResult result = this.commandsSourceWritePlatformService.logCommandSource(commandRequest);
View Full Code Here

Examples of org.xmlBlaster.engine.admin.CommandWrapper

   }

   public void testBasic() {
      assertEquals("Wrong node id", "heron", glob.getId());
      String cmd = null;
      CommandWrapper w = null;

      try {
         cmd = "/node/heron/client/joe/?sessionList";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", "joe/?sessionList", w.getTail());
     
         cmd = "/node/heron/client/joe/";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", "joe/", w.getTail());

         cmd = "/node/heron/client/joe";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", "joe", w.getTail());

         cmd = "/node/heron/client/";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());

         cmd = "/node/heron/client";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "/node/heron/client", w.getCommand());
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());

         cmd = "client/joe/?sessionList";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", "joe/?sessionList", w.getTail());
     
         cmd = "client";
         w = new CommandWrapper(glob, cmd);
         assertEquals("Command '" + cmd + "' wrong parsed", "/node/heron/client", w.getCommand());
         assertEquals("Command '" + cmd + "' wrong parsed", "node", w.getRoot());
         assertEquals("Command '" + cmd + "' wrong parsed", "heron", w.getClusterNodeId());
         assertEquals("Command '" + cmd + "' wrong parsed", "client", w.getThirdLevel());
         assertEquals("Command '" + cmd + "' wrong parsed", null, w.getTail());
      }
      catch(XmlBlasterException e) {
         fail("Failed: " + e.toString());
      }
   }
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.