Commit 2cc6f036 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Write properties.xml as well in exportSQLMethods.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@3690 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 6871b117
......@@ -186,7 +186,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
self.default_sql_catalog_id = config_id
security.declareProtected( 'Import/Export objects', 'exportSQLMethods' )
def exportSQLMethods(self, id=None, config_id='erp5'):
def exportSQLMethods(self, sql_catalog_id=None, config_id='erp5'):
"""
Export SQL methods for a given configuration.
"""
......@@ -196,7 +196,7 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
elif config_id.lower() == 'cps3':
config_id = 'cps3_mysql'
catalog = self.getSQLCatalog(config_id)
catalog = self.getSQLCatalog(sql_catalog_id)
product_path = package_home(globals())
common_sql_dir = os.path.join(product_path, 'sql', 'common_mysql')
config_sql_dir = os.path.join(product_path, 'sql', config_id)
......@@ -222,6 +222,16 @@ class CatalogTool (UniqueObject, ZCatalog, CMFCoreCatalogTool, ActiveObject):
f.write(text)
finally:
f.close()
properties = self.manage_catalogExportProperties(sql_catalog_id=sql_catalog_id)
name = os.path.join(config_sql_dir, 'properties.xml')
msg += 'Writing %s\n' % (name,)
f = open(name, 'w')
try:
f.write(properties)
finally:
f.close()
return msg
def _listAllowedRolesAndUsers(self, user):
......
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