[Zope3-Users] A question regarding zope generations

2007-11-16 Thread Shailesh Kumar
Hi,

I have a small doubt regarding zope3 generations.

In the current way of doing things:
- one should first put a dummy schema manager, restart the zope, so that a
generation 0 is assigned to the application.
- one should then put the actual site specific schema manager which would
use the evolution scripts from this point onwards in development.

I essentially have a web based application product and the users have no
idea of zope and python as such. The product is shipped to them,
the installer installs the whole zope 3 instances and services by itself and
starts them.

For the upgrade case, the installer (NSIS based) stops existing zope 3
services (Win32), replaces the software and then restarts the services.

Unfortunately, I didn't have setup the dummy schema manager in the earlier
version of the product.

Now that I need to send an upgrade, I am facing the dilemma of how to setup
the evolution scripts. As doing that would require doing more complicated
processing
in the installer. (stop the services, put code for dummy schema manager,
start the services, ensure that database schema generation has  been setup
for the product,
stop the service again, put the new code and the regular schema manager,
start the service again).

This would complicate my installer a bit more. Its already quite
complicated.

I don't know if this is quite a common use case scenario for zope based
applications. I am sure its not relevant for applications which are based on
a website and managed
by an expert, but for products with zope built-inside, may be this could be
of use.

As of now, I am thinking of a following solution. For the current upgrade, I
will have some code which will automatically evolve the existing
installation during startup
(i.e. DatabaseOpenedEvent) and actually assign a generation number in the
root[generations_key]['product_name'] key.

In the later upgrades, I will replace this with the regular schema manager.

Comments from the zope 3 experts would be very useful.

Thanks a lot.
With regards,
- Shailesh
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] ftp server access log

2007-11-16 Thread catonano

Hello zopers,

I configured my Zope installation (on XP) to start the ftp server 
also and I'd love to read in the log file about the ftp access 
operations.It reports about http GETs and POSTs only !


Here an excerpt of my log/z3.log file

2007-11-15T22:02:54 INFO root -- HTTP:localhost:8080 Server started.
Hostname: localhost
Port: 8080
--
2007-11-15T22:02:54 INFO root -- FTP:localhost:8021 Server started.
Hostname: localhost
Port: 8021
--
2007-11-15T22:02:54 INFO root Startup time: 3.968 sec real, 3.974 sec CPU



well, nice. Now, here's an excerpt from my log/access.log file

127.0.0.1 - - [15/Nov/2007:22:06:41 +0200] GET 
/miaMensola/@@contents.html HTTP/1.1 200 8925 
http://localhost:8080/cart/@@contents.html; Mozilla/5.0 (Windows; 
U; Windows NT 5.1; it; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
127.0.0.1 - - [15/Nov/2007:22:06:41 +0200] GET 
/miaMensola/@@singleBranchTree.xml HTTP/1.1 200 537 
http://localhost:8080/miaMensola/@@contents.html; Mozilla/5.0 
(Windows; U; Windows NT 5.1; it; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
127.0.0.1 - - [15/Nov/2007:22:06:45 +0200] POST 
/miaMensola/@@contents.html HTTP/1.1 303 7411 
http://localhost:8080/miaMensola/@@contents.html; Mozilla/5.0 
(Windows; U; Windows NT 5.1; it; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
127.0.0.1 - - [15/Nov/2007:22:06:45 +0200] GET 
/miaMensola/@@contents.html HTTP/1.1 200 7711 
http://localhost:8080/miaMensola/@@contents.html; Mozilla/5.0 
(Windows; U; Windows NT 5.1; it; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9
127.0.0.1 - - [15/Nov/2007:22:06:45 +0200] GET 
/miaMensola/@@singleBranchTree.xml HTTP/1.1 200 537 
http://localhost:8080/miaMensola/@@contents.html; Mozilla/5.0 
(Windows; U; Windows NT 5.1; it; rv:1.8.1.9) Gecko/20071025 Firefox/2.0.0.9



I logged in in the ftp server too and no trace of that is present in this log !

How can I instruct the ftp server to log its activities ?

Thanks so much
Bye
Catonano


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Re: Problem with interdependent utilities registration

2007-11-16 Thread Philipp von Weitershausen

Yuan HOng wrote:

If I have a utility component whose initializaiton depends on the
availability of another utility, the initialization fails with a
Component Lookup Error. It seems that in the ZCML file, the utility
components are first created, and then at the end of the whole
configuration, they are registered.


Yup.


So if in the initilization code of utility B I need to look up a
utility A, the ZCML configuration will  fail.


That's why you shouldn't look up any components in __init__ :)


The problem is that although the z3c eninge object is created before
the 'utility' directive is executed, it is not registered and
therefore can not be looked up when the 'utility' directive tries to
create the MyUtility object.

How does one usually solve such interdependencies?


Look up the utility when you actually *need* it. This is a general rule 
of thumb, because you always want to preserve the possibility of local 
utilities coming from some local sites, and those aren't available 
during some initialization code.


___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Problem with interdependent utilities registration

2007-11-16 Thread Yuan HOng
Hi,

If I have a utility component whose initializaiton depends on the
availability of another utility, the initialization fails with a
Component Lookup Error. It seems that in the ZCML file, the utility
components are first created, and then at the end of the whole
configuration, they are registered. So if in the initilization code of
utility B I need to look up a utility A, the ZCML configuration will
fail.

As an example, I have a utility that reference a z3c.zalchemy engine.

class MyUtility(object):
implements(IMyUtility)

def __init__(self):
engine = getUtility(z3c.zalchemy.interfaces.IAlchemyEngineUtility,
name=u'TheEngine').getEngine()

And the configuration goes like this:

configure
xmlns:alchemy=http://namespaces.zalchemy.org/alchemy;

alchemy:engine
name=TheEngine
url=some db url /

utility
factory=.utility.MyUtility
permission=zope.Public
provides=.interfaces.IMyUtility /

/configure

The problem is that although the z3c eninge object is created before
the 'utility' directive is executed, it is not registered and
therefore can not be looked up when the 'utility' directive tries to
create the MyUtility object.

How does one usually solve such interdependencies?

-- 
Hong Yuan

大管家网上建材超市
装修装潢建材一站式购物
http://www.homemaster.cn
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users