Package er.extensions.validation

Examples of er.extensions.validation.ERXValidationException


            } catch (NSValidation.ValidationException e) {
                exception = e;
            }
            if(exception != null) {
                if (exception instanceof ERXValidationException) {
                    ERXValidationException ex = (ERXValidationException) exception;
                    D2WContext context = d2wContext();
                    Object o = ex.object();

                    if (o instanceof EOEnterpriseObject) {
                        EOEnterpriseObject eo = (EOEnterpriseObject) o;
                        context.takeValueForKey(eo.entityName(), "entityName");
                        context.takeValueForKey(ex.propertyKey(), "propertyKey");
                    }
                    ((ERXValidationException) exception).setContext(context);
                   
                    log.info("Validation Exception: " + exception + exception.getMessage());
                    editingContext.revert();
View Full Code Here


        if (outputFilePath != null) {
            log.info("fileName: " + outputFilePath);

            if(new File(outputFilePath).exists()) {
                ERXValidationException ex = ERXValidationFactory.defaultFactory().createException(object(), key(), fileName(), "fileexists");
                validationFailedWithException(ex, fileName(), key());
            } else {
                try {
                    FileOutputStream fileOutputStream = new FileOutputStream(outputFilePath);
                    fileContentz().writeToStream(fileOutputStream);
View Full Code Here

                try {
                  Object[] objs = format.parse(message);
                  String idx = (String) objs[0];
                  ERXValidationFactory factory = ERXValidationFactory.defaultFactory();
                  String method = "UniqueConstraintException." + idx;
                  ERXValidationException ex = factory.createCustomException(null, method);
                  databaseContext.rollbackChanges();
                  throw ex;
                } catch (ParseException e) {
                  log.warn("Error parsing unique constraint exception message: " + message);
                }
View Full Code Here

                  Object parsedObject = format.parseObject(stringValue);
                  String reformatedObject = format.format(parsedObject);
                  result = format.parseObject(reformatedObject);
                } catch(ParseException parseexception) {
                  String keyPath = _value.keyPath();
                  ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
                  component.validationFailedWithException(validationexception, stringValue, keyPath);
                  return;
                } finally {
                  tsFormat.setDefaultFormatTimeZone(formatZone);
                  tsFormat.setDefaultParseTimeZone(parseZone);
                }
              }
            } else {
              try {
                Object parsedObject = format.parseObject(stringValue);
                String reformatedObject = format.format(parsedObject);
                result = format.parseObject(reformatedObject);
              } catch(ParseException parseexception) {
                String keyPath = _value.keyPath();
                ERXValidationException validationexception = new ERXValidationException(ERXValidationException.InvalidValueException, parseexception, keyPath, stringValue);
                component.validationFailedWithException(validationexception, stringValue, keyPath);
                return;
              }
            }
            if(result != null && _useDecimalNumber != null && _useDecimalNumber.booleanValueInComponent(component)) {
View Full Code Here

TOP

Related Classes of er.extensions.validation.ERXValidationException

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.