Commit c2f0628b authored by Alexandre Boeglin's avatar Alexandre Boeglin

Do not use CatalogTool.addDefaultSQLMethods anymore to bootstrap the creation

of the SQLCatalog when creating a new site. Instead, we just import the
SQLMethods and properties defined in erp5_core.

This removes the need to maintain the catalog in ERP5Catalog/sql AND the
erp5_core business template (which is now used exclusively, for both
installation and upgrade of catalog methods).


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@10925 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 99393c76
...@@ -923,8 +923,8 @@ class ERP5Generator(PortalGenerator): ...@@ -923,8 +923,8 @@ class ERP5Generator(PortalGenerator):
cmf_activity_sql_connection_string, 'string') cmf_activity_sql_connection_string, 'string')
# XXX hardcoded charset # XXX hardcoded charset
p._setProperty('management_page_charset', 'UTF-8', 'string') p._setProperty('management_page_charset', 'UTF-8', 'string')
self.setup(p, create_userfolder, self.setup(p, create_userfolder, create_activities=create_activities,
create_activities=create_activities, **kw) reindex=reindex, **kw)
return p return p
def setupLastTools(self, p, **kw): def setupLastTools(self, p, **kw):
...@@ -1073,18 +1073,11 @@ class ERP5Generator(PortalGenerator): ...@@ -1073,18 +1073,11 @@ class ERP5Generator(PortalGenerator):
portal_catalog = getToolByName(p, 'portal_catalog') portal_catalog = getToolByName(p, 'portal_catalog')
if (not update) and (not portal_catalog.getSQLCatalog('erp5_mysql')): if (not update) and (not portal_catalog.getSQLCatalog('erp5_mysql')):
# Add a default SQL Catalog # Add a empty SQL Catalog, which will be filled when installing
portal_catalog.addDefaultSQLMethods() # erp5_core business template
if (p.erp5_sql_connection_type is not None): portal_catalog.manage_addProduct['ZSQLCatalog'].manage_addSQLCatalog(
portal_catalog.manage_catalogClear() 'erp5_mysql', '')
# TODO: Replace previous lines with the commented below portal_catalog.default_sql_catalog_id = 'erp5_mysql'
# (not working actually).
# The goal is to delete addDefaultSQLMethods() method and duplicated zsql
# method from /ERP5Catalog/sql/mysql_erp5.
#addSQLCatalog = portal_catalog.manage_addProduct['ZSQLCatalog']\
# .manage_addSQLCatalog
#addSQLCatalog('erp5_mysql', '')
#portal_catalog.default_sql_catalog_id = 'erp5_mysql'
# Add ERP5Form Tools # Add ERP5Form Tools
addTool = p.manage_addProduct['ERP5Form'].manage_addTool addTool = p.manage_addProduct['ERP5Form'].manage_addTool
...@@ -1192,7 +1185,7 @@ class ERP5Generator(PortalGenerator): ...@@ -1192,7 +1185,7 @@ class ERP5Generator(PortalGenerator):
def setupIndex(self, p, **kw): def setupIndex(self, p, **kw):
# Make sure all tools and folders have been indexed # Make sure all tools and folders have been indexed
if kw.has_key('reindex') and kw['reindex']==0: if not kw.get('reindex', 1):
return return
skins_tool = getToolByName(p, 'portal_skins', None) skins_tool = getToolByName(p, 'portal_skins', None)
if skins_tool is None: if skins_tool is None:
......
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