Commit 46632e3a authored by Sebastien Robin's avatar Sebastien Robin

allow light_install


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2039 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent acb25000
...@@ -53,6 +53,7 @@ def manage_addERP5Site(self, id, title='ERP5', description='', ...@@ -53,6 +53,7 @@ def manage_addERP5Site(self, id, title='ERP5', description='',
erp5_sql_connection_string='test test', erp5_sql_connection_string='test test',
cmf_activity_sql_connection_type='Z MySQL Database Connection', cmf_activity_sql_connection_type='Z MySQL Database Connection',
cmf_activity_sql_connection_string='test test', cmf_activity_sql_connection_string='test test',
light_install=0,reindex=1,
RESPONSE=None): RESPONSE=None):
''' '''
Adds a portal instance. Adds a portal instance.
...@@ -65,7 +66,8 @@ def manage_addERP5Site(self, id, title='ERP5', description='', ...@@ -65,7 +66,8 @@ def manage_addERP5Site(self, id, title='ERP5', description='',
p = gen.create(self, id, create_userfolder, p = gen.create(self, id, create_userfolder,
erp5_sql_connection_type,erp5_sql_connection_string, erp5_sql_connection_type,erp5_sql_connection_string,
cmf_activity_sql_connection_type,cmf_activity_sql_connection_string, cmf_activity_sql_connection_type,cmf_activity_sql_connection_string,
create_activities=create_activities) create_activities=create_activities,light_install=light_install,
reindex=reindex)
gen.setupDefaultProperties(p, title, description, gen.setupDefaultProperties(p, title, description,
email_from_address, email_from_name, email_from_address, email_from_name,
validate_email) validate_email)
...@@ -471,10 +473,12 @@ class ERP5Generator(PortalGenerator): ...@@ -471,10 +473,12 @@ class ERP5Generator(PortalGenerator):
def create(self, parent, id, create_userfolder, def create(self, parent, id, create_userfolder,
erp5_sql_connection_type, erp5_sql_connection_string, erp5_sql_connection_type, erp5_sql_connection_string,
cmf_activity_sql_connection_type,cmf_activity_sql_connection_string, cmf_activity_sql_connection_type,cmf_activity_sql_connection_string,
**kw): reindex=1,**kw):
LOG('setupTools, create',0,kw) LOG('setupTools, create',0,kw)
id = str(id) id = str(id)
portal = self.klass(id=id) portal = self.klass(id=id)
if reindex==0:
setattr(portal,'isIndexable',0)
parent._setObject(id, portal) parent._setObject(id, portal)
# Return the fully wrapped object. # Return the fully wrapped object.
p = parent.this()._getOb(id) p = parent.this()._getOb(id)
...@@ -544,12 +548,16 @@ class ERP5Generator(PortalGenerator): ...@@ -544,12 +548,16 @@ class ERP5Generator(PortalGenerator):
addTool('ERP5 Synchronizations', None) addTool('ERP5 Synchronizations', None)
# Add Message Catalog # Add Message Catalog
if 'Localizer' in p.objectIds(): #if 'Localizer' in p.objectIds():
p._delObject('Localizer') #p._delObject('Localizer') # Why delete it, we should keep for ERP5/CPS
if not 'Localizer' in p.objectIds():
#p._delObject('Localizer') # Why delete it, we should keep for ERP5/CPS
addLocalizer = p.manage_addProduct['Localizer'].manage_addLocalizer addLocalizer = p.manage_addProduct['Localizer'].manage_addLocalizer
addLocalizer('', ('en',)) addLocalizer('', ('en',))
localizer = getToolByName(p, 'Localizer') localizer = getToolByName(p, 'Localizer')
addMessageCatalog = localizer.manage_addProduct['Localizer'].manage_addMessageCatalog addMessageCatalog = localizer.manage_addProduct['Localizer'].manage_addMessageCatalog
if 'default' in localizer.objectIds():
localizer.manage_delObjects('default')
addMessageCatalog('default', 'ERP5 Localized Messages', ('en',)) addMessageCatalog('default', 'ERP5 Localized Messages', ('en',))
addMessageCatalog('erp5_ui', 'ERP5 Localized Interface', ('en',)) addMessageCatalog('erp5_ui', 'ERP5 Localized Interface', ('en',))
addMessageCatalog('erp5_content', 'ERP5 Localized Content', ('en',)) addMessageCatalog('erp5_content', 'ERP5 Localized Content', ('en',))
...@@ -659,11 +667,13 @@ class ERP5Generator(PortalGenerator): ...@@ -659,11 +667,13 @@ class ERP5Generator(PortalGenerator):
'business_template_installation_workflow' ) ) 'business_template_installation_workflow' ) )
pass pass
def setupIndex(self, p): def setupIndex(self, p,**kw):
from Products.CMFDefault.MembershipTool import MembershipTool from Products.CMFDefault.MembershipTool import MembershipTool
# Make sure all tools and folders have been indexed # Make sure all tools and folders have been indexed
portal_catalog = p.portal_catalog portal_catalog = p.portal_catalog
portal_catalog.manage_catalogClear() portal_catalog.manage_catalogClear()
if kw.has_key('reindex') and kw['reindex']==0:
return
#portal_catalog.reindexObject(p) #portal_catalog.reindexObject(p)
#portal_catalog.reindexObject(p.portal_templates) #portal_catalog.reindexObject(p.portal_templates)
#portal_catalog.reindexObject(p.portal_categories) #portal_catalog.reindexObject(p.portal_categories)
...@@ -744,11 +754,11 @@ class ERP5Generator(PortalGenerator): ...@@ -744,11 +754,11 @@ class ERP5Generator(PortalGenerator):
self.setupWorkflow(p) self.setupWorkflow(p)
self.setupFrontPage(p) self.setupFrontPage(p)
self.setupERP5Core(p) self.setupERP5Core(p,**kw)
# Make sure tools are cleanly indexed with a uid before creating children # Make sure tools are cleanly indexed with a uid before creating children
# XXX for some strange reason, member was indexed 5 times # XXX for some strange reason, member was indexed 5 times
self.setupIndex(p) self.setupIndex(p,**kw)
self.setupLastTools(p,**kw) self.setupLastTools(p,**kw)
...@@ -765,7 +775,7 @@ class ERP5Generator(PortalGenerator): ...@@ -765,7 +775,7 @@ class ERP5Generator(PortalGenerator):
ti = apply(ERP5TypeInformation, (), t) ti = apply(ERP5TypeInformation, (), t)
tool._setObject(t['id'], ti) tool._setObject(t['id'], ti)
def setupERP5Core(self,p): def setupERP5Core(self,p,**kw):
""" """
Install the core part of ERP5 Install the core part of ERP5
""" """
...@@ -777,7 +787,7 @@ class ERP5Generator(PortalGenerator): ...@@ -777,7 +787,7 @@ class ERP5Generator(PortalGenerator):
id = template_tool.generateNewId() id = template_tool.generateNewId()
template_tool.download(template, id=id) template_tool.download(template, id=id)
template_tool[id].install() template_tool[id].install(**kw)
# Patch the standard method # Patch the standard method
CMFSite.getPhysicalPath = ERP5Site.getPhysicalPath CMFSite.getPhysicalPath = ERP5Site.getPhysicalPath
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