[Zope-Checkins] CVS: Zope3 - zserver.zcml:1.1.4.1 principals.zcml.in:1.1.2.2 sample_principals.zcml:1.1.2.2 site.zcml:1.1.2.8 z3.py:1.1.2.29 startup.zcml:NONE

Jim Fulton jim@zope.com
Fri, 7 Jun 2002 10:41:57 -0400


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv12187

Modified Files:
      Tag: Zope-3x-branch
	principals.zcml.in sample_principals.zcml site.zcml z3.py 
Added Files:
      Tag: Zope-3x-branch
	zserver.zcml 
Removed Files:
      Tag: Zope-3x-branch
	startup.zcml 
Log Message:
Merging in Zope3InWonderland-branch, which implemented the following
proposals (see
http://dev.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/OldProposals): 
- RenameAllowToRequire

- GroupClassRelatedDirectivesInClassDirective

- ViewInterfaceAndSimplification

- ConsistentUseOfSpacesAsDelimitersInZCMLAttributes

- TwoArgumentViewConstructors

- ImplementsInZCML

- SimpleViewCreationInZCML

- RemoveGetView

- ReplaceProtectWithAllow

- ViewMethodsAsViews

- MergeProtectionAndComponentDefinitions

There were also various security fixes resulting of better integration
of security with components.


=== Added File Zope3/zserver.zcml ===
<zopeConfigure
   xmlns="http://namespaces.zope.org/zope"
   xmlns:startup="http://namespaces.zope.org/startup">

  <!-- Define a specific site. The name of the site is used for server
       messages only. The number of threads specifies the number of
       threads the server should maximally use. -->

  <startup:defineSite name="Zope 3 Default"
                      threads="4">

    <!-- You can choose between several storages.

         At the moment only two storages are supported:
             FileStorage - Saves data in a specified file
             MappingStorage - Saves data in a dictionary. No saving. -->

    <startup:useFileStorage file = "Data.fs" />
    <!--startup:useMappingStorage /-->


    <!-- Setup the log file.

         There are two special file names:
             STDERR - sends output to standard error
             STDOUT - sends output to standard output -->

    <startup:useLog file="STDERR" />


    <!-- Now define the servers you would like to start. All you need
    to specify is the server type. Both, the port and verbose option,
    are optional.

    The following types are currently available: 
        Browser - A standard HTML/XUL server
        XML-RPC - An XML-RPC server, for calling objects remotely
        FTP - A server to access the ZODB via the FTP protocol
    Soon:
        SOAP - An SOAP server for Zope based on ZSI

    The 'port' option specifies the port the server should run on of course.

    The 'verbose' option specifies whether any logs should be written. If
    set to false, nothing is reported. -->

    <startup:addServer type = "Browser" port = "8080" />
    <startup:addServer type = "XML-RPC" port = "8081" verbose="true" />
    <startup:addServer type = "FTP" port = "8021" />


  </startup:defineSite>


</zopeConfigure>


=== Zope3/principals.zcml.in 1.1.2.1 => 1.1.2.2 ===
 >
 
-<security:defaultPrincipal principal_id="anybody" title="Unauthenticated User" />
+<security:defaultPrincipal id="anybody" title="Unauthenticated User" />
 
 </zopeConfigure>


=== Zope3/sample_principals.zcml 1.1.2.1 => 1.1.2.2 ===
 
 
-<security:defaultPrincipal principal_id="anybody" 
+<security:defaultPrincipal id="anybody" 
                            title="Unauthenticated User" />
 
-<security:principal principal_id="stupid" title="Stupid, replace me"
+<security:principal id="stupid" title="Stupid, replace me"
                     login="stupid" password="123" />
-<security:principal principal_id="idiot" title="I'm an idiot, replace me"
+<security:principal id="idiot" title="I'm an idiot, replace me"
                     login="idiot" password="456" />
 
-<security:assignRoleToPrincipal role_id="Manager" principal_id="stupid" />
-<security:assignRoleToPrincipal role_id="Member"  principal_id="idiot" />
+<security:assignRoleToPrincipal role="Manager" principal="stupid" />
+<security:assignRoleToPrincipal role="Member"  principal="idiot" />
 
 </zopeConfigure>


=== Zope3/site.zcml 1.1.2.7 => 1.1.2.8 ===
 <include package="Zope" file="zope.zcml" />
 
-<security:role role_id="Manager" title="Site Manager" />
-<security:role role_id="Member" title="Site Member" />
+<security:role id="Manager" title="Site Manager" />
+<security:role id="Member" title="Site Member" />
 
 <include file="principals.zcml" />
 
-<security:grantPermissionToRole permission_id="Zope.View" 
-                                role_id="Manager" />
-<security:grantPermissionToRole permission_id="Zope.ManageContent"
-                                role_id="Manager" />
-<security:grantPermissionToRole permission_id="Zope.Security" 
-                                role_id="Manager" />
+<security:grantPermissionToRole permission="Zope.View" 
+                                role="Manager" />
+<security:grantPermissionToRole permission="Zope.ManageContent"
+                                role="Manager" />
+<security:grantPermissionToRole permission="Zope.Security" 
+                                role="Manager" />
 
-<security:grantPermissionToRole permission_id="Zope.ManageServices" 
-                                role_id="Manager" />
+<security:grantPermissionToRole permission="Zope.ManageServices" 
+                                role="Manager" />
 
-<security:grantPermissionToRole permission_id="Zope.ManageApplication" 
-                                role_id="Manager" />
+<security:grantPermissionToRole permission="Zope.ManageApplication" 
+                                role="Manager" />
 
 <include file="products.zcml" />
-
-
-<!-- Now start Zope -->
-<include file="startup.zcml" />
 
 </zopeConfigure>


=== Zope3/z3.py 1.1.2.28 => 1.1.2.29 ===
 import os, sys, asyncore
 
-# setting python paths
-program = sys.argv[0]
-here = os.path.join(os.getcwd(), os.path.split(program)[0])
-sys.path=[os.path.join(here,'lib','python'),
-          here] + filter(None, sys.path)
-
-from Zope.Configuration import config
-from Zope.Configuration.xmlconfig import XMLConfig
-
-# temp hack
-config(os.getcwd())
-
-try:
-    asyncore.loop()
-except KeyboardInterrupt:
-    # Exit without spewing an exception.
-    pass
-sys.exit(0)
+basepath = filter(None, sys.path)
 
+def run(argv=sys.argv):
+
+    # setting python paths
+    program = argv[0]
+    here = os.path.join(os.getcwd(), os.path.split(program)[0])
+    libpython = os.path.join(here,'lib','python') 
+    sys.path=[libpython, here] + basepath
+
+    # temp hack
+    dir = os.getcwd()
+
+    from Zope.Configuration.xmlconfig import XMLConfig
+
+    # Load server-independent site config
+    XMLConfig(os.path.join(dir, 'site.zcml'))()
+    
+    # Load server config
+    XMLConfig(os.path.join(dir, 'zserver.zcml'))()
+
+    try:
+        asyncore.loop()
+    except KeyboardInterrupt:
+        # Exit without spewing an exception.
+        pass
+    sys.exit(0)
+
+
+if __name__ == '__main__':
+    run()
+    

=== Removed File Zope3/startup.zcml ===