nuxeo-localizer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nuxeo-localizer] Question re: using manage_editLocalProperty


From: Juan David Ibáñez Palomar
Subject: Re: [Nuxeo-localizer] Question re: using manage_editLocalProperty
Date: Mon, 05 Aug 2002 10:14:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.0) Gecko/20020610 Debian/1.0.0-1

Hi Michael,


The code you've sent has a DTML method for the form which is
also the action, right?

Well, this is not a good idea, usually you do the form in DTML
and the action of the form in Python, which modifies the objects
and does a redirect back to the form. Try this approach.


Regarding the Localizer API to be used..

* For LocalPropertyManager

 From unrestricted code you can use a lower level API, for
 example:

   ob._setLocalPropValue('title', 'en', 'hello world')

 The parameters are the id of the local property, the language
 being updated and the version for that language. Other related
 methods are '_setLocalProperty' and '_delLocalProperty'.

 From restricted code you've to use:

   ob.manage_editLocalProperty('title', {'en': 'hello world'})


* For the message catalog

 The method to be used is 'manage_editMessage', like this:

   manage_editMessage('hello world', 'es', 'hola mundo')

 The parameters are the message to be translated, the language
 of the translation and the translation itself. Other related
 methods are 'manage_delMessage'.


Looking for the solution to your problem I've seen that the API
needs to be improved.


Another thing, are you working from restricted or unrestricted
code?, that is, are you developing your application through the
web or are you building a Python product? You'll get a more
accurate answer if I've this information.




Cheers,



Michael Stuempel wrote:

Hi,

I'm hoping I can get some help with this problem. I'm a newbie to Zope
and to Localizer (although I'm learning that both are great!) and have
run into a problem that's had me running in circles over the last couple
of days.

I want to create a form to edit both the Message Catalog and the Body of
the localizer text. However, I don't want to use the built in zope
management interface. I need to have a way for an authenticated user to
make the edits, but I can't have them seeing all the other tabs that the
regular interface throws up. I've created a form (see below) which gets
the correct information from both Message Catalog and from the body of
the object. This populates the form correctly (including language) and I
can make changes to that text, however I can't figure out a way to
update the actual objects.
The form basically pulls in data from the object to be edited from the
body of html_content and then from the Message Catalog. Once SUBMIT is
pressed, the form reloads going to the TRUE case of the <dtml-if>. At
the moment the text 'submitting...' is being shown on the rendered page.
I need to have it update the Message Catalog, update the body of
html_content and then redirect itself to the original page to edit,
showing the updated text.

I've been trying to use manage_editLocalProperty, but can't seem to get
the correct variables/objects passed for the call to work. Does anyone have any advice on how to get this to work?
Thanks in Advance,

 --Michael




--
J. David Ibáñez, http://www.j-david.net
Software Engineer / Ingénieur Logiciel / Ingeniero de Software





reply via email to

[Prev in Thread] Current Thread [Next in Thread]