Upgrading user topics to use the form fields rather than bullet fields.
To take advantage of the advanced processing and ease of use of user data in form fields, all existing user topics need converting from " * Field: value" to META:FIELD values.
Can someone please advise whether there is an API in Form or elsewhere that allows me to get the list of fields defined in the
UserForm? We need a converter that:
- Moves any field defined in UserForm from the bullet list into a META:FIELD
%META:FIELD{name="Location" attributes="" title="Location" value=""}%
- Adds the UserForm to the user topic
%META:FORM{name="UserForm"}%
- Locks the home topic
Set ALLOWTOPICCHANGE=whatever
- Adds
%META:PREFERENCE{name="VIEW_TEMPLATE" title="VIEW_TEMPLATE" type="Local" value="UserView"}%
This code, resembling
renderForDisplay
looks like the way to go... am I right? Has anyone code that will set up the TWiki environment from the command line?
my $form = $meta->get( 'FORM' );
return '' unless( $form );
my $name = $form->{name};
my @fields = $meta->find( 'FIELD' );
foreach my $field ( @fields ) {
Thanks.
M.
There is no such API, but if it makes sense, then add one.
Regrading to enhancement.
CC
Untouched for aeons, no longer relevant.
CC