private void validateMandatoryItem ( ItemState changedItem ) throws ConstraintViolationException , AccessDeniedException { if ( changedItem . getData ( ) . isNode ( ) && ( changedItem . isAdded ( ) || changedItem . isMixinChanged ( ) ) && ! changesLog . getItemState ( changedItem . getData ( ) . getQPath ( ) ) . isDeleted ( ) ) { // Node not in delete state. It might be a wrong if ( ! changesLog . getItemState ( changedItem . getData ( ) . getIdentifier ( ) ) . isDeleted ( ) ) { NodeData nData = ( NodeData ) changedItem . getData ( ) ; try { validateMandatoryChildren ( nData ) ; } catch ( ConstraintViolationException e ) { throw e ; } catch ( AccessDeniedException e ) { throw e ; } catch ( RepositoryException e ) { LOG . warn ( "Unexpected exception. Probable wrong data. Exception message:" + e . getLocalizedMessage ( ) ) ; } } } }
Validate ItemState which represents the add node for it s all mandatory items