Hi, I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server. The production environment is running on a Linux box and my test environment is running on a WindowXP machine. I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but... When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.) The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment. How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or? Sorry if this is a stupid question but I am new to ZOPE. Best Regards Jørgen Larsen http://jorgen.larsen.name/
Did you copy over all your products to the dev server? It looks like your Zope instance is looking for a product file that is called in your Data.fs. Jake -- http://www.ZopeZone.com Jørgen Larsen said:
Hi,
I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server.
The production environment is running on a Linux box and my test environment is running on a WindowXP machine.
I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but...
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or?
Sorry if this is a stupid question but I am new to ZOPE.
Best Regards Jørgen Larsen
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Hi, Yes I did. But the path on the linux and the windows environment are not the same. Ie. Linux: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' Windows: 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' - Jørgen -----Original Message----- From: Jake (aka BZ) [mailto:jake@zopezone.com] Sent: 3. december 2003 14:03 To: Jørgen Larsen Cc: zope@zope.org Subject: Re: [Zope] Moving the Data.fs Did you copy over all your products to the dev server? It looks like your Zope instance is looking for a product file that is called in your Data.fs. Jake -- http://www.ZopeZone.com Jørgen Larsen said:
Hi,
I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server.
The production environment is running on a Linux box and my test environment is running on a WindowXP machine.
I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but...
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or?
Sorry if this is a stupid question but I am new to ZOPE.
Best Regards Jørgen Larsen
_______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
On Wed, 2003-12-03 at 02:56, Jørgen Larsen wrote:
Hi,
I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server.
An excellent idea. :-)
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
I haven't used the product myself, but it sounds like it may have been symlinked into the Products folder on the Linux side. Copy Localizer into ZOPE_DIR\Products and restart zope... see if that doesn't fix it. HTH, Dylan
Jørgen Larsen wrote at 2003-12-3 11:56 +0100:
... The production environment is running on a Linux box and my test environment is running on a WindowXP machine.
I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but...
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or?
Maybe, a reinstalltion of the "Localizer" product can help. I do not know this product. It may be possible that there are instances in your Zope site. In this case, deleting these instances and recreating them may already help. If there are such instances, they should be remove before deinstallation of the product (otherwise, they become "broken"). -- Dieter
Jørgen Larsen wrote:
I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server.
The production environment is running on a Linux box and my test environment is running on a WindowXP machine.
I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but...
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or?
I wouldn't know without looking at the source (and even though I can theoretically look at the source, I wouldn't know where to begin without a traceback and a version number). I doubt reinstalling the product will help, but you can try. Speaking of: I can't find a trace of such a file in the Localizer CVS. The solution to the problem lies in finding out why and where Localizer stores an OS-specific path. (It shouldn't do this.) You can look through the code yourself, or maybe the author(s) of the product can help you. It seems to be pretty well-maintained. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
Hi, Okay I fixed the problem ;) It was the HTMLFile() function that 'generated' the broken path. The problem was solved by adding a refresh method to the class (named resource) that had the path problem and making a python script in ZOPE that traversed through the tree and calling the refresh method on each resource object. Ie. def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English') Best Regards http://jorgen.larsen.name -----Original Message----- From: J. Cameron Cooper [mailto:jccooper@jcameroncooper.com] Sent: 4. december 2003 03:52 To: Jørgen Larsen Cc: zope@zope.org Subject: Re: [Zope] Moving the Data.fs Jørgen Larsen wrote:
I'm trying to setup a ZOPE test environment so I can test my ZOPE stuff before it is installed on the production server.
The production environment is running on a Linux box and my test environment is running on a WindowXP machine.
I copied the Data.fs and Data.fs.index from the production env. to my test environment - started the ZOPE server - and everything almost seems okay ;) but...
When I try to edit one of my objects (named: resource) I get this ZOPE error: Error Value: [Errno 2] No such file or directory: '/usr/lib/zope/lib/python/Products/Localizer/resEdit.dtml' (this is where the dtml file is located on the linux production env.)
The resEdit.dtml is located at 'C:\Program Files\zopelocalizer\lib\python\Products\Localizer\resEdit.dtml' in my test environment.
How do I fix my the path problem? Do I have to traverse through the tree and change an 'edit path' attribute on my objects? Or?
I wouldn't know without looking at the source (and even though I can theoretically look at the source, I wouldn't know where to begin without a traceback and a version number). I doubt reinstalling the product will help, but you can try. Speaking of: I can't find a trace of such a file in the Localizer CVS. The solution to the problem lies in finding out why and where Localizer stores an OS-specific path. (It shouldn't do this.) You can look through the code yourself, or maybe the author(s) of the product can help you. It seems to be pretty well-maintained. --jcc -- "My point and period will be throughly wrought, Or well or ill, as this day's battle's fought."
Jørgen Larsen wrote at 2003-12-4 08:47 +0100:
... def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
That looks funny (and wrong): You assign "HTMLFile()" to a local variable. This should have no effect (other than consuming time). -- Dieter
Hi, Here is some more code: class Resource: manage_main = HTMLFile('resEdit', globals(),language='English') def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English') I hope thats another case? Best Regards Jørgen -----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: 4. december 2003 21:13 To: Jørgen Larsen Cc: zope@zope.org Subject: RE: [Zope] Moving the Data.fs Jørgen Larsen wrote at 2003-12-4 08:47 +0100:
... def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
That looks funny (and wrong): You assign "HTMLFile()" to a local variable. This should have no effect (other than consuming time). -- Dieter
On Fri, 2003-12-05 at 00:24, Jørgen Larsen wrote:
Hi,
Here is some more code:
class Resource:
manage_main = HTMLFile('resEdit', globals(),language='English')
def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
I think what you want is: def refresh(self): return self.manage_main HTH, Dylan
J�rgen Larsen wrote at 2003-12-5 09:24 +0100:
Here is some more code:
class Resource:
manage_main = HTMLFile('resEdit', globals(),language='English')
def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
I hope that�s another case?
It is not. "refresh" is still an expensive no-op...
-----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: 4. december 2003 21:13 To: J�rgen Larsen Cc: zope@zope.org Subject: RE: [Zope] Moving the Data.fs
J�rgen Larsen wrote at 2003-12-4 08:47 +0100:
... def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
That looks funny (and wrong):
You assign "HTMLFile()" to a local variable.
This should have no effect (other than consuming time).
-- Dieter
Weird it works... ;)
Jørgen Larsen wrote at 2003-12-5 09:24 +0100:
Here is some more code:
class Resource:
manage_main = HTMLFile('resEdit', globals(),language='English')
def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
I hope thats another case?
It is not. "refresh" is still an expensive no-op...
-----Original Message----- From: Dieter Maurer [mailto:dieter@handshake.de] Sent: 4. december 2003 21:13 To: Jørgen Larsen Cc: zope@zope.org Subject: RE: [Zope] Moving the Data.fs
Jørgen Larsen wrote at 2003-12-4 08:47 +0100:
... def refresh(self): manage_main = HTMLFile('resEdit', globals(),language='English')
That looks funny (and wrong):
You assign "HTMLFile()" to a local variable.
This should have no effect (other than consuming time).
-- Dieter
On Sat, 2003-12-06 at 07:19, Jørgen Larsen wrote:
Weird it works... ;)
It only appears to work. When you call a method that has no return value (as yours doesn't) your browser will continue to display the same page you were viewing when you made the request. Since you're *expecting* to see the same page, you don't realize that what you're *actually* looking at is no change. I think I posted this once already, but what you want is this: def refresh(self, request): return self.manage_main(self, request) HTH, Dylan
Hi Dylan, I think you need to read the orginal post ;) The refresh method is used for opdating the manage_main attribute that had the wrong path when i moved the Data.fs file from a Linux to a Windows system. The refresh method is called from a python script that traverses the ZOPE tree. Best Regards Jørgen Larsen
On Sat, 2003-12-06 at 07:19, Jørgen Larsen wrote:
Weird it works... ;)
It only appears to work.
When you call a method that has no return value (as yours doesn't) your browser will continue to display the same page you were viewing when you made the request. Since you're *expecting* to see the same page, you don't realize that what you're *actually* looking at is no change.
I think I posted this once already, but what you want is this:
def refresh(self, request): return self.manage_main(self, request)
HTH,
Dylan
On Sun, 2003-12-07 at 01:57, Jørgen Larsen wrote:
Hi Dylan,
I think you need to read the orginal post ;) The refresh method is used for opdating the manage_main attribute that had the wrong path when i moved the Data.fs file from a Linux to a Windows system.
Ah, clearly I was confused. This just shouldn't be a problem and I'm surprised that it is. I've never had any trouble moving my products among several different platforms. If your paths use forward slashes and relative paths, there should be no trouble getting DTMLFile to work at all. (You should be using DTMLFile instead of HTMLFile, by the way. HTMLFile is a potential security risk and is pretty much deprecated.) Having said that, you probably don't want to do what you're trying to do anyway. You probably should maintain manage_main as a *class* attribute and change as necessary *for the class* rather than per-instance. Handling it this way requires nothing more than a refresh of the product code to update all instances. But if you *really* want to override manage_main per-instance, do this: def refresh(self): self.manage_main = DTMLFile('foo', globals()) ^^^^---- this is what you were missing. HTH, Dylan
participants (5)
-
Dieter Maurer -
Dylan Reinhardt -
J. Cameron Cooper -
Jake (aka BZ) -
Jørgen Larsen