Package org.vosao.service

Examples of org.vosao.service.ServiceResponse


    UserEntity user = getDao().getUserDao().getByEmail(email);
    if (user == null || user.isDisabled()) {
      return ServiceResponse.createErrorResponse(Messages.get(
          "user_not_found"));
    }
    ServiceResponse passwordIncorrect = ServiceResponse.createErrorResponse(
        Messages.get("password_incorrect"));
    if (user.getPassword() == null) {
      if (!StringUtils.isEmpty(password)) {
        return passwordIncorrect;
      }
View Full Code Here


        }
        return ServiceResponse.createSuccessResponse(
            Messages.get("form.field_success_update"));
      }
      else {
        ServiceResponse resp = ServiceResponse.createErrorResponse(
            Messages.get("validation_errors"));
        resp.setMessages(validateErrors);
        return resp;
      }
    }
    else {
      ServiceResponse resp = ServiceResponse.createErrorResponse(
          Messages.get("convertation_errors"));
      resp.setMessages(errors);
      return resp;
    }
  }
View Full Code Here

  @Override
  public ServiceResponse send(final String name, Map<String, String> params) {
    FormEntity form = getDao().getFormDao().getByName(name);
    if (form == null) {
      return new ServiceResponse("error", Messages.get("form_not_found",
          name));
    }
    String msgBody = createLetter(params);
    String subject = form.getLetterSubject();
    ConfigEntity config = getBusiness().getConfigBusiness().getConfig();
    String fromAddress = config.getSiteEmail();
    String fromText = config.getSiteDomain() + " admin";
    String toAddress = form.getEmail();
    String error = EmailUtil.sendEmail(msgBody, subject, fromAddress, fromText,
          toAddress);
    if (error == null) {
      return new ServiceResponse("success", Messages.get(
          "form.success_send", form.getEmail()));
    }
    else {
      return new ServiceResponse("error", error);
    }
  }
View Full Code Here

    ConfigEntity config = getBusiness().getConfigBusiness().getConfig();
    ReCaptchaResponse recaptchaResponse = RecaptchaUtil.check(
        config.getRecaptchaPublicKey(),
        config.getRecaptchaPrivateKey(),
        challenge, response, request);
    ServiceResponse result = new ServiceResponse();
        if (recaptchaResponse.isValid()) {
            return send(name, params);
        }
        else {
                result.setResult("error");
                result.setMessage(recaptchaResponse.getErrorMessage());
        }
    return result;
  }
View Full Code Here

  }

  @Override
  public ServiceResponse deleteFiles(List<String> fileIds) {
    getBusiness().getFileBusiness().remove(StrUtil.toLong(fileIds));
    return new ServiceResponse("success", Messages.get(
        "files.success_delete"));
  }
View Full Code Here

TOP

Related Classes of org.vosao.service.ServiceResponse

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.