Commit 9dcf08bd authored by Romain Courteaud's avatar Romain Courteaud

Export skin folder's property business_template_registered_skin_selections to a

specific Business Template parameter (template_registered_skin_selection).
This modification will help adding an existing skin folder to a new skin
selection.

Skin folder exported after this revision will not have the
business_template_registered_skin_selections properties anymore, and so, it
will be required to update the business template configuration.

Compatibility with existing bt5 is supported by allowing imported skin folder
with this property.

Thanks to Kazuhiko for the review.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@28759 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 972e5b96
...@@ -180,6 +180,98 @@ def fixZSQLMethod(portal, method): ...@@ -180,6 +180,98 @@ def fixZSQLMethod(portal, method):
method.getId(), sql_connection_list[0])) method.getId(), sql_connection_list[0]))
method.connection_id = sql_connection_list[0] method.connection_id = sql_connection_list[0]
def registerSkinFolder(skin_tool, skin_folder):
request = skin_tool.REQUEST
register_skin_selection = request.get('your_register_skin_selection', 1)
reorder_skin_selection = request.get('your_reorder_skin_selection', 1)
skin_layer_list = request.get('your_skin_layer_list',
skin_tool.getSkinSelections())
skin_folder_id = skin_folder.getId()
try:
skin_selection_list = skin_folder.getProperty(
'business_template_registered_skin_selections',
skin_tool.getSkinSelections()
)
except AttributeError:
skin_selection_list = skin_tool.getSkinSelections()
for skin_name in skin_selection_list:
if (skin_name not in skin_tool.getSkinSelections()) and \
register_skin_selection:
createSkinSelection(skin_tool, skin_name)
# add newly created skins to list of skins we care for
skin_layer_list.append(skin_name)
selection = skin_tool.getSkinPath(skin_name) or ''
if (skin_folder_id not in selection) and (skin_name in skin_layer_list):
selection_list = selection.split(',')
selection_list.insert(0, skin_folder_id)
if reorder_skin_selection:
selection_list.sort(
key=lambda x: x in skin_tool.objectIds() and -skin_tool[x].getProperty(
'business_template_skin_layer_priority', 0) or 0)
skin_tool.manage_skinLayers(skinpath=selection_list,
skinname=skin_name, add_skin=1)
skin_tool.getPortalObject().changeSkin(None)
def createSkinSelection(skin_tool, skin_name):
# This skin selection does not exist, so we create a new one.
# We'll initialize it with all skin folders, unless:
# - they explictly define a list of
# "business_template_registered_skin_selections", and we
# are not in this list.
# - they are not registred in the default skin selection
skin_path = ''
for skin_folder in skin_tool.objectValues():
if skin_name in skin_folder.getProperty(
'business_template_registered_skin_selections',
(skin_name, )):
if skin_folder.getId() in \
skin_tool.getSkinPath(skin_tool.getDefaultSkin()):
if skin_path:
skin_path = '%s,%s' % (skin_path, skin_folder.getId())
else:
skin_path= skin_folder.getId()
# add newly created skins to list of skins we care for
skin_tool.addSkinSelection(skin_name, skin_path)
skin_tool.getPortalObject().changeSkin(None)
def deleteSkinSelection(skin_tool, skin_name):
# Do not delete default skin
if skin_tool.getDefaultSkin() != skin_name:
skin_selection_registered = False
for skin_folder in skin_tool.objectValues():
try:
skin_selection_list = skin_folder.getProperty(
'business_template_registered_skin_selections', ())
if skin_name in skin_selection_list:
skin_selection_registered = True
break
except AttributeError:
pass
if (not skin_selection_registered):
skin_tool.manage_skinLayers(chosen=[skin_name],
del_skin=1)
skin_tool.getPortalObject().changeSkin(None)
def unregisterSkinFolder(skin_tool, skin_folder, skin_selection_list):
skin_folder_id = skin_folder.getId()
for skin_selection in skin_selection_list:
selection = skin_tool.getSkinPath(skin_selection)
selection = selection.split(',')
if (skin_folder_id in selection):
selection.remove(skin_folder_id)
skin_tool.manage_skinLayers(skinpath=tuple(selection),
skinname=skin_selection, add_skin=1)
deleteSkinSelection(skin_tool, skin_selection)
skin_tool.getPortalObject().changeSkin(None)
class BusinessTemplateArchive: class BusinessTemplateArchive:
""" """
This is the base class for all Business Template archives This is the base class for all Business Template archives
...@@ -969,22 +1061,9 @@ class ObjectTemplateItem(BaseTemplateItem): ...@@ -969,22 +1061,9 @@ class ObjectTemplateItem(BaseTemplateItem):
# we are removing a skin folder, check and # we are removing a skin folder, check and
# remove if registered skin selection # remove if registered skin selection
skin_folder = container[object_id] skin_folder = container[object_id]
registered_skin_selections = getattr(skin_folder, unregisterSkinFolder(container, skin_folder,
'business_template_registered_skin_selections', None) container.getSkinSelections())
if registered_skin_selections is not None:
for other_skin_folder in container.objectValues():
if other_skin_folder.getId() != object_id:
for other_registered_skin_selection in \
other_skin_folder.getProperty(
'business_template_registered_skin_selections', ()):
if other_registered_skin_selection in \
registered_skin_selections:
registered_skin_selections.remove(
other_registered_skin_selection)
if registered_skin_selections:
container.manage_skinLayers(chosen=registered_skin_selections,
del_skin=1)
container.manage_delObjects([object_id]) container.manage_delObjects([object_id])
if container.aq_parent.meta_type == 'ERP5 Catalog' and len(container.objectIds()) == 0: if container.aq_parent.meta_type == 'ERP5 Catalog' and len(container.objectIds()) == 0:
# We are removing a ZSQLMethod, remove the SQLCatalog if empty # We are removing a ZSQLMethod, remove the SQLCatalog if empty
...@@ -1196,6 +1275,16 @@ class SkinTemplateItem(ObjectTemplateItem): ...@@ -1196,6 +1275,16 @@ class SkinTemplateItem(ObjectTemplateItem):
def __init__(self, id_list, tool_id='portal_skins', **kw): def __init__(self, id_list, tool_id='portal_skins', **kw):
ObjectTemplateItem.__init__(self, id_list, tool_id=tool_id, **kw) ObjectTemplateItem.__init__(self, id_list, tool_id=tool_id, **kw)
def build(self, context, **kw):
ObjectTemplateItem.build(self, context, **kw)
for relative_url in self._objects.keys():
obj = self._objects[relative_url]
if (getattr(obj, 'meta_type', None) == 'Folder') and \
(obj.getProperty('business_template_registered_skin_selections', None) \
is not None):
obj._delProperty(
'business_template_registered_skin_selections')
def preinstall(self, context, installed_bt, **kw): def preinstall(self, context, installed_bt, **kw):
modified_object_list = ObjectTemplateItem.preinstall(self, context, installed_bt, **kw) modified_object_list = ObjectTemplateItem.preinstall(self, context, installed_bt, **kw)
# We must install/update an ERP5 Form if one of its widget is modified. # We must install/update an ERP5 Form if one of its widget is modified.
...@@ -1216,102 +1305,187 @@ class SkinTemplateItem(ObjectTemplateItem): ...@@ -1216,102 +1305,187 @@ class SkinTemplateItem(ObjectTemplateItem):
update_dict = kw.get('object_to_update') update_dict = kw.get('object_to_update')
force = kw.get('force') force = kw.get('force')
p = context.getPortalObject() p = context.getPortalObject()
skin_tool = p.portal_skins
for relative_url in self._archive.keys(): for relative_url in self._archive.keys():
folder = p.unrestrictedTraverse(relative_url) folder = p.unrestrictedTraverse(relative_url)
for obj in folder.objectValues(spec=('Z SQL Method',)): for obj in folder.objectValues(spec=('Z SQL Method',)):
fixZSQLMethod(p, obj) fixZSQLMethod(p, obj)
ps = p.portal_skins # Do not register skin which were explicitely ask not to be installed
request = context.REQUEST
register_skin_selection = request.get('your_register_skin_selection', 1)
reorder_skin_selection = request.get('your_reorder_skin_selection', 1)
skin_layer_list = request.get('your_skin_layer_list', ps.getSkinSelections())
# Add new skin selection if not already existing
for relative_url in self._archive.keys():
if context.getTemplateFormatVersion() == 1: if context.getTemplateFormatVersion() == 1:
if update_dict.has_key(relative_url) or force: if update_dict.has_key(relative_url) or force:
if not force: if not force:
if update_dict[relative_url] == 'nothing': if update_dict[relative_url] == 'nothing':
continue continue
obj = self._objects[relative_url] if folder.aq_parent.meta_type == 'CMF Skins Tool':
registerSkinFolder(skin_tool, folder)
class RegisteredSkinSelectionTemplateItem(BaseTemplateItem):
def build(self, context, **kw):
portal = context.getPortalObject()
skin_tool = getToolByName(portal, 'portal_skins')
for key in self._archive.keys():
skin_folder_id, skin_selection_id = key.split(' | ')
skin_folder = skin_tool[skin_folder_id]
selection_list = skin_folder.getProperty(
'business_template_registered_skin_selections',
[])
if skin_selection_id in selection_list:
if self._objects.has_key(skin_folder_id):
self._objects[skin_folder_id].append(skin_selection_id)
else:
self._objects[skin_folder_id] = [skin_selection_id]
else: else:
obj = self._archive[relative_url] raise NotFound, 'No skin selection %s found for skin folder %s.' \
selection_list = obj.getProperty( % (skin_selection_id, skin_folder_id)
'business_template_registered_skin_selections', [])
if isinstance(selection_list, basestring): # Function to generate XML Code Manually
selection_list = selection_list.split() def generateXml(self, path=None):
for skin_selection in selection_list: xml_data = '<registered_skin_selection>'
# user may explicitly choose not to register skin keys = self._objects.keys()
if skin_selection not in ps.getSkinSelections() and register_skin_selection: keys.sort()
# This skin selection does not exist, so we create a new one. for key in keys:
# We'll initialize it with all skin folders, unless: skin_selection_list = self._objects[key]
# - they explictly define a list of xml_data += '\n <skin_folder_selection>'
# "business_template_registered_skin_selections", and we xml_data += '\n <skin_folder>%s</skin_folder>' % key
# are not in this list. xml_data += '\n <skin_selection>%s</skin_selection>' \
# - they are not registred in the default skin selection % ','.join(skin_selection_list)
skin_path = '' xml_data += '\n </skin_folder_selection>'
for skin_folder in ps.objectValues(): xml_data += '\n</registered_skin_selection>'
if skin_selection in skin_folder.getProperty( return xml_data
'business_template_registered_skin_selections',
(skin_selection, )): def export(self, context, bta, **kw):
if skin_folder.getId() in ps.getSkinPath(ps.getDefaultSkin()): if len(self._objects.keys()) == 0:
if skin_path: return
skin_path = '%s,%s' % (skin_path, skin_folder.getId()) root_path = os.path.join(bta.path, self.__class__.__name__)
else: bta.addFolder(name=root_path)
skin_path= skin_folder.getId() # export workflow chain
# add newly created skins to list of skins we care for xml_data = self.generateXml()
skin_layer_list.append(skin_selection) bta.addObject(obj=xml_data, name='registered_skin_selection', path=root_path)
ps.addSkinSelection(skin_selection, skin_path)
def install(self, context, trashbin, **kw):
# Add new folders into skin paths. update_dict = kw.get('object_to_update')
for skin_name, selection in ps.getSkinPaths(): force = kw.get('force')
# install only if user selected this skin to be reordered according to priority portal = context.getPortalObject()
if skin_name in skin_layer_list: skin_tool = getToolByName(portal, 'portal_skins')
new_selection = []
selection = selection.split(',') for skin_folder_id in self._objects.keys():
for relative_url in self._archive.keys():
if context.getTemplateFormatVersion() == 1: if update_dict.has_key(skin_folder_id) or force:
if update_dict.has_key(relative_url) or force: if not force:
if not force: action = update_dict[skin_folder_id]
if update_dict[relative_url] == 'nothing': if action == 'nothing':
continue continue
obj = self._objects[relative_url] skin_folder = skin_tool[skin_folder_id]
else: selection_string = skin_folder.getProperty(
obj = self._archive[relative_url] 'business_template_registered_skin_selections', None)
skin_id = relative_url.split('/')[-1]
selection_list = obj.getProperty('business_template_registered_skin_selections', None) if selection_string is None:
if selection_list is None or skin_name in selection_list: selection_string = self._objects[skin_folder_id].replace(',', ' ')
if skin_id not in selection: else:
new_selection.append(skin_id) selection_string += ' %s' % \
new_selection.extend(selection) self._objects[skin_folder_id].replace(',', ' ')
# sort the layer according to skin priorities
if reorder_skin_selection: # Remove duplicate
new_selection.sort( selection_string = \
key=lambda x: x in ps.objectIds() and -ps[x].getProperty( ' '.join(dict([(x, 0) for x in selection_string.split(' ')]).keys())
'business_template_skin_layer_priority', 0) or 0) skin_folder._setProperty(
ps.manage_skinLayers(skinpath = tuple(new_selection), skinname = skin_name, add_skin = 1) 'business_template_registered_skin_selections',
# Make sure that skin data is up-to-date (see CMFCore/Skinnable.py). selection_string.split(' '), type='tokens')
p.changeSkin(None)
selection_list = selection_string.split(' ')
unregisterSkinFolder(skin_tool, skin_folder,
skin_tool.getSkinSelections())
registerSkinFolder(skin_tool, skin_folder)
def uninstall(self, context, **kw): def uninstall(self, context, **kw):
# Remove folders from skin paths. portal = context.getPortalObject()
skin_tool = getToolByName(portal, 'portal_skins')
object_path = kw.get('object_path', None) object_path = kw.get('object_path', None)
if object_path is not None: if object_path is not None:
object_keys = [object_path] object_keys = [object_path]
else: else:
object_keys = self._archive.keys() object_keys = self._objects.keys()
ps = context.portal_skins
skin_id_list = [relative_url.split('/')[-1] for relative_url in object_keys] for skin_folder_id in object_keys:
for skin_name, selection in ps.getSkinPaths(): skin_folder = skin_tool[skin_folder_id]
new_selection = [] current_selection_string = skin_folder.getProperty(
selection = selection.split(',') 'business_template_registered_skin_selections', [])
for skin_id in selection: current_selection_set = set(current_selection_string)
if skin_id not in skin_id_list:
new_selection.append(skin_id) skin_selection = workflow_id = self._objects[skin_folder_id]
ps.manage_skinLayers(skinpath = tuple(new_selection), skinname = skin_name, add_skin = 1) skin_selection_list = skin_selection.split(',')
# Make sure that skin data is up-to-date (see CMFCore/Skinnable.py). for skin_selection in skin_selection_list:
context.getPortalObject().changeSkin(None) current_selection_set.remove(skin_selection)
ObjectTemplateItem.uninstall(self, context, **kw)
current_selection_list = list(current_selection_set)
if current_selection_list:
skin_folder.setProperty(
'business_template_registered_skin_selections',
current_selection_list)
# Unregister skin folder from skin selection
unregisterSkinFolder(skin_tool, skin_folder, skin_selection_list)
else:
delattr(skin_folder, 'business_template_registered_skin_selections')
# Delete all skin selection
for skin_selection in skin_selection_list:
deleteSkinSelection(skin_tool, skin_selection)
# Register to all other skin selection
registerSkinFolder(skin_tool, skin_folder)
def preinstall(self, context, installed_bt, **kw):
modified_object_list = {}
if context.getTemplateFormatVersion() == 1:
new_keys = self._objects.keys()
new_dict = PersistentMapping()
# Fix key from installed bt if necessary
for key in installed_bt._objects.keys():
new_key = 'registered_skin_selection/%s' %key
new_dict[new_key] = installed_bt._objects[key]
if len(new_dict):
installed_bt._objects = new_dict
for path in new_keys:
if installed_bt._objects.has_key(path):
# compare object to see it there is changes
new_object = self._objects[path]
old_object = installed_bt._objects[path]
if new_object != old_object:
modified_object_list.update({path : ['Modified', self.__class__.__name__[:-12]]})
else: # new object
modified_object_list.update({path : ['New', self.__class__.__name__[:-12]]})
# get removed object
old_keys = installed_bt._objects.keys()
for path in old_keys:
if path not in new_keys:
modified_object_list.update({path : ['Removed', self.__class__.__name__[:-12]]})
return modified_object_list
def _importFile(self, file_name, file):
if not file_name.endswith('.xml'):
if not file_name.endswith('.zexp'):
LOG('Business Template', 0, 'Skipping file "%s"' % (file_name, ))
return
# import workflow chain for portal_type
skin_selection_dict = {}
xml = parse(file)
skin_folder_selection_list = xml.getElementsByTagName('skin_folder_selection')
for skin_folder_selection in skin_folder_selection_list:
skin_folder_id = skin_folder_selection.getElementsByTagName(
'skin_folder')[0].childNodes[0].data
selection_list = skin_folder_selection.getElementsByTagName(
'skin_selection')[0].childNodes
if len(selection_list) == 0:
selection = ''
else:
selection = selection_list[0].data
skin_selection_dict[str(skin_folder_id)] = str(selection)
self._objects = skin_selection_dict
class WorkflowTemplateItem(ObjectTemplateItem): class WorkflowTemplateItem(ObjectTemplateItem):
...@@ -4460,6 +4634,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4460,6 +4634,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
'_module_item', '_module_item',
'_path_item', '_path_item',
'_skin_item', '_skin_item',
'_registered_skin_selection_item',
'_preference_item', '_preference_item',
'_action_item', '_action_item',
'_portal_type_roles_item', '_portal_type_roles_item',
...@@ -4551,6 +4726,9 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -4551,6 +4726,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
WorkflowTemplateItem(self.getTemplateWorkflowIdList()) WorkflowTemplateItem(self.getTemplateWorkflowIdList())
self._skin_item = \ self._skin_item = \
SkinTemplateItem(self.getTemplateSkinIdList()) SkinTemplateItem(self.getTemplateSkinIdList())
self._registered_skin_selection_item = \
RegisteredSkinSelectionTemplateItem(
self.getTemplateRegisteredSkinSelectionList())
self._category_item = \ self._category_item = \
CategoryTemplateItem(self.getTemplateBaseCategoryList()) CategoryTemplateItem(self.getTemplateBaseCategoryList())
self._catalog_method_item = \ self._catalog_method_item = \
...@@ -5100,6 +5278,13 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5100,6 +5278,13 @@ Business Template is a set of definitions, such as skins, portal types and categ
""" """
return self._getOrderedList('template_skin_id') return self._getOrderedList('template_skin_id')
def getTemplateRegisteredSkinSelectionList(self):
"""
We have to set this method because we want an
ordered list
"""
return self._getOrderedList('template_registered_skin_selection')
def getTemplateModuleIdList(self): def getTemplateModuleIdList(self):
""" """
We have to set this method because we want an We have to set this method because we want an
...@@ -5175,6 +5360,9 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5175,6 +5360,9 @@ Business Template is a set of definitions, such as skins, portal types and categ
WorkflowTemplateItem(self.getTemplateWorkflowIdList()) WorkflowTemplateItem(self.getTemplateWorkflowIdList())
self._skin_item = \ self._skin_item = \
SkinTemplateItem(self.getTemplateSkinIdList()) SkinTemplateItem(self.getTemplateSkinIdList())
self._registered_skin_selection_item = \
RegisteredSkinSelectionTemplateItem(
self.getTemplateRegisteredSkinSelectionList())
self._category_item = \ self._category_item = \
CategoryTemplateItem(self.getTemplateBaseCategoryList()) CategoryTemplateItem(self.getTemplateBaseCategoryList())
self._catalog_method_item = \ self._catalog_method_item = \
...@@ -5350,6 +5538,7 @@ Business Template is a set of definitions, such as skins, portal types and categ ...@@ -5350,6 +5538,7 @@ Business Template is a set of definitions, such as skins, portal types and categ
'Category' : '_category_item', 'Category' : '_category_item',
'Module' : '_module_item', 'Module' : '_module_item',
'Skin' : '_skin_item', 'Skin' : '_skin_item',
'RegisteredSkinSelection' : '_registered_skin_selection_item',
'Path' : '_path_item', 'Path' : '_path_item',
'Preference' : '_preference_item', 'Preference' : '_preference_item',
'Action' : '_action_item', 'Action' : '_action_item',
......
...@@ -75,6 +75,11 @@ class BusinessTemplate: ...@@ -75,6 +75,11 @@ class BusinessTemplate:
'type' : 'lines', 'type' : 'lines',
'mode' : 'w', 'mode' : 'w',
'default' : () }, 'default' : () },
{ 'id' : 'template_registered_skin_selection',
'description' : 'A list of registered skin selections used by this template',
'type' : 'lines',
'mode' : 'w',
'default' : () },
{ 'id' : 'template_workflow_id', { 'id' : 'template_workflow_id',
'description' : 'A list of ids of workflows used by this template', 'description' : 'A list of ids of workflows used by this template',
'type' : 'lines', 'type' : 'lines',
......
...@@ -86,6 +86,7 @@ ...@@ -86,6 +86,7 @@
<value> <value>
<list> <list>
<string>my_template_skin_id_list</string> <string>my_template_skin_id_list</string>
<string>my_template_registered_skin_selection</string>
<string>my_template_workflow_id_list</string> <string>my_template_workflow_id_list</string>
</list> </list>
</value> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<tuple>
<global name="LinesField" module="Products.Formulator.StandardFields"/>
<tuple/>
</tuple>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_template_registered_skin_selection</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
<item>
<key> <string>line_too_long</string> </key>
<value> <string>A line was too long.</string> </value>
</item>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>Input is required but no input given.</string> </value>
</item>
<item>
<key> <string>too_long</string> </key>
<value> <string>You entered too many characters.</string> </value>
</item>
<item>
<key> <string>too_many_lines</string> </key>
<value> <string>You entered too many lines.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value>
<list/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>height</string> </key>
<value> <int>5</int> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>max_length</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_linelength</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>max_lines</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Registered Skin Selection</string> </value>
</item>
<item>
<key> <string>unicode</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>view_separator</string> </key>
<value> <string encoding="cdata"><![CDATA[
<br />
]]></string> </value>
</item>
<item>
<key> <string>whitespace_preserve</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>width</string> </key>
<value> <int>40</int> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
1289 1290
\ No newline at end of file \ No newline at end of file
...@@ -857,6 +857,16 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -857,6 +857,16 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
self.assertEqual(len(wf_ids), 1) self.assertEqual(len(wf_ids), 1)
bt.edit(template_skin_id_list=wf_ids) bt.edit(template_skin_id_list=wf_ids)
def stepAddRegistredSelectionToBusinessTemplate(self, sequence=None,
sequence_list=None, **kw):
"""
Add registered selection to business template
"""
bt = sequence.get('current_bt', None)
self.failUnless(bt is not None)
bt.edit(template_registered_skin_selection_list = \
('%s | Foo' % sequence.get('skin_folder_id'), ))
def stepAddPathToBusinessTemplate(self, sequence=None, sequence_list=None, **kw): def stepAddPathToBusinessTemplate(self, sequence=None, sequence_list=None, **kw):
""" """
Add a path to business template Add a path to business template
...@@ -4622,6 +4632,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -4622,6 +4632,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
AddRegistredSelectionToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
SaveBusinessTemplate \ SaveBusinessTemplate \
RemoveSkinFolder \ RemoveSkinFolder \
...@@ -5414,6 +5425,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -5414,6 +5425,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
AddRegistredSelectionToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
SaveBusinessTemplate \ SaveBusinessTemplate \
RemoveSkinFolder \ RemoveSkinFolder \
...@@ -5444,6 +5456,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -5444,6 +5456,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
AddRegistredSelectionToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
SaveBusinessTemplate \ SaveBusinessTemplate \
RemoveSkinFolder \ RemoveSkinFolder \
...@@ -5471,6 +5484,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor): ...@@ -5471,6 +5484,7 @@ class TestBusinessTemplate(ERP5TypeTestCase, LogInterceptor):
CreateNewBusinessTemplate \ CreateNewBusinessTemplate \
UseExportBusinessTemplate \ UseExportBusinessTemplate \
AddSkinFolderToBusinessTemplate \ AddSkinFolderToBusinessTemplate \
AddRegistredSelectionToBusinessTemplate \
BuildBusinessTemplate \ BuildBusinessTemplate \
SaveBusinessTemplate \ SaveBusinessTemplate \
RemoveSkinFolder \ RemoveSkinFolder \
......
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