]> source.dussan.org Git - gitblit.git/commitdiff
Generate Keys class from gitblit.properties as part of build process.
authorJames Moger <james.moger@gitblit.com>
Thu, 14 Apr 2011 23:44:47 +0000 (19:44 -0400)
committerJames Moger <james.moger@gitblit.com>
Thu, 14 Apr 2011 23:44:47 +0000 (19:44 -0400)
45 files changed:
build.xml
gitblit.properties
src/com/gitblit/.gitignore [new file with mode: 0644]
src/com/gitblit/Build.java
src/com/gitblit/Constants.java
src/com/gitblit/GitBlit.java
src/com/gitblit/GitBlitServer.java
src/com/gitblit/ILoginService.java
src/com/gitblit/JettyLoginService.java
src/com/gitblit/StoredSettings.java
src/com/gitblit/tests/JGitUtilsTest.java
src/com/gitblit/utils/HtmlDiffFormatter.java
src/com/gitblit/utils/JGitUtils.java
src/com/gitblit/utils/Utils.java
src/com/gitblit/wicket/AuthorizationStrategy.java
src/com/gitblit/wicket/BasePage.java
src/com/gitblit/wicket/GitBlitWebApp.java
src/com/gitblit/wicket/GitBlitWebSession.java
src/com/gitblit/wicket/LinkPanel.java
src/com/gitblit/wicket/LoginPage.java
src/com/gitblit/wicket/RepositoryPage.java
src/com/gitblit/wicket/User.java
src/com/gitblit/wicket/WicketUtils.java
src/com/gitblit/wicket/models/PathModel.java
src/com/gitblit/wicket/models/RefModel.java
src/com/gitblit/wicket/models/TicGitTicket.java
src/com/gitblit/wicket/pages/BlobDiffPage.java
src/com/gitblit/wicket/pages/BlobPage.java
src/com/gitblit/wicket/pages/BranchesPage.java
src/com/gitblit/wicket/pages/CommitDiffPage.java
src/com/gitblit/wicket/pages/CommitPage.java
src/com/gitblit/wicket/pages/PatchPage.java
src/com/gitblit/wicket/pages/RawPage.java
src/com/gitblit/wicket/pages/RepositoriesPage.java
src/com/gitblit/wicket/pages/SummaryPage.java
src/com/gitblit/wicket/pages/TagPage.java
src/com/gitblit/wicket/pages/TagsPage.java
src/com/gitblit/wicket/pages/TicGitPage.java
src/com/gitblit/wicket/pages/TicGitTicketPage.java
src/com/gitblit/wicket/pages/TreePage.java
src/com/gitblit/wicket/panels/BasePanel.java
src/com/gitblit/wicket/panels/BranchesPanel.java
src/com/gitblit/wicket/panels/LogPanel.java
src/com/gitblit/wicket/panels/PageLinksPanel.java
src/com/gitblit/wicket/panels/RefsPanel.java

index 54cbaa279d80ef96ee8c309853b688652d07a312..34c195756564d03c9232bf1ac781f30b2383200b 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -16,6 +16,7 @@
                <mkdir dir="${project.build.dir}" />\r
                <javac srcdir="${basedir}/src" destdir="${project.build.dir}">\r
                        <include name="com/gitblit/Build.java" />\r
+                       <include name="com/gitblit/Constants.java" />\r
                </javac>\r
                <java classpath="${project.build.dir}" classname="com.gitblit.Build" />\r
 \r
@@ -30,6 +31,7 @@
                </path>\r
                <javac destdir="${project.build.dir}">\r
                        <src path="${basedir}/src" />\r
+                       <src path="${basedir}/contrib" />\r
                        <classpath refid="master-classpath" />\r
                </javac>\r
                <copy todir="${project.build.dir}">\r
index 65f44d170d6748c533ef4a3a4af5efacc0f1d4ca..7708a9b997f014cc928ec6370acd0a04cdbacb4a 100644 (file)
 #\r
 \r
 # Allow push/pull over http/https with JGit servlet\r
-allowPushPull = true\r
+git.allowPushPull = true\r
 \r
 # Base folder for repositories\r
 # Use forward slashes on Windows!!\r
-repositoriesFolder = c:/projects/git\r
+git.repositoriesFolder = c:/projects/git\r
 \r
 # Export all repositories\r
 # if false, each exported repository must have a .git/git-daemon-export-ok file\r
-exportAll = true\r
+git.exportAll = true\r
 \r
 # Search repositories folder for nested repositories\r
-nestedRepositories = true\r
+git.nestedRepositories = true\r
 \r
 # The root clone url\r
-cloneUrl = https://localhost/git/\r
+git.cloneUrl = https://localhost/git/\r
 \r
 #\r
 # Authentication Settings\r
 #\r
 \r
 # Require authentication for http/https push/pull access of git repositories\r
-authenticatePushPull = true\r
+git.authenticate = true\r
 \r
 # Require authentication to see the web ui\r
-authenticateWebUI = true\r
+web.authenticate = true\r
 \r
-# Simple user realm file to authenticate users for push/pull\r
-realmFile = users.properties\r
+# Simple user realm file to authenticate users\r
+server.realmFile = users.properties\r
 \r
 #\r
 # Server Settings\r
 #\r
-debugMode = true\r
-tempFolder = temp\r
-log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n\r
+server.debugMode = true\r
+server.tempFolder = temp\r
+server.log4jPattern = %-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n\r
 \r
 # Aggressive heap management will run the garbage collector on every generated\r
 # page.  This slows down page generation but improves heap consumption. \r
-aggressiveHeapManagement = true\r
+server.aggressiveHeapManagement = true\r
 \r
 #\r
 # Git:Blit UI Settings\r
 #\r
-siteName =\r
+web.siteName =\r
 \r
 # If authenticateWebUI=true, users with "admin" role can create repositories,\r
 # create users, and edit repository metadata (owner, description, etc)\r
 #\r
 # If authenticateWebUI=false, any user can execute the aforementioned functions.  \r
-allowAdministration = true\r
+web.allowAdministration = true\r
 \r
-repositoriesMessage = Welcome to Git:Blit!<br>A quick and easy way to host your own Git repositories.<br>Built with <a href="http://eclipse.org/jgit">JGit</a>, <a href="http://wicket.apache.org">Wicket</a>, <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>, <a href="http://eclipse.org/jetty">Jetty</a>, <a href="http://www.slf4j.org">SLF4J</a>, <a href="http://logging.apache.org/log4j">Log4j</a>, and <a href="http://jcommander.org">JCommander</a>.\r
+# This is the message display above the repositories table.\r
+# This can point to a file with HTML content.\r
+web.repositoriesMessage = Welcome to Git:Blit!<br>A quick and easy way to host your own Git repositories.<br>Built with <a href="http://eclipse.org/jgit">JGit</a>, <a href="http://wicket.apache.org">Wicket</a>, <a href="http://code.google.com/p/google-code-prettify/">google-code-prettify</a>, <a href="http://eclipse.org/jetty">Jetty</a>, <a href="http://www.slf4j.org">SLF4J</a>, <a href="http://logging.apache.org/log4j">Log4j</a>, and <a href="http://jcommander.org">JCommander</a>.\r
 \r
 # Use the client timezone when formatting dates.\r
 # This uses AJAX to determine the browser's timezone and enables Wicket \r
 # session management for the connection.\r
-useClientTimezone = false\r
+web.useClientTimezone = false\r
 \r
 # Date and Time formats\r
-timestampFormat = h:mm a\r
-\r
-datestampShortFormat = yyyy-MM-dd\r
-datestampLongFormat = EEEE, MMMM d, yyyy\r
-\r
-datetimestampShortFormat = yyyy-MM-dd h:mm a z\r
-datetimestampLongFormat = EEEE, MMMM d, yyyy h:mm a z\r
+web.datestampShortFormat = yyyy-MM-dd\r
+web.datetimestampLongFormat = EEEE, MMMM d, yyyy h:mm a z\r
 \r
 # Generates a line graph of repository activity over time on the Summary page.\r
 # This is a real-time graph so generation may be expensive. \r
-generateActivityGraph = true\r
+web.generateActivityGraph = true\r
 \r
 # The number of commits to display on the summary page\r
 # Value must exceed 0 else default of 20 is used\r
-summaryCommitCount = 20\r
+web.summaryCommitCount = 20\r
 \r
 # The number of tags/heads to display on the summary page\r
 # Value must exceed 0 else default of 5 is used\r
-summaryRefsCount = 5\r
+web.summaryRefsCount = 5\r
 \r
 # The number of commits to show on each page of a Log\r
 # Value must exceed 0 else default of 50 is used\r
-logPageCommitCount = 50\r
+web.logPageCommitCount = 50\r
 \r
 # Registered extensions for google-code-prettify\r
-prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
+web.prettyPrintExtensions = c cpp cs css htm html java js php pl prefs properties py rb sh sql xml vb\r
 \r
 # Image extensions\r
-imageExtensions = bmp jpg gif png \r
+web.imageExtensions = bmp jpg gif png \r
 \r
 # Registered extensions for binary blobs\r
