Commit 5008eafd authored by Vincent Pelletier's avatar Vincent Pelletier

Check file extension instead of just stripping unknown chars.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@20912 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 76fa4bd7
......@@ -2126,17 +2126,7 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
ObjectTemplateItem.uninstall(self, context, **kw)
def _importFile(self, file_name, file):
if not '.catalog_keys' in file_name:
# just import xml object
obj = self
connection = None
while connection is None:
obj=obj.aq_parent
connection=obj._p_jar
obj = connection.importFile(file, customImporters=customImporters)
self.removeProperties(obj)
self._objects[file_name[:-4]] = obj
else:
if file_name.endswith('.catalog_keys.xml'):
# recreate data mapping specific to catalog method
name = os.path.basename(file_name)
id = name.split('.', 1)[0]
......@@ -2168,6 +2158,18 @@ class CatalogMethodTemplateItem(ObjectTemplateItem):
else:
# new style key
self._method_properties.setdefault(id, PersistentMapping())[key] = 1
elif file_name.endswith('.xml'):
# just import xml object
obj = self
connection = None
while connection is None:
obj=obj.aq_parent
connection=obj._p_jar
obj = connection.importFile(file, customImporters=customImporters)
self.removeProperties(obj)
self._objects[file_name[:-4]] = obj
else:
LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, ))
class ActionTemplateItem(ObjectTemplateItem):
......
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