Package org.butor.json

Examples of org.butor.json.CommonRequestArgs


    ResponseHandler<FirmKey> rh = ctx.getResponseHandler();
    if (Strings.isNullOrEmpty(firm.getFirmName())) {
      rh.addMessage(CommonMessageID.MISSING_ARG.getMessage("Name"));
      return;
    }
    CommonRequestArgs cra = ctx.getRequest();
    FirmKey ck = firmDao.insertFirm(firm, cra);
    if (ck == null) {
      rh.addMessage(CommonMessageID.SERVICE_FAILURE.getMessage());
      return;
    }
View Full Code Here


    ResponseHandler<FirmKey> rh = ctx.getResponseHandler();
    if (Strings.isNullOrEmpty(firm.getFirmName())) {
      rh.addMessage(CommonMessageID.MISSING_ARG.getMessage("Name"));
      return;
    }
    CommonRequestArgs cra = ctx.getRequest();
    FirmKey ck = firmDao.updateFirm(firm, cra);
    if (ck == null) {
      rh.addMessage(CommonMessageID.NOT_FOUND.getMessage());
      return;
    }
View Full Code Here

  }

  @Override
  @Transactional
  public void deleteFirm(Context<Firm> ctx, FirmKey firmKey) {
    CommonRequestArgs cra = ctx.getRequest();
    Firm firm = firmDao.readFirm(firmKey.getFirmId(), SecurityConstants.SYSTEM_ID, SecurityConstants.SEC_FUNC_FIRMS, AccessMode.READ, cra);
    if (firm == null) {
      ApplicationException.exception(AuthMessageID.FIRM_NOT_FOUND.getMessage());
    }
    if (firm.isActive()) {
View Full Code Here

  private String secFunc;
  private AuthDao authDao;

  @Override
  public void listRole(Context<Role> ctx, FuncKey criteria, String func) {
    CommonRequestArgs cra = ctx.getRequest();
    ResponseHandler<Role> rh = ctx.getResponseHandler();
    List<Role> list = roleDao.listRole(criteria, func, cra);
    ResponseHandlerHelper.addList(list, rh);
  }
View Full Code Here

    ResponseHandlerHelper.addList(list, rh);
  }

  @Override
  public void readRole(Context<Role> ctx, String roleId) {
    CommonRequestArgs cra = ctx.getRequest();
    if (!authDao.hasAccess(systemId, secFunc, AccessMode.READ, cra)) {
      ApplicationException.exception(DAOMessageID.UNAUTHORIZED.getMessage());
    }
    ResponseHandler<Role> rh = ctx.getResponseHandler();
    RoleKey rk = new RoleKey(roleId);
View Full Code Here

  }

  @Override
  @Transactional
  public void createRole(Context<Role> ctx, Role role) {
    CommonRequestArgs cra = ctx.getRequest();
    if (Strings.isNullOrEmpty(role.getId())) {
      ApplicationException.exception(
          CommonMessageID.MISSING_ARG.getMessage("roleId"));
    }
    if (Strings.isNullOrEmpty(role.getDescription())) {
View Full Code Here

  }

  @Override
  @Transactional
  public void updateRole(Context<Role> ctx, Role role) {
    CommonRequestArgs cra = ctx.getRequest();
    if (Strings.isNullOrEmpty(role.getId())) {
      ApplicationException.exception(
          CommonMessageID.MISSING_ARG.getMessage("roleId"));
    }
    if (Strings.isNullOrEmpty(role.getDescription())) {
View Full Code Here

  }

  @Override
  @Transactional
  public void deleteRole(Context<Role> ctx, RoleKey roleKey) {
    CommonRequestArgs cra = ctx.getRequest();
    if (!authDao.hasAccess(systemId, secFunc, AccessMode.WRITE, cra)) {
      ApplicationException.exception(DAOMessageID.UNAUTHORIZED.getMessage());
    }
    roleKey.setIdType("role");
    if (roleDao.isRoleRefered(roleKey.getId(), cra)) {
View Full Code Here

  private FuncDao funcDao;

  @Override
  public void listFunc(Context ctx, String sys) {
    ResponseHandler<Object> rh = ctx.getResponseHandler();
    CommonRequestArgs cra = ctx.getRequest();
    List<Func> list = funcDao.listFunc(sys, cra);
    ResponseHandlerHelper.addList(list, rh);
  }
View Full Code Here

  }

  @Override
  public void readFunc(Context ctx, FuncKey funcKey) {
    ResponseHandler<Object> rh = ctx.getResponseHandler();
    CommonRequestArgs cra = ctx.getRequest();
    Func func = funcDao.readFunc(funcKey, cra);
    if (func == null) {
      rh.addMessage(CommonMessageID.NOT_FOUND.getMessage());
      return;
    }
View Full Code Here

TOP

Related Classes of org.butor.json.CommonRequestArgs

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.