[Zope] Making Magic with Mirrowing Folders

Gary Duke Speer gspeer at cortech.org
Fri Jun 11 14:19:11 EDT 2004


I have been trying to configure Dieter's Mirrowing Folders Product.
Using both direct _dtml-var_ links and Shane's AquisitionUnderstander I
cannot see the product having any effect.  I suspect it is because I do
not understand either the product's intention or how to properly setup the
mirrow link.

For the benefit of other newbies like me, if I am mis-stating the goal of
the product or any aspect of it, please say so.  My understanding of the
intention of the product is that it will insert a distant folder into the
acquision path as if the URL routed through that folder, and it does so
only when there is exact alignment of the two relative paths.

For background, my objective is to have a portable-hole style solution but
using only relative urls due to using virtual hosting and other reasons.

relative to the site's root folder, there are two primary directory
trees - common content files and objects and context-specific files.

a simplistic example:
.../mysite/  (relative root)
.../mysite/common (branch of common content to be mirrowed into other
contexts)
.../mysite/common/images (folder of site-wide images)
.../mysite/common/images/logos/sitelogo.gif (an image to acquire)

.../mysite/englishpages (branch of context-specific content)
.../mysite/englishpages/page.html (the page trying to access both specific
and common content)
.../mysite/englishpages/images (folder of context-specific - english
language - images)
.../mysite/englishpages/images/logos/sitename.gif (an image of the site
name written in english)

.../mysite/germanpages (branch with identical sub-structure to
englishpages and to common)

My impression is that
.../mysite/englishpages/images
is the folder that should be created as a mirrow folder and it should
point to the matching common folder.
That it's ID is images and it's mirrowid__ property should be set to
../common/images meaning include content that is located up one level from
my containing folder, englishpages in a folder called common and in a
subfolder called images.

The complete magic, compared to transparent folder is that links inside
page.html to the logos folder will acquire objects from both logos
folders.  In other words, a relative link to
images/logos/sitename.gif
works because the path directly accesses the file.
A link to
images/logos/sitelogo.gif
triggers acquisition because it is not found in the
.../mysite/englishpages/images/logos/
folder, so acquisition checks the
.../mysite/englishpages/images/
folder, again not found.
By operation of the mirrowlink acquisition checks the same subpath of the
target, namely
.../mysite/common/images/logos/
and should find it.  If not, since mirrow is described as subpath
specific, aquisition skips checking
.../mysite/common/images/
and proceeds to check
.../mysite/
.../
and so on up to the Zope root.

In short, the mirrow is largely functionally equivalent to using the URL:
../mysite/englishpages/common/images/logos/englishpages/images/logos
except that common/images is skipped over.

I have tried several variations, including a link to
.../mysite/englishpages/images/testimage.jpg
in the hopes of returning
.../mysite/common/images/testimage.jpg
but no luck and
.../mysite/common/images/logos/showaq
does not look anywhere except each folder of the path.
(During this testing VHM is off, tried on both Zope 2.6.1 and 2.7.0 to see
if there was a change in the way.)

Sorry this is lengthy, but I'm hoping to get my conceptual understanding
improved better than I have so far by Googling the archives of this group.

Maybe the result will lead to a how-to comparing LinkedFolder,
TransparentFolder, PortableHole, Reference, Mirrow Folder, and the toxic
Symlink product.
Thank you,
Duke









More information about the Zope mailing list