-binaryExtensions = jar pdf tar.gz zip\r
+web.binaryExtensions = jar pdf tar.gz zip\r
 \r
 # Example global regex substitutions\r
 regex.global.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://somehost/bug/$3">Bug-Id: $3</a>\r
 regex.global.changeid = \\b(Change-Id:\\s*)([A-Za-z0-9]*)\\b!!!<a href="http://somehost/changeid/$2">Change-Id: $2</a>\r
 \r
 # Example per-repository regex substitutions overrides global\r
-regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
+#regex.myrepository.bug = \\b(Bug:)(\\s*[#]?|-){0,1}(\\d+)\\b!!!<a href="http://elsewhere/bug/$3">Bug-Id: $3</a>\r
 \r
 # Enable ticgit viewer for all repositories (checks for ticgit branch)\r
 ticgit.global = false\r
 \r
 # Enable ticgit viewer for specified repository (checks for ticgit branch)\r
-ticgit.myrepository = true\r
-ticgit.ticgit = true\r
+#ticgit.myrepository = true\r
 \r
 #\r
 # Jetty Settings\r
 #\r
 \r
 # use NIO connectors.  If false, socket connectors will be used.\r
-useNio = true\r
+server.useNio = true\r
 \r
 # Standard http port to serve.  <= 0 disables this connector.\r
-httpPort = 0\r
+server.httpPort = 0\r
 \r
 # Secure/SSL https port to serve. <= 0 disables this connector.\r
-httpsPort = 443\r
+server.httpsPort = 443\r
 \r
 # Password for SSL keystore (keystore password and certificate password must match)\r
-storePassword = dosomegit\r
+server.storePassword = dosomegit\r
 \r
 # Port for shutdown monitor to listen on.\r
-shutdownPort = 8081\r
+server.shutdownPort = 8081\r
diff --git a/src/com/gitblit/.gitignore b/src/com/gitblit/.gitignore
new file mode 100644 (file)
index 0000000..c629860
--- /dev/null
@@ -0,0 +1,2 @@
+/SettingKeys.java
+/Keys.java
index 0af7390c231bbf882b07d37737a00c9f12d9aa48..ec392e1fda030a4f3b5080177952e6ac200e63d8 100644 (file)
@@ -3,18 +3,25 @@ package com.gitblit;
 import java.io.BufferedInputStream;\r
 import java.io.ByteArrayOutputStream;\r
 import java.io.File;\r
+import java.io.FileInputStream;\r
 import java.io.IOException;\r
 import java.io.InputStream;\r
 import java.io.RandomAccessFile;\r
 import java.net.URL;\r
 import java.security.MessageDigest;\r
 import java.security.NoSuchAlgorithmException;\r
+import java.text.MessageFormat;\r
+import java.util.ArrayList;\r
+import java.util.Collections;\r
+import java.util.List;\r
+import java.util.Properties;\r
 \r
 public class Build {\r
 \r
        public static void main(String... args) {\r
                runtime();\r
                compiletime();\r
+               buildSettingKeys();\r
        }\r
 \r
        public static void runtime() {\r
@@ -33,6 +40,40 @@ public class Build {
                downloadFromMaven(MavenObject.JUNIT);\r
        }\r
 \r
+       public static void buildSettingKeys() {\r
+               Properties properties = new Properties();\r
+               try {\r
+                       properties.load(new FileInputStream(Constants.PROPERTIES_FILE));\r
+               } catch (Throwable t) {\r
+                       t.printStackTrace();\r
+               }\r
+               List<String> keys = new ArrayList<String>(properties.stringPropertyNames());\r
+               Collections.sort(keys);\r
+\r
+               StringBuilder sb = new StringBuilder();\r
+               sb.append("package com.gitblit;\n");\r
+               sb.append("\n");\r
+               sb.append("/*\n");\r
+               sb.append(" * This class is auto-generated from the properties file.\n");\r
+               sb.append(" * Do not version control!\n");\r
+               sb.append(" */\n");\r
+               sb.append("public final class Keys {\n");\r
+               sb.append("\n");\r
+               for (String key : keys) {\r
+                       sb.append(MessageFormat.format("\tpublic static final String {0} = \"{1}\";\n\n", key.replace('.', '_'), key));\r
+               }\r
+               sb.append("}");\r
+               try {\r
+                       File file = new File("src/com/gitblit/Keys.java");\r
+                       file.delete();\r
+                       RandomAccessFile raf = new RandomAccessFile(file, "rw");\r
+                       raf.writeBytes(sb.toString());\r
+                       raf.close();\r
+               } catch (Throwable t) {\r
+                       t.printStackTrace();\r
+               }\r
+       }\r
+\r
        /**\r
         * Download a file from a Maven repository.\r
         * \r
@@ -135,7 +176,7 @@ public class Build {
                public static final MavenObject WICKET_EXT = new MavenObject("Apache Wicket Extensions", "org/apache/wicket", "wicket-extensions", "1.4.17", "01111d0dbffdc425581b006a43864c22797ce72a");\r
 \r
                public static final MavenObject WICKET_AUTH_ROLES = new MavenObject("Apache Wicket Auth Roles", "org/apache/wicket", "wicket-auth-roles", "1.4.17", "86d20ff32f62d3026213ff11a78555da643bc676");\r
-               \r
+\r
                public static final MavenObject JUNIT = new MavenObject("JUnit", "junit", "junit", "3.8.2", "07e4cde26b53a9a0e3fe5b00d1dbbc7cc1d46060");\r
 \r
                public final String name;\r
index 186193eb818eb4b1079dc597f97ca71cce57cc96..75f1badbd7370ae5dcba870eae9cc1c2840402f2 100644 (file)
@@ -5,17 +5,19 @@ public class Constants {
        public final static String NAME = "Git:Blit";\r
 \r
        public final static String VERSION = "0.0.1";\r
-       \r
+\r
        public final static String ADMIN_ROLE = "admin";\r
-       \r
+\r
        public final static String PULL_ROLE = "pull";\r
-       \r
+\r
        public final static String PUSH_ROLE = "push";\r
 \r
+       public final static String PROPERTIES_FILE = "gitblit.properties";\r
+\r
        public static String getGitBlitVersion() {\r
                return NAME + " v" + VERSION;\r
        }\r
-       \r
+\r
        public static String getJGitVersion() {\r
                return "JGit 0.11.3";\r
        }\r
index 276414321ca9947b02e2799230ec472a4fb2142f..f437e5f03ed5fb5034efde786d5be8c839677b43 100644 (file)
@@ -46,12 +46,12 @@ public class GitBlit {
        }\r
 \r
        private GitBlit() {\r
-               repositories = new File(StoredSettings.getString("repositoriesFolder", "repos"));\r
-               exportAll = StoredSettings.getBoolean("exportAll", true);\r
+               repositories = new File(StoredSettings.getString(Keys.git_repositoriesFolder, "repos"));\r
+               exportAll = StoredSettings.getBoolean(Keys.git_exportAll, true);\r
                repositoryResolver = new FileResolver(repositories, exportAll);\r
-               debugMode = StoredSettings.getBoolean("debugMode", false);\r
+               debugMode = StoredSettings.getBoolean(Keys.server_debugMode, false);\r
        }\r
-       \r
+\r
        public boolean isDebugMode() {\r
                return debugMode;\r
        }\r
@@ -88,9 +88,9 @@ public class GitBlit {
                userCookie.setPath("/");\r
                response.addCookie(userCookie);\r
        }\r
-       \r
+\r
        public List<String> getRepositoryList() {\r
-               return JGitUtils.getRepositoryList(repositories, exportAll, StoredSettings.getBoolean("nestedRepositories", true));\r
+               return JGitUtils.getRepositoryList(repositories, exportAll, StoredSettings.getBoolean(Keys.git_nestedRepositories, true));\r
        }\r
 \r
        public List<RepositoryModel> getRepositories(Request request) {\r
index 4f1aeccc30f727478c1154d401717734846b01ac..b167e6c1e3b746d74cd5e6543ed0050c2426cb79 100644 (file)
@@ -79,7 +79,7 @@ public class GitBlitServer {
                }\r
                if (jc != null) {\r
                        jc.usage();\r
-                       System.out.println("\nExample:\n  java -server -Xmx1024M -jar go-git-go.jar --repos c:\\git --port 80 --securePort 443");\r
+                       System.out.println("\nExample:\n  java -server -Xmx1024M -jar gitblit.jar --repos c:\\git --port 80 --securePort 443");\r
                }\r
                System.exit(0);\r
        }\r
@@ -108,8 +108,8 @@ public class GitBlitServer {
        private static void start(Params params) {\r
                // instantiate GitBlit\r
                GitBlit.self();\r
-               \r
-               PatternLayout layout = new PatternLayout(StoredSettings.getString("log4jPattern", "%-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n"));\r
+\r
+               PatternLayout layout = new PatternLayout(StoredSettings.getString(Keys.server_log4jPattern, "%-5p %d{MM-dd HH:mm:ss.SSS}  %-20.20c{1}  %m%n"));\r
                org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();\r
                rootLogger.addAppender(new ConsoleAppender(layout));\r
 \r
@@ -121,7 +121,7 @@ public class GitBlitServer {
                String osversion = System.getProperty("os.version");\r
                logger.info("Running on " + osname + " (" + osversion + ")");\r
 \r
-               if (StoredSettings.getBoolean("debugMode", false)) {\r
+               if (StoredSettings.getBoolean(Keys.server_debugMode, false)) {\r
                        logger.warn("DEBUG Mode");\r
                }\r
 \r
@@ -177,12 +177,12 @@ public class GitBlitServer {
                // Git Servlet\r
                ServletHolder gitServlet = null;\r
                String gitServletPathSpec = "/git/*";\r
-               if (StoredSettings.getBoolean("allowPushPull", true)) {\r
+               if (StoredSettings.getBoolean(Keys.git_allowPushPull, true)) {\r
                        gitServlet = rootContext.addServlet(GitServlet.class, gitServletPathSpec);\r
                        gitServlet.setInitParameter("base-path", params.repositoriesFolder);\r
                        gitServlet.setInitParameter("export-all", params.exportAll ? "1" : "0");\r
                }\r
-               \r
+\r
                // Login Service\r
                LoginService loginService = null;\r
                String realmUsers = params.realmFile;\r
@@ -192,7 +192,7 @@ public class GitBlitServer {
                        GitBlit.self().setLoginService(jettyLoginService);\r
                        loginService = jettyLoginService;\r
                }\r
-               \r
+\r
                // Determine what handler to use\r
                Handler handler;\r
                if (gitServlet != null) {\r
@@ -356,43 +356,43 @@ public class GitBlitServer {
                public Boolean stop = false;\r
 \r
                @Parameter(names = { "--temp" }, description = "Server temp folder")\r
-               public String temp = StoredSettings.getString("tempFolder", "temp");\r
+               public String temp = StoredSettings.getString(Keys.server_tempFolder, "temp");\r
 \r
                /*\r
                 * GIT Servlet Parameters\r
                 */\r
                @Parameter(names = { "--repos" }, description = "Git Repositories Folder")\r
-               public String repositoriesFolder = StoredSettings.getString("repositoriesFolder", "repos");\r
+               public String repositoriesFolder = StoredSettings.getString(Keys.git_repositoriesFolder, "repos");\r
 \r
                @Parameter(names = { "--exportAll" }, description = "Export All Found Repositories")\r
-               public Boolean exportAll = StoredSettings.getBoolean("exportAll", true);\r
+               public Boolean exportAll = StoredSettings.getBoolean(Keys.git_exportAll, true);\r
 \r
                /*\r
                 * Authentication Parameters\r
                 */\r
                @Parameter(names = { "--authenticatePushPull" }, description = "Authenticate Git Push/Pull access")\r
-               public Boolean authenticatePushPull = StoredSettings.getBoolean("authenticatePushPull", true);\r
+               public Boolean authenticatePushPull = StoredSettings.getBoolean(Keys.git_authenticate, true);\r
 \r
                @Parameter(names = { "--realm" }, description = "Users Realm Hash File")\r
-               public String realmFile = StoredSettings.getString("realmFile", "users.properties");\r
+               public String realmFile = StoredSettings.getString(Keys.server_realmFile, "users.properties");\r
 \r
                /*\r
                 * JETTY Parameters\r
                 */\r
                @Parameter(names = { "--nio" }, description = "Use NIO Connector else use Socket Connector.")\r
-               public Boolean useNIO = StoredSettings.getBoolean("useNio", true);\r
+               public Boolean useNIO = StoredSettings.getBoolean(Keys.server_useNio, true);\r
 \r
                @Parameter(names = "--port", description = "HTTP port for to serve. (port <= 0 will disable this connector)")\r
-               public Integer port = StoredSettings.getInteger("httpPort", 80);\r
+               public Integer port = StoredSettings.getInteger(Keys.server_httpPort, 80);\r
 \r
                @Parameter(names = "--securePort", description = "HTTPS port to serve.  (port <= 0 will disable this connector)")\r
-               public Integer securePort = StoredSettings.getInteger("httpsPort", 443);\r
+               public Integer securePort = StoredSettings.getInteger(Keys.server_httpsPort, 443);\r
 \r
                @Parameter(names = "--storePassword", description = "Password for SSL (https) keystore.")\r
-               public String storePassword = StoredSettings.getString("storePassword", "");\r
+               public String storePassword = StoredSettings.getString(Keys.server_storePassword, "");\r
 \r
                @Parameter(names = "--shutdownPort", description = "Port for Shutdown Monitor to listen on. (port <= 0 will disable this monitor)")\r
-               public Integer shutdownPort = StoredSettings.getInteger("shutdownPort", 8081);\r
+               public Integer shutdownPort = StoredSettings.getInteger(Keys.server_shutdownPort, 8081);\r
 \r
        }\r
 }
