diff --git a/README.md b/README.md index 410699f4..ab41d1b8 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,23 @@ CommaFeed ========= -Google Reader inspired self-hosted RSS reader. +Google Reader inspired self-hosted RSS reader, based on Wicket and AngularJS. -Deploy on any JavaEE6 container or better yet on OpenShift. \ No newline at end of file +Deploy on any JavaEE6 container or better yet on OpenShift. + + +Deployment on OpenShift +---------- + +* Create an account on `http://www.openshift.com/`. +* Add an application, select `JBoss Enterprise Application Platform 6.0``. +* For the`Public URL` set the name you want (e.g. `commafeed`). +* For the`Source Code` option, click ``Change` and set this repository (`https://github.com/Athou/commafeed.git`)`. +* Click `Create Application`. +* Click `Add cartridge` and select `MySQL`. +* Wait a couple of minutes and access your application. +* The defaut user is `admin` and the password is `admin`. + +Local development +----------------- + +`mvn clean package tomee:run` and access `http://localhost:8082`. Any changes to the source code will be applied immediatly. \ No newline at end of file diff --git a/pom.xml b/pom.xml index 95a228a0..bd32080a 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ 1.6.0-SNAPSHOT plus 8082 - -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled -XX:+CMSPermGenSweepingEnabled + -Xmx1024m -XX:MaxPermSize=512m -XX:+CMSClassUnloadingEnabled true 1 @@ -71,20 +71,6 @@ - - org.zeroturnaround - jrebel-maven-plugin - 1.1.3 - - - generate-rebel-xml - process-resources - - generate - - - - @@ -101,11 +87,6 @@ EasyCriteria 2.1.0 - - org.slf4j - slf4j-simple - 1.7.4 - com.google.guava @@ -137,6 +118,16 @@ commons-lang 2.6 + + com.googlecode.lambdaj + lambdaj + 2.3.3 + + + joda-time + joda-time + 2.2 + net.java.dev.rome @@ -149,14 +140,20 @@ 4.2.3 - joda-time - joda-time - 2.2 + org.jsoup + jsoup + 1.7.2 + + + + com.google.code.gson + gson + 2.2.2 - com.googlecode.lambdaj - lambdaj - 2.3.3 + org.slf4j + slf4j-simple + 1.7.4 @@ -175,11 +172,6 @@ 6.6.0 - - com.google.code.gson - gson - 2.2.2 - diff --git a/src/main/java/com/commafeed/backend/feeds/FeedParser.java b/src/main/java/com/commafeed/backend/feeds/FeedParser.java index 1cefb7f1..4b4c22fe 100644 --- a/src/main/java/com/commafeed/backend/feeds/FeedParser.java +++ b/src/main/java/com/commafeed/backend/feeds/FeedParser.java @@ -8,6 +8,8 @@ import javax.ejb.Stateless; import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.SystemUtils; +import org.jsoup.Jsoup; +import org.jsoup.nodes.Document; import com.commafeed.model.Feed; import com.commafeed.model.FeedEntry; @@ -65,6 +67,13 @@ public class FeedParser { } }), SystemUtils.LINE_SEPARATOR); } + content = handleContent(content); return content; } + + private String handleContent(String content) { + Document doc = Jsoup.parse(content); + doc.select("a").attr("target", "_blank"); + return doc.outerHtml(); + } } diff --git a/src/main/java/com/commafeed/frontend/rest/FeedEntriesREST.java b/src/main/java/com/commafeed/frontend/rest/FeedEntriesREST.java index a4bf635b..a8d92e50 100644 --- a/src/main/java/com/commafeed/frontend/rest/FeedEntriesREST.java +++ b/src/main/java/com/commafeed/frontend/rest/FeedEntriesREST.java @@ -7,6 +7,7 @@ import java.util.List; import javax.inject.Inject; +import org.apache.commons.lang.ObjectUtils; import org.apache.wicket.request.mapper.parameter.PageParameters; import com.commafeed.backend.dao.FeedCategoryService; @@ -78,7 +79,7 @@ public class FeedEntriesREST extends JSONPage { @Override public int compare(Entry e1, Entry e2) { - return e2.getDate().compareTo(e1.getDate()); + return ObjectUtils.compare(e2.getDate(), e1.getDate()); } }); return entries;