]> source.dussan.org Git - gitblit.git/commitdiff
Moved SearchType enum to Constants
authorJames Moger <james.moger@gitblit.com>
Fri, 4 Nov 2011 21:21:30 +0000 (17:21 -0400)
committerJames Moger <james.moger@gitblit.com>
Fri, 4 Nov 2011 21:22:06 +0000 (17:22 -0400)
15 files changed:
src/com/gitblit/Constants.java
src/com/gitblit/SyndicationServlet.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/utils/SyndicationUtils.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/pages/CommitPage.java
src/com/gitblit/wicket/pages/RepositoryPage.java
src/com/gitblit/wicket/pages/SearchPage.java
src/com/gitblit/wicket/pages/TagPage.java
src/com/gitblit/wicket/panels/BasePanel.java
src/com/gitblit/wicket/panels/BranchesPanel.java
src/com/gitblit/wicket/panels/HistoryPanel.java
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/SearchPanel.java
tests/com/gitblit/tests/JGitUtilsTest.java

index 2543ea12a57af19bd2c5e4dbbf81e917c84f5d6a..3204a553a9d03acfbed06423afc7466bed6bc7a2 100644 (file)
@@ -227,4 +227,25 @@ public class Constants {
                        return name();\r
                }\r
        }\r
+\r
+       /**\r
+        * Enumeration of the search types.\r
+        */\r
+       public static enum SearchType {\r
+               AUTHOR, COMMITTER, COMMIT;\r
+       \r
+               public static SearchType forName(String name) {\r
+                       for (SearchType type : values()) {\r
+                               if (type.name().equalsIgnoreCase(name)) {\r
+                                       return type;\r
+                               }\r
+                       }\r
+                       return COMMIT;\r
+               }\r
+       \r
+               @Override\r
+               public String toString() {\r
+                       return name().toLowerCase();\r
+               }\r
+       }\r
 }\r
index af0fab715bab87e2c327fb475b31ae164914f69f..128df43f7f727c58bd54ecef7c46946e4dafb51b 100644 (file)
@@ -33,7 +33,6 @@ import com.gitblit.models.RepositoryModel;
 import com.gitblit.models.SyndicatedEntryModel;\r
 import com.gitblit.utils.HttpUtils;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.SyndicationUtils;\r
 \r
