New Foswiki release 2.1.6 is available with important security fixes.
Sourceforge foswiki email lists being discontinued. Subscribe to the new Foswiki announce and discuss lists at MailingLists

How can I SEARCH for topics which have some metadata (Eg. that I want to change?

IDEA! You may wish to check out:

  • JQGridPlugin, which gives an editable grid interface to your topics
  • MultiTopicSavePlugin, which doesn't currently have the feature to save metadata, but does work for formfield values. The author of the plugin would probably welcome a patch, or feature request.
  • Documentation for the /bin/save script, if you want to update parts of topics other than the metadata

Courtesy of the foswiki-discuss ML:

  1. Collect up a list of pages whose parent is a particular page?
  2. Collect up a list of pages whose parent page is in a particular web (say "Trash")?
  3. Given a list of pages, change the parent of the page to a given page?

We are going to use some techniques that are also used in Tasks.Item10874 which includes an example of a SEARCH that also renders a UI to help with bulk-updating values.

The problem for is almost exactly the same.

   "%URLPARAM{"query" default="NOT" encode="quote"}%"
   header="| *Topic* | *Parent* | *#* |"
   format="| [[$web.$topic]] | '$parent' | \
     <form action='%SCRIPTURL{"save"}%/$web/$topic' method='post'>\
       <input type='hidden' name='redirectto' value='%SCRIPTURL{"view"}%/%BASEWEB%.%BASETOPIC%?section=fix;query=%URLPARAM{"query" default="NOT"}%;parent=%URLPARAM{"parent" default="%HOMETOPIC%"}%#FixUp'/>\
       <input type='input' name='topicparent' class='foswikiInputField' value='%URLPARAM{"parent" default="%HOMETOPIC%"}%'/>\
       <input type='submit' class='foswikiSubmit' value='Update' display='inline'/>\
     </form> |"

Here's a UI that allows you to build a query expression and supply a value to set for bulk updating:
%STARTSECTION{"fix"}%<form action="%SCRIPTURLPATH{"view"}%/%WEB%/%TOPIC%#FixUp" method="GET">
  | Query | <input type="text" name="query" class="foswikiInputField" value="%URLPARAM{"query" default="NOT"}%"/> |
  | New parent | <input type="text" name="parent" class="foswikiInputField" value="%URLPARAM{"parent" default="%HOMETOPIC%"}%"/> |
  <input type="hidden" name="section" value="fix"/>
  <input type="submit" class='foswikiSubmit' value="Query"/>
%INCLUDE{"%TOPIC%" section="fixup"}%

Example queries to try:

   * Search for topics parented to a specific topic:
   * Search for topics parented to a topic in Trash web:
   * Search for topics with no topic parent, or an empty one:
      * NOT


New parent
Searched: NOT
Topic Parent #
Support.AttachContentPlugin ''
Support.AttachmentFilterPlugin ''
Support.BasicForm ''
Support.BestPracticeTip14 ''
Support.BioKbPlugin ''
Support.BookmakerPlugin ''
Support.CalDAVPlugin ''
Support.ClamAVScanPlugin ''
Support.CommercialSupport ''
Support.CompareRevisionsAddonPlugin ''
Support.ConsultantBlendedPerspectives ''
Support.ConsultantFosiki ''
Support.CreateInstallGuide ''
Support.DBIStoreContribSchemas ''
Support.DebianPackage ''
Support.DelayMacroPlugin ''
Support.DirectedGraphWebMapPlugin ''
Support.DistributedServersPlugin ''
Support.DownloadZipPlugin ''
Support.DuplicateNotificationsFromMailerCon ''
Support.ExpandTopicContentPlugin ''
Support.Extension ''
Support.ExtensionHub ''
Support.ExtensionTemplate ''
Support.ExtensionsRepositoryContrib ''
Number of topics: 25
Page 1 of 7 Next >

-- PaulHarvey - 08 Jul 2011

Great stuff Paul! Power/admin users will be most grateful.

-- FranzJosefGigler - 08 Jul 2011

Glad you think so! In fact I just used query of TopicClassification='SupplementalDoc' AND!='SupplementalDoc' to find mis-parented supplemental docs smile

Also fixed a bug where custom query/parent values weren't being carried across redirects.

-- PaulHarvey - 08 Jul 2011

This is very good. Much better than adjusting strikeone etc. IMO, things like this could very well be in the admin tools because there is a good treshold for new admins to make use of this and it's definitely a feature wanted.

-- LarsEik - 08 Jul 2011

Support.FAQForm edit

TopicClassification FrequentlyAskedQuestion
Subject Search
Topic Summary Demonstrate usage of SEARCH on with a way to more easily bulk-update pages.
Interested Parties
Related Topics
Topic revision: r5 - 27 Dec 2011, ArthurClemens - This page was cached on 20 Mar 2018 - 12:38.

The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License