private boolean verifyTypesForParentChildRelationship(String childType,String parentType,String childId,Errors errors){
  if (childType.equals(Constants.notebook) && !(parentType.equals(Constants.tableofcontents) || parentType.equals(Constants.notebook))) {
    Errors.add(errors,errorMessages.errorInvalidRelatedType(childType,parentType,childId));
    return false;
  }
  if ((childType.equals(Constants.note) || childType.equals(Constants.quotation) || childType.equals(Constants.source)) && !(parentType.equals(Constants.root) || parentType.equals(Constants.note) || parentType.equals(Constants.quotation)|| parentType.equals(Constants.source))) {
    Errors.add(errors,errorMessages.errorInvalidRelatedType(childType,parentType,childId));
    return false;
  }
  return true;
}

private boolean verifyTypesForParentChildRelationship ( String childType , String parentType , String childId , Errors errors ) { if ( childType . equals ( Constants . notebook ) && ! ( parentType . equals ( Constants . tableofcontents ) || parentType . equals ( Constants . notebook ) ) ) { Errors . add ( errors , errorMessages . errorInvalidRelatedType ( childType , parentType , childId ) ) ; return false ; } if ( ( childType . equals ( Constants . note ) || childType . equals ( Constants . quotation ) || childType . equals ( Constants . source ) ) && ! ( parentType . equals ( Constants . root ) || parentType . equals ( Constants . note ) || parentType . equals ( Constants . quotation ) || parentType . equals ( Constants . source ) ) ) { Errors . add ( errors , errorMessages . errorInvalidRelatedType ( childType , parentType , childId ) ) ; return false ; } return true ; }
verify that types of the parent and child are valid for a relationship .
