Collection<org.uberfire.backend.organizationalunit.OrganizationalUnit> origOrgUnits
= organizationalUnitService.getOrganizationalUnits();
List<OrganizationalUnit> organizationalUnits = new ArrayList<OrganizationalUnit>();
for ( org.uberfire.backend.organizationalunit.OrganizationalUnit ou : origOrgUnits ) {
OrganizationalUnit orgUnit = new OrganizationalUnit();
orgUnit.setName( ou.getName() );
orgUnit.setOwner( ou.getOwner() );
orgUnit.setRepositories( new ArrayList<String>() );
List<String> repoNames = new ArrayList<String>();
for ( Repository r : ou.getRepositories() ) {
repoNames.add( r.getAlias() );
}
orgUnit.setRepositories( repoNames );
organizationalUnits.add( orgUnit );
}
return organizationalUnits;
}