From 9119cf9d89257717b486c59b73bacc7c375501fc Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 4 Nov 2011 17:24:45 -0400 Subject: Search added to gbapi. Search dialog for Manager. Misc Manager fixes. --- src/com/gitblit/client/GitblitClient.java | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'src/com/gitblit/client/GitblitClient.java') diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java index dcc7dfc5..e8460f5f 100644 --- a/src/com/gitblit/client/GitblitClient.java +++ b/src/com/gitblit/client/GitblitClient.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import com.gitblit.Constants; import com.gitblit.GitBlitException.ForbiddenException; import com.gitblit.GitBlitException.NotAllowedException; import com.gitblit.GitBlitException.UnauthorizedException; @@ -213,17 +214,31 @@ public class GitblitClient implements Serializable { return status; } + public List getBranches(String repository) { + List feeds = getAvailableFeeds(repository); + List branches = new ArrayList(); + for (FeedModel feed : feeds) { + branches.add(feed.branch); + } + Collections.sort(branches); + return branches; + } + public List getAvailableFeeds() { return availableFeeds; } public List getAvailableFeeds(RepositoryModel repository) { + return getAvailableFeeds(repository.name); + } + + public List getAvailableFeeds(String repository) { List repositoryFeeds = new ArrayList(); if (repository == null) { return repositoryFeeds; } for (FeedModel feed : availableFeeds) { - if (feed.repository.equalsIgnoreCase(repository.name)) { + if (feed.repository.equalsIgnoreCase(repository)) { repositoryFeeds.add(feed); } } @@ -292,6 +307,12 @@ public class GitblitClient implements Serializable { return syndicatedEntries; } + public List search(String repository, String branch, String fragment, + Constants.SearchType type, int numberOfEntries) throws IOException { + return SyndicationUtils.readSearchFeed(url, repository, branch, fragment, type, + numberOfEntries, account, password); + } + public List refreshFederationRegistrations() throws IOException { List list = RpcUtils.getFederationRegistrations(url, account, password); federationRegistrations.clear(); -- cgit v1.2.3