Tags:
create new tag
view all tags

SID-01171: Good method or example to update form fields in Contrib

Status: Answered Answered TWiki version: 4.3.1 Perl version: 5.8.8
Category: CategoryAPI Server OS: AIX 5.3 Last update: 14 years ago

I'm writing a contrib (batch job) which will read some XML and update or create some form fields in a topic. I'm not sure of the best way to modify the form fields. I can readTopic, getFormName, getField, putKeyed, etc., but I don't seem to have the order right, or if there is a cleaner existing function. If someone could suggest a good existing module out there I can use as a model, I would appreciate it!

-- AaronLWalker - 2011-05-11

Discussion and Answer

Look into the source code of EditHiddenTablePlugin, EditTablerowPlugin, RestPlugin, WorkflowPlugin, XpTrackerPlugin.

Example:

    my( $topicMeta, $topicText ) = TWiki::Func::readTopic( $web, $topic );
    my $field = $topicMeta->get( 'FIELD', 'Title' );
    if( $field ) {
        $field->{value} = $newTitle;
        $topicMeta->putKeyed( 'FIELD', $field );
    }
    TWiki::Func::saveTopic( $web, $topic, $topicMeta, $topicText );

-- PeterThoeny - 2011-05-12

Aaron, please consider writing a blog post on twiki.org on how TWiki helps your organization. More at BlogIdeas.

-- PeterThoeny - 2011-05-12

I may. I've thought about it, but it's rather a battle here against... "competing" products, such that I fear I may get myself into trouble. And administering TWiki is completely peripheral to what I do, so time is limited smile I'll think about it. Thanks for the help, as always! Hopefully I'll change the status on this in a day or so.

-- AaronLWalker - 2011-05-12

      Change status to:
ALERT! If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.
SupportForm
Status Answered
Title Good method or example to update form fields in Contrib
SupportCategory CategoryAPI
TWiki version 4.3.1
Server OS AIX 5.3
Web server IBM IHS
Perl version 5.8.8
Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r3 - 2011-05-12 - AaronLWalker
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.