[quills-dev] [Collective-checkins] r32314 - in Quills/trunk: . skins/Quills
quills-dev at lists.etria.com quills-dev at lists.etria.comWed Oct 25 16:21:18 UTC 2006
- Previous message: [quills-dev] [Collective-checkins] r32313 - Quills/trunk/browser
- Next message: [quills-dev] quills-dev-mailinglist down?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: tomster
Date: Wed Oct 25 16:21:16 2006
New Revision: 32314
Modified:
Quills/trunk/WeblogArchive.py
Quills/trunk/skins/Quills/weblogarchive_view.pt
Log:
Added `Last-Modified`-Header for `weblogarchive_view`, as well, because search engine bots crawling through them could ''really'' create some serious cpu usage...
Modified: Quills/trunk/WeblogArchive.py
==============================================================================
--- Quills/trunk/WeblogArchive.py (original)
+++ Quills/trunk/WeblogArchive.py Wed Oct 25 16:21:16 2006
@@ -23,7 +23,9 @@
from Products.Archetypes.public import *
from Products.Archetypes.Marshall import PrimaryFieldMarshaller
+from AccessControl import ClassSecurityInfo
from Products.CMFCore import permissions
+from Products.CMFCore.utils import getToolByName
from config import PROJECTNAME
import DateTime
@@ -47,6 +49,7 @@
"""Weblog Archive: There are 4 basic styles, root, year, month, day"""
schema = WeblogArchiveSchema
+ security = ClassSecurityInfo()
archetype_name = "Weblog Archive"
meta_type = 'WeblogArchive'
global_allow = 0
@@ -201,5 +204,29 @@
path = getattr(path.aq_inner.aq_explicit, day)
return path
+ security.declareProtected(permissions.View, 'getModifiedDate')
+ def getModifiedDate(self):
+ """ Dirty Convenience method for accessing the effective modification date from syndication.py.
+ As long as we haven't migrated weblog_view.pt to a zope3 view, we need a convenient way
+ to access the modification date for CacheFu or such.
+ TODO: this is just a copy&paste job from syndication.py, this should be factored out somewhere.
+ However, this 'somewhere' should really be a separate caching product, so while we handle
+ this still in Quills internally, let's not get too fancy and just leave it like this.
+ """
+ portal_catalog = getToolByName(self, 'portal_catalog')
+ path = '/'.join(self.getPhysicalPath())
+ results = portal_catalog(
+ meta_type=['WeblogEntry', 'Discussion Item',],
+ path={'query':path, 'level': 0},
+ sort_on = 'modified',
+ sort_order = 'reverse',
+ review_state = 'published')
+
+ # just like fatsyndication, we return 'now', if there
+ # aren't any entries:
+ try:
+ return results[0].getObject().modified()
+ except IndexError:
+ return DateTime()
registerType(WeblogArchive, PROJECTNAME)
Modified: Quills/trunk/skins/Quills/weblogarchive_view.pt
==============================================================================
--- Quills/trunk/skins/Quills/weblogarchive_view.pt (original)
+++ Quills/trunk/skins/Quills/weblogarchive_view.pt Wed Oct 25 16:21:16 2006
@@ -5,7 +5,9 @@
xmlns:tal="http://xml.zope.org/namespaces/tal"
i18n:domain="quills">
- <metal:block fill-slot="head_slot">
+ <metal:block fill-slot="head_slot"
+ tal:define="dummy python:request.RESPONSE.setHeader('Last-Modified', here.getModifiedDate().toZone('GMT').rfc822());"
+ >
<metal:macro use-macro="here/quills_header_macros/macros/feed-links" />
</metal:block>
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Collective-checkins mailing list
Collective-checkins at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/collective-checkins
- Previous message: [quills-dev] [Collective-checkins] r32313 - Quills/trunk/browser
- Next message: [quills-dev] quills-dev-mailinglist down?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the quills-dev mailing list