public void handleOrganisationUnits(){
  if (user != null && isOrganisationUnitMode(OrganisationUnitSelectionMode.ACCESSIBLE)) {
    setOrganisationUnits(user.getTeiSearchOrganisationUnitsWithFallback());
    setOrganisationUnitMode(OrganisationUnitSelectionMode.DESCENDANTS);
  }
 else   if (isOrganisationUnitMode(CHILDREN)) {
    Set<OrganisationUnit> organisationUnits=new HashSet<>(getOrganisationUnits());
    for (    OrganisationUnit organisationUnit : getOrganisationUnits()) {
      organisationUnits.addAll(organisationUnit.getChildren());
    }
    setOrganisationUnits(organisationUnits);
    setOrganisationUnitMode(OrganisationUnitSelectionMode.SELECTED);
  }
}

public void handleOrganisationUnits ( ) { if ( user != null && isOrganisationUnitMode ( OrganisationUnitSelectionMode . ACCESSIBLE ) ) { setOrganisationUnits ( user . getTeiSearchOrganisationUnitsWithFallback ( ) ) ; setOrganisationUnitMode ( OrganisationUnitSelectionMode . DESCENDANTS ) ; } else if ( isOrganisationUnitMode ( CHILDREN ) ) { Set < OrganisationUnit > organisationUnits = new HashSet < > ( getOrganisationUnits ( ) ) ; for ( OrganisationUnit organisationUnit : getOrganisationUnits ( ) ) { organisationUnits . addAll ( organisationUnit . getChildren ( ) ) ; } setOrganisationUnits ( organisationUnits ) ; setOrganisationUnitMode ( OrganisationUnitSelectionMode . SELECTED ) ; } }
prepares the organisation units of the given parameters to simplify querying . mode accessible is converted to descendants for organisation units linked to the given user , and mode children is converted to children for organisation units including all their children . mode can be descendants , selected , all only after invoking this method .
