[ZDP] Réf. : [ZDP] ZBook: changing contexts in Zope - part 3 - Draft 1 part 3 - Draft 1

kamon.ayeva@bureauveritas.com kamon.ayeva@bureauveritas.com
Tue, 14 Dec 1999 20:26:39 +0100


Hi all,

I am back to the team.

I am sorry Rik but I only got your draft this week, and I tried to add my
comments here after, hoping that you or someone else will be able to answer
my questions.
Let me also encourage you as the content is good and I support the idea of
having a part of the book focusing on analyzing the way to implement things
with Zope.

>3.4 Complications in acquisition
>
>It should be clear that acquisition adds some incredible flexibility to
>your site. There are already many excellent examples of it in the Zope
>community. Many of them are too complicated to explain here (if only if
>I do not completely understand them myself), but they are worthwile to
>study. Remember that Zope is Open Source and most of the Zope Products
>are also, and reading the sources is often a great way of learning more -
>it does require knowledge of the Python language [links to Chameleon
>Folder and SiteAccess and who knows what]

[[[Instead: Link to the chapter of ZBook presenting Python basics ?]]]

[[[Snip]]]


>Solution 1

[[[Snip Presentation of Solution 1]]]

Here isn't usefull to explain what acquisition does for this solution ?
Like: In this solution, Acquisition gets language="Dutch" from the folder
Dutch, and use it when processing the index_html method of the subfolder
foo.

>Solution 2

[[[Snip Presentation of Solution 2]]]

>Analysis and some remarks:

>(see the tree above)
>Calling the page in sibling folders works as proposed in the solution:
Which solution ? 1 or 2 ?

>It _is_ possible to place a contents in the directories at the same level
as
>foo and then call them as
>http://whatever/dutch|english|antarctic/site/content

I am sorry, but I don't understand these lines.

>[also refer to http://www.zope.org/pipermail/zope/1999-June/005141.html]

>The default part does _not_ work as described.

>If sitehome is on the same level as the language specific folders, in
>a URL like http://ROOT/en/sitehome/page (in which page refers to text
>methods in en) acquisition only returns the page with the method from en,
if
>there is no method with the same name anywhere else in the hierarchy: not
>above and not below. If there is, _that_ method will be returned.
>Anyway, if you want to return language specific content, unless there is
>none available, in which case you would return default content, you
>should construct something like:

<dtml-var standard_html_header>
<all sorts of fancy html layout>
<dtml-if tekst1>
  <dtml-var tekst1>
<dtml-else>
  <dtml-var default-text1>
</dtml-if>

<more layout>

<dtml-if tekst2>
  <dtml-var tekst2>
<dtml-else>
  <dtml-var default-text2>
</dtml-if>
bla bla
<dtml-var standard_html_footer>

>Note 1: This means that the sitehome folder would have to have a different
>naming convention than the other directories. This is due to a feature
>in acquisition.

Can we explain more ?

>Note 2:
>Now in either solution you would have to be careful with hyperlinks. They
>should not be absolute because in that case you run the risk of 'jumping
>out of the environment'. [This last point could of course be solved by
>taking the variable from cookies or even http header variables, but
>these are much more inflexible in changing context.]

That's all for now.

Best regards,
Kamon