Пример #1
0
 public void deleteGood(@WebParam(name = "id") Long id) throws WebServiceException {
   try {
     if (id == null || id == 0)
       throw new WebServiceException(Constants.objectIsNull, "ID is null or empty");
     bean.deleteGood(id);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
Пример #2
0
 public void createGood(@WebParam(name = "good") GoodWrapper good) throws WebServiceException {
   try {
     validator.validate(good);
     bean.createGood(good);
   } catch (ValidatorException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
Пример #3
0
 public void changeGoodProperty(
     @WebParam(name = "id") Long id,
     @WebParam(name = "property") GoodProperty property,
     @WebParam(name = "newValue") String newValue)
     throws WebServiceException {
   if (id == null || id == 0)
     throw new WebServiceException(Constants.objectIsNull, "ID is null or empty");
   if (property == null || newValue == null || newValue.trim().length() == 0)
     throw new WebServiceException(
         Constants.fieldNotFilledProperly, "PropertyName or newValue is NULL");
   try {
     bean.changeGoodProperty(id, property, newValue);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }
Пример #4
0
 public List<GoodWrapper> getGoodList(
     @WebParam(name = "params") PageParam params,
     @WebParam(name = "nameFilter") String nameFilter,
     @WebParam(name = "barcode") String barcode)
     throws WebServiceException {
   if (params != null)
     if (params.getPaged() == null
         || (params.getPaged()
             && (params.getPageNum() == null
                 || params.getPageNum() == 0
                 || params.getPerPage() == null
                 || params.getPerPage() == 0)))
       throw new WebServiceException(Constants.rangeIsIncorrect, "Request range is incorrect");
   try {
     return bean.getGoodList(params, nameFilter, barcode);
   } catch (ServicesException ex) {
     throw new WebServiceException(ex.getErrorCode(), ex.getComment());
   }
 }