RE: [Zope] Re: Physical path of objects in portal_skins tool of a CMF site
You are right... (I just read the SkinnableObjectManager code for a while). I found a workaround : setting a variable in the manage_afterAdd method of my object that uses container.getPhysicalPath() to compute the path I need. It looks like copy/paste/rename operations work fine, even inside portal_skins, even when copying a whole folder. What do you think ? Anyway, thanks for the quick answers so far ! Pascal -----Message d'origine----- De : zope-bounces@zope.org [mailto:zope-bounces@zope.org]De la part de yuppie Envoyé : lundi 30 août 2004 18:40 À : zope@zope.org Objet : [Zope] Re: Physical path of objects in portal_skins tool of a CMF site Hi! Pascal Peregrina wrote:
Ok, object is /site_staging/portal_skins/DEFAULT/testpath.html
So 'DEFAULT' is a skin layer and 'default' a skin that includes the 'DEFAULT' layer?
When invoking it using http://myserver/site_staging/testpath.html (so I use CMF skins traversal with implicit skin=default) aq_parent(self).id returns site_staging, which looks ok to me. And getPhysicalPath() will return : '','site_staging','testpath.html'
But I really need (for some complicated to explain reasons) to get the full physical path of the object. So something returning : '','site_staging','portal_skins','DEFAULT','testpath.html'
I guess you have no chance. SkinnableObjectManager.__getattr__ removes the original acquisition context from the object. So if you invoke it as attribute of 'site_staging', the object knows nothing about its original context. HTH, Yuppie BTW: There is a CMF list, see <http://mail.zope.org/mailman/listinfo/zope-cmf> _______________________________________________ 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 ) ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________ ________________________________________________________________________ This e-mail has been scanned for all viruses by Star Internet. The service is powered by MessageLabs. For more information on a proactive anti-virus service working around the clock, around the globe, visit: http://www.star.net.uk ________________________________________________________________________
Pascal Peregrina wrote:
I found a workaround : setting a variable in the manage_afterAdd method of my object that uses container.getPhysicalPath() to compute the path I need. It looks like copy/paste/rename operations work fine, even inside portal_skins, even when copying a whole folder.
What do you think ?
I think you're using the skins tool in a very strange way. Smells like bad application design. But your workaround should work. Cheers, Yuppie
participants (2)
-
Pascal Peregrina -
yuppie