Package org.eurekastreams.commons.exceptions

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


                throw valEx;
            }
        }
        else
        {
            valEx.addError("validator_required",
                    "The supplied activity does not have a corresponding validator and cannot be persisted.");
            throw valEx;
        }
    }
}
View Full Code Here


        // insure valid recipient
        PersonModelView recipient = personMapper.execute(params.getRecipientAccountId());
        if (recipient == null)
        {
            ve.addError("recipientAccountId", "Unknown or missing recipient account id.");
        }
        else if (recipient.isAccountLocked())
        {
            ve.addError("recipientAccountId", "Cannot send notifications to locked users.");
        }
View Full Code Here

        {
            ve.addError("recipientAccountId", "Unknown or missing recipient account id.");
        }
        else if (recipient.isAccountLocked())
        {
            ve.addError("recipientAccountId", "Cannot send notifications to locked users.");
        }
        else
        {
            inActionContext.getState().put("recipient", recipient);
        }
View Full Code Here

        }

        // message
        if (params.getMessage() == null || params.getMessage().isEmpty())
        {
            ve.addError("message", "Message must be provided.");
        }
        else if (params.getMessage().length() > maxMessageLength)
        {
            ve.addError("message", "Message must be no more than " + maxMessageLength + " characters.");
        }
View Full Code Here

        {
            ve.addError("message", "Message must be provided.");
        }
        else if (params.getMessage().length() > maxMessageLength)
        {
            ve.addError("message", "Message must be no more than " + maxMessageLength + " characters.");
        }
        // TODO: Should we check content of message?

        // URL
        if (params.getUrl() != null && params.getUrl().length() > maxUrlLength)
View Full Code Here

        // TODO: Should we check content of message?

        // URL
        if (params.getUrl() != null && params.getUrl().length() > maxUrlLength)
        {
            ve.addError("url", "URL must be no more than " + maxUrlLength + " characters.");
        }
        // TODO: Should we check format of URL?

        if (ve.hasErrors())
        {
View Full Code Here

        ValidationException vex = new ValidationException();
        SetFollowingStatusRequest inRequest = (SetFollowingStatusRequest) inActionContext.getParams();

        if (!inRequest.getTargetEntityType().equals(EntityType.GROUP))
        {
            vex.addError("EntityType", "This action only supports following a group.");
        }

        DomainGroupModelView targetResult = domainGroupMapper.fetchUniqueResult(inRequest.getTargetUniqueId());

        if (targetResult == null)
View Full Code Here

        DomainGroupModelView targetResult = domainGroupMapper.fetchUniqueResult(inRequest.getTargetUniqueId());

        if (targetResult == null)
        {
            vex.addError("FollowerAndTarget", "Target unique id must refer to valid entity.");
        }

        if (vex.getErrors().size() > 0)
        {
            throw vex;
View Full Code Here

        Tab destinationTab = tabMapper.findById(targetTabId);

        // Ensure that the destination tab exists.
        if (destinationTab == null)
        {
            vex.addError("invalidTab", "Destination zone does not exist.");
            throw vex;
        }

        TabTemplate destinationTemplate = destinationTab.getTemplate();
        Layout destinationLayout = destinationTemplate.getTabLayout();
View Full Code Here

        inActionContext.getState().put("sourceTemplate", sourceTemplate);

        // Destination zone is within the valid number of destination zones.
        if (targetZoneNumber + 1 > destinationLayout.getNumberOfZones())
        {
            vex.addError("invalidZone", "ReorderGadgetAction told to move a gadget to a nonexistent zone.");
            throw vex;
        }

        // Ensure that the gadget to be moved exists.
        if (sourceTemplate == null)
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.