[Zope-Checkins] CVS: Zope3/lib/python/Zope/StartUp - ServerType.py:1.1.2.2.2.1 SiteDefinition.py:1.1.2.1.4.1 startup-registry.zcml:1.1.2.1.4.2

Stephan Richter srichter@cbu.edu
Thu, 4 Apr 2002 06:44:58 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/StartUp
In directory cvs.zope.org:/tmp/cvs-serv21650/lib/python/Zope/StartUp

Modified Files:
      Tag: Zope3-Server-Branch
	ServerType.py SiteDefinition.py startup-registry.zcml 
Log Message:
Worked some more on FTP, especially in regards with the Publisher.

- Finally we can get rid of the medusa base. I think I have extracted all
  of the interesting code.

- Started on a PublisherFileSystem. A few methods might work, but most of 
  the FS methods are not hooked up yet.

- Started writing VFS Publisher hooks.

- Added the FTPServer to the startup registry. It comes up, but do not 
  expect it to work, since no views have been written for VFS yet.


=== Zope3/lib/python/Zope/StartUp/ServerType.py 1.1.2.2 => 1.1.2.2.2.1 ===
 # 
 ##############################################################################
-"""
-
-$Id$
-"""
-
-from Interface import Interface
-from RequestFactoryRegistry import getRequestFactory
-
-
-class IServerType(Interface):
-    """This is a pure read-only interface, since the values are set through
-       a ZCML directive and we shouldn't be able to change them.
-    """
-
-    def create(task_dispatcher, db, port=None, verbose=None):
-        """Create the server knowing the port, task dispatcher and the ZODB.
-        """
-
-
-class ServerType:
-
-    __implements__ =  IServerType
-
-
-    def __init__(self, name, factory, requestFactory, logFactory,
-                 defaultPort, defaultVerbose):
-        """ """
-        self._name = name
-        self._factory = factory
-        self._requestFactory = requestFactory
-        self._logFactory = logFactory
-        self._defaultPort = defaultPort
-        self._defaultVerbose = defaultVerbose
-
-
-    ############################################################
-    # Implementation methods for interface
-    # Zope.StartUp.ServerType.IServerType
-
-    def create(self, task_dispatcher, db, port=None, verbose=None):
-        'See Zope.StartUp.ServerType.IServerType'
-
-
-        request_factory = getRequestFactory(self._requestFactory)
-        request_factory = request_factory.realize(db)
-
-        if port is None:
-            port = self._defaultPort
-
-        if verbose is None:
-            verbose = self._defaultVerbose
-
-        apply(self._factory,
-              (request_factory, self._name, '', port),
-              {'task_dispatcher': task_dispatcher,
-               'verbose': verbose,
-               'hit_log': self._logFactory()})
-
-    #
-    ############################################################
-
-        
+"""e.py,v 1.1.2.2 2002/04/02 02:20:40 srichter Exp $
+"""
+
+from Interface import Interface
+from RequestFactoryRegistry import getRequestFactory
+
+
+class IServerType(Interface):
+    """This is a pure read-only interface, since the values are set through
+       a ZCML directive and we shouldn't be able to change them.
+    """
+
+    def create(task_dispatcher, db, port=None, verbose=None):
+        """Create the server knowing the port, task dispatcher and the ZODB.
+        """
+
+
+class ServerType:
+
+    __implements__ =  IServerType
+
+
+    def __init__(self, name, factory, requestFactory, logFactory,
+                 defaultPort, defaultVerbose):
+        """ """
+        self._name = name
+        self._factory = factory
+        self._requestFactory = requestFactory
+        self._logFactory = logFactory
+        self._defaultPort = defaultPort
+        self._defaultVerbose = defaultVerbose
+
+
+    ############################################################
+    # Implementation methods for interface
+    # Zope.StartUp.ServerType.IServerType
+
+    def create(self, task_dispatcher, db, port=None, verbose=None):
+        'See Zope.StartUp.ServerType.IServerType'
+
+        request_factory = getRequestFactory(self._requestFactory)
+        request_factory = request_factory.realize(db)
+
+        if port is None:
+            port = self._defaultPort
+
+        if verbose is None:
+            verbose = self._defaultVerbose
+
+        apply(self._factory,
+              (request_factory, self._name, '', port),
+              {'task_dispatcher': task_dispatcher,
+               'verbose': verbose,
+               'hit_log': self._logFactory()})
+
+    #
+    ############################################################
+
+        


=== Zope3/lib/python/Zope/StartUp/SiteDefinition.py 1.1.2.1 => 1.1.2.1.4.1 ===
         # not create one.
         self._initDB()
-        
+
         # Start the servers
         for type, server_info in self._servers.items():
 
             server = getServerType(type)
-
             server.create(td, self._zodb, server_info['port'],
                           server_info['verbose'])
-        
 
     def _initDB(self):
         """Initialize the ZODB"""


=== Zope3/lib/python/Zope/StartUp/startup-registry.zcml 1.1.2.1.4.1 => 1.1.2.1.4.2 ===
 
 
+  <startup:registerRequestFactory name="VFSRequestFactory"
+    publication = 
+    "Zope.App.ZopePublication.VFS.Publication.VFSPublication"
+    request = "Zope.Publisher.VFS.VFSRequest." 
+  />
+
   <startup:registerServerType 
     name = "Browser"
     factory = "Zope.Server.HTTP.PublisherHTTPServer."
@@ -32,6 +38,15 @@
     requestFactory="XMLRPCRequestFactory"
     logFactory = "Zope.Server.HTTP.CommonHitLogger."
     defaultPort="8081"
+    defaultVerbose="true" />
+
+
+  <startup:registerServerType 
+    name = "FTP"
+    factory = "Zope.Server.FTP.PublisherFTPServer."
+    requestFactory="VFSRequestFactory"
+    logFactory = "Zope.Server.FTP.CommonFTPActivityLogger."
+    defaultPort="8021"
     defaultVerbose="true" />