From 074b4b4599383cd1b9ed1132c7474a5aaf292e78 Mon Sep 17 00:00:00 2001
From: James Moger <james.moger@gitblit.com>
Date: Mon, 07 Nov 2011 21:17:13 -0500
Subject: [PATCH] Updated to Wicket 1.4.19

---
 src/com/gitblit/client/GitblitClient.java |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/src/com/gitblit/client/GitblitClient.java b/src/com/gitblit/client/GitblitClient.java
index dcc7dfc..588b6d8 100644
--- a/src/com/gitblit/client/GitblitClient.java
+++ b/src/com/gitblit/client/GitblitClient.java
@@ -25,6 +25,7 @@
 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;
@@ -100,13 +101,7 @@
 		refreshSettings();
 		refreshAvailableFeeds();
 		refreshRepositories();
-
-		try {
-			// RSS feeds may be disabled by server
-			refreshSubscribedFeeds();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
+		refreshSubscribedFeeds(0);
 
 		try {
 			// credentials may not have administrator access
@@ -213,17 +208,31 @@
 		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);
 			}
 		}
@@ -238,14 +247,14 @@
 		return availableFeeds;
 	}
 
-	public List<SyndicatedEntryModel> refreshSubscribedFeeds() throws IOException {
+	public List<SyndicatedEntryModel> refreshSubscribedFeeds(int page) throws IOException {
 		Set<SyndicatedEntryModel> allEntries = new HashSet<SyndicatedEntryModel>();
 		if (reg.feeds.size() > 0) {
 			for (FeedModel feed : reg.feeds) {
 				feed.lastRefreshDate = feed.currentRefreshDate;
 				feed.currentRefreshDate = new Date();
 				List<SyndicatedEntryModel> entries = SyndicationUtils.readFeed(url,
-						feed.repository, feed.branch, -1, account, password);
+						feed.repository, feed.branch, -1, page, account, password);
 				allEntries.addAll(entries);
 			}
 		}
@@ -292,6 +301,12 @@
 		return syndicatedEntries;
 	}
 
+	public List<SyndicatedEntryModel> search(String repository, String branch, String fragment,
+			Constants.SearchType type, int numberOfEntries, int page) throws IOException {
+		return SyndicationUtils.readSearchFeed(url, repository, branch, fragment, type,
+				numberOfEntries, page, account, password);
+	}
+
 	public List<FederationModel> refreshFederationRegistrations() throws IOException {
 		List<FederationModel> list = RpcUtils.getFederationRegistrations(url, account, password);
 		federationRegistrations.clear();

--
Gitblit v1.9.1