Commit 749fe117 authored by Ivan Tyagov's avatar Ivan Tyagov

Setup categories from spreadheet rather than hard code. Add mimic business configuration script.

parent 2ef4e779
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Categories Spreadsheet Configurator Item" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>32</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Categories Spreadsheet Configurator Item</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>codification</string> </key>
<value> <string>COMP-MAN</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>MAN</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>manager</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value> <string>Manager</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Company Manager</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Category" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_folders_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Copy_or_Move_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_group</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Category</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Scalability company</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""
This script creates a Business Configuration as if user selected it during configuration process.
"""
configuration_save = context.restrictedTraverse(configuration_save_url)
# bt5 setup
bt5_installation_list = ('erp5_full_text_mroonga_catalog',
'erp5_base',
'erp5_jquery_ui',
'erp5_ingestion_mysql_innodb_catalog',
'erp5_ingestion',
'erp5_stock_cache',
'erp5_web',
'erp5_dms',
'erp5_pdm',
'erp5_knowledge_pad',
'erp5_trade',
'erp5_project',
'erp5_simulation',
'erp5_ods_style',
'erp5_odt_style',
'erp5_rss_style',
'erp5_trade',
# to develop faster
'erp5_code_mirror',
'erp5_forge',
'erp5_development_wizard',
'erp5_dhtml_style',
# install later UI bt5s as broken now
#'erp5_wendelin_renderjs_ui',
'erp5_hal_json_style',
'erp5_web_renderjs_ui',
'erp5_wendelin',
'erp5_wendelin_examples',
'erp5_wendelin_data',
'erp5_wendelin_development'
)
bt5_update_catalog = ('erp5_ingestion_mysql_innodb_catalog', 'erp5_wendelin',)
for name in bt5_installation_list:
configuration_save.addConfigurationItem("Standard BT5 Configurator Item",
title=name, bt5_id=name,
update_catalog=(name in bt5_update_catalog),
install_dependency=True,
)
# categories setup
configuration_save.addConfigurationItem("Categories Spreadsheet Configurator Item",
configuration_spreadsheet_data = getattr(context, "standard_wendelin_category.ods").data)
# security setup
configuration_save.addConfigurationItem("Portal Type Roles Spreadsheet Configurator Item",
configuration_spreadsheet_data = getattr(context, "standard_wendelin_portal_types_roles.ods").data)
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>__name__</string> </key>
<value> <string>standard_wendelin_category.ods</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/vnd.oasis.opendocument.spreadsheet</string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Standard Workflow Categories.ods</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
business_configuration_module/default_wendelin_configuration
business_configuration_module/default_wendelin_configuration/**
portal_categories/function/company/manager
portal_categories/function/company/manager/**
portal_categories/group/my_group
portal_categories/group/my_group/**
\ No newline at end of file
business_configuration_module/default_wendelin_configuration/**
\ No newline at end of file
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