]> source.dussan.org Git - gitblit.git/commitdiff
Restored html content to feeds. Include regex substitutions in content.
authorJames Moger <james.moger@gitblit.com>
Wed, 9 Nov 2011 22:01:59 +0000 (17:01 -0500)
committerJames Moger <james.moger@gitblit.com>
Wed, 9 Nov 2011 22:01:59 +0000 (17:01 -0500)
docs/00_index.mkd
docs/04_releases.mkd
src/com/gitblit/SyndicationServlet.java
src/com/gitblit/client/FeedsPanel.java
src/com/gitblit/client/GitblitClient.java
src/com/gitblit/client/SearchDialog.java
src/com/gitblit/utils/SyndicationUtils.java

index 5139f041754730fc04eb62641d856f59d52f6e86..f8c7fd4db49fc695ba32d7fe7b6765437d362df2 100644 (file)
@@ -47,6 +47,7 @@ Gitblit requires a Java 6 Runtime Environment (JRE) or a Java 6 Development Kit
 - added: setting to control Gitblit GO context path for proxy setups  \r
     **New:** *server.contextPath = /*\r
 - added: *combined-md5* password storage option which stores the hash of username+password as the password\r
+- added: RSS feeds now include regex substitutions on commit messages for bug trackers, etc\r
 - fixed: federation protocol timestamps.  dates are now serialized to the [iso8601](http://en.wikipedia.org/wiki/ISO_8601) standard.  \r
     **This breaks 0.6.0 federation clients/servers.**\r
 - fixed: collision on rename for repositories and users\r
index a2161d28df610a5cf288f46089e7585dd030316c..0b6537b3514fe06177d35e05370338fdeadca353 100644 (file)
@@ -20,6 +20,7 @@
 - added: setting to control Gitblit GO context path for proxy setups  \r
     **New:** *server.contextPath = /*\r
 - added: *combined-md5* password storage option which stores the hash of username+password as the password\r
+- added: RSS feeds now include regex substitutions on commit messages for bug trackers, etc\r
 - fixed: federation protocol timestamps.  dates are now serialized to the [iso8601](http://en.wikipedia.org/wiki/ISO_8601) standard.  \r
     **This breaks 0.6.0 federation clients/servers.**\r
 - fixed: collision on rename for repositories and users\r
index 66415d10e4b04e9a8ad4e84988ea5f24053a5db3..1de3d7906cbd9a18368717e2b0550f920ffa84b3 100644 (file)
@@ -28,9 +28,9 @@ import org.eclipse.jgit.revwalk.RevCommit;
 import org.slf4j.Logger;\r
 import org.slf4j.LoggerFactory;\r
 \r
+import com.gitblit.models.FeedEntryModel;\r
 import com.gitblit.models.RefModel;\r
 import com.gitblit.models.RepositoryModel;\r
-import com.gitblit.models.FeedEntryModel;\r
 import com.gitblit.utils.HttpUtils;\r
 import com.gitblit.utils.JGitUtils;\r
 import com.gitblit.utils.StringUtils;\r
@@ -189,8 +189,9 @@ public class SyndicationServlet extends HttpServlet {
                        entry.link = MessageFormat.format(urlPattern, gitblitUrl,\r
                                        StringUtils.encodeURL(model.name), commit.getName());\r
                        entry.published = commit.getCommitterIdent().getWhen();\r
-                       entry.contentType = "text/plain";\r
-                       entry.content = commit.getFullMessage();\r
+                       entry.contentType = "text/html";\r
+                       String message = GitBlit.self().processCommitMessage(model.name, commit.getFullMessage());\r
+                       entry.content = message;\r
                        entry.repository = model.name;\r
                        entry.branch = objectId;\r
                        List<RefModel> refs = allRefs.get(commit.getId());\r
index 9f8de8c3e4ece7cd7e6b79ee2544ec3691ac4461..97f37c0df6fbe36bd6c7edbed992bf092724de09 100644 (file)
@@ -42,8 +42,8 @@ import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;\r
 import javax.swing.table.TableRowSorter;\r
 \r
-import com.gitblit.models.FeedModel;\r
 import com.gitblit.models.FeedEntryModel;\r
+import com.gitblit.models.FeedModel;\r
 import com.gitblit.utils.StringUtils;\r
 \r
 /**\r
index c590dcccebe0f2eef3a9b2aba1187f85d2f5beae..c027537a5d9a84da62a689857f92c05bea88d84c 100644 (file)
@@ -32,11 +32,11 @@ import com.gitblit.GitBlitException.UnauthorizedException;
 import com.gitblit.GitBlitException.UnknownRequestException;\r
 import com.gitblit.Keys;\r
 import com.gitblit.models.FederationModel;\r
+import com.gitblit.models.FeedEntryModel;\r
 import com.gitblit.models.FeedModel;\r
 import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.ServerSettings;\r
 import com.gitblit.models.ServerStatus;\r
-import com.gitblit.models.FeedEntryModel;\r
 import com.gitblit.models.UserModel;\r
 import com.gitblit.utils.RpcUtils;\r
 import com.gitblit.utils.StringUtils;\r
index 8c94a5bb9c3e99e04d3226b0bbab10e4b58cc6ca..cf171160e976466100cf04b0560cb441c329630f 100644 (file)
@@ -43,8 +43,8 @@ import javax.swing.event.ListSelectionEvent;
 import javax.swing.event.ListSelectionListener;\r
 \r
 import com.gitblit.Constants;\r
-import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.models.FeedEntryModel;\r
+import com.gitblit.models.RepositoryModel;\r
 import com.gitblit.utils.StringUtils;\r
 \r
 /**\r
index 6ba8d738bf0f6cbd7443742dd704fcbc21550c6a..061d12a4c2be8189df9db7b7d023619d309b51ea 100644 (file)
@@ -97,8 +97,14 @@ public class SyndicationUtils {
                        }\r
 \r
                        SyndContent content = new SyndContentImpl();\r
-                       content.setType(entryModel.contentType);\r
-                       content.setValue(entryModel.content);\r
+                       if (StringUtils.isEmpty(entryModel.contentType)\r
+                                       || entryModel.contentType.equalsIgnoreCase("text/plain")) {\r
+                               content.setType("text/html");\r
+                               content.setValue(StringUtils.breakLinesForHtml(entryModel.content));\r
+                       } else {\r
+                               content.setType(entryModel.contentType);\r
+                               content.setValue(entryModel.content);\r
+                       }\r
                        entry.setDescription(content);\r
 \r
                        entries.add(entry);\r
@@ -167,9 +173,9 @@ public class SyndicationUtils {
         * @return a list of SyndicationModel entries\r
         * @throws {@link IOException}\r
         */\r
-       public static List<FeedEntryModel> readSearchFeed(String url, String repository,\r
-                       String branch, String fragment, Constants.SearchType searchType, int numberOfEntries,\r
-                       int page, String username, char[] password) throws IOException {\r
+       public static List<FeedEntryModel> readSearchFeed(String url, String repository, String branch,\r
+                       String fragment, Constants.SearchType searchType, int numberOfEntries, int page,\r
+                       String username, char[] password) throws IOException {\r
                // determine parameters\r
                List<String> parameters = new ArrayList<String>();\r
                parameters.add("s=" + StringUtils.encodeURL(fragment));\r