*.pyc
easyshop/
/local.cfg
+SOURCES.txt
shell:
@PATH=$(BASEDIR)/$(PYTHON_DIR)/bin:$(BASEDIR)/bin:$$PATH $$SHELL
-init: python setuptools pil eggs buildout bootstrap otherinit update .gitignore
+init: python setuptools pil eggs buildout otherinit otherupdate bootstrap update .gitignore
otherinit::
+++ /dev/null
-README.txt
-setup.cfg
-setup.py
-koehsel/__init__.py
-koehsel.policy.egg-info/PKG-INFO
-koehsel.policy.egg-info/SOURCES.txt
-koehsel.policy.egg-info/dependency_links.txt
-koehsel.policy.egg-info/entry_points.txt
-koehsel.policy.egg-info/namespace_packages.txt
-koehsel.policy.egg-info/not-zip-safe
-koehsel.policy.egg-info/paster_plugins.txt
-koehsel.policy.egg-info/requires.txt
-koehsel.policy.egg-info/top_level.txt
-koehsel/policy/__init__.py
-koehsel/policy/setuphandlers.py
-koehsel/policy/tests.py
\ No newline at end of file
+import setuphandlers
+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)
+
def initialize(context):
"""Initializer called when used as a Zope 2 product."""
+ global orig_install_standards
+
+ if doInstall():
+ orig_install_standards = OFS.Application.install_standards
+ OFS.Application.install_standards = install_standards
i18n_domain="koehsel.policy">
<five:registerPackage package="." initialize=".initialize" />
-
- <genericsetup:registerProfile
- name="default"
- title="Koehsel Site"
- directory="profiles/default"
- description='Extension profile for the Koehsel Site.'
- provides="Products.GenericSetup.interfaces.EXTENSION"
- />
-
- <genericsetup:importStep
- name="koehsel.policy.various"
- title="Koehsel Theme: miscellaneous import steps"
- description="Various import steps that are not handled by GS import/export handlers."
- handler="koehsel.policy.setuphandlers.setupVarious">
- </genericsetup:importStep>
+ <include file="profiles.zcml" />
</configure>
--- /dev/null
+<configure
+ xmlns="http://namespaces.zope.org/zope"
+ xmlns:genericsetup="http://namespaces.zope.org/genericsetup"
+ i18n_domain="koehsel.theme">
+
+ <genericsetup:registerProfile
+ name="default"
+ title="Koehsel Site"
+ directory="profiles/default"
+ description='Extension profile for the Koehsel Site.'
+ provides="Products.GenericSetup.interfaces.EXTENSION"
+ />
+
+ <genericsetup:importStep
+ name="koehsel.policy.content"
+ title="Koehsel Site: initial site setup"
+ description="Create and customize initial site content."
+ handler=".setuphandlers.siteSetup">
+ <depends name="plone-content"/>
+ </genericsetup:importStep>
+
+</configure>
--- /dev/null
+Marker file
<metadata>
<version>1</version>
<dependencies>
- <dependency>profile-easyshop.core:default</dependency>
<dependency>profile-koehsel.theme:default</dependency>
</dependencies>
</metadata>
-def setupVarious(context):
+from Products.CMFCore.utils import getToolByName
- # Ordinarily, GenericSetup handlers check for the existence of XML files.
- # Here, we are not parsing an XML file, but we use this text file as a
- # flag to check that we actually meant for this import step to be run.
- # The file is found in profiles/default.
+INSTALL_PRODUCTS = ['easyshop.core']
- if context.readDataFile('koehsel.theme_various.txt') is None:
+def siteSetup(context):
+
+ if context.readDataFile('koehsel.policy_setup.txt') is None:
return
- # Add additional setup code here
+ site = context.getSite()
+
+ # Install EasyShop product
+
+ qi = getToolByName(site, 'portal_quickinstaller')
+ for p in INSTALL_PRODUCTS:
+ if not qi.isProductInstalled(p):
+ qi.installProduct(p)
+
+ # Add and publish shop instance
+
+ try: site.shop
+ except AttributeError:
+ site.invokeFactory(id='shop', type_name='EasyShop')
+ 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')
+
+ # Hide Users, News and Events
+
+ for id in ('Members', 'news', 'events'):
+ ob = getattr(site,id)
+ if wf.getInfoFor(ob,'review_state','') != 'private':
+ wf.doActionFor(ob,'retract',comment='site setup')
+
+
+# Called via hackery in __init__.py
+def appInit(app):
+ try: app.site
+ except AttributeError:
+ app.manage_addProduct['CMFPlone'].addPloneSite(id='site',
+ extension_ids=['koehsel.policy:default'])
+++ /dev/null
-MANIFEST.in
-README.txt
-setup.cfg
-setup.py
-koehsel/__init__.py
-koehsel.theme.egg-info/PKG-INFO
-koehsel.theme.egg-info/SOURCES.txt
-koehsel.theme.egg-info/dependency_links.txt
-koehsel.theme.egg-info/entry_points.txt
-koehsel.theme.egg-info/namespace_packages.txt
-koehsel.theme.egg-info/not-zip-safe
-koehsel.theme.egg-info/paster_plugins.txt
-koehsel.theme.egg-info/requires.txt
-koehsel.theme.egg-info/top_level.txt
-koehsel/theme/__init__.py
-koehsel/theme/configure.zcml
-koehsel/theme/profiles.zcml
-koehsel/theme/setuphandlers.py
-koehsel/theme/skins.zcml
-koehsel/theme/tests.py
-koehsel/theme/version.txt
-koehsel/theme/browser/__init__.py
-koehsel/theme/browser/configure.zcml
-koehsel/theme/browser/interfaces.py
-koehsel/theme/browser/viewlet.pt
-koehsel/theme/browser/viewlets.py
-koehsel/theme/browser/images/README.txt
-koehsel/theme/browser/stylesheets/README.txt
-koehsel/theme/browser/stylesheets/main.css
-koehsel/theme/profiles/default/cssregistry.xml
-koehsel/theme/profiles/default/jsregistry.xml
-koehsel/theme/profiles/default/koehsel.theme_various.txt
-koehsel/theme/profiles/default/metadata.xml
-koehsel/theme/profiles/default/portlets.xml
-koehsel/theme/profiles/default/portlets.xml~
-koehsel/theme/profiles/default/skins.xml
-koehsel/theme/profiles/default/viewlets.xml
-koehsel/theme/skins/koehsel_theme_custom_images/CONTENT.txt
-koehsel/theme/skins/koehsel_theme_custom_images/logo.jpg
-koehsel/theme/skins/koehsel_theme_custom_templates/CONTENT.txt
-koehsel/theme/skins/koehsel_theme_styles/CONTENT.txt
-koehsel/theme/skins/koehsel_theme_styles/base_properties.props
\ No newline at end of file