Package org.eurekastreams.commons.exceptions

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


        }

        // Ensure that the gadget to be moved exists.
        if (sourceTemplate == null)
        {
            vex.addError("invalidGadget", "Gadget to be moved is invalid.");
            throw vex;
        }

        // Create a map of the zonenumbers and a list of the corresponding zone indexes.
        HashMap<Integer, List<Integer>> gadgetZoneIndexes = new HashMap<Integer, List<Integer>>();
View Full Code Here


            // Test that the target zone index is not greater than the last position in the list of indexes
            // or less than the first position in the list of indexes.
            if (targetZoneIndex > targetZoneIndexes.get(targetZoneIndexes.size() - 1) + 1
                    || targetZoneIndex < targetZoneIndexes.get(0) - 1)
            {
                vex.addError("invalidZoneIndex",
                        "Destination zone index is outside of the acceptable bounds for the target zone index.");
                throw vex;
            }
        }
        //If the target zone number does not have any gadgets in it, then the index should always be 0.
View Full Code Here

        else if (!errors.isEmpty())
        {
            ValidationException ve = new ValidationException();
            for (String errorKey : errors.keySet())
            {
                ve.addError(errorKey, errors.get(errorKey));
            }
            throw ve;
        }       
    }
View Full Code Here

            InvalidValue[] invalidValues = e.getInvalidValues();
            ValidationException validationException = new ValidationException();

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

            throw validationException;
        }
        catch (PersistenceException e)
View Full Code Here

        else if (!errors.isEmpty())
        {
            ValidationException ve = new ValidationException();
            for (String errorKey : errors.keySet())
            {
                ve.addError(errorKey, errors.get(errorKey));
            }
            throw ve;
        }
    }
}
View Full Code Here

            }
        }
        //If the target zone number does not have any gadgets in it, then the index should always be 0.
        else if (targetZoneIndex != 0)
        {
            vex.addError("invalidZoneIndex",
                    "Destination zone index should be zero when moving to an empty zone.");
        }
    }
}
View Full Code Here

        }
        catch (Exception e)
        {
            log.error("Validation for gadget definition failed.", e);
            ValidationException ve = new ValidationException();
            ve.addError(URL_KEY, "Valid url is required");
            throw ve;
        }
        finally
        {
            try
View Full Code Here

        {
            object = JSONObject.fromObject(stream.getRequest());
        }
        catch (JSONException ex)
        {
            valEx.addError("stream", "Malformed JSON. Try again later.");
            throw valEx;
        }

        if (stream.getName() == null || stream.getName().length() == 0)
        {
View Full Code Here

            throw valEx;
        }

        if (stream.getName() == null || stream.getName().length() == 0)
        {
            valEx.addError("name", "Stream must have a name.");
            throw valEx;
        }

        JSONObject query = object.getJSONObject("query");
View Full Code Here

            {
                JSONArray arr = query.getJSONArray(keyStr);

                if (arr.size() == 0)
                {
                    valEx.addError("stream", "Add at least one stream");
                    throw valEx;
                }
                else if (arr.size() > MAX_STREAMS)
                {
                    valEx.addError("stream", "Maximum number of streams allowed is " + MAX_STREAMS);
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.