Commit 8be67f6e authored by Rafael Monnerat's avatar Rafael Monnerat

Add specific configuration script.

Include a specific script for additional configuration specific to the vifib project. Each additional configuration should be reviewed and recoded as Configurator Item on ERP5Configurator.

It is important to have in mind in this case that not always such configuration s should be converted in a generic setup.
parent 8cb43b9b
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># This script contains some steps which are not yet supported\n
# by configuration items. Each feature should be back ported to\n
# ERP5Configurator as an specific Configuration Item.\n
\n
portal = context.getPortalObject() \n
\n
## Create new portal tool for Vifib\n
if getattr(portal, "portal_certificate_authority", None ) is None:\n
portal.manage_addProduct[\'Vifib\'].manage_addTool(\'ERP5 Certificate Authority Tool\', None)\n
print "Created portal_certificate_authority"\n
else:\n
print "portal_certificate_authority already exists."\n
\n
## Set Authentification Plugin\n
plugin_id = "vifib_auth"\n
user_folder = context.acl_users\n
if plugin_id not in user_folder.objectIds():\n
# check if it\'s not already created\n
user_folder.manage_addProduct[\'Vifib\'].addVifibMachineAuthenticationPlugin(\n
id = plugin_id, \n
title = "Vifib Machine Authentication Plugin")\n
print "%s Plugin added at acl_users." % plugin_id\n
else:\n
print "%s Plugin already added added at acl_users." % plugin_id\n
\n
vifib_plugin = getattr(user_folder, plugin_id)\n
vifib_plugin.manage_activateInterfaces(interfaces=[\'IAuthenticationPlugin\',\n
\'IUserEnumerationPlugin\', \n
\'IGroupsPlugin\', \n
\'IExtractionPlugin\' ])\n
print "Enabled "\n
## This is a hack, the initial users should be created by traditional \n
## user configurator state.\n
##test_vifib_admin = self.person_module.searchFolder(portal_type="Person", \n
## reference="test_vifib_admin")\n
\n
##if len(user.searchFolder(portal_type="Assignment", validation_date="started")) == 0:\n
## assignment = test_vifib_admin.newContent(portal_type="Assignment")\n
## assigment.setGroup("group/vifib")\n
## assignment.start()\n
\n
\n
\n
return printed\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>BusinessCondiguration_additionalConfiguration</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -81,46 +81,7 @@ for gadget in portal.portal_gadgets.objectValues():\n
gadget.visible()\n
gadget.public()\n
\n
# set manually in \'Module Properties\' respective business_application category\n
# XXX This should be part of Configuration Item probably, but as access_tab is\n
# going to be deprecated, make sure it still requires set business application\n
# info modules.\n
module_business_application_map = {\'base\': (\'currency_module\',\n
\'organisation_module\',\n
\'person_module\',),\n
\'accounting\': (\'accounting_module\',\n
\'account_module\',),\n
\'crm\': (\'campaign_module\',\n
\'event_module\',\n
\'meeting_module\',\n
\'sale_opportunity_module\',\n
\'support_request_module\',),\n
\'dms\': (\'document_module\',\n
\'image_module\',\n
\'document_ingestion_module\',\n
\'web_page_module\',),\n
\'trade\': (\'internal_packing_list_module\',\n
\'inventory_module\',\n
\'purchase_order_module\',\n
\'purchase_packing_list_module\',\n
\'purchase_trade_condition_module\',\n
\'returned_sale_packing_list_module\',\n
\'sale_order_module\',\n
\'sale_packing_list_module\',\n
\'sale_trade_condition_module\'),\n
\'pdm\': (\'component_module\',\n
\'product_module\',\n
\'purchase_supply_module\',\n
\'sale_supply_module\',\n
\'service_module\',\n
\'transformation_module\',),\n
}\n
\n
for business_application_category_id, module_ids in module_business_application_map.items():\n
for module_id in module_ids:\n
module = getattr(portal, module_id, None)\n
if module is not None:\n
module.edit(business_application = business_application_category_id)\n
context.BusinessCondiguration_additionalConfiguration()\n
\n
print "Indexing translations"\n
portal.ERP5Site_updateTranslationTable()\n
......
4
\ No newline at end of file
5
\ 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