/** Retrieves the available locations. */ @Factory("availableCoreRepositories") public List<Repository> getAvailableRepositories() throws ClientException { try { if (availableRepositories == null) { availableRepositories = getRepositoryManager().getRepositories(); } List<Repository> result = new ArrayList<Repository>(); result.addAll(availableRepositories); return result; } catch (Throwable t) { throw ClientException.wrap(t); } }
public String selectRepository(String repositoryName) throws ClientException { try { Repository selectedRepository = null; for (Repository repo : getRepositoryManager().getRepositories()) { if (repo.getName().equals(repositoryName)) { selectedRepository = repo; break; } } log.debug("Selected core name: " + repositoryName); if (selectedRepository != null) { RepositoryLocation selectedLocation = new RepositoryLocation(selectedRepository.getName()); navigationContext.setCurrentServerLocation(selectedLocation); return DEFAULT_VIEW; } else { return null; } } catch (Throwable t) { throw ClientException.wrap(t); } }