Skip to content

Commit

Permalink
Item9934: try to add a little redundancy of information, and clarify …
Browse files Browse the repository at this point in the history
…that complex structures are not returned by default. - feedback on actual function appreciated

git-svn-id: http://svn.foswiki.org/trunk@9814 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
SvenDowideit authored and SvenDowideit committed Nov 1, 2010
1 parent 24d8d94 commit f82453f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions core/data/System/VarQUERY.txt
Expand Up @@ -2,7 +2,7 @@
%META:TOPICPARENT{name="Macros"}%
#VarQUERY
---+++ QUERY -- get the value of meta-data
* Uses the query syntax described in [[System.QuerySearch][QuerySearch]] to get information about meta-data.
* Uses the query syntax described in [[System.QuerySearch][QuerySearch]] to get information about meta-data from one specified topic.
* supports formatted access to formfields and other meta-data in topics using the same syntax as is used in =IF= and =SEARCH= statements,
* gives access to *all* meta-data, including that added by extensions,
* supports reporting values using JSON and other standards, simplifying the retrieval of meta-data for REST applications,
Expand Down Expand Up @@ -36,10 +36,10 @@
%<nop>QUERY{"{NameFilter}"}%</pre>
Plain strings (such as field values) are returned _without_ quotes. Simple arrays of scalars are also returned without quotes, in a comma-separated list (beware of values that contain commas!).

More complex data structures (e.g. arrays of hashes) will be returned as Perl code strings generated by running through CPAN:Data::Dumper.
More complex data structures (e.g. arrays of hashes) will only be returned if =style="perl"= or =style="json"= are set - else will return a string containing 'undef'.

You can make the macro generate different output formats using the =style= parameter:
* =style="perl"= - generates values as Perl code strings
* =style="perl"= - generates values as Perl code strings generated by running through CPAN:Data::Dumper
* =style="json"= - generates values as JSON strings, suitable for reading by browsers.

Only some configuration settings are available via QUERY: %FORMAT{"%QUERY{"{AccessibleCFG}"}%" type="string" format="=$item=" separator=", "}%
Expand Down

0 comments on commit f82453f

Please sign in to comment.