From 110e3024a0452432447e602aa38a23df2f963b5c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Wed, 8 Aug 2007 07:29:39 +0000
Subject: [PATCH] make it possible to define a custom generator class, stored
 as _generator_class attribute on the site.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@15543 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/BusinessTemplate.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/BusinessTemplate.py b/product/ERP5/Document/BusinessTemplate.py
index 8fa2824d54..13a26decdd 100644
--- a/product/ERP5/Document/BusinessTemplate.py
+++ b/product/ERP5/Document/BusinessTemplate.py
@@ -4099,8 +4099,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
         self.checkDependencies()
 
       site = self.getPortalObject()
-      from Products.ERP5.ERP5Site import ERP5Generator
-      gen = ERP5Generator()
+      custom_generator_class = getattr(site, '_generator_class', None)
+      if custom_generator_class is not None:
+        gen = custom_generator_class()
+      else:
+        from Products.ERP5.ERP5Site import ERP5Generator
+        gen = ERP5Generator()
       # update activity tool first if necessary
       if self.getTitle() == 'erp5_core' and self.getTemplateUpdateTool():
         LOG('Business Template', 0, 'Updating Activity Tool')
-- 
2.30.9