echo " \$${local:eggs}" \
) >$@ || (rm -f $@; false)
.PHONY: local.cfg
+# Not phony in reality but needs to be considered out-of-date whenever called
otherupdate:: local.cfg
+
+instance: update-nonet
+ bin/instance foreground
+.PHONY: instance
+
+newinstance: purgeinstance instance
+.PHONY: newinstance
+
+purgeinstance:
+ rm -rf parts/instance var/filestorage
+.PHONY: purgeinstance
import OFS.Application
from App.Product import doInstall
import transaction
-from AccessControl.SecurityManagement import newSecurityManager
-import AccessControl
-from Testing.makerequest import makerequest
orig_install_standards = None
def install_standards(app):
orig_install_standards(app)
- transaction.commit()
-
- # Log in as 'admin' user
- newSecurityManager(None, app.acl_users.getUser('admin'))
- setuphandlers.appInit(makerequest(app))
- transaction.commit()
-
- # Back to system user
- newSecurityManager(None, AccessControl.User.system)
-
+ setuphandlers.appInit(app)
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
from Products.CMFCore.utils import getToolByName
-INSTALL_PRODUCTS = ['easyshop.core']
+INSTALL_PRODUCTS = [
+ 'easyshop.core',
+ 'koehsel.theme',
+]
+
+SITE_OWNER = 'admin'
def siteSetup(context):
return
site = context.getSite()
+ qi = getToolByName(site, 'portal_quickinstaller')
+ wf = getToolByName(site, 'portal_workflow')
# Install EasyShop product
- qi = getToolByName(site, 'portal_quickinstaller')
for p in INSTALL_PRODUCTS:
if not qi.isProductInstalled(p):
qi.installProduct(p)
shop = site.shop
shop.title = 'Shop'
shop.shopOwner = 'admin'
- wf = getToolByName(site, 'portal_workflow')
if wf.getInfoFor(shop,'review_state','') != 'published':
wf.doActionFor(shop,'publish',comment='site setup')
wf.doActionFor(ob,'retract',comment='site setup')
-# Called via hackery in __init__.py
+def contentSetup(app):
+ app.manage_addProduct['CMFPlone'].addPloneSite(id='site',
+ extension_ids=['koehsel.policy:default'])
+
+
+# Called via hackery in __init__.py on every site start
def appInit(app):
try: app.site
except AttributeError:
- app.manage_addProduct['CMFPlone'].addPloneSite(id='site',
- extension_ids=['koehsel.policy:default'])
+
+ from Testing.makerequest import makerequest
+ from AccessControl.SecurityManagement import newSecurityManager
+ import transaction, AccessControl
+
+ # Call 'contentSetup' as SITE_OWNER user with a valid REQUEST
+ req = makerequest(app)
+ newSecurityManager(req.REQUEST, app.acl_users.getUser(SITE_OWNER).__of__(app.acl_users))
+ contentSetup(req)
+ transaction.commit()
+ newSecurityManager(None, AccessControl.User.system)