return GlobalResults.ACCESS_TO_NO_REPOS;
}
Set<String> projects = new LinkedHashSet<String>();
RepositorySession repositorySession = repositorySessionFactory.createSession();
Set<String> namespaces;
try
{
MetadataResolver metadataResolver = repositorySession.getResolver();
Set<String> namespacesToCollapse = new LinkedHashSet<String>();
for ( String repoId : selectedRepos )
{
namespacesToCollapse.addAll( metadataResolver.resolveNamespaces( repositorySession, repoId, groupId ) );
projects.addAll( metadataResolver.resolveProjects( repositorySession, repoId, groupId ) );
}
// TODO: this logic should be optional, particularly remembering we want to keep this code simple
// it is located here to avoid the content repository implementation needing to do too much for what
// is essentially presentation code
namespaces = new LinkedHashSet<String>();
for ( String n : namespacesToCollapse )
{
// TODO: check performance of this
namespaces.add(
collapseNamespaces( repositorySession, metadataResolver, selectedRepos, groupId + "." + n ) );
}
}
finally
{
repositorySession.close();
}
this.namespaces = getSortedList( namespaces );
this.projectIds = getSortedList( projects );
return SUCCESS;