[Zope3-checkins] CVS: Products3/NewsSite - sitesetup.py:1.2

Ulrich Eck ueck@net-labs.de
Thu, 27 Mar 2003 09:02:00 -0500


Update of /cvs-repository/Products3/NewsSite
In directory cvs.zope.org:/tmp/cvs-serv16142

Modified Files:
	sitesetup.py 
Log Message:
newssite setup:
 - Create ServiceManager
 - Create Workflow Service + Configuration
 - Create Authentication Service + Configuration
 - Create ContentWorkflowsUtility + subscribe


=== Products3/NewsSite/sitesetup.py 1.1 => 1.2 ===
--- Products3/NewsSite/sitesetup.py:1.1	Thu Mar 27 05:21:59 2003
+++ Products3/NewsSite/sitesetup.py	Thu Mar 27 09:01:59 2003
@@ -18,5 +18,54 @@
 __metaclass__ = type
 
 
+from zope.app.traversing import traverse, getPath
+from zope.app.services.service import ServiceManager
+from zope.app.services.service import ServiceConfiguration
+from zope.app.interfaces.services.configuration import Active
+from zope.app.services.servicenames \
+     import Workflows, Authentication
+
+from zope.app.services.auth import AuthenticationService
+from zope.app.workflow.service import WorkflowService
+
+from zope.app.workflow.stateful.contentworkflow \
+     import ContentWorkflowsUtility
+
 def setupSite(site, data):
     print "setup site"
+    
+    # Add SiteManagementFolder
+    site.setServiceManager(ServiceManager())
+    sm = traverse(site, '++etc++site')
+    default = traverse(sm, 'default')
+    cm = default.getConfigurationManager()
+
+
+    # Create Local Authentication Service
+    auth_service_name = 'Authentication-1'
+    default.setObject(auth_service_name, AuthenticationService())
+    workflowservice = traverse(default, auth_service_name)
+    auth_path = "%s/%s" % (getPath(default), auth_service_name)
+    configuration = ServiceConfiguration(Authentication, auth_path, site)
+    cm.setObject('', configuration)
+    traverse(cm, '1').status = Active
+
+    # Create Workflow Serivce
+    workflow_service_name = 'Workflows-1'
+    default.setObject(workflow_service_name, WorkflowService())
+    workflowservice = traverse(default, workflow_service_name)
+    workflow_path = "%s/%s" % (getPath(default), workflow_service_name)
+    configuration = ServiceConfiguration(Workflows, workflow_path, site)
+    cm.setObject('', configuration)
+    traverse(cm, '2').status = Active
+
+    # Create Content Workflows Utility
+    workflowsutility_name = 'ContentWorkflowsUtility-1'
+    default.setObject(workflowsutility_name, ContentWorkflowsUtility())
+    workflowsutility = traverse(default, workflowsutility_name)
+    workflowsutility.subscribe()
+
+    # Create Default Processdefinition
+
+    
+