Forum OpenACS Q&A: Re: XOWiki and Categories

Collapse
3: Re: XOWiki and Categories (response to 1)
Posted by Carl Lemp on

Thank you Gustaf.
That definitely helps and is even better than the original XOWiki use of categories for my purposes. I have not looked at the form constraints yet but I will now.

In your post, what does the @cr_fields:hidden do? I looked in the documentation and found this:

    The form constraints refer not only to form.fields, but use a few 
    special field names starting with an at-sign for  other purposes as 
    well.

    @cr_fields: assign properties to all content repository fields
    For example: @cr_fields: hidden is a short form of
    _name:hidden _creator:hidden _title:hidden _description:hidden nls_language:hidden

    @fields: symbolic name for all user fields
    @categories: turn categories optionally off for form entries of  this form
    @table: specify, which form fields should be included in the summary table

but I'm new to OpenACS so that didn't help me understand it. The only use I found in the XOWiki source was in:

  form-usages instproc generate_voting_form

and that didn't help either.

Thanks, Carl

Collapse
4: Re: XOWiki and Categories (response to 3)
Posted by Gustaf Neumann on
Dear Carl,

i've reformatted your posting lightly to increase readability.

Concerning @cr_fields: The term refers to the fields of the content repository, which are part of every content repository entry ("name", "title", "description", "nls_language", and also the "creator" field, which is defined in xowiki::Page). Since form pages extend these pages with arbitrary additional attributes, these native names of the content repository are prefixed with an "_" to allow same-named fields for extending as well. So, instead of defining in the form_constraints attributes for all of these fields, one can use the short-form @cr_fields. This is just a convenience for the developer.

The meaning of "hidden" in this case is, that when one edits such a page, the edit page does not render input fields, but hidden fields. If "omit" is specified, these fields will be omitted.

if you look for the source code, see e.g. "xowiki-www-procs.tcl", where the value of this entry is passed in `-field_spec`. Typically, this value is set in user-level forms.