Commit bdfc3b11 authored by Aurel's avatar Aurel

* execute build transition at import of Business Template

* don't export empty items in SiteProperty


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@4271 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent b4f796a9
...@@ -1342,7 +1342,8 @@ class SitePropertyTemplateItem(BaseTemplateItem): ...@@ -1342,7 +1342,8 @@ class SitePropertyTemplateItem(BaseTemplateItem):
if type in ('lines', 'tokens'): if type in ('lines', 'tokens'):
xml_data += os.linesep+' <value>' xml_data += os.linesep+' <value>'
for item in object: for item in object:
xml_data += os.linesep+' <item>%s</item>' %(item,) if item != '':
xml_data += os.linesep+' <item>%s</item>' %(item,)
xml_data += os.linesep+' </value>' xml_data += os.linesep+' </value>'
else: else:
xml_data += os.linesep+' <value>%r</value>' %((os.linesep).join(object),) xml_data += os.linesep+' <value>%r</value>' %((os.linesep).join(object),)
...@@ -2101,10 +2102,12 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -2101,10 +2102,12 @@ Business Template is a set of definitions, such as skins, portal types and categ
'business_template_installation_workflow'] = None 'business_template_installation_workflow'] = None
security.declareProtected(Permissions.ManagePortal, 'build') security.declareProtected(Permissions.ManagePortal, 'build')
def build(self): def build(self, no_action=0):
""" """
Copy existing portal objects to self Copy existing portal objects to self
""" """
if no_action: return # this is use at import of Business Template to get the status built
# Make sure that everything is sane. # Make sure that everything is sane.
self.clean() self.clean()
......
...@@ -249,6 +249,7 @@ class TemplateTool (BaseTool): ...@@ -249,6 +249,7 @@ class TemplateTool (BaseTool):
tempid, temppath = mkstemp() tempid, temppath = mkstemp()
file, headers = urlretrieve(url, temppath) file, headers = urlretrieve(url, temppath)
bt = self._importBT(temppath, id) bt = self._importBT(temppath, id)
bt.build(no_action=1)
bt.reindexObject() bt.reindexObject()
if REQUEST is not None: if REQUEST is not None:
...@@ -277,7 +278,8 @@ class TemplateTool (BaseTool): ...@@ -277,7 +278,8 @@ class TemplateTool (BaseTool):
tempfile.write(import_file.read()) tempfile.write(import_file.read())
tempfile.close() tempfile.close()
bt = self._importBT(temppath, id) bt = self._importBT(temppath, id)
bt.build(no_action=1)
bt.reindexObject() bt.reindexObject()
if REQUEST is not None: if REQUEST is not 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