Is it possible to filter on a literal string (ignoring metacharacters) using the Reporting Plugin?
I'm using the replace-and-render macro to insert the page name into a text-filter. This works just fine until the page name includes the following characters: '(' or ')'... The text-filter macro uses regular expressions to include results which is great, but I can't find any way of controling the filter to perform a literal string match, ignoring any special meaning that regular expression assigns to certain characters. Example below. I'd be happy to hear about any way to achieve the same result!
{replace-and-render}
{replace-item:%page_title%}{report-info:content:title}{replace-item}
{replace-body}
{report-on}
{report-table:injected=true}
{combining-reporter:matchAll=false}
{local-reporter:content:children|source=Documentation}
{text-sort:content:title}
{collection-filter:data:doc_description|matchItems=any}
{text-filter:reference:value|include=%page_title%}
{collection-filter}
{local-reporter}
{local-reporter:content:children|source=Documentation}
{text-sort:content:title}
{collection-filter:data:doc_keywords|matchItems=any}
{text-filter:reference:value|include=%page_title%}
{collection-filter}
{local-reporter}
{combining-reporter}
{report-column:title=Document}{report-info:content:title|link=true}{report-column}
{report-column:title=Document Description}{report-info:data:doc_description}{report-column}
{report-empty}_No documents found._{report-empty}
{report-table}
{report-on}
{replace-body}
{replace-and-render}
{replace-and-render}
{replace-item:%page_title%}{report-info:content:title}{replace-item}
{replace-body}
{report-on}
{report-table:injected=true}
{combining-reporter:matchAll=false}
{local-reporter:content:children|source=Documentation}
{text-sort:content:title}
{collection-filter:data:doc_description|matchItems=any}
{text-filter:reference:value|include=%page_title%}
{collection-filter}
{local-reporter}
{local-reporter:content:children|source=Documentation}
{text-sort:content:title}
{collection-filter:data:doc_keywords|matchItems=any}
{text-filter:reference:value|include=%page_title%}
{collection-filter}
{local-reporter}
{combining-reporter}
{report-column:title=Document}{report-info:content:title|link=true}{report-column}
{report-column:title=Document Description}{report-info:data:doc_description}{report-column}
{report-empty}_No documents found._{report-empty}
{report-table}
{report-on}
{replace-body}
{replace-and-render}
2
people have this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
The company marked this question as answered.
The best answer from the company
-
You should be able to use the standard Regexp 'quote' pattern. Here, you'll have to quadruple-escape the backslash (due to macro and Regexp escaping the '\' character), unfortunately, but it will look something like this:
{text-filter:reference:value|include=\\\\Q%page_title%\\\\E}
The company and 1 other person say
this answers the question
-
Inappropriate?You should be able to use the standard Regexp 'quote' pattern. Here, you'll have to quadruple-escape the backslash (due to macro and Regexp escaping the '\' character), unfortunately, but it will look something like this:
{text-filter:reference:value|include=\\\\Q%page_title%\\\\E}
The company and 1 other person say
this answers the question
-
Inappropriate?By the way, your {report-on} surrounding the report is redundant - it's not actually doing anything in this case. You could set 'injected=true' to do injection using {report-on} rather than {replace-and-render} if you wish.
-
Inappropriate?Thanks for the fast reply - I'm sure I had tried this, but after closer inspection and checking everything else thoroughly it works just fine! Thanks!
I’m thankful
-
Inappropriate?Super helpful ... once again David :)
For the beginners out there ... if you actually want to use the page name using the injected = true option as David outlines above, you should use the following syntax:
{text-filter:reference:value|include=\\\\Q%page:title%\\\\E} -
Inappropriate?I tried the syntax with
{text-filter:reference:value|include=\\\\Q%page:title%\\\\E}
but it did not work.
{text-filter:reference:value|include=.*%page:title%.*}
works but sometimes matches too much, as you can guess.
is the \\\\Q-Syntax depending on any versions?
We are currently running Confluence 3.0.0_01
Thanks in advance,
Christian
As I see by now is that I'm not filtering on a reference but on a text-data-field:
{text-filter:data:Server|include=\\\\Q%page:title%\\\\E}
I’m frustrated
-
Hi Christian, I don't think there were any particular version restrictions on that. You could try it with just two '\\' in front, might make a difference, but I wouldn't expect it to.
What's your full wiki markup for the report? -
Inappropriate?Hello David,
thanks for the fast reply. I was just about to update my comment as i found the solution:
The data-field, I'm using is a page reference - resulting out of a list-data macro with a list of content-options - , so I had to use the following syntax:
{text-filter:data:Server > page:title|include=\\\\Q%page:title%\\\\E}
Thanks - and, your plugins are great!
Christian
I’m excited
-
Yeah, I was wondering if it might be something like that. My favourite problems are the ones that people fix themselves. :-D
Loading Profile...



EMPLOYEE