@@ -131,9 +130,9 @@ public class SyndicationServlet extends HttpServlet {
                String objectId = request.getParameter("h");\r
                String l = request.getParameter("l");\r
                String searchString = request.getParameter("s");\r
-               SearchType searchType = SearchType.COMMIT;\r
+               Constants.SearchType searchType = Constants.SearchType.COMMIT;\r
                if (!StringUtils.isEmpty(request.getParameter("st"))) {\r
-                       SearchType type = SearchType.forName(request.getParameter("st"));\r
+                       Constants.SearchType type = Constants.SearchType.forName(request.getParameter("st"));\r
                        if (type != null) {\r
                                searchType = type;\r
                        }\r
index 80147d4660b0bf82208e0525abcaea54ef294e89..c61b3d9f757981d5072a205409c40602bbf40b31 100644 (file)
@@ -924,27 +924,6 @@ public class JGitUtils {
                return list;\r
        }\r
 \r
-       /**\r
-        * Enumeration of the search types.\r
-        */\r
-       public static enum SearchType {\r
-               AUTHOR, COMMITTER, COMMIT;\r
-\r
-               public static SearchType forName(String name) {\r
-                       for (SearchType type : values()) {\r
-                               if (type.name().equalsIgnoreCase(name)) {\r
-                                       return type;\r
-                               }\r
-                       }\r
-                       return COMMIT;\r
-               }\r
-\r
-               @Override\r
-               public String toString() {\r
-                       return name().toLowerCase();\r
-               }\r
-       }\r
-\r
        /**\r
         * Search the commit history for a case-insensitive match to the value.\r
         * Search results require a specified SearchType of AUTHOR, COMMITTER, or\r
@@ -963,7 +942,7 @@ public class JGitUtils {
         * @return matching list of commits\r
         */\r
        public static List<RevCommit> searchRevlogs(Repository repository, String objectId,\r
-                       String value, final SearchType type, int offset, int maxCount) {\r
+                       String value, final com.gitblit.Constants.SearchType type, int offset, int maxCount) {\r
                final String lcValue = value.toLowerCase();\r
                List<RevCommit> list = new ArrayList<RevCommit>();\r
                if (maxCount == 0) {\r
index 85d5f8d2c582d4c893ef188326d0ed5c3239f3b5..4ba56223bdcec7949b5bba88ad171d5b8ffdc463 100644 (file)
@@ -22,13 +22,11 @@ import java.io.OutputStreamWriter;
 import java.net.URLConnection;\r
 import java.text.MessageFormat;\r
 import java.util.ArrayList;\r
-import java.util.Arrays;\r
 import java.util.List;\r
 \r
 import com.gitblit.Constants;\r
 import com.gitblit.GitBlitException;\r
 import com.gitblit.models.SyndicatedEntryModel;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.sun.syndication.feed.synd.SyndCategory;\r
 import com.sun.syndication.feed.synd.SyndCategoryImpl;\r
 import com.sun.syndication.feed.synd.SyndContent;\r
@@ -163,7 +161,7 @@ public class SyndicationUtils {
         * @throws {@link IOException}\r
         */\r
        public static List<SyndicatedEntryModel> readSearchFeed(String url, String repository,\r
-                       String branch, String fragment, SearchType searchType, int numberOfEntries,\r
+                       String branch, String fragment, Constants.SearchType searchType, int numberOfEntries,\r
                        String username, char[] password) throws IOException {\r
                // determine parameters\r
                List<String> parameters = new ArrayList<String>();\r
index e5b7f697bfc1a8231c9fe1971fe2668af9403815..f47663cae1ea69fa4fb20678cfb7c267dfb5606e 100644 (file)
@@ -39,13 +39,13 @@ import org.eclipse.jgit.diff.DiffEntry.ChangeType;
 import org.wicketstuff.googlecharts.AbstractChartData;\r
 import org.wicketstuff.googlecharts.IChartData;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.Constants.FederationPullStatus;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.FederationModel;\r
 import com.gitblit.models.Metric;\r
 import com.gitblit.utils.HttpUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.TimeUtils;\r
 \r
@@ -311,7 +311,7 @@ public class WicketUtils {
        }\r
 \r
        public static PageParameters newSearchParameter(String repositoryName, String commitId,\r
-                       String search, SearchType type) {\r
+                       String search, Constants.SearchType type) {\r
                if (StringUtils.isEmpty(commitId)) {\r
                        return new PageParameters("r=" + repositoryName + ",s=" + search + ",st=" + type.name());\r
                }\r
@@ -320,7 +320,7 @@ public class WicketUtils {
        }\r
 \r
        public static PageParameters newSearchParameter(String repositoryName, String commitId,\r
-                       String search, SearchType type, int pageNumber) {\r
+                       String search, Constants.SearchType type, int pageNumber) {\r
                if (StringUtils.isEmpty(commitId)) {\r
                        return new PageParameters("r=" + repositoryName + ",s=" + search + ",st=" + type.name()\r
                                        + ",page=" + pageNumber);\r
index ad3344679b15822131fb14bbc8c29ef5923a531a..dd3decbe5e4f01b83894f69f5a4f0c663a5680c5 100644 (file)
@@ -31,13 +31,13 @@ import org.eclipse.jgit.diff.DiffEntry.ChangeType;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.DownloadZipServlet;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.GitNote;\r
 import com.gitblit.models.PathModel.PathChangeModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.CommitHeaderPanel;\r
 import com.gitblit.wicket.panels.CommitLegendPanel;\r
@@ -78,12 +78,12 @@ public class CommitPage extends RepositoryPage {
                addRefs(r, c);\r
 \r
                // author\r
-               add(createPersonPanel("commitAuthor", c.getAuthorIdent(), SearchType.AUTHOR));\r
+               add(createPersonPanel("commitAuthor", c.getAuthorIdent(), Constants.SearchType.AUTHOR));\r
                add(WicketUtils.createTimestampLabel("commitAuthorDate", c.getAuthorIdent().getWhen(),\r
                                getTimeZone()));\r
 \r
                // committer\r
-               add(createPersonPanel("commitCommitter", c.getCommitterIdent(), SearchType.COMMITTER));\r
+               add(createPersonPanel("commitCommitter", c.getCommitterIdent(), Constants.SearchType.COMMITTER));\r
                add(WicketUtils.createTimestampLabel("commitCommitterDate",\r
                                c.getCommitterIdent().getWhen(), getTimeZone()));\r
 \r
@@ -125,7 +125,7 @@ public class CommitPage extends RepositoryPage {
                                GitNote entry = item.getModelObject();\r
                                item.add(new RefsPanel("refName", repositoryName, Arrays.asList(entry.notesRef)));\r
                                item.add(createPersonPanel("authorName", entry.notesRef.getAuthorIdent(),\r
-                                               SearchType.AUTHOR));\r
+                                               Constants.SearchType.AUTHOR));\r
                                item.add(WicketUtils.createTimestampLabel("authorDate", entry.notesRef\r
                                                .getAuthorIdent().getWhen(), getTimeZone()));\r
                                item.add(new Label("noteContent", GitBlit.self().processCommitMessage(\r
index 2d616a49896cba612c01e394855f80400a11a2b6..4c417d9557e6423c83646f0c4d526804fcee092c 100644 (file)
@@ -38,12 +38,12 @@ import org.eclipse.jgit.lib.PersonIdent;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.SyndicationServlet;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.utils.TicgitUtils;\r
 import com.gitblit.wicket.GitBlitWebSession;\r
@@ -206,7 +206,7 @@ public abstract class RepositoryPage extends BasePage {
        protected abstract String getPageName();\r
 \r
        protected Component createPersonPanel(String wicketId, PersonIdent identity,\r
-                       SearchType searchType) {\r
+                       Constants.SearchType searchType) {\r
                String name = identity == null ? "" : identity.getName();\r
                String address = identity == null ? "" : identity.getEmailAddress();\r
                boolean showEmail = GitBlit.getBoolean(Keys.web.showEmailAddresses, false);\r
@@ -241,10 +241,10 @@ public abstract class RepositoryPage extends BasePage {
                }\r
        }\r
 \r
-       protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
-               if (searchType.equals(SearchType.AUTHOR)) {\r
+       protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {\r
+               if (searchType.equals(Constants.SearchType.AUTHOR)) {\r
                        WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
-               } else if (searchType.equals(SearchType.COMMITTER)) {\r
+               } else if (searchType.equals(Constants.SearchType.COMMITTER)) {\r
                        WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
                }\r
        }\r
@@ -298,13 +298,13 @@ public abstract class RepositoryPage extends BasePage {
 \r
                private final IModel<String> searchBoxModel = new Model<String>("");\r
 \r
-               private final IModel<SearchType> searchTypeModel = new Model<SearchType>(SearchType.COMMIT);\r
+               private final IModel<Constants.SearchType> searchTypeModel = new Model<Constants.SearchType>(Constants.SearchType.COMMIT);\r
 \r
                public SearchForm(String id, String repositoryName) {\r
                        super(id);\r
                        this.repositoryName = repositoryName;\r
-                       DropDownChoice<SearchType> searchType = new DropDownChoice<SearchType>("searchType",\r
-                                       Arrays.asList(SearchType.values()));\r
+                       DropDownChoice<Constants.SearchType> searchType = new DropDownChoice<Constants.SearchType>("searchType",\r
+                                       Arrays.asList(Constants.SearchType.values()));\r
                        searchType.setModel(searchTypeModel);\r
                        add(searchType.setVisible(GitBlit.getBoolean(Keys.web.showSearchTypeSelection, false)));\r
                        TextField<String> searchBox = new TextField<String>("searchBox", searchBoxModel);\r
@@ -320,13 +320,13 @@ public abstract class RepositoryPage extends BasePage {
 \r
                @Override\r
                public void onSubmit() {\r
-                       SearchType searchType = searchTypeModel.getObject();\r
+                       Constants.SearchType searchType = searchTypeModel.getObject();\r
                        String searchString = searchBoxModel.getObject();\r
                        if (searchString == null) {\r
                                // FIXME IE intermittently has no searchString. Wicket bug?\r
                                return;\r
                        }\r
-                       for (SearchType type : SearchType.values()) {\r
+                       for (Constants.SearchType type : Constants.SearchType.values()) {\r
                                if (searchString.toLowerCase().startsWith(type.name().toLowerCase() + ":")) {\r
                                        searchType = type;\r
                                        searchString = searchString.substring(type.name().toLowerCase().length() + 1)\r
index 335c40d78f516e1f657dba09c6c84381e17949ef..d4728d7982bd150563d0c95534ca4bb4f95d5629 100644 (file)
@@ -18,7 +18,7 @@ package com.gitblit.wicket.pages;
 import org.apache.wicket.PageParameters;\r
 import org.apache.wicket.markup.html.link.BookmarkablePageLink;\r
 \r
-import com.gitblit.utils.JGitUtils.SearchType;\r
+import com.gitblit.Constants;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.SearchPanel;\r
 \r
@@ -29,7 +29,7 @@ public class SearchPage extends RepositoryPage {
 \r
                String value = WicketUtils.getSearchString(params);\r
                String type = WicketUtils.getSearchType(params);\r
-               SearchType searchType = SearchType.forName(type);\r
+               Constants.SearchType searchType = Constants.SearchType.forName(type);\r
 \r
                int pageNumber = WicketUtils.getPage(params);\r
                int prevPage = Math.max(0, pageNumber - 1);\r
index a346670e8b5d1f663b023c791555585d19108bd1..b1ab071489eb10d1adc0626afca3b7b4113421d9 100644 (file)
@@ -27,7 +27,6 @@ import org.eclipse.jgit.lib.Repository;
 \r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.LinkPanel;\r
 import com.gitblit.wicket.panels.RefsPanel;\r
@@ -80,7 +79,7 @@ public class TagPage extends RepositoryPage {
                                linkClass, linkParameters));\r
                add(new Label("taggedObjectType", getString(typeKey)));\r
 \r
-               add(createPersonPanel("tagger", tagRef.getAuthorIdent(), SearchType.AUTHOR));\r
+               add(createPersonPanel("tagger", tagRef.getAuthorIdent(), com.gitblit.Constants.SearchType.AUTHOR));\r
                Date when = new Date(0);\r
                if (tagRef.getAuthorIdent() != null) {\r
                        when = tagRef.getAuthorIdent().getWhen();\r
index 9dda03c2e4b99c75a64f739dffca3a5ee21caa86..8ea2a69763c53c85b06b8873cdf287b44a83ae56 100644 (file)
@@ -22,9 +22,9 @@ import org.apache.wicket.Component;
 import org.apache.wicket.markup.html.panel.Panel;\r
 import org.apache.wicket.model.Model;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.wicket.GitBlitWebSession;\r
 import com.gitblit.wicket.WicketUtils;\r
 \r
@@ -41,10 +41,10 @@ public abstract class BasePanel extends Panel {
                                .getTimezone() : TimeZone.getDefault();\r
        }\r
 \r
-       protected void setPersonSearchTooltip(Component component, String value, SearchType searchType) {\r
-               if (searchType.equals(SearchType.AUTHOR)) {\r
+       protected void setPersonSearchTooltip(Component component, String value, Constants.SearchType searchType) {\r
+               if (searchType.equals(Constants.SearchType.AUTHOR)) {\r
                        WicketUtils.setHtmlTooltip(component, getString("gb.searchForAuthor") + " " + value);\r
-               } else if (searchType.equals(SearchType.COMMITTER)) {\r
+               } else if (searchType.equals(Constants.SearchType.COMMITTER)) {\r
                        WicketUtils.setHtmlTooltip(component, getString("gb.searchForCommitter") + " " + value);\r
                }\r
        }\r
index d45c0e6267f143242261c6ddd9c2dd7c751e2d61..6eb4019940c30f0d4b9c14ff535c4d16dbc01fa6 100644 (file)
@@ -29,11 +29,11 @@ import org.apache.wicket.markup.repeater.data.ListDataProvider;
 import org.apache.wicket.model.StringResourceModel;\r
 import org.eclipse.jgit.lib.Repository;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.SyndicationServlet;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.BranchesPage;\r
@@ -95,8 +95,8 @@ public class BranchesPanel extends BasePanel {
                                String author = entry.getAuthorIdent().getName();\r
                                LinkPanel authorLink = new LinkPanel("branchAuthor", "list", author,\r
                                                SearchPage.class, WicketUtils.newSearchParameter(model.name,\r
-                                                               entry.getName(), author, SearchType.AUTHOR));\r
-                               setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);\r
+                                                               entry.getName(), author, Constants.SearchType.AUTHOR));\r
+                               setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
 \r
                                // short message\r
index 9ad407ca8b692d1076144da769b3507fd761e38a..16f95f227555969eca7dab88a53a8ebff0077736 100644 (file)
@@ -30,13 +30,13 @@ import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.PathModel;\r
 import com.gitblit.models.PathModel.PathChangeModel;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.BlobDiffPage;\r
@@ -109,8 +109,8 @@ public class HistoryPanel extends BasePanel {
                                String author = entry.getAuthorIdent().getName();\r
                                LinkPanel authorLink = new LinkPanel("commitAuthor", "list", author,\r
                                                SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId,\r
-                                                               author, SearchType.AUTHOR));\r
-                               setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);\r
+                                                               author, Constants.SearchType.AUTHOR));\r
+                               setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
 \r
                                // merge icon\r
index 66fddd2cbbf10f564e80f01866817962fb686237..90b6745fb2ba6e636c23d2069c0dcf4511990f0d 100644 (file)
@@ -29,11 +29,11 @@ import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.CommitDiffPage;\r
@@ -100,8 +100,8 @@ public class LogPanel extends BasePanel {
                                String author = entry.getAuthorIdent().getName();\r
                                LinkPanel authorLink = new LinkPanel("commitAuthor", "list", author,\r
                                                SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId,\r
-                                                               author, SearchType.AUTHOR));\r
-                               setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);\r
+                                                               author, Constants.SearchType.AUTHOR));\r
+                               setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
 \r
                                // merge icon\r
index d118790c033259b25c2077f172d1169643375f20..44b499b23f48bf8cedff0679575cea95af3193cc 100644 (file)
@@ -28,11 +28,11 @@ import org.eclipse.jgit.lib.ObjectId;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Constants;\r
 import com.gitblit.GitBlit;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.pages.CommitDiffPage;\r
@@ -47,7 +47,7 @@ public class SearchPanel extends BasePanel {
        private boolean hasMore;\r
 \r
        public SearchPanel(String wicketId, final String repositoryName, final String objectId,\r
-                       final String value, SearchType searchType, Repository r, int limit, int pageOffset) {\r
+                       final String value, Constants.SearchType searchType, Repository r, int limit, int pageOffset) {\r
                super(wicketId);\r
                boolean pageResults = limit <= 0;\r
                int itemsPerPage = GitBlit.getInteger(Keys.web.itemsPerPage, 50);\r
@@ -93,8 +93,8 @@ public class SearchPanel extends BasePanel {
                                String author = entry.getAuthorIdent().getName();\r
                                LinkPanel authorLink = new LinkPanel("commitAuthor", "list", author,\r
                                                SearchPage.class, WicketUtils.newSearchParameter(repositoryName, objectId,\r
-                                                               author, SearchType.AUTHOR));\r
-                               setPersonSearchTooltip(authorLink, author, SearchType.AUTHOR);\r
+                                                               author, Constants.SearchType.AUTHOR));\r
+                               setPersonSearchTooltip(authorLink, author, Constants.SearchType.AUTHOR);\r
                                item.add(authorLink);\r
 \r
                                // merge icon\r
index 0d7aa635f8bdff9cf50e3c7d842192dc28609811..594d090d1df75120034ca1bf7a31f6321dfe8f75 100644 (file)
@@ -42,7 +42,6 @@ import com.gitblit.models.PathModel;
 import com.gitblit.models.PathModel.PathChangeModel;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.utils.JGitUtils;\r
-import com.gitblit.utils.JGitUtils.SearchType;\r
 import com.gitblit.utils.StringUtils;\r
 \r
 public class JGitUtilsTest extends TestCase {\r
@@ -306,37 +305,37 @@ public class JGitUtilsTest extends TestCase {
        }\r
 \r
        public void testSearchTypes() throws Exception {\r
-               assertTrue(SearchType.forName("commit").equals(SearchType.COMMIT));\r
-               assertTrue(SearchType.forName("committer").equals(SearchType.COMMITTER));\r
-               assertTrue(SearchType.forName("author").equals(SearchType.AUTHOR));\r
-               assertTrue(SearchType.forName("unknown").equals(SearchType.COMMIT));\r
-\r
-               assertTrue(SearchType.COMMIT.toString().equals("commit"));\r
-               assertTrue(SearchType.COMMITTER.toString().equals("committer"));\r
-               assertTrue(SearchType.AUTHOR.toString().equals("author"));\r
+               assertTrue(com.gitblit.Constants.SearchType.forName("commit").equals(com.gitblit.Constants.SearchType.COMMIT));\r
+               assertTrue(com.gitblit.Constants.SearchType.forName("committer").equals(com.gitblit.Constants.SearchType.COMMITTER));\r
+               assertTrue(com.gitblit.Constants.SearchType.forName("author").equals(com.gitblit.Constants.SearchType.AUTHOR));\r
+               assertTrue(com.gitblit.Constants.SearchType.forName("unknown").equals(com.gitblit.Constants.SearchType.COMMIT));\r
+\r
+               assertTrue(com.gitblit.Constants.SearchType.COMMIT.toString().equals("commit"));\r
+               assertTrue(com.gitblit.Constants.SearchType.COMMITTER.toString().equals("committer"));\r
+               assertTrue(com.gitblit.Constants.SearchType.AUTHOR.toString().equals("author"));\r
        }\r
 \r
        public void testSearchRevlogs() throws Exception {\r
-               assertTrue(JGitUtils.searchRevlogs(null, null, "java", SearchType.COMMIT, 0, 0).size() == 0);\r
-               List<RevCommit> results = JGitUtils.searchRevlogs(null, null, "java", SearchType.COMMIT, 0,\r
+               assertTrue(JGitUtils.searchRevlogs(null, null, "java", com.gitblit.Constants.SearchType.COMMIT, 0, 0).size() == 0);\r
+               List<RevCommit> results = JGitUtils.searchRevlogs(null, null, "java", com.gitblit.Constants.SearchType.COMMIT, 0,\r
                                3);\r
                assertTrue(results.size() == 0);\r
 \r
                // test commit message search\r
                Repository repository = GitBlitSuite.getHelloworldRepository();\r
-               results = JGitUtils.searchRevlogs(repository, null, "java", SearchType.COMMIT, 0, 3);\r
+               results = JGitUtils.searchRevlogs(repository, null, "java", com.gitblit.Constants.SearchType.COMMIT, 0, 3);\r
                assertTrue(results.size() == 3);\r
 \r
                // test author search\r
-               results = JGitUtils.searchRevlogs(repository, null, "timothy", SearchType.AUTHOR, 0, -1);\r
+               results = JGitUtils.searchRevlogs(repository, null, "timothy", com.gitblit.Constants.SearchType.AUTHOR, 0, -1);\r
                assertTrue(results.size() == 1);\r
 \r
                // test committer search\r
-               results = JGitUtils.searchRevlogs(repository, null, "mike", SearchType.COMMITTER, 0, 10);\r
+               results = JGitUtils.searchRevlogs(repository, null, "mike", com.gitblit.Constants.SearchType.COMMITTER, 0, 10);\r
                assertTrue(results.size() == 10);\r
 \r
                // test paging and offset\r
-               RevCommit commit = JGitUtils.searchRevlogs(repository, null, "mike", SearchType.COMMITTER,\r
+               RevCommit commit = JGitUtils.searchRevlogs(repository, null, "mike", com.gitblit.Constants.SearchType.COMMITTER,\r
                                9, 1).get(0);\r
                assertTrue(results.get(9).equals(commit));\r
 \r