[Zope] Re: [Zope]Newbie: manage_changeProperties and wrong permission

Milos Prudek milos.prudek@worldonline.cz
Wed, 20 Dec 2000 12:40:31 +0100


Sven Hohage wrote:
> 
> Hallo Milos,
> I'm not sure if I understand your problem right.
> First of all what do you mean with 'Fir-class'?Is it a ZClass or a
> usual Zope-Folder.I suppose a Zope-Folder!.

Oh no. "Fir" is a Product, with a single Z Class "Fir". Within Fir there
are two folders and three methods:

Products
+-- Fir               (product)
+----Fir              (Z Class)
+------cz             (folder)
+--------lst_name     (property of cz folder)
+--------lst_text     (property of cz folder)
+------en             (folder)
+--------lst_name     (property of cz folder)
+--------lst_text     (property of cz folder)
+------changeLST_form (method)
+------changeLST      (method)
+------display        (method)

> You have to call the method "manage_changeProperties" on an Object.

An object in my case is a property "lst_name" in "cz" folder.

After creating an instance called AAA of Fir ZClass, I can access the
"display" method:

http://.....AAA/cz/display

The "display" method simply contains just <dtml-var lst_name>. Depending
on the URL, it displays the "cz/lst_name" or "en/lst_name".

Using the same acquisition thinking, the "changeLST" method contains 
<dtml-call
expr="manage_changeProperties(lst_name=REQUEST['lst_name_new'])">
where "lst_name_new" is obtained from a trivial form. I thought that
"changeLST" would change the "cz/lst_name" property when called with
http://.....AAA/cz/changeLST.


> This should work: <dtml- call expr="cz.manage_changeProperties({'lst_name':lst_name_new})">

Unfortunately this would require to write many almost identical
changeLST methods: one with cz.manage_changeProperties, one with
en.manage_changeProperties, and there are many more language versions.

As you may have guessed this is a database where every record contains
many identical fields (name, text, etc.) for many languages. Like this:

+--cz
+----lst_name
+----lst_text
+--en
+----lst_name
+----lst_text
+--de
+----lst_name
+----lst_text
+--ru
+----lst_name
+----lst_text

The idea is that once a new user selects her preferred language (and a
Cookie is set for her), she is transferred to a starting url
"http://www.website.org/de/start.htm" and from there she can access the
database in her language by simple acquisition, without the need for
having each method in many "language" versions, like I said above.

I may figured it wrong. Is there a more clever way to do this?

--
Milos Prudek