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
This question about Using an extension: Answered

How to use PublishPlugin's regex filter setting?

The PublishPlugin offers a filter that seems very useful, but I need help to understand how to use it right:
Filter topic contents (regex)
A regular expression that will cause a topic to be excluded if the RE matches the topic content. Leave blank to include all topics.

I want to filter not by topic text, but by a certain DataForms field value: I've got a form named DocumentationForm which contains the field DocumentationStatus. I want to exclude pages with DocumentationStatus = DraftStatus.

How do I enter this as a regex filter? I have no experience with regex, but I'm willing to try!

I already have a search macro that correctly lists all my draft pages:
%SEARCH{ type="query" "DocumentationForm[name='DocumentationStatus'].value='DraftStatus'"

So I would expect that when I put this:

into the publishing form field, then these matches would be excluded, but they seem to be included.

So I still a little help getting this to work.

-- TorbenGB - 04 Oct 2010

I found that the regex filter apparently only looks for matches in the topic body, not in the topic metadata. Is this true?

I want to exclude those topics from publishing that have the meta field:
%META:FIELD{name="DocumentationStatus" attributes="M" title="DocumentationStatus" value="DraftStatus"}%

I don't know how to achieve that, except that I could copy the web in question, and delete all the draft topics, then start the publishing process in that copied-and-trimmed web. Ugly and tedious, but it would probably work...

-- TorbenGB - 04 Oct 2010

I still need an answer and my own experiments have not revealed more than what I've already written above. - 17 Nov 2010


I don't have an answer for your regex question, but to accomplish your task you should be able to use a negated form of your %SEARCH% in the topiclist parameter.

-- DiabJerius - 04 Apr 2011

Thank you very much for your answer; my question is still relevant to me so you've already helped me!

It's a good idea to use a %SEARCH in the topic list, I'll have to test it with a search for topics that have DocumentationStatus = FinalStatus. Some of my pages don't have any form, so I need to find a way to somehow include both "FinalStatus" and "no form" in the topic list.


-- TorbenGB - 04 Apr 2011

  1. Only the text body of the topic is searched. regex searchs of embedded meta-data are not supported.
  2. Use the standard %SEARCH{type="query" to build a list of topics you are interested in publishing, and feed that list to the PublishPlugin (in the topiclist parameter).
-- CrawfordCurrie - 03 Aug 2011

RE: Use the standard =%SEARCH= -- AHA! So that was the part I was missing. I should've tested that way too. Thank you Crawford!

-- TorbenGB - 03 Aug 2011

QuestionForm edit

Subject Using an extension
Extension PublishPlugin
Version Foswiki 1.0.9
Status Answered
Related Topics
Topic revision: r12 - 03 Aug 2011, TorbenGB - This page was cached on 14 Aug 2018 - 19:29.

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