Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-09 Thread Oleg Broytmann

Hello!

   Many thanks to all who replied! Sorry for late answer - twas XMas
holidays in Russia (Russian Orthodox church celebrates XMas Jan 7).

On Fri, 5 Jan 2001, Rik Hoekstra wrote:
> >If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
> > this HOWTO), and ADocument calls , what is acquisition
> > path for AMethod?
>
> what might come handy in your case is the howto "Shane's Aquisition
> Understander" at
>
>  http://www.zope.org/Members/chrisw/showaq
> it'll help you visualize the acquisition path from your document.

   I used it for sometime, sure...

> You may also want to look at my howto Changing Contexts in Zope
> http://www.zope.org/Members/Hoekstra/ChangingZopeContexts

   Read and reread it many times, sure. Cannot live without it :) The thing
that I didn't understand from this (and the thing is still cloudy) is that
there is One Acquisition Path for a request. When I call a Method through
the web, I have proper path, so I can call Documents and Methods from each
other. But when I call a Document through the web, I have "wrong" path -
static path, and when I try to call a Method from the Document, the Method
will use this static path. I thought the Method will use dynamic path,
based on request (URL). That was my mistake.

> Or Jim's acquisition algebra from a Python point of view of these matters:
> http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html

   Of course.

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-06 Thread Tim Cook

Oleg Broytmann wrote:

> 
>There are many Documents on my site, not only index_html. Should I make
> them all Methods? Why after this I need Documents at all?

The ONLY time I use a Document is, as a container for properties. 
For example a patient is seen by a doctor. The date/time, vital
signs etc. would be recorded in properties of a DTML Document.
The DTML code in the Document is used to display this information
anytime later.
(Okay, FreePM is really more complicated than that but it's the
basic idea. )


-- Tim Cook  --
Help the new U.S. President (and your Country).
Visit http://www.petitiononline.com/sphinx84/petition.html
Censorship: The reaction of the ignorant to freedom.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Dieter Maurer

Oleg Broytmann writes:
 >Can anyone here explain clearly what is the difference between DTML
 > Methods and DTML Documents regarding acquisition?
I think, I gave a good answer to a similar question
in zope-dev recently --> searchable list archive.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Rik Hoekstra

> On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
> > http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo
> > saved my life.
>
>Thanks. I'be read it yesterday. It does not help much because it does
> not answer my question:
>
>If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
> this HOWTO), and ADocument calls , what is acquisition
> path for AMethod?

Oleg,

what might come handy in your case is the howto "Shane's Aquisition
Understander" at

 http://www.zope.org/Members/chrisw/showaq

it'll help you visualize the acquisition path from your document.

You may also want to look at my howto Changing Contexts in Zope
http://www.zope.org/Members/Hoekstra/ChangingZopeContexts

Or Jim's acquisition algebra from a Python point of view of these matters:

http://www.zope.org/Members/jim/Info/IPC8/AcquisitionAlgebra/index.html


hth

Rik


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Dario Lopez-Kästen

Hello!

I think hade a similar problem. It seems that you can only use methods for
acquisition, not documents.

I had an index_html DOC where I specified the structure of my site. In
index_html I used  that and in some_doc I once .

The idea was that in my subfolers I only needed to have the objects some_doc
and other_doc, and that I would use the structure from the index_html higher
up. This way I could provide "modules" to managers of subfolders, so they
need not to concern themselvs with the proper way of setting up their
index_html.

It didn't work unitl I changed index_html and all other objects from
dtml-docs to dtml-methods. Otherwise I would always end up with the parent
(in my case the root level) documents. I wanted to have DTML-documents in
the firts place, because I noticed that in dtml-methods the  call has no effect; it does not use the methods title_or_id, it
uses the toplevel (or the calling documents) title_or_id.

Is this a similar situation to yours?

/dario

- Original Message -
From: "Oleg Broytmann" <[EMAIL PROTECTED]>

>
>There are many Documents on my site, not only index_html. Should I make
> them all Methods? Why after this I need Documents at all?
>
> Oleg.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 17 h 58, the keyboard of Oleg Broytmann 
<[EMAIL PROTECTED]> wrote:

>There are many Documents on my site, not only index_html. Should I make
> them all Methods? Why after this I need Documents at all?

Because not all documents are acquired (from an above folder). For index_html, for 
instance, it is common to have a different index_html (and in that case a document) in 
each folder. 




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 12 h 26, the keyboard of Oleg Broytmann 
<[EMAIL PROTECTED]> wrote:

>When I call standard_html_header directly through the web, it acquires
> foobar using dynamic acquisition path:

Actually, if I understand it myself :-) it acquires foobar because a method 
has no poperties, so it looks first in the innermost container, the folder 
TEST or TEST/2.

> But then I call standard_html_header from DTML Document index_html:

In that case, you start the acquisition with the document index_html (reread 
the HOWTO : 
the acquisition can start from a document or a folder, not from a method).

> http://phd.russ.ru/pcgi/TEST/index_html
>show foobar from root (/TEST); exactly as I expected, no problem
> http://phd.russ.ru/pcgi/TEST/2/index_html
>WOW! It show foobar again from root, not from /TEST/2!
> standard_html_header acquires using static path provided by index_html!

You started acquisition from index_html. Since it has no foobar, it looked 
into its own container, /TEST, then in root.

>Is it normal and intended behaviour? If it is, how can I "solve" my
> problem? (I want to acquire different properties in standard_html_header,
> but call standard_html_header from different DTML Documents).

You can but the "problem" in your case, comes from the acquisition of an index_html 
document in a different folder. I suggest to add index_html documents in every folder 
*or* make index_html a method (this is what I use).



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Oleg Broytmann

On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
> > http://phd.russ.ru/pcgi/TEST/2/index_html
> >WOW! It show foobar again from root, not from /TEST/2!
> > standard_html_header acquires using static path provided by index_html!
>
> You started acquisition from index_html. Since it has no foobar, it looked
> into its own container, /TEST, then in root.

   Exactly as I wrote - in this situation standard_html_header acquires
using static path provided by index_html :(

> You can but the "problem" in your case, comes from the acquisition of an
> index_html document in a different folder. I suggest to add index_html
> documents in every folder *or* make index_html a method (this is what I
> use).

   There are many Documents on my site, not only index_html. Should I make
them all Methods? Why after this I need Documents at all?

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Oleg Broytmann

On Fri, 5 Jan 2001, Stephane Bortzmeyer wrote:
> http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo
> saved my life.

   Thanks. I'be read it yesterday. It does not help much because it does
not answer my question:

   If I call http://machine:port/top/middle/AFolder/ADocument (in terms of
this HOWTO), and ADocument calls , what is acquisition
path for AMethod?

   I showed an example, where AMethod do acquisition using static path, and
I think it is a bug. Or, may be, just my misunderstanding...

Oleg.

 Oleg Broytmann http://www.zope.org/Members/phd/ [EMAIL PROTECTED]
   Programmers don't die, they just GOSUB without RETURN.


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Acquisition: DTML Methods vs Documents

2001-01-05 Thread Stephane Bortzmeyer

On Friday 5 January 2001, at 12 h 26, the keyboard of Oleg Broytmann 
<[EMAIL PROTECTED]> wrote:

>Can anyone here explain clearly what is the difference between DTML
> Methods and DTML Documents regarding acquisition?

Not me but this HOWTO:

http://www.zope.org/Members/michel/HowTos/DTMLMethodsandDocsHowTo

saved my life.



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )