Package org.eurekastreams.commons.exceptions

Examples of org.eurekastreams.commons.exceptions.ValidationException.addError()


                    continue;
                }
                // TODO add more property types here
                // once our domain classes have more than just strings.

                validationException.addError(propertyName, "Type not found.");

                // TODO some of these exceptions I either can't get to
                // (because they're programmatically prevented above)
                // or I just plain don't know how to cause. These should be tested as well
            }
View Full Code Here


            originalActivityResults = activityMapper.execute(activityIds);

            // If the original activity cannot be found throw an error right away.
            if (originalActivityResults.size() == 0)
            {
                ve.addError("OriginalActivity", "activity being shared could not be found in the db.");
                throw ve;
            }

            // if a unuqie activity is not found throw an error.
            if (originalActivityResults.size() > 1)
View Full Code Here

                // (because they're programmatically prevented above)
                // or I just plain don't know how to cause. These should be tested as well
            }
            catch (IllegalArgumentException e)
            {
                validationException.addError(propertyName, valueObj + " had an illegal argument");
            }
            catch (IllegalAccessException e)
            {
                validationException.addError(propertyName, valueObj + " couldn't be accessed");
            }
View Full Code Here

            }

            // if a unuqie activity is not found throw an error.
            if (originalActivityResults.size() > 1)
            {
                ve.addError("OriginalActivity", "more than one result was found for the original activity id.");
            }

            ActivityDTO origActivity = originalActivityResults.get(0);

            if (origActivity.getDestinationStream().getType() == EntityType.GROUP)
View Full Code Here

            {
                validationException.addError(propertyName, valueObj + " had an illegal argument");
            }
            catch (IllegalAccessException e)
            {
                validationException.addError(propertyName, valueObj + " couldn't be accessed");
            }
            catch (InvocationTargetException e)
            {
                validationException.addError(propertyName, valueObj + " couldn't be invoked");
            }
View Full Code Here

                DomainGroupModelView group = groupShortNameCacheMapper.fetchUniqueResult(origActivity
                        .getDestinationStream().getUniqueIdentifier());

                if (group != null && !group.isPublic())
                {
                    ve.addError("OriginalActivity", "OriginalActivity from a private group and can not be shared.");
                    throw ve;
                }
                else if (group == null)
                {
                    ve.addError("OriginalActivity", "OriginalActivity Group Entity not found.");
View Full Code Here

                    ve.addError("OriginalActivity", "OriginalActivity from a private group and can not be shared.");
                    throw ve;
                }
                else if (group == null)
                {
                    ve.addError("OriginalActivity", "OriginalActivity Group Entity not found.");
                }
            }

            if (!inActivity.getBaseObjectProperties().equals(origActivity.getBaseObjectProperties()))
            {
View Full Code Here

            {
                validationException.addError(propertyName, valueObj + " couldn't be accessed");
            }
            catch (InvocationTargetException e)
            {
                validationException.addError(propertyName, valueObj + " couldn't be invoked");
            }
        }

        // hibernate would throw an exception on writing,
        // but if we do it manually we can re-wrap hibernate's validation info
View Full Code Here

        ClassValidator validator = new ClassValidator(instance.getClass());
        InvalidValue[] invalidValues = validator.getInvalidValues(instance);

        for (InvalidValue invalidValue : invalidValues)
        {
            validationException.addError(invalidValue.getPropertyName(), invalidValue.getMessage());
        }

        // throw if we had any parse errors or constraints errors
        if (validationException.getErrors().size() > 0)
        {
View Full Code Here

                }
            }

            if (!inActivity.getBaseObjectProperties().equals(origActivity.getBaseObjectProperties()))
            {
                ve.addError("BaseObjectProperties",
                        "Oringal Activity BaseObjectProperties must equal the properties of the Shared Activity.");
            }
            else
            {
                // Push the property back onto the object properties for use
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.