Package net.datacrow.core.objects

Examples of net.datacrow.core.objects.ValidationException


    protected void beforeSave() throws ValidationException {
        Container parent = getParentContainer();
        String ID = getID();
       
        if (parent != null && parent.getID().equals(ID)) {
            throw new ValidationException(DcResources.getText("msgCannotSetItemAsParent"));
        } else  {
            while (parent != null) {
                if (ID.equals(parent.getID()))
                    throw new ValidationException(DcResources.getText("msgCannotSetItemAsParentLoop"));       

                parent = parent.getParentContainer();
            }
        }
        super.beforeSave();
View Full Code Here


       
        String loginname = (String) getValue(_A_LOGINNAME);
        if (loginname != null)
            setValue(_A_LOGINNAME, loginname.toLowerCase());
        else
            throw new ValidationException(DcResources.getText("msgLoginNameNotFilled"));
    }
View Full Code Here

        DcObject original = DataManager.getItem(DcModules._USER, getID(), new int[] {User._A_LOGINNAME, DcObject._ID});
       
        if (!original.getValue(User._A_LOGINNAME).equals(getValue(User._A_LOGINNAME))) {
            setValue(User._A_LOGINNAME, original.getValue(User._A_LOGINNAME));
            getValueDef(User._A_LOGINNAME).setChanged(false);
            throw new ValidationException(DcResources.getText("msgLoginnameIsNotAllowedToChange"));
        }
      }
    }
View Full Code Here

TOP

Related Classes of net.datacrow.core.objects.ValidationException

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.