Problem with VirtualHostMonster
Hi, I was using Zope "SiteRoot" product until now (without any problem) to handle my Zope virtual hosting behind an Apache server with rewrite rules. I've tried recently to use VirtualHostMonster product, but had to face a little problem : - if I load an object and call his "absolute_url()" method, everything is OK - if I load an object, store it in a REQUEST variable or on the stack with "<dtml-with>" or "<dtml-let>", and call "absolute_url()" on this object, the URL is not rewritten. Is there any way to handle this problem ?? Thanks, Thierry
FLORAC Thierry wrote:
I was using Zope "SiteRoot" product until now (without any problem) to handle my Zope virtual hosting behind an Apache server with rewrite rules. I've tried recently to use VirtualHostMonster product, but had to face a little problem : - if I load an object and call his "absolute_url()" method, everything is OK - if I load an object, store it in a REQUEST variable or on the stack with "<dtml-with>" or "<dtml-let>", and call "absolute_url()" on this object, the URL is not rewritten.
That sounds pretty odd. What kind of object are you putting on the request or the namestack? How are you putting it in.on there? Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Tue, 2004-03-23 at 10:05, Chris Withers wrote:
FLORAC Thierry wrote:
I was using Zope "SiteRoot" product until now (without any problem) to handle my Zope virtual hosting behind an Apache server with rewrite rules. I've tried recently to use VirtualHostMonster product, but had to face a little problem : - if I load an object and call his "absolute_url()" method, everything is OK - if I load an object, store it in a REQUEST variable or on the stack with "<dtml-with>" or "<dtml-let>", and call "absolute_url()" on this object, the URL is not rewritten.
That sounds pretty odd.
What kind of object are you putting on the request or the namestack?
Concerned objects are custom classes instances, inherited from SimpleItem or ObjectManager (for which the "absolute_url" is never defined).
How are you putting it in.on there?
I can use several methods : - <dtml-let MYINSTANCE="otherObject.callMethod()"> (which retrieves an object) - <dtml-call "REQUEST.set('MYINSTANCE', otherObject.callMethod())"> (which is used mainly when the result can be used in several scripts) - <dtml-in ... prefix="sequence"> <dtml-let MYINSTANCE=sequence_item> and probably other similar methods called via Python scripts... Thierry P.S. : I forgot to you that I'm using Zope-2.6.1 with Python-2.1.3 -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
FLORAC Thierry wrote:
Concerned objects are custom classes instances, inherited from SimpleItem or ObjectManager (for which the "absolute_url" is never defined).
Yeah, but be DAMN sure your class returns an id get .getID() is called ;-)
I can use several methods : - <dtml-let MYINSTANCE="otherObject.callMethod()"> (which retrieves an object) - <dtml-call "REQUEST.set('MYINSTANCE', otherObject.callMethod())"> (which is used mainly when the result can be used in several scripts) - <dtml-in ... prefix="sequence"> <dtml-let MYINSTANCE=sequence_item>
Ewww... DTML :'( Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
On Wed, 2004-03-24 at 14:21, Chris Withers wrote:
FLORAC Thierry wrote:
Concerned objects are custom classes instances, inherited from SimpleItem or ObjectManager (for which the "absolute_url" is never defined).
Yeah, but be DAMN sure your class returns an id get .getID() is called ;-)
Do you mean "getId" or "getID" ?? The "getId" method is never redefined and the "id" property is always set...
I can use several methods : - <dtml-let MYINSTANCE="otherObject.callMethod()"> (which retrieves an object) - <dtml-call "REQUEST.set('MYINSTANCE', otherObject.callMethod())"> (which is used mainly when the result can be used in several scripts) - <dtml-in ... prefix="sequence"> <dtml-let MYINSTANCE=sequence_item>
Ewww... DTML :'(
I know that DTML doesn't seems to be the best way to define pages templates, but my application which is quite old now il heavily based on DTML and I can't modify all my templates to use ZPT... Thierry -- Linux every day, keeps Dr Watson away... http://gpc.sourceforge.net -- http://www.ulthar.net
(loose the HTML posting ;-) FLORAC Thierry wrote:
Yeah, but be DAMN sure your class returns an id get .getID() is called ;-)/
Do you mean "getId" or "getID" ?? The "getId" method is never redefined and the "id" property is always set...
I meant to say "be DAMN sure your class returns an id when .getId() is called" You're making an assumption that setting id means that getId will return it. It usually does, but you may have found an edge case where it doesn't :-S
I know that DTML doesn't seems to be the best way to define pages templates, but my application which is quite old now il heavily based on DTML and I can't modify all my templates to use ZPT...
Well, that stuff should have been in a python script anyway... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
FLORAC Thierry