\ No newline at end of file
index ee98d8ef22c278025adcf1f4a2a742a3f194ad20..b58f4f1f559d9c9dcf0f89a6a0d1befeb2433e25 100644 (file)
@@ -4,7 +4,7 @@ import com.gitblit.wicket.User;
 \r
 public interface ILoginService {\r
 \r
-       User authenticate(String username, char [] password);\r
-       \r
-       User authenticate(char [] cookie);\r
+       User authenticate(String username, char[] password);\r
+\r
+       User authenticate(char[] cookie);\r
 }\r
index 93e9a192fb7e598f6fafef7f112c7e3beb874998..5173d2133366b02d504f44419890ed1cc0a46bee 100644 (file)
@@ -10,7 +10,7 @@ public class JettyLoginService extends HashLoginService implements ILoginService
        public JettyLoginService(String realmFile) {\r
                super(Constants.NAME, realmFile);\r
        }\r
-       \r
+\r
        @Override\r
        public User authenticate(String username, char[] password) {\r
                UserIdentity identity = login(username, new String(password));\r
@@ -25,7 +25,7 @@ public class JettyLoginService extends HashLoginService implements ILoginService
        }\r
 \r
        @Override\r
-       public User authenticate(char [] cookie) {\r
+       public User authenticate(char[] cookie) {\r
                // TODO cookie login\r
                return null;\r
        }\r
index d495ad87045c12271851616b9c0f6015fbdf0181..1db87c04bb50a08ce99f0ac223545ea7d0fb64b6 100644 (file)
@@ -27,7 +27,7 @@ public class StoredSettings {
                List<String> keys = new ArrayList<String>();\r
                Properties props = read();\r
                for (Object o : props.keySet()) {\r
-                       String key = o.toString().toLowerCase(); \r
+                       String key = o.toString().toLowerCase();\r
                        if (key.startsWith(startingWith)) {\r
                                keys.add(key);\r
                        }\r
@@ -114,11 +114,11 @@ public class StoredSettings {
        }\r
 \r
        private static synchronized Properties read() {\r
-               File file = new File("gitblit.properties");\r
+               File file = new File(Constants.PROPERTIES_FILE);\r
                if (file.exists() && (file.lastModified() > lastread)) {\r
                        try {\r
                                properties = new Properties();\r
-                               properties.load(new FileInputStream("gitblit.properties"));\r
+                               properties.load(new FileInputStream(Constants.PROPERTIES_FILE));\r
                                lastread = file.lastModified();\r
                        } catch (FileNotFoundException f) {\r
                        } catch (Throwable t) {\r
index abc733c9c3c1a5db1061d3c86556e73bfbbe4a49..c77aaaf10afe9a879ce89abccf5c1fa36dad05b1 100644 (file)
@@ -86,7 +86,7 @@ public class JGitUtilsTest extends TestCase {
                r.close();\r
                assertTrue("No changed paths found!", paths.size() > 0);\r
        }\r
-       \r
+\r
        public void testCommitDiff() throws Exception {\r
                Repository r = getRepository();\r
                RevCommit commit = JGitUtils.getCommit(r, Constants.HEAD);\r
index 08c0c21966a74243d8f4b03f1f2ab217c83e2e80..a3e58c383d7b476f0d1f147a73cd9dd20cd85ced 100644 (file)
@@ -10,7 +10,7 @@ import org.eclipse.jgit.diff.DiffFormatter;
 import org.eclipse.jgit.diff.RawText;\r
 \r
 public class HtmlDiffFormatter extends DiffFormatter {\r
-               \r
+\r
        private final OutputStream os;\r
 \r
        public HtmlDiffFormatter(OutputStream os) {\r
index 69c46da4d16a7bb40685ea21ab8b73a5743b997d..fa313911129cae84384a2133bdb3ee3a21952f4e 100644 (file)
@@ -340,11 +340,11 @@ public class JGitUtils {
                }\r
                return null;\r
        }\r
-       \r
+\r
        public static String getCommitPatch(Repository r, RevCommit commit) {\r
                return getCommitPatch(r, commit);\r
        }\r
-       \r
+\r
        public static String getCommitPatch(Repository r, RevCommit commit, String path) {\r
                try {\r
                        final RevWalk rw = new RevWalk(r);\r
index c742fb624faa8f9bc692399e7d7426a4b74c2f34..6d0c6b3cd092880201226cca9ef6f8e44bf69d56 100644 (file)
@@ -116,7 +116,7 @@ public class Utils {
                }\r
                return ago;\r
        }\r
-       \r
+\r
        public static String leftPad(String input, int length, char pad) {\r
                if (input.length() < length) {\r
                        StringBuilder sb = new StringBuilder();\r
@@ -128,19 +128,19 @@ public class Utils {
                }\r
                return input;\r
        }\r
-       \r
+\r
        public static String rightPad(String input, int length, char pad) {\r
                if (input.length() < length) {\r
                        StringBuilder sb = new StringBuilder();\r
                        sb.append(input);\r
                        for (int i = 0, len = length - input.length(); i < len; i++) {\r
                                sb.append(pad);\r
-                       }                       \r
+                       }\r
                        return sb.toString();\r
                }\r
                return input;\r
        }\r
-       \r
+\r
        public static String escapeForHtml(String inStr, boolean changeSpace) {\r
                StringBuffer retStr = new StringBuffer();\r
                int i = 0;\r
index b99ad6de9c0b338e143796ea8cb18bdbc0963eda..b73e849cc8c60cd17c014bb42630084883ad82b0 100644 (file)
@@ -23,8 +23,8 @@ public class AuthorizationStrategy extends AbstractPageAuthorizationStrategy imp
 \r
        @Override\r
        public void onUnauthorizedInstantiation(Component component) {\r
-               if (component instanceof BasePage) {                    \r
-                       GitBlitWebSession session = GitBlitWebSession.get();                    \r
+               if (component instanceof BasePage) {\r
+                       GitBlitWebSession session = GitBlitWebSession.get();\r
                        if (!session.isLoggedIn())\r
                                throw new RestartResponseAtInterceptPageException(LoginPage.class);\r
                        else\r
@@ -38,7 +38,7 @@ public class AuthorizationStrategy extends AbstractPageAuthorizationStrategy imp
                        return false;\r
                User user = session.getUser();\r
                if (pageClass.isAnnotationPresent(AdminPage.class)) {\r
-                       \r
+\r
                }\r
                return true;\r
        }\r
index 8084b3353d0317c6ce1b66ed5bc04569ad85fa7a..9aa7baa036b1fee0e930bfdcd7b91f08de915c1e 100644 (file)
@@ -12,6 +12,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;\r
 \r
 import com.gitblit.Constants;\r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 \r
@@ -26,7 +27,7 @@ public abstract class BasePage extends WebPage {
        public BasePage(PageParameters params) {\r
                super(params);\r
        }\r
-       \r
+\r
        protected void setupPage(String repositoryName, String pageName) {\r
                if (repositoryName != null && repositoryName.trim().length() > 0) {\r
                        add(new Label("title", getServerName() + " - " + repositoryName));\r
@@ -34,38 +35,38 @@ public abstract class BasePage extends WebPage {
                        add(new Label("title", getServerName()));\r
                }\r
                // header\r
-               String siteName = StoredSettings.getString("siteName", Constants.NAME);\r
+               String siteName = StoredSettings.getString(Keys.web_siteName, Constants.NAME);\r
                if (siteName == null || siteName.trim().length() == 0) {\r
                        siteName = Constants.NAME;\r
                }\r
                add(new Label("siteName", siteName));\r
                add(new LinkPanel("repositoryName", null, repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                add(new Label("pageName", pageName));\r
-               \r
+\r
                // footer\r
                User user = null;\r
-               if (StoredSettings.getBoolean("authenticateWebUI", true)) {\r
+               if (StoredSettings.getBoolean(Keys.web_authenticate, true)) {\r
                        user = GitBlitWebSession.get().getUser();\r
                        add(new Label("userText", "Logout " + user.toString()));\r
                } else {\r
                        add(new Label("userText", ""));\r
                }\r
                add(new Label("gbVersion", "v" + Constants.VERSION));\r
-               if (StoredSettings.getBoolean("aggressiveHeapManagement", false)) {\r
+               if (StoredSettings.getBoolean(Keys.server_aggressiveHeapManagement, false)) {\r
                        System.gc();\r
                }\r
        }\r
-       \r
+\r
        protected TimeZone getTimeZone() {\r
-               return StoredSettings.getBoolean("useClientTimezone", false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
+               return StoredSettings.getBoolean(Keys.web_useClientTimezone, false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
        }\r
-       \r
+\r
        protected String getServerName() {\r
                ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
                HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
                return req.getServerName();\r
        }\r
-       \r
+\r
        public void error(String message, Throwable t) {\r
                super.error(message);\r
                logger.error(message, t);\r
index 658ae67a68498c26a31587652cef52e11341da26..8589b75cff1e591d60a29d990024232f8cc385cc 100644 (file)
@@ -11,6 +11,7 @@ import org.apache.wicket.request.IRequestCycleProcessor;
 import org.apache.wicket.request.target.coding.MixedParamUrlCodingStrategy;\r
 \r
 import com.gitblit.GitBlit;\r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.wicket.pages.BlobDiffPage;\r
 import com.gitblit.wicket.pages.BlobPage;\r
@@ -35,14 +36,14 @@ public class GitBlitWebApp extends WebApplication {
                super.init();\r
 \r
                // Setup page authorization mechanism\r
-               if (StoredSettings.getBoolean("authenticateWebUI", false)) {\r
+               if (StoredSettings.getBoolean(Keys.web_authenticate, false)) {\r
                        AuthorizationStrategy authStrategy = new AuthorizationStrategy();\r
                        getSecuritySettings().setAuthorizationStrategy(authStrategy);\r
                        getSecuritySettings().setUnauthorizedComponentInstantiationListener(authStrategy);\r
                }\r
 \r
                // Grab Browser info (like timezone, etc)\r
-               if (StoredSettings.getBoolean("useClientTimezone", false)) {\r
+               if (StoredSettings.getBoolean(Keys.web_useClientTimezone, false)) {\r
                        getRequestCycleSettings().setGatherExtendedBrowserInfo(true);\r
                }\r
 \r
@@ -90,7 +91,7 @@ public class GitBlitWebApp extends WebApplication {
        }\r
 \r
        public String getCloneUrl(String repositoryName) {\r
-               return StoredSettings.getString("cloneUrl", "https://localhost/git/") + repositoryName;\r
+               return StoredSettings.getString(Keys.git_cloneUrl, "https://localhost/git/") + repositoryName;\r
        }\r
 \r
        public static GitBlitWebApp get() {\r
index 34e597f049c4dbaddf4c3653c60af6372af873f0..92eaff666b996fcb624469a31459dd51f03d8f13 100644 (file)
@@ -12,7 +12,7 @@ public final class GitBlitWebSession extends WebSession {
        private static final long serialVersionUID = 1L;\r
 \r
        protected TimeZone timezone = null;\r
-       \r
+\r
        private User user = null;\r
 \r
        public GitBlitWebSession(Request request) {\r
@@ -23,22 +23,22 @@ public final class GitBlitWebSession extends WebSession {
                super.invalidate();\r
                user = null;\r
        }\r
-       \r
+\r
        public boolean isLoggedIn() {\r
                return user != null;\r
        }\r
-       \r
+\r
        public boolean canAdmin() {\r
                if (user == null) {\r
-                       return false;                   \r
+                       return false;\r
                }\r
                return user.canAdmin();\r
        }\r
-       \r
+\r
        public User getUser() {\r
                return user;\r
        }\r
-       \r
+\r
        public void setUser(User user) {\r
                this.user = user;\r
        }\r
index 716ed491d942cad56a0302d8aa4d9db064ad29e8..ab55cfdd321a528ce931666018da75a028cdeabe 100644 (file)
@@ -31,7 +31,7 @@ public class LinkPanel extends Panel {
                }\r
                if (linkCssClass != null) {\r
                        link.add(new SimpleAttributeModifier("class", linkCssClass));\r
-               }               \r
+               }\r
                link.add(new Label("label", labelModel));\r
                add(link);\r
        }\r
index e27adc316668e65b0974dd854ac5ec012f6a2ca1..e3a345cebb2b836623b956ea9bff4d34d9dd963e 100644 (file)
@@ -40,7 +40,7 @@ public class LoginPage extends WebPage {
                loginForm.add(new FeedbackPanel("feedback"));\r
                add(loginForm);\r
        }\r
-       \r
+\r
        protected String getServerName() {\r
                ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
                HttpServletRequest req = servletWebRequest.getHttpServletRequest();\r
@@ -57,7 +57,7 @@ public class LoginPage extends WebPage {
                @Override\r
                public void onSubmit() {\r
                        String username = LoginPage.this.username.getObject();\r
-                       char [] password = LoginPage.this.password.getObject().toCharArray();\r
+                       char[] password = LoginPage.this.password.getObject().toCharArray();\r
 \r
                        User user = GitBlit.self().authenticate(username, password);\r
                        if (user == null)\r
@@ -87,7 +87,7 @@ public class LoginPage extends WebPage {
                        // Set Cookie\r
                        WebResponse response = (WebResponse) getRequestCycle().getResponse();\r
                        GitBlit.self().setCookie(response, user);\r
-                       \r
+\r
                        // track user object so that we do not have to continue\r
                        // re-authenticating on each request.\r
                        session.setUser(user);\r
index 8dc485a5227d8e5f5a59b62c1f603e3ed66fc52f..e7196690136b355696de43fa225563e51fc129d9 100644 (file)
@@ -65,7 +65,7 @@ public abstract class RepositoryPage extends BasePage {
        }\r
 \r
        protected void addRefs(Repository r, RevCommit c) {\r
-               add(new RefsPanel("refsPanel", repositoryName,  c, JGitUtils.getAllRefs(r)));\r
+               add(new RefsPanel("refsPanel", repositoryName, c, JGitUtils.getAllRefs(r)));\r
        }\r
 \r
        protected void addFullText(String wicketId, String text, boolean substituteRegex) {\r
index c23b849ca41aa5e85b55f9da8c30eca467ca415d..e506c8cb84eac2a0b9390cb3332bd40cdeac8e60 100644 (file)
@@ -4,22 +4,22 @@ import com.gitblit.Build;
 import com.gitblit.Constants;\r
 \r
 public class User {\r
-       \r
+\r
        private String username;\r
-       private char [] password;\r
+       private String cookie;\r
        private boolean canAdmin = false;\r
        private boolean canClone = false;\r
        private boolean canPush = false;\r
-       \r
-       public User(String username, char [] password) {\r
+\r
+       public User(String username, char[] password) {\r
                this.username = username;\r
-               this.password = password;\r
+               this.cookie = Build.getSHA1((Constants.NAME + username + new String(password)).getBytes());\r
        }\r
-       \r
+\r
        public void canAdmin(boolean value) {\r
                canAdmin = value;\r
        }\r
-       \r
+\r
        public boolean canAdmin() {\r
                return canAdmin;\r
        }\r
@@ -27,23 +27,23 @@ public class User {
        public void canClone(boolean value) {\r
                canClone = value;\r
        }\r
-       \r
+\r
        public boolean canClone() {\r
                return canClone;\r
        }\r
-       \r
+\r
        public void canPush(boolean value) {\r
                canPush = value;\r
        }\r
-       \r
+\r
        public boolean canPush() {\r
                return canPush;\r
        }\r
 \r
        public String getCookie() {\r
-               return Build.getSHA1((Constants.NAME + username + new String(password)).getBytes());\r
+               return cookie;\r
        }\r
-       \r
+\r
        public String toString() {\r
                return username;\r
        }\r
index 65270a2c3f7d090b02d3634c5185d15b493b754c..27992f138bde17ae116d8f0f969c3bec9e972b85 100644 (file)
@@ -12,6 +12,7 @@ import org.apache.wicket.behavior.SimpleAttributeModifier;
 import org.apache.wicket.markup.html.basic.Label;\r
 import org.eclipse.jgit.lib.Constants;\r
 \r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.Utils;\r
 \r
@@ -32,7 +33,7 @@ public class WicketUtils {
        public static String breakLines(String string) {\r
                return string.replace("\r", "<br/>").replace("\n", "<br/>");\r
        }\r
-       \r
+\r
        public static void setTicketCssClass(Component container, String state) {\r
                String css = null;\r
                if (state.equals("open")) {\r
@@ -48,7 +49,7 @@ public class WicketUtils {
                        setCssClass(container, css);\r
                }\r
        }\r
-       \r
+\r
        public static String flattenStrings(List<String> values) {\r
                StringBuilder sb = new StringBuilder();\r
                for (String value : values) {\r
@@ -56,12 +57,12 @@ public class WicketUtils {
                }\r
                return sb.toString().trim();\r
        }\r
-       \r
+\r
        public static void setAlternatingBackground(Component c, int i) {\r
                String clazz = i % 2 == 0 ? "dark" : "light";\r
                setCssClass(c, clazz);\r
        }\r
-       \r
+\r
        public static Label createAuthorLabel(String wicketId, String author) {\r
                Label label = new Label(wicketId, author);\r
                WicketUtils.setHtmlTitle(label, author);\r
@@ -71,14 +72,14 @@ public class WicketUtils {
        public static String trimShortLog(String string) {\r
                return trimString(string, 60);\r
        }\r
-       \r
+\r
        public static String trimString(String value, int max) {\r
                if (value.length() <= max) {\r
                        return value;\r
                }\r
                return value.substring(0, max - 3) + "...";\r
        }\r
-       \r
+\r
        public static PageParameters newRepositoryParameter(String repositoryName) {\r
                return new PageParameters("r=" + repositoryName);\r
        }\r
@@ -96,14 +97,14 @@ public class WicketUtils {
                }\r
                return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",f=" + path);\r
        }\r
-       \r
+\r
        public static PageParameters newLogPageParameter(String repositoryName, String objectId, int pageNumber) {\r
                if (pageNumber <= 1) {\r
                        return newObjectParameter(repositoryName, objectId);\r
                }\r
                return new PageParameters("r=" + repositoryName + ",h=" + objectId + ",page=" + pageNumber);\r
        }\r
-       \r
+\r
        public static String getRepositoryName(PageParameters params) {\r
                return params.getString("r", "");\r
        }\r
@@ -121,7 +122,7 @@ public class WicketUtils {
        }\r
 \r
        public static Label createDateLabel(String wicketId, Date date, TimeZone timeZone) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datestampShortFormat", "MM/dd/yy"));\r
+               DateFormat df = new SimpleDateFormat(StoredSettings.getString(Keys.web_datestampShortFormat, "MM/dd/yy"));\r
                if (timeZone != null) {\r
                        df.setTimeZone(timeZone);\r
                }\r
@@ -137,9 +138,9 @@ public class WicketUtils {
                WicketUtils.setHtmlTitle(label, title);\r
                return label;\r
        }\r
-       \r
+\r
        public static Label createTimestampLabel(String wicketId, Date date, TimeZone timeZone) {\r
-               DateFormat df = new SimpleDateFormat(StoredSettings.getString("datetimestampLongFormat", "EEEE, MMMM d, yyyy h:mm a z"));\r
+               DateFormat df = new SimpleDateFormat(StoredSettings.getString(Keys.web_datetimestampLongFormat, "EEEE, MMMM d, yyyy h:mm a z"));\r
                if (timeZone != null) {\r
                        df.setTimeZone(timeZone);\r
                }\r
index cd44730a7b795dac175235dfe22506be30f31528..e2e463f9d04231011efd84a536d351afbf9b70c8 100644 (file)
@@ -4,18 +4,17 @@ import java.io.Serializable;
 \r
 import com.gitblit.utils.JGitUtils;\r
 \r
-\r
 public class PathModel implements Serializable, Comparable<PathModel> {\r
 \r
        private static final long serialVersionUID = 1L;\r
-       \r
+\r
        public final String name;\r
        public final String path;\r
        public final long size;\r
-       public final int  mode;\r
+       public final int mode;\r
        public final String commitId;\r
        public boolean isParentPath;\r
-       \r
+\r
        public PathModel(String name, String path, long size, int mode, String commitId) {\r
                this.name = name;\r
                this.path = path;\r
@@ -23,11 +22,11 @@ public class PathModel implements Serializable, Comparable<PathModel> {
                this.mode = mode;\r
                this.commitId = commitId;\r
        }\r
-       \r
+\r
        public boolean isTree() {\r
                return JGitUtils.isTreeFromMode(mode);\r
        }\r
-       \r
+\r
        public static PathModel getParentPath(String basePath, String commitId) {\r
                String parentPath = null;\r
                if (basePath.lastIndexOf('/') > -1) {\r
index 0c784340c14610fb3051ff887cd40d1128f1abb3..bb563d52989f9206122d2e9c68a2660c3507e812 100644 (file)
@@ -9,7 +9,6 @@ import org.eclipse.jgit.revwalk.RevCommit;
 \r
 import com.gitblit.utils.JGitUtils;\r
 \r
-\r
 public class RefModel implements Serializable, Comparable<RefModel> {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -34,7 +33,7 @@ public class RefModel implements Serializable, Comparable<RefModel> {
        public String getName() {\r
                return ref.getName();\r
        }\r
-       \r
+\r
        public RevCommit getCommit() {\r
                return commit;\r
        }\r
@@ -50,12 +49,12 @@ public class RefModel implements Serializable, Comparable<RefModel> {
        public ObjectId getObjectId() {\r
                return ref.getObjectId();\r
        }\r
-       \r
+\r
        public boolean isAnnotatedTag() {\r
                // ref.isPeeled() ??\r
                return !getCommitId().equals(getObjectId());\r
        }\r
-               \r
+\r
        @Override\r
        public int compareTo(RefModel o) {\r
                return getDate().compareTo(o.getDate());\r
index 50f1e08feb307ddc579ccc0cf8aff4a2103fc3bf..6bbb7be0ea800bedb9e50655225d39a760eb091e 100644 (file)
@@ -38,13 +38,13 @@ public class TicGitTicket implements Serializable, Comparable<TicGitTicket> {
                if (chunks.length == 3) {\r
                        date = new Date(Long.parseLong(chunks[0]) * 1000l);\r
                        title = chunks[1].replace('-', ' ');\r
-               }               \r
+               }\r
        }\r
 \r
        public static class Comment implements Serializable, Comparable<Comment> {\r
-               \r
+\r
                private static final long serialVersionUID = 1L;\r
-               \r
+\r
                public String text;\r
                public String author;\r
                public Date date;\r
index 17d78968131f25687d150fdb3f951b46519d9700..21127bc46c95165479ecb75b4f04efd67f8f29f1 100644 (file)
@@ -33,10 +33,10 @@ public class BlobDiffPage extends RepositoryPage {
                add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
 \r
                add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, blobPath, objectId));\r
-               \r
+\r
                add(new Label("diffText", diff).setEscapeModelStrings(false));\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.diff");\r
index 0c112d08f665f19608b82b92b19073232e59e43b..51749a362a9d2322836accaa72f658c0a5ea1955 100644 (file)
@@ -11,6 +11,7 @@ import org.eclipse.jgit.lib.Constants;
 import org.eclipse.jgit.lib.Repository;\r
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.LinkPanel;\r
@@ -18,7 +19,6 @@ import com.gitblit.wicket.RepositoryPage;
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
 \r
-\r
 public class BlobPage extends RepositoryPage {\r
 \r
        public BlobPage(PageParameters params) {\r
@@ -45,13 +45,13 @@ public class BlobPage extends RepositoryPage {
 \r
                // Map the extensions to types\r
                Map<String, Integer> map = new HashMap<String, Integer>();\r
-               for (String ext : StoredSettings.getStrings("prettyPrintExtensions")) {\r
+               for (String ext : StoredSettings.getStrings(Keys.web_prettyPrintExtensions)) {\r
                        map.put(ext.toLowerCase(), 1);\r
                }\r
-               for (String ext : StoredSettings.getStrings("imageExtensions")) {\r
+               for (String ext : StoredSettings.getStrings(Keys.web_imageExtensions)) {\r
                        map.put(ext.toLowerCase(), 2);\r
                }\r
-               for (String ext : StoredSettings.getStrings("binaryExtensions")) {\r
+               for (String ext : StoredSettings.getStrings(Keys.web_binaryExtensions)) {\r
                        map.put(ext.toLowerCase(), 3);\r
                }\r
 \r
@@ -88,7 +88,7 @@ public class BlobPage extends RepositoryPage {
                        add(blobLabel);\r
                }\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.view");\r
index f4359d81d44f484fc4a628b317434ac8a86661f4..49088f0d2f1ebda5d5f65a8b1a861429996a435f 100644 (file)
@@ -5,7 +5,6 @@ import org.apache.wicket.PageParameters;
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.panels.BranchesPanel;\r
 \r
-\r
 public class BranchesPage extends RepositoryPage {\r
 \r
        public BranchesPage(PageParameters params) {\r
@@ -13,7 +12,7 @@ public class BranchesPage extends RepositoryPage {
 \r
                add(new BranchesPanel("branchesPanel", repositoryName, getRepository(), -1));\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.branches");\r
index 7f6d347e2556532e6e6cc26a3dde95a77aa1f6f5..7218cf8104be82a9a56be92cec0e8bcc669b5d40 100644 (file)
@@ -25,15 +25,15 @@ public class CommitDiffPage extends RepositoryPage {
 \r
                Repository r = getRepository();\r
                RevCommit commit = JGitUtils.getCommit(r, objectId);\r
-               String diff = JGitUtils.getCommitDiff(r, commit, true);         \r
-               \r
+               String diff = JGitUtils.getCommitDiff(r, commit, true);\r
+\r
                List<String> parents = new ArrayList<String>();\r
                if (commit.getParentCount() > 0) {\r
                        for (RevCommit parent : commit.getParents()) {\r
                                parents.add(parent.name());\r
                        }\r
                }\r
-               \r
+\r
                // commit page links\r
                if (parents.size() == 0) {\r
                        add(new Label("parentLink", "none"));\r
@@ -46,7 +46,7 @@ public class CommitDiffPage extends RepositoryPage {
                add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
 \r
                // changed paths list\r
-               List<PathModel> paths  = JGitUtils.getFilesInCommit(r, commit);\r
+               List<PathModel> paths = JGitUtils.getFilesInCommit(r, commit);\r
                ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);\r
                DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -59,7 +59,7 @@ public class CommitDiffPage extends RepositoryPage {
                                } else {\r
                                        item.add(new LinkPanel("pathName", "list", entry.path, BlobPage.class, newPathParameter(entry.path)));\r
                                }\r
-                               \r
+\r
                                item.add(new BookmarkablePageLink<Void>("patch", PatchPage.class, newPathParameter(entry.path)));\r
                                item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, newPathParameter(entry.path)));\r
                                item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false));\r
@@ -72,7 +72,7 @@ public class CommitDiffPage extends RepositoryPage {
                add(pathsView);\r
                add(new Label("diffText", diff).setEscapeModelStrings(false));\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.commitdiff");\r
index 7e3403ded6523747769acb256c7fd3e3b6cc2124..9cc6df8558d31babca06a539fee3a296a694581f 100644 (file)
@@ -19,7 +19,6 @@ import com.gitblit.wicket.RepositoryPage;
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.PathModel;\r
 \r
-\r
 public class CommitPage extends RepositoryPage {\r
 \r
        public CommitPage(PageParameters params) {\r
@@ -27,14 +26,14 @@ public class CommitPage extends RepositoryPage {
 \r
                Repository r = getRepository();\r
                RevCommit c = JGitUtils.getCommit(r, objectId);\r
-               \r
+\r
                List<String> parents = new ArrayList<String>();\r
                if (c.getParentCount() > 0) {\r
                        for (RevCommit parent : c.getParents()) {\r
                                parents.add(parent.name());\r
                        }\r
                }\r
-               \r
+\r
                // commit page links\r
                if (parents.size() == 0) {\r
                        add(new Label("parentLink", "none"));\r
@@ -44,9 +43,9 @@ public class CommitPage extends RepositoryPage {
                        add(new LinkPanel("commitdiffLink", null, new StringResourceModel("gb.commitdiff", this, null), CommitDiffPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
                }\r
                add(new BookmarkablePageLink<Void>("patchLink", PatchPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
-               \r
+\r
                add(new LinkPanel("shortlog", "title", c.getShortMessage(), CommitDiffPage.class, WicketUtils.newObjectParameter(repositoryName, objectId)));\r
-               \r
+\r
                addRefs(r, c);\r
 \r
                add(new Label("commitAuthor", JGitUtils.getDisplayName(c.getAuthorIdent())));\r
@@ -76,7 +75,7 @@ public class CommitPage extends RepositoryPage {
                addFullText("fullMessage", c.getFullMessage(), true);\r
 \r
                // changed paths list\r
-               List<PathModel> paths  = JGitUtils.getFilesInCommit(r, c);\r
+               List<PathModel> paths = JGitUtils.getFilesInCommit(r, c);\r
                ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);\r
                DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -89,7 +88,7 @@ public class CommitPage extends RepositoryPage {
                                } else {\r
                                        item.add(new LinkPanel("pathName", "list", entry.path, BlobPage.class, newPathParameter(entry.path)));\r
                                }\r
-                               \r
+\r
                                item.add(new BookmarkablePageLink<Void>("diff", BlobDiffPage.class, newPathParameter(entry.path)));\r
                                item.add(new BookmarkablePageLink<Void>("view", BlobPage.class, newPathParameter(entry.path)));\r
                                item.add(new BookmarkablePageLink<Void>("blame", BlobPage.class).setEnabled(false));\r
@@ -101,7 +100,7 @@ public class CommitPage extends RepositoryPage {
                };\r
                add(pathsView);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.commit");\r
index c877bb6d83039a5461cfaed13fa3e439e76a4a22..12e89a6c89dfca620a80449bf291deccdb832d0b 100644 (file)
@@ -13,7 +13,6 @@ import com.gitblit.GitBlit;
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 \r
-\r
 public class PatchPage extends WebPage {\r
 \r
        public PatchPage(PageParameters params) {\r
@@ -24,7 +23,7 @@ public class PatchPage extends WebPage {
                        redirectToInterceptPage(new RepositoriesPage());\r
                }\r
                final String repositoryName = WicketUtils.getRepositoryName(params);\r
-               final String objectId = WicketUtils.getObject(params);          \r
+               final String objectId = WicketUtils.getObject(params);\r
                final String blobPath = WicketUtils.getPath(params);\r
 \r
                ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
@@ -42,5 +41,5 @@ public class PatchPage extends WebPage {
                String patch = JGitUtils.getCommitPatch(r, commit, blobPath);\r
                add(new Label("patchText", patch));\r
                r.close();\r
-       }       \r
+       }\r
 }\r
index dc58b20880f882f4dc6106e5dd28fccb67734600..961e4c94ced0baa8a1e75fbf3bd7107eee83759a 100644 (file)
@@ -14,11 +14,11 @@ import org.eclipse.jgit.lib.Repository;
 import org.eclipse.jgit.revwalk.RevCommit;\r
 \r
 import com.gitblit.GitBlit;\r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.WicketUtils;\r
 \r
-\r
 public class RawPage extends WebPage {\r
 \r
        public RawPage(PageParameters params) {\r
@@ -29,7 +29,7 @@ public class RawPage extends WebPage {
                        redirectToInterceptPage(new RepositoriesPage());\r
                }\r
                final String repositoryName = WicketUtils.getRepositoryName(params);\r
-               final String objectId = WicketUtils.getObject(params);          \r
+               final String objectId = WicketUtils.getObject(params);\r
                final String blobPath = WicketUtils.getPath(params);\r
 \r
                ServletWebRequest servletWebRequest = (ServletWebRequest) getRequest();\r
@@ -52,10 +52,10 @@ public class RawPage extends WebPage {
 \r
                // Map the extensions to types\r
                Map<String, Integer> map = new HashMap<String, Integer>();\r
-               for (String ext : StoredSettings.getStrings("imageExtensions")) {\r
+               for (String ext : StoredSettings.getStrings(Keys.web_imageExtensions)) {\r
                        map.put(ext.toLowerCase(), 2);\r
                }\r
-               for (String ext : StoredSettings.getStrings("binaryExtensions")) {\r
+               for (String ext : StoredSettings.getStrings(Keys.web_binaryExtensions)) {\r
                        map.put(ext.toLowerCase(), 3);\r
                }\r
 \r
@@ -87,5 +87,5 @@ public class RawPage extends WebPage {
                        add(blobLabel);\r
                }\r
                r.close();\r
-       }       \r
+       }\r
 }\r
index 3a43b0d9aa4e1c28d7aac818488d76cf52cd18ae..eca216c9bb366737664361a8b8dff15f84102a2b 100644 (file)
@@ -18,6 +18,7 @@ import org.apache.wicket.model.IModel;
 import org.apache.wicket.model.Model;\r
 \r
 import com.gitblit.GitBlit;\r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.Utils;\r
 import com.gitblit.wicket.BasePage;\r
@@ -26,27 +27,26 @@ import com.gitblit.wicket.LinkPanel;
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.RepositoryModel;\r
 \r
-\r
 public class RepositoriesPage extends BasePage {\r
 \r
        public RepositoriesPage() {\r
                super();\r
                setupPage("", "");\r
-               \r
+\r
                boolean showAdmin = false;\r
-               if (StoredSettings.getBoolean("authenticateWebUI", true)) {\r
-                       boolean allowAdmin = StoredSettings.getBoolean("allowAdministration", false);\r
-                       showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin(); \r
+               if (StoredSettings.getBoolean(Keys.web_authenticate, true)) {\r
+                       boolean allowAdmin = StoredSettings.getBoolean(Keys.web_allowAdministration, false);\r
+                       showAdmin = allowAdmin && GitBlitWebSession.get().canAdmin();\r
                } else {\r
-                       showAdmin = StoredSettings.getBoolean("allowAdministration", false);\r
+                       showAdmin = StoredSettings.getBoolean(Keys.web_allowAdministration, false);\r
                }\r
-               \r
+\r
                Fragment adminLinks = new Fragment("adminPanel", "adminLinks", this);\r
                adminLinks.add(new BookmarkablePageLink<Void>("newRepository", RepositoriesPage.class));\r
-               adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));              \r
+               adminLinks.add(new BookmarkablePageLink<Void>("newUser", RepositoriesPage.class));\r
                add(adminLinks.setVisible(showAdmin));\r
-               \r
-               add(new Label("repositoriesMessage", StoredSettings.getString("repositoriesMessage", "")).setEscapeModelStrings(false));\r
+\r
+               add(new Label("repositoriesMessage", StoredSettings.getString(Keys.web_repositoriesMessage, "")).setEscapeModelStrings(false));\r
 \r
                List<RepositoryModel> rows = GitBlit.self().getRepositories(getRequest());\r
                DataProvider dp = new DataProvider(rows);\r
index 1dafb52b0bbb1f68803a72d5b6b95a60fc498ca9..50de96ec12ef57cbbbeea4add12327333228a3ff 100644 (file)
@@ -15,6 +15,7 @@ import com.codecommit.wicket.ChartAxisType;
 import com.codecommit.wicket.ChartProvider;\r
 import com.codecommit.wicket.ChartType;\r
 import com.codecommit.wicket.IChartData;\r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.GitBlitWebApp;\r
@@ -29,23 +30,23 @@ public class SummaryPage extends RepositoryPage {
 \r
        public SummaryPage(PageParameters params) {\r
                super(params);\r
-               \r
+\r
                int numCommitsDef = 20;\r
                int numRefsDef = 5;\r
-               \r
-               int numberCommits = StoredSettings.getInteger("summaryCommitCount", numCommitsDef);\r
+\r
+               int numberCommits = StoredSettings.getInteger(Keys.web_summaryCommitCount, numCommitsDef);\r
                if (numberCommits <= 0) {\r
                        numberCommits = numCommitsDef;\r
                }\r
 \r
-               int numberRefs = StoredSettings.getInteger("summaryRefsCount", numRefsDef);\r
+               int numberRefs = StoredSettings.getInteger(Keys.web_summaryRefsCount, numRefsDef);\r
                if (numberRefs <= 0) {\r
                        numberRefs = numRefsDef;\r
                }\r
-               \r
-               Repository r = getRepository();         \r
+\r
+               Repository r = getRepository();\r
                List<Metric> metrics = JGitUtils.getDateMetrics(r);\r
-               \r
+\r
                long numberOfCommits = 0;\r
                for (Metric m : metrics) {\r
                        numberOfCommits += m.count;\r
@@ -54,25 +55,25 @@ public class SummaryPage extends RepositoryPage {
                // repository description\r
                add(new Label("repositoryDescription", description));\r
                add(new Label("repositoryOwner", JGitUtils.getRepositoryOwner(r)));\r
-               \r
+\r
                add(WicketUtils.createTimestampLabel("repositoryLastChange", JGitUtils.getLastChange(r), getTimeZone()));\r
                add(new Label("repositoryCloneUrl", GitBlitWebApp.get().getCloneUrl(repositoryName)));\r
 \r
                add(new LogPanel("commitsPanel", repositoryName, null, r, numberCommits, 0));\r
                add(new TagsPanel("tagsPanel", repositoryName, r, numberRefs));\r
                add(new BranchesPanel("branchesPanel", repositoryName, r, numberRefs));\r
-               \r
+\r
                // Display an activity line graph\r
                insertActivityGraph(metrics);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.summary");\r
        }\r
 \r
        private void insertActivityGraph(List<Metric> metrics) {\r
-               if (StoredSettings.getBoolean("generateActivityGraph", true)) {                 \r
+               if (StoredSettings.getBoolean(Keys.web_generateActivityGraph, true)) {\r
                        IChartData data = getChartData(metrics);\r
 \r
                        ChartProvider provider = new ChartProvider(new Dimension(400, 80), ChartType.LINE, data);\r
@@ -86,7 +87,7 @@ public class SummaryPage extends RepositoryPage {
 \r
                        add(new Chart("commitsChart", provider));\r
                } else {\r
-                       add(new ContextImage("commitsChart", "blank.png"));                     \r
+                       add(new ContextImage("commitsChart", "blank.png"));\r
                }\r
        }\r
 \r
index e6f2fd6b2ce3ea67c81f54cc8544b4047692c6b6..d36c887a4f20a26415ff7384ceaa2861cd5841d4 100644 (file)
@@ -13,19 +13,18 @@ import com.gitblit.wicket.RepositoryPage;
 import com.gitblit.wicket.WicketUtils;\r
 import com.gitblit.wicket.models.RefModel;\r
 \r
-\r
 public class TagPage extends RepositoryPage {\r
 \r
        public TagPage(PageParameters params) {\r
                super(params);\r
 \r
-               Repository r = getRepository();         \r
+               Repository r = getRepository();\r
                List<RefModel> tags = JGitUtils.getTags(r, -1);\r
                RevCommit c = JGitUtils.getCommit(r, objectId);\r
-               \r
+\r
                RefModel tagRef = null;\r
                // determine tag\r
-               for (RefModel tag:tags) {\r
+               for (RefModel tag : tags) {\r
                        if (tag.getName().equals(objectId) || tag.getObjectId().getName().equals(objectId)) {\r
                                tagRef = tag;\r
                                break;\r
@@ -35,19 +34,19 @@ public class TagPage extends RepositoryPage {
                if (tagRef == null) {\r
                        // point to commit\r
                        add(new LinkPanel("commit", "title", c.getShortMessage(), CommitPage.class, newCommitParameter()));\r
-                       add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName())));                    \r
+                       add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName())));\r
                } else {\r
                        // TODO commit or tree or blob?\r
                        add(new LinkPanel("commit", "title", tagRef.getDisplayName(), CommitPage.class, newCommitParameter()));\r
                        add(new LinkPanel("tagId", "list", c.getName(), CommitPage.class, newCommitParameter(c.getName())));\r
-               }               \r
-               \r
+               }\r
+\r
                add(new Label("tagAuthor", JGitUtils.getDisplayName(c.getAuthorIdent())));\r
                add(WicketUtils.createTimestampLabel("tagDate", c.getAuthorIdent().getWhen(), getTimeZone()));\r
 \r
                addFullText("fullMessage", c.getFullMessage(), true);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.tag");\r
index eb1742d1b67b945c168d6b686aae137d92bc7c5a..d759d5d126015473b0a9ab38bccb8328475e1129 100644 (file)
@@ -5,16 +5,15 @@ import org.apache.wicket.PageParameters;
 import com.gitblit.wicket.RepositoryPage;\r
 import com.gitblit.wicket.panels.TagsPanel;\r
 \r
-\r
 public class TagsPage extends RepositoryPage {\r
 \r
        public TagsPage(PageParameters params) {\r
                super(params);\r
-               \r
+\r
                add(new TagsPanel("tagsPanel", repositoryName, getRepository(), -1));\r
-               \r
+\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.tags");\r
index 7a8b301efc30c328a144bef1921681c6f7236b14..204565c66030b881cb990010553acad4203d2789 100644 (file)
@@ -45,7 +45,7 @@ public class TicGitPage extends RepositoryPage {
                };\r
                add(ticketsView);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.ticgit");\r
index 73b70850480d37b60874f7773a71e3d9d5e39769..30bd6ccfdd6f3323de62ca1de8faa43ae70a79e6 100644 (file)
@@ -50,7 +50,7 @@ public class TicGitTicketPage extends RepositoryPage {
                };\r
                add(commentsView);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.ticket");\r
@@ -58,7 +58,7 @@ public class TicGitTicketPage extends RepositoryPage {
 \r
        private String prepareComment(String comment) {\r
                String html = Utils.escapeForHtml(comment, false);\r
-               html = WicketUtils.breakLines(comment).trim();          \r
+               html = WicketUtils.breakLines(comment).trim();\r
                return html.replaceAll("\\bcommit\\s*([A-Za-z0-9]*)\\b", "<a href=\"/commit/" + repositoryName + "/$1\">commit $1</a>");\r
        }\r
 }\r
index d83939eac6d05e50f7b6b6edbf1ad98afef4898a..5ebb1b655624b826a1b806d43e81ec6b8f00c6c0 100644 (file)
@@ -21,7 +21,6 @@ import com.gitblit.wicket.WicketUtils;
 import com.gitblit.wicket.models.PathModel;\r
 import com.gitblit.wicket.panels.PathBreadcrumbsPanel;\r
 \r
-\r
 public class TreePage extends RepositoryPage {\r
 \r
        public TreePage(PageParameters params) {\r
@@ -37,18 +36,17 @@ public class TreePage extends RepositoryPage {
                add(new Label("historyLink", getString("gb.history")));\r
                add(new BookmarkablePageLink<Void>("headLink", TreePage.class, WicketUtils.newPathParameter(repositoryName, Constants.HEAD, basePath)));\r
 \r
-\r
                add(new LinkPanel("shortlog", "title", commit.getShortMessage(), CommitPage.class, newCommitParameter()));\r
 \r
                // breadcrumbs\r
-               add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, basePath, objectId));                       \r
+               add(new PathBreadcrumbsPanel("breadcrumbs", repositoryName, basePath, objectId));\r
                if (basePath != null && basePath.trim().length() > 0) {\r
                        paths.add(0, PathModel.getParentPath(basePath, objectId));\r
                }\r
 \r
                final ByteFormat byteFormat = new ByteFormat();\r
-               \r
-               // changed paths list           \r
+\r
+               // changed paths list\r
                ListDataProvider<PathModel> pathsDp = new ListDataProvider<PathModel>(paths);\r
                DataView<PathModel> pathsView = new DataView<PathModel>("changedPath", pathsDp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -67,7 +65,7 @@ public class TreePage extends RepositoryPage {
                                                // folder/tree link\r
                                                item.add(new Label("pathSize", ""));\r
                                                item.add(new LinkPanel("pathName", null, entry.name, TreePage.class, newPathParameter(entry.path)));\r
-                                               \r
+\r
                                                // links\r
                                                Fragment links = new Fragment("pathLinks", "treeLinks", this);\r
                                                links.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
@@ -77,7 +75,7 @@ public class TreePage extends RepositoryPage {
                                                // blob link\r
                                                item.add(new Label("pathSize", byteFormat.format(entry.size)));\r
                                                item.add(new LinkPanel("pathName", "list", entry.name, BlobPage.class, newPathParameter(entry.path)));\r
-                                               \r
+\r
                                                // links\r
                                                Fragment links = new Fragment("pathLinks", "blobLinks", this);\r
                                                links.add(new BookmarkablePageLink<Void>("view", BlobPage.class, WicketUtils.newPathParameter(repositoryName, entry.commitId, entry.path)));\r
@@ -93,7 +91,7 @@ public class TreePage extends RepositoryPage {
                };\r
                add(pathsView);\r
        }\r
-       \r
+\r
        @Override\r
        protected String getPageName() {\r
                return getString("gb.tree");\r
index f81dfa9f391f5b3a2412b60cb11a9d5cc5d00453..cdfc050c3ff120c9f5b2a1593761916159227fdd 100644 (file)
@@ -4,6 +4,7 @@ import java.util.TimeZone;
 \r
 import org.apache.wicket.markup.html.panel.Panel;\r
 \r
+import com.gitblit.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.wicket.GitBlitWebSession;\r
 \r
@@ -16,6 +17,6 @@ public abstract class BasePanel extends Panel {
        }\r
 \r
        protected TimeZone getTimeZone() {\r
-               return StoredSettings.getBoolean("useClientTimezone", false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
+               return StoredSettings.getBoolean(Keys.web_useClientTimezone, false) ? GitBlitWebSession.get().getTimezone() : TimeZone.getDefault();\r
        }\r
 }\r
index 1c68b6f9d8e874494c757aeede52c6d8667a3d5b..8ac78e4cc27e744a357bfafa8b91c8e50ef72b21 100644 (file)
@@ -48,7 +48,7 @@ public class BranchesPanel extends BasePanel {
                        // show repository summary page link\r
                        add(new LinkPanel("branches", "title", repositoryName, SummaryPage.class, WicketUtils.newRepositoryParameter(repositoryName)));\r
                }\r
-               \r
+\r
                ListDataProvider<RefModel> branchesDp = new ListDataProvider<RefModel>(branches);\r
                DataView<RefModel> branchesView = new DataView<RefModel>("branch", branchesDp) {\r
                        private static final long serialVersionUID = 1L;\r
@@ -60,11 +60,11 @@ public class BranchesPanel extends BasePanel {
                                item.add(WicketUtils.createDateLabel("branchDate", entry.getDate(), getTimeZone()));\r
 \r
                                item.add(new LinkPanel("branchName", "list name", WicketUtils.trimString(entry.getDisplayName(), 28), LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
-                               \r
+\r
                                // only show branch type on the branches page\r
                                boolean remote = entry.getName().startsWith(Constants.R_REMOTES);\r
-                               item.add(new Label("branchType", remote ? getString("gb.remote"):getString("gb.local")).setVisible(maxCount <= 0));\r
-                               \r
+                               item.add(new Label("branchType", remote ? getString("gb.remote") : getString("gb.local")).setVisible(maxCount <= 0));\r
+\r
                                item.add(new BookmarkablePageLink<Void>("log", LogPage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
                                item.add(new BookmarkablePageLink<Void>("tree", TreePage.class, WicketUtils.newObjectParameter(repositoryName, entry.getName())));\r
 \r
index 8ef1e3e7e1d0061610f6394a6427c8227a974b7c..504bdd3ad500da27ed445f1428c9a8c3095ca8f9 100644 (file)
@@ -14,12 +14,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.Keys;\r
 import com.gitblit.StoredSettings;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.wicket.LinkPanel;\r
 import com.gitblit.wicket.WicketUtils;\r
-import com.gitblit.wicket.pages.CommitPage;\r
 import com.gitblit.wicket.pages.CommitDiffPage;\r
+import com.gitblit.wicket.pages.CommitPage;\r
 import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.SummaryPage;\r
 import com.gitblit.wicket.pages.TreePage;\r
@@ -31,7 +32,7 @@ public class LogPanel extends BasePanel {
        public LogPanel(String wicketId, final String repositoryName, String objectId, Repository r, int limit, int pageOffset) {\r
                super(wicketId);\r
                boolean pageResults = limit <= 0;\r
-               int itemsPerPage = StoredSettings.getInteger("logPageCommitCount", 50);\r
+               int itemsPerPage = StoredSettings.getInteger(Keys.web_logPageCommitCount, 50);\r
                if (itemsPerPage <= 1) {\r
                        itemsPerPage = 50;\r
                }\r
index e2f9401d1b06d613f6f51405e80d38f1a67eaa03..252b49a4934b6c552752d9e4eb1e6e417e9b8799 100644 (file)
@@ -57,7 +57,7 @@ public class PageLinksPanel extends Panel {
                // Get the repository ticgit setting\r
                boolean checkTicgit = StoredSettings.getBoolean("ticgit.global", false);\r
                checkTicgit |= StoredSettings.getBoolean(MessageFormat.format("ticgit.{0}", repositoryName), false);\r
-               \r
+\r
                // Add dynamic repository extras\r
                List<String> extras = new ArrayList<String>();\r
                if (checkTicgit && JGitUtils.getTicGitBranch(r) != null) {\r
@@ -84,7 +84,7 @@ public class PageLinksPanel extends Panel {
                        String key = knownPages.get(wicketId);\r
                        String linkName = getString(key);\r
                        if (linkName.equals(pageName)) {\r
-                               Component c = get(wicketId);                            \r
+                               Component c = get(wicketId);\r
                                if (c != null) {\r
                                        c.setEnabled(false);\r
                                }\r
index 9f92891208475ccc0f88db1cad1d818ce9862f26..b84d9df88ede5850561c1a550f3e4add08e07d9a 100644 (file)
@@ -20,7 +20,6 @@ import com.gitblit.wicket.pages.CommitPage;
 import com.gitblit.wicket.pages.LogPage;\r
 import com.gitblit.wicket.pages.TagPage;\r
 \r
-\r
 public class RefsPanel extends Panel {\r
 \r
        private static final long serialVersionUID = 1L;\r
@@ -32,11 +31,12 @@ public class RefsPanel extends Panel {
                        refNames = new ArrayList<String>();\r
                }\r
                Collections.sort(refNames);\r
-//             refNames.remove(Constants.HEAD);\r
-               \r
+               // refNames.remove(Constants.HEAD);\r
+\r
                ListDataProvider<String> refsDp = new ListDataProvider<String>(refNames);\r
                DataView<String> refsView = new DataView<String>("ref", refsDp) {\r
                        private static final long serialVersionUID = 1L;\r
+\r
                        public void populateItem(final Item<String> item) {\r
                                String entry = item.getModelObject();\r
                                Component c = null;\r