public boolean apply(RepositoryHandle repoHandle) { return p.apply(repoHandle.getName()); }
public URI getRepositoryUri(final URI baseUri, final RepositoryHandle repository) { final String repositoryName = repository.getName(); return UriBuilder .fromUri(baseUri) .path("changelog") .path(repositoryName) .build(); }
public Iterable<FileRevisionData> get() { return filter(transform(changeSet.getRevisionsIterable(), toRevisionData(repositoryHandle.getName())), nonZeroModifiedLines); } });
public URI getChangelogUri(final URI baseUri, final FileRevisionData revision, final RepositoryHandle repository) { final String repositoryName = repository.getName(); final String revisionPath = revision.getPath(); final String csId = revision.getCsid(); return UriBuilder .fromUri(baseUri) .path("browse") .path(repositoryName) .path(revisionPath) .queryParam("r", csId) .build(); }
public Collection<String> getRepositoryNames() { // Get FishEye projects final Collection<String> results = new ArrayList<String>(); final List<RepositoryHandle> handles = AppConfig.getsConfig().getRepositoryManager().getHandles(); for (final RepositoryHandle handle : handles) { results.add(handle.getName()); } return results; }
private Set<String> getLocalProjectKeys() { final Set<String> repoData = new HashSet<String>(); for (final RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
public Set<String> getLocalProjectKeys() { Set<String> repoData = new HashSet<String>(); for (RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
private Set<String> getLocalProjectKeys() { final Set<String> repoData = new HashSet<String>(); for (final RepositoryHandle h : AppConfig.getsConfig().getRepositoryManager().getHandles()) { repoData.add(h.getName()); } return repoData; }
public void doGet(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) throws ServletException, IOException { final String remoteUsername = userManager.getRemoteUsername(httpServletRequest); if (remoteUsername == null || remoteUsername.trim().length() == 0) { httpServletResponse.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } final RepositoryManager repositoryManager = AppConfig.getsConfig().getRepositoryManager(); final List<RepositoryHandle> repositoryHandles = repositoryManager.getHandles(); StringBuilder sb = new StringBuilder(); for(RepositoryHandle handle : repositoryHandles) { final String name = handle.getName(); final SvnRepType repType = handle.getCfg().getRepositoryTypeConfig().getSvn(); final String path = repType.getPath(); sb.append(name).append(","); sb.append(path).append(";"); } httpServletResponse.getOutputStream().println(sb.toString()); httpServletResponse.getOutputStream().flush(); // not strictly necessary, but I'm paranoid about these things. httpServletResponse.setStatus(HttpServletResponse.SC_OK); }
private String getPathToCurrentRepo(String repositoryKey, List<RepositoryHandle> repositoryHandles) { String pathToCurrentRepo = null; for(RepositoryHandle handle : repositoryHandles) { if(handle.getName().equals(repositoryKey)) { final SvnRepType repType = handle.getCfg().getRepositoryTypeConfig().getSvn(); final String repositoryPath = repType.getPath(); if(!StringUtils.isBlank(repositoryPath)) { pathToCurrentRepo = repositoryPath + "/"; } else { pathToCurrentRepo = ""; } break; } } if(pathToCurrentRepo == null) { log.warn("Could not find a path for repository " + repositoryKey); pathToCurrentRepo = repositoryKey + "/"; } return pathToCurrentRepo; }
public StreamsKey apply(RepositoryHandle handle) { final String description = handle.getCfg().getRepositoryTypeConfig().getDescription(); return new StreamsKey(handle.getName(), description == null ? "" : description); } };
public StreamsEntry getEntry(final URI baseUri, final ChangesetDataFE changeSet, final RepositoryHandle repositoryHandle) { final StreamsUriBuilder streamsUriBuilder = new StreamsUriBuilder(); final URI uri = uriProvider.getChangeSetUri(baseUri, changeSet, repositoryHandle); streamsUriBuilder.setUrl(uri.toASCIIString()); StreamsEntry.Parameters params = StreamsEntry.params(); if (permissionAccessor.isCreateReviewAllowed()) { params = params.addLink(uriProvider.getChangesetReviewUri(baseUri, changeSet.getCsid(), repositoryHandle.getName()), CHANGESET_REVIEW_REL, none(String.class)); } return new StreamsEntry(params .id(streamsUriBuilder.getUri()) .postedDate(new DateTime(changeSet.getDate())) .applicationType(FISHEYE_APPLICATION_TYPE) .categories(ImmutableList.of(COMMIT_CATEGORY)) .authors(ImmutableNonEmptyList.of(userProfileAccessor.getUserProfile(baseUri, getUserName(changeSet)))) .addLink(uriProvider.getCommitIconUri(baseUri), ICON_LINK_REL, some(i18nResolver.getText("streams.item.fisheye.tooltip.changeset"))) .alternateLinkUri(uri) .addActivityObject(buildActivityObject(baseUri, changeSet, repositoryHandle)) .verb(push()) .target(some(buildActivityObject(baseUri, repositoryHandle))) .baseUri(baseUri) .renderer(rendererFactory.newRenderer(changeSet, repositoryHandle, baseUri)), i18nResolver); }