diff options
author | James Moger <james.moger@gitblit.com> | 2011-11-04 17:24:45 -0400 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2011-11-04 17:24:45 -0400 |
commit | 9119cf9d89257717b486c59b73bacc7c375501fc (patch) | |
tree | ce67aa47523abec604f60a5d4fcee7c36702cd01 /src/com/gitblit/client/GitblitClient.java | |
parent | 33d8d8b21c5586f1328c8c3e7f6049037ae5fd0d (diff) | |
download | gitblit-9119cf9d89257717b486c59b73bacc7c375501fc.tar.gz gitblit-9119cf9d89257717b486c59b73bacc7c375501fc.zip |
Search added to gbapi. Search dialog for Manager. Misc Manager fixes.
Diffstat (limited to 'src/com/gitblit/client/GitblitClient.java')
-rw-r--r-- | src/com/gitblit/client/GitblitClient.java | 23 |
1 files changed, 22 insertions, 1 deletions
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<String> getBranches(String repository) {
+ List<FeedModel> feeds = getAvailableFeeds(repository);
+ List<String> branches = new ArrayList<String>();
+ for (FeedModel feed : feeds) {
+ branches.add(feed.branch);
+ }
+ Collections.sort(branches);
+ return branches;
+ }
+
public List<FeedModel> getAvailableFeeds() {
return availableFeeds;
}
public List<FeedModel> getAvailableFeeds(RepositoryModel repository) {
+ return getAvailableFeeds(repository.name);
+ }
+
+ public List<FeedModel> getAvailableFeeds(String repository) {
List<FeedModel> repositoryFeeds = new ArrayList<FeedModel>();
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<SyndicatedEntryModel> 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<FederationModel> refreshFederationRegistrations() throws IOException {
List<FederationModel> list = RpcUtils.getFederationRegistrations(url, account, password);
federationRegistrations.clear();
|