[Zope] Users editing properties -- howto?
Tino Wildenhain
tino@wildenhain.de
Thu, 17 May 2001 09:37:37 +0200
Hi Leigh Ann,
first of all, what you want to do is not so hard as it might
look like at first. However, it requires some steps which
to describe in depth is not done in a few words in a mail.
So I can only point you in the direction.
If you dont want to have logins, you can either give the annoymous
user the right to change Properties and such or give the DTML Methods
the proxy role to do so (this is better)
You need some basic forms to edit the properties.
Your objects have methods to manipulate their properties like that:
manage_addProperty(id,value,type)
where id is the name of the property you want to create, value is
obviously the value and type is what you can select on the management-
interface (look there)
manage_changeProperties(REQUEST)
this changes the value of some properties which are already created and
which have matching values in the REQUEST
The values can get into the REQUEST object either by a form:
<input type="string" name="mynumber:int">
would result in an integer value assigned to the name "mynumber"
in REQUEST.
If you habe a property with this name, the above method would assign
the value to it.
You can also use manage_changeProperties(mynumber=5)
instead of this.
To search in your objects you could use the ZCatalog.
I believe this is all covered in the zope-book much
better then I would be able to do it here in the mail so
please look there.
See http://zdp.zope.org/ for more info.
HTH
Tino Wildenhain
--On Mittwoch, 16. Mai 2001 21:32 -0700 Leigh Ann Hildebrand
<leighann@onebox.com> wrote:
> Some background: I'm using Zope to create and manage an internal document
> library for engineers and developers. Because of the circumstances,
> website security isn't an issue; I don't have to require logins for
> users. I work in dtml only right now -- no python. I have only been doing
> so for a couple of weeks. I'm not a programmer. (Translation: use small
> words and don't assume I know how to do basic things yet!)
>
> I've been asked to implement a keyword indexing/search feature. Documents
> are currently represented by dtml documents, with a "keywords" property
> of the type "tokens". I'm listing the keywords at the top of documents,
> by referencing <dtml-var keywords>.
>
> I'd like for users to be able to use an "Add" feature to add a keyword
> to a document if they feel one is missing. That would involve an "Add
> keyword?" link, I guess. The result would be that the keyword property
> for that document would be modified.
>
> Can anyone offer suggestions/examples for doing this? Are there problems
> with it? (Other than the problems with keyword indexing in general,
> please.) Is there some more elegant way to handle this, that I, as a
> non-python person Zope newbie, could handle?
>
> Thanks!
>
> Leigh Ann
>
> --
> Leigh Ann Hildebrand
> leighann@onebox.com - email
> (650) 223-2199 x2231 - voicemail/fax
>
>
>
> __________________________________________________
> FREE voicemail, email, and fax...all in one place.
> Sign Up Now! http://www.onebox.com
>
>
> _______________________________________________
> Zope maillist - Zope@zope.org
> 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 )