[Erp5-report] r8685 - /erp5/trunk/products/ERP5/Document/WebSite.py

nobody at svn.erp5.org nobody at svn.erp5.org
Sat Jul 22 15:21:31 CEST 2006


Author: jp
Date: Sat Jul 22 15:21:29 2006
New Revision: 8685

URL: http://svn.erp5.org?rev=8685&view=rev
Log:
Added support for URL rewriting in web sites

Modified:
    erp5/trunk/products/ERP5/Document/WebSite.py

Modified: erp5/trunk/products/ERP5/Document/WebSite.py
URL: http://svn.erp5.org/erp5/trunk/products/ERP5/Document/WebSite.py?rev=8685&r1=8684&r2=8685&view=diff
==============================================================================
--- erp5/trunk/products/ERP5/Document/WebSite.py (original)
+++ erp5/trunk/products/ERP5/Document/WebSite.py Sat Jul 22 15:21:29 2006
@@ -38,10 +38,14 @@
 from AccessControl.SecurityManagement import getSecurityManager
 from AccessControl.User import emergency_user
 from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
+from Products.ERP5Type.patches.HTTPRequest import website_key
 
 from zLOG import LOG
 
 Domain_getattr = Domain.inheritedAttribute('__getattr__')
+
+# Use a request key to store access attributes and prevent infinite recursion
+cache_key = 'web_site_aq_cache'
 
 class WebSite(Domain):
     """
@@ -77,10 +81,11 @@
       """
         Try to find a suitable document based on the
         web site local naming policies as defined by
-        the WebSite_getDocument script """
-      # Use a non recursion variable
-      cache_key = 'web_site_aq_cache'
+        the WebSite_getDocument script
+      """
       request = self.REQUEST
+      # Register current web site physical path for later URL generation
+      if not request.has_key(website_key): request[website_key] = self.getPhysicalPath()
       # First let us call the super method
       dynamic = Domain._aq_dynamic(self, name)
       if dynamic is not None :
@@ -113,3 +118,4 @@
         raise
       return document
 
+




More information about the Erp5-report mailing list