Commit fb270e20 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added support for URL rewriting in web sites

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@8685 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4f114748
...@@ -38,11 +38,15 @@ from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthentic ...@@ -38,11 +38,15 @@ from Products.CMFCore.utils import UniqueObject, _checkPermission, _getAuthentic
from AccessControl.SecurityManagement import getSecurityManager from AccessControl.SecurityManagement import getSecurityManager
from AccessControl.User import emergency_user from AccessControl.User import emergency_user
from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager from AccessControl.SecurityManagement import newSecurityManager, setSecurityManager
from Products.ERP5Type.patches.HTTPRequest import website_key
from zLOG import LOG from zLOG import LOG
Domain_getattr = Domain.inheritedAttribute('__getattr__') 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): class WebSite(Domain):
""" """
A Web Site root class. This class is used by ERP5 Commerce A Web Site root class. This class is used by ERP5 Commerce
...@@ -77,10 +81,11 @@ class WebSite(Domain): ...@@ -77,10 +81,11 @@ class WebSite(Domain):
""" """
Try to find a suitable document based on the Try to find a suitable document based on the
web site local naming policies as defined by web site local naming policies as defined by
the WebSite_getDocument script """ the WebSite_getDocument script
# Use a non recursion variable """
cache_key = 'web_site_aq_cache'
request = self.REQUEST 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 # First let us call the super method
dynamic = Domain._aq_dynamic(self, name) dynamic = Domain._aq_dynamic(self, name)
if dynamic is not None : if dynamic is not None :
...@@ -113,3 +118,4 @@ class WebSite(Domain): ...@@ -113,3 +118,4 @@ class WebSite(Domain):
raise raise
return document return document
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment