[seam-commits] Seam SVN: r7498 - in trunk/examples/wiki: view/themes/default/css and 2 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Mar 3 11:15:22 EST 2008
Author: christian.bauer at jboss.com
Date: 2008-03-03 11:15:22 -0500 (Mon, 03 Mar 2008)
New Revision: 7498
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java
trunk/examples/wiki/view/themes/default/css/template.css
trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
Log:
JBSEAM-2699, set <updated> timestamp on feed based on last entry
Modified: trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java
===================================================================
--- trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java 2008-03-02 12:56:31 UTC (rev 7497)
+++ trunk/examples/wiki/src/main/org/jboss/seam/wiki/core/ui/FeedServlet.java 2008-03-03 16:15:22 UTC (rev 7498)
@@ -214,28 +214,29 @@
}
}
- String etag = null;
+ Date lastFeedEntryDate = null;
if (feed.getId() != null) {
- log.debug("calculating etag for local feed");
// Ask the database what the latest feed entry is for that feed, then use its updated timestamp hash
FeedDAO feedDAO = (FeedDAO)Component.getInstance(FeedDAO.class);
List<FeedEntry> result = feedDAO.findLastFeedEntries(feed.getId(), 1);
- if (result.size() > 0)
- etag = calculateEtag(result.get(0).getUpdatedDate());
+ if (result.size() > 0) {
+ lastFeedEntryDate = result.get(0).getUpdatedDate();
+ }
} else {
- log.debug("calculating etag for aggregated feed");
// Get the first (latest) entry of the aggregated feed and use its published timestamp hash (ignoring updates!)
// There is a wrinkle hidden here: What if a feed entry is updated? Then the published timestamp should also
// be different because the "first latest" feed entry in the list is sorted by both published and updated
// timestamps. So even though we only use published timestamp hash as an ETag, this timestamp also changes
// when a feed entry is updated because the collection order changes as well.
- if (feed.getFeedEntries().size() > 0)
- etag = calculateEtag(feed.getFeedEntries().iterator().next().getPublishedDate());
+ if (feed.getFeedEntries().size() > 0) {
+ lastFeedEntryDate = feed.getFeedEntries().iterator().next().getPublishedDate();
+ }
}
- if (etag != null) {
+ if (lastFeedEntryDate != null) {
+ String etag = calculateEtag(lastFeedEntryDate);
log.debug("setting etag header: " + etag);
response.setHeader("ETag", etag);
String previousToken = request.getHeader("If-None-Match");
@@ -261,6 +262,13 @@
aggregateParam
);
+ // If we have an entry on this feed, take the last entry's update timestamp and use it as
+ // the published timestamp of the feed. The Rome library does not have a setUpdatedDate()
+ // method and abuses the published date to write <updated> into the Atom <feed> element.
+ if (lastFeedEntryDate != null) {
+ syndFeed.setPublishedDate(lastFeedEntryDate);
+ }
+
// Write feed to output
response.setContentType(syndFeedType.contentType);
response.setCharacterEncoding("UTF-8");
@@ -319,6 +327,8 @@
syndFeed.setAuthor(feed.getAuthor());
if (feed.getDescription() != null && feed.getDescription().length() >0)
syndFeed.setDescription(feed.getDescription());
+
+ // Setting the date on which the local feed was stored in the database, might be overwritten later
syndFeed.setPublishedDate(feed.getPublishedDate());
// Create feed entries
Modified: trunk/examples/wiki/view/themes/default/css/template.css
===================================================================
--- trunk/examples/wiki/view/themes/default/css/template.css 2008-03-02 12:56:31 UTC (rev 7497)
+++ trunk/examples/wiki/view/themes/default/css/template.css 2008-03-03 16:15:22 UTC (rev 7498)
@@ -1580,6 +1580,10 @@
border: none;
}
+.dr-tree-h-ic-img {
+ height: 18px;
+}
+
.directoryTreeLabel {
padding-top: 2px;
cursor: pointer;
Modified: trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css
===================================================================
--- trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2008-03-02 12:56:31 UTC (rev 7497)
+++ trunk/examples/wiki/view/themes/inrelationto/css/inrelationto.css 2008-03-03 16:15:22 UTC (rev 7498)
@@ -1596,6 +1596,10 @@
border: none;
}
+.dr-tree-h-ic-img {
+ height: 18px;
+}
+
.directoryTreeLabel {
padding-top: 2px;
cursor: pointer;
Modified: trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css
===================================================================
--- trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-03-02 12:56:31 UTC (rev 7497)
+++ trunk/examples/wiki/view/themes/sfwkorg/css/sfwk.css 2008-03-03 16:15:22 UTC (rev 7498)
@@ -998,9 +998,9 @@
text-align: left;
padding-left: 5px;
padding-right: 5px;
- padding-top: 5px;
- padding-bottom: 15px;
- background: white url(../img/th.bg.inverse.gif) 0 0 repeat-x;
+ padding-top: 8px;
+ padding-bottom: 8px;
+ background: #ede8db url(../img/th.bg.gif) 0 0 repeat-x;
border-top: 1px solid #d3d2d1;
border-left: 1px solid #d3d2d1;
border-right: 1px solid #d3d2d1;
@@ -1014,8 +1014,7 @@
}
.boxFooter {
- background: #ede8db url(../img/th.bg.gif) 0 0 repeat-x;
- padding-top: 10px;
+ background: white;
padding-bottom: 5px;
padding-left: 15px;
padding-right: 15px;
@@ -1543,6 +1542,10 @@
border: none;
}
+.dr-tree-h-ic-img {
+ height: 18px;
+}
+
.directoryTreeLabel {
padding-top: 2px;
cursor: pointer;
More information about the seam-commits
mailing list