<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://camnet.oetterer.eu/index.php?action=history&amp;feed=atom&amp;title=Modul%3ACargoUtil%2Fdoc</id>
	<title>Modul:CargoUtil/doc - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://camnet.oetterer.eu/index.php?action=history&amp;feed=atom&amp;title=Modul%3ACargoUtil%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;action=history"/>
	<updated>2026-10-30T23:46:50Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in CamNet</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=5944&amp;oldid=prev</id>
		<title>imported&gt;Oetterer am 9. April 2022 um 21:45 Uhr</title>
		<link rel="alternate" type="text/html" href="https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=5944&amp;oldid=prev"/>
		<updated>2022-04-09T21:45:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 9. April 2022, 22:45 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;de&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(kein Unterschied)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>imported&gt;Oetterer</name></author>
	</entry>
	<entry>
		<id>https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=5683&amp;oldid=prev</id>
		<title>imported&gt;Oetterer am 17. Mai 2016 um 10:08 Uhr</title>
		<link rel="alternate" type="text/html" href="https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=5683&amp;oldid=prev"/>
		<updated>2016-05-17T10:08:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;de&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Nächstältere Version&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Version vom 17. Mai 2016, 11:08 Uhr&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l112&quot;&gt;Zeile 112:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 112:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see, the data fields can be indexed either by number or by the provided headline in table &amp;#039;&amp;#039;fields&amp;#039;&amp;#039;. (The headline is either the fieldname or a special string you provided via &amp;#039;&amp;#039;fieldname=headline&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;As you can see, the data fields can be indexed either by number or by the provided headline in table &amp;#039;&amp;#039;fields&amp;#039;&amp;#039;. (The headline is either the fieldname or a special string you provided via &amp;#039;&amp;#039;fieldname=headline&amp;#039;&amp;#039;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;=== queryParserHelper(frame) ===&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;The is a query helper function invoked by the template used by [[#query(query, attributes, retainBlanks)|the query function]]. It formats the query result fields in a unique way, so that the query function can easily construct a table from your request.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;frame&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:object, mandatory&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:the frame object, supplied by the template&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;;return&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;:string, formatted query result fields&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== rawquery(query, attributes) ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== rawquery(query, attributes) ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l172&quot;&gt;Zeile 172:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Zeile 163:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;return&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;;return&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:string, return values of the store call&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;:string, return values of the store call&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;== The Helper Template ==&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;In order for the [[#query(query, attributes, retainBlanks)|query funtion]] to work, you need to have a helper template created that invokes the [[#queryParserHelper(frame)|queryParserHelper]] function. If not present, please navigate to {{tl|CargoUtilQueryParserHelper}} and provide the following content:&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{code|lang=html4strict|code=&amp;lt;nowiki&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- Start your template code here. for tipps and tools for template development, please refer to our help-section --&gt;{{#invoke:CargoUtil|queryParserHelper}}&amp;lt;!--Last line of your template code--&gt;&amp;lt;noinclude&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{{documentation|content=This is a helper template that prepares the output of a cargo query so it can easily be parsed in a lua table. See [[Module:CargoUtil]] for more information.}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- Add categories to the /doc subpage, not here! --&gt;[[Category:Query templates]][[Category:Metatemplates]][[Category:Class engine]]&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/noinclude&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/nowiki&gt;|3=no}}&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Class engine]]&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:Class engine]]&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>imported&gt;Oetterer</name></author>
	</entry>
	<entry>
		<id>https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=38&amp;oldid=prev</id>
		<title>mw&gt;Oetterer am 12. Januar 2016 um 18:34 Uhr</title>
		<link rel="alternate" type="text/html" href="https://camnet.oetterer.eu/index.php?title=Modul:CargoUtil/doc&amp;diff=38&amp;oldid=prev"/>
		<updated>2016-01-12T18:34:48Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Neue Seite&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{documentation subpage}}&lt;br /&gt;
{{module rating|protected}}&lt;br /&gt;
&amp;lt;!-- Categories go at the bottom of this page and interwikis go in Wikidata. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This module provides serveral useful function that can be used in other module to store or retrive data operating a cargo store.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{code|lang=lua|code=&lt;br /&gt;
local _CARGO = require(&amp;#039;Module:CargoUtil&amp;#039;)&lt;br /&gt;
if dataStore == &amp;#039;cargo&amp;#039; and mw.title.getCurrentTitle().namespace == 10 then&lt;br /&gt;
	-- create table declaration, then call&lt;br /&gt;
	_CARGO.declare(&amp;#039;tablename&amp;#039;, declaration)&lt;br /&gt;
end&lt;br /&gt;
if stash then&lt;br /&gt;
	_CARGO.store(&amp;#039;tablename&amp;#039;, stash)&lt;br /&gt;
end&lt;br /&gt;
local query = {&lt;br /&gt;
	tables = {&amp;#039;table1&amp;#039;}&lt;br /&gt;
	fields = {&amp;#039;_pageName&amp;#039;, &amp;#039;_ID&amp;#039;, &amp;#039;field1&amp;#039;}&lt;br /&gt;
	where = {&amp;#039;field1=&amp;quot;hello world&amp;quot;&amp;#039;, &amp;#039;_ID &amp;gt; 1&amp;#039;}&lt;br /&gt;
	order = {&amp;#039;_ID ASC&amp;#039;, &amp;#039;_pageName DESC&amp;#039;}&lt;br /&gt;
}&lt;br /&gt;
local attributes = {&lt;br /&gt;
	limit = 1&lt;br /&gt;
}&lt;br /&gt;
local result = _CARGO.query(query, attributes)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
Provided functions are as follow:&lt;br /&gt;
&lt;br /&gt;
=== declare(dbtable, declaration) ===&lt;br /&gt;
Calls #cargo_declare with the provided parameter. Note that this parser function must be called (and therefore placed) on the template page, that later fills the table via [[#store(dbtable, data)|store(dbtable, stash)]]. See [[#Usage|Usage]]-example above. Please refer to the [https://www.mediawiki.org/wiki/Extension:Cargo/Storing_data#Declaring_a_table Cargo documentation page] fore more information about declaration options.&lt;br /&gt;
{{ambox|type=content|text=Warning: The declaration must be done on the template page and cannot be placed inside a &amp;amp;lt;includeonly&amp;amp;gt;-tag because in template space it creates a link in the toolbox (where you can also find &amp;quot;move&amp;quot; and &amp;quot;protect&amp;quot; buttons) to create the table. You have to do this in order to store data.}}&lt;br /&gt;
;dbtable&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:takes the name of the database table that should be declared&lt;br /&gt;
;declaration&lt;br /&gt;
:table or string, mandatory&lt;br /&gt;
:holds the declaration. if provided a table, it must be formatted {{code snippet|lang=lua|code={fieldName : &amp;#039;declaration&amp;#039; } }}&lt;br /&gt;
;return&lt;br /&gt;
:string, return values of the declaration call&lt;br /&gt;
&lt;br /&gt;
=== query(query, attributes, retainBlanks) ===&lt;br /&gt;
Runs a query on the cargo store according to the parameters provided and returns the result as a lua-table. The first parameter (query) has the following mandatory fields:&lt;br /&gt;
;tables&lt;br /&gt;
:table or string, mandatory&lt;br /&gt;
:the name(s) of the table(s) to query data from&lt;br /&gt;
;fields&lt;br /&gt;
:table or string, mandatory&lt;br /&gt;
:the fields, you want to get data from. format is &amp;#039;&amp;#039;fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;fieldname=headline&amp;#039;&amp;#039;. In case of more than one table, please use &amp;#039;&amp;#039;tablename.fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;tablealias.fieldname&amp;#039;&amp;#039;&lt;br /&gt;
;joins&lt;br /&gt;
:table or string, mandatory if you have more than one table. you need one join statement for each table after the first&lt;br /&gt;
:the list of join statements&lt;br /&gt;
Also, there are several optional fields:&lt;br /&gt;
;where&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:you can filter the results with where clauses&lt;br /&gt;
;group&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:the group statements&lt;br /&gt;
;having&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:filter your query, similar to WHERE, but applies to values computed for &amp;quot;groups&amp;quot;&lt;br /&gt;
;order&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:the fields, you wish to sort the result for.  please use &amp;#039;&amp;#039;tablename.fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;tablealias.fieldname&amp;#039;&amp;#039;&lt;br /&gt;
Please keep in mind:&lt;br /&gt;
* attributes may contain any attribute you find in the documentation, but &amp;#039;&amp;#039;intro&amp;#039;&amp;#039; and &amp;#039;&amp;#039;outro&amp;#039;&amp;#039; will be NILed, &amp;#039;&amp;#039;default&amp;#039;&amp;#039; and &amp;#039;&amp;#039;more results text&amp;#039;&amp;#039; will be set to the empty string, and &amp;#039;&amp;#039;format&amp;#039;&amp;#039; will be overwritten&lt;br /&gt;
* per default, does only return fields that contain a value. that can result in an &amp;quot;unbalanced&amp;quot; result, where one row contains more elements than others. if you want to get all fields, set &amp;lt;code&amp;gt;retainBlanks&amp;lt;/code&amp;gt; to true&lt;br /&gt;
;query&lt;br /&gt;
:table, mandatory&lt;br /&gt;
:the arguments to construct the query. see above for details&lt;br /&gt;
;attributes&lt;br /&gt;
:table, optional&lt;br /&gt;
:more attributes, you want to pass on to the query (like limit, for instance)&lt;br /&gt;
;retainBlanks&lt;br /&gt;
:boolean, optional&lt;br /&gt;
:if set to true, result can contain entries with empty values. per default, these entries will be deleted&lt;br /&gt;
;return&lt;br /&gt;
:table, see the following printout as example&lt;br /&gt;
&lt;br /&gt;
The result has the following format:&lt;br /&gt;
&amp;lt;-- cut&lt;br /&gt;
1:&lt;br /&gt;
		1 = &amp;#039;Extension:Cargo&amp;#039;&lt;br /&gt;
		2 = &amp;#039;7&amp;#039;&lt;br /&gt;
		3 = &amp;#039;901&amp;#039;&lt;br /&gt;
		4 = &amp;#039;Cargo provides a lightweight way to store and query the data contained within the calls to templates, such as infoboxes in mysql tables.&amp;#039;&lt;br /&gt;
2:&lt;br /&gt;
		1 = &amp;#039;Extension:SyntaxHighlight GeSHi&amp;#039;&lt;br /&gt;
		2 = &amp;#039;6&amp;#039;&lt;br /&gt;
		3 = &amp;#039;911&amp;#039;&lt;br /&gt;
		4 = &amp;#039;The SyntaxHighlight GeSHi extension provides rich formatting of source code using the &amp;quot;syntaxhighlight&amp;quot;-tag. ...&amp;#039;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
{{code|lang=lua|code=&lt;br /&gt;
{&lt;br /&gt;
	1 = {&lt;br /&gt;
		id = &amp;#039;7&amp;#039;&lt;br /&gt;
		pageid = &amp;#039;901&amp;#039;&lt;br /&gt;
		description = &amp;#039;Cargo provides a lightweight way to store and query the data contained within the calls to templates, such as infoboxes in mysql tables.&amp;#039;&lt;br /&gt;
		page = &amp;#039;Extension:Cargo&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
	2 = {&lt;br /&gt;
		id = &amp;#039;6&amp;#039;&lt;br /&gt;
		pageid = &amp;#039;911&amp;#039;&lt;br /&gt;
		description = &amp;#039;The SyntaxHighlight GeSHi extension provides rich formatting of source code using the &amp;quot;syntaxhighlight&amp;quot;-tag. ...&amp;#039;&lt;br /&gt;
		page = &amp;#039;Extension:SyntaxHighlight GeSHi&amp;#039;&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
As you can see, the data fields can be indexed either by number or by the provided headline in table &amp;#039;&amp;#039;fields&amp;#039;&amp;#039;. (The headline is either the fieldname or a special string you provided via &amp;#039;&amp;#039;fieldname=headline&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== queryParserHelper(frame) ===&lt;br /&gt;
The is a query helper function invoked by the template used by [[#query(query, attributes, retainBlanks)|the query function]]. It formats the query result fields in a unique way, so that the query function can easily construct a table from your request.&lt;br /&gt;
&lt;br /&gt;
;frame&lt;br /&gt;
:object, mandatory&lt;br /&gt;
:the frame object, supplied by the template&lt;br /&gt;
;return&lt;br /&gt;
:string, formatted query result fields&lt;br /&gt;
&lt;br /&gt;
=== rawquery(query, attributes) ===&lt;br /&gt;
{{ombox|type=content|text=Warning: If you want to do anything other with the result than passing it to the output stream, you have to encapsulate it with {{code snippet|lang=lua|code=mw.text.unstrip()}}, otherwise you only get a strip marker as result!}}&lt;br /&gt;
Calls the parser function #cargo_query according to the provided parameters and passes the result on directly. The format of the output is depending on attributes.format. The first parameter (query) has the following mandatory fields:&lt;br /&gt;
;tables&lt;br /&gt;
:table or string, mandatory&lt;br /&gt;
:the name(s) of the table(s) to query data from&lt;br /&gt;
;fields&lt;br /&gt;
:table or string, mandatory&lt;br /&gt;
:the fields, you want to get data from. format is &amp;#039;&amp;#039;fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;fieldname=headline&amp;#039;&amp;#039;. In case of more than one table, please use &amp;#039;&amp;#039;tablename.fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;tablealias.fieldname&amp;#039;&amp;#039;&lt;br /&gt;
;joins&lt;br /&gt;
:table or string, mandatory if you have more than one table. you need one join statement for each table after the first&lt;br /&gt;
:the list of join statements&lt;br /&gt;
Also, there are several optional fields:&lt;br /&gt;
;where&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:you can filter the results with where clauses&lt;br /&gt;
;group&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:the group statements&lt;br /&gt;
;having&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:filter your query, similar to WHERE, but applies to values computed for &amp;quot;groups&amp;quot;&lt;br /&gt;
;order&lt;br /&gt;
:table or string, optional&lt;br /&gt;
:the fields, you wish to sort the result for.  please use &amp;#039;&amp;#039;tablename.fieldname&amp;#039;&amp;#039; or &amp;#039;&amp;#039;tablealias.fieldname&amp;#039;&amp;#039;&lt;br /&gt;
Please keep in mind:&lt;br /&gt;
* attributes may contain any attribute you find in the documentation, but &amp;#039;&amp;#039;intro&amp;#039;&amp;#039; and &amp;#039;&amp;#039;outro&amp;#039;&amp;#039; will be NILed, &amp;#039;&amp;#039;default&amp;#039;&amp;#039; and &amp;#039;&amp;#039;more results text&amp;#039;&amp;#039; will be set to the empty string, and &amp;#039;&amp;#039;format&amp;#039;&amp;#039; will be overwritten&lt;br /&gt;
* per default, does only return fields that contain a value. that can result in an &amp;quot;unbalanced&amp;quot; result, where one row contains more elements than others. if you want to get all fields, set &amp;lt;code&amp;gt;retainBlanks&amp;lt;/code&amp;gt; to true&lt;br /&gt;
;query&lt;br /&gt;
:table, mandatory&lt;br /&gt;
:the arguments to construct the query. see above for details&lt;br /&gt;
;attributes&lt;br /&gt;
:table, optional&lt;br /&gt;
:more attributes, you want to pass on to the query (like limit, for instance)&lt;br /&gt;
;return&lt;br /&gt;
:string, the renderd output&lt;br /&gt;
&lt;br /&gt;
=== store(dbtable, stash) ===&lt;br /&gt;
Calls #cargo_store with the provided parameters. Note that the table must be [[#declare(dbtable, declaration|declared]] and created before you can actually store anything.&lt;br /&gt;
&lt;br /&gt;
{{ambox|type=info|text=Note: For security reasons, the data stored will be html-encoded. If you manually retrieve data from it (without using any of the query function), you have to decode manually.}}&lt;br /&gt;
&lt;br /&gt;
;dbtable&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:takes the name of the database table to be filled&lt;br /&gt;
;stash&lt;br /&gt;
:table (!), mandatory&lt;br /&gt;
:holds the data to store. it must be formatted {{code snippet|lang=lua|code={fieldName : data of type string or integer } }}&lt;br /&gt;
;return&lt;br /&gt;
:string, return values of the store call&lt;br /&gt;
&lt;br /&gt;
== The Helper Template ==&lt;br /&gt;
In order for the [[#query(query, attributes, retainBlanks)|query funtion]] to work, you need to have a helper template created that invokes the [[#queryParserHelper(frame)|queryParserHelper]] function. If not present, please navigate to {{tl|CargoUtilQueryParserHelper}} and provide the following content:&lt;br /&gt;
{{code|lang=html4strict|code=&amp;lt;nowiki&amp;gt;&lt;br /&gt;
&amp;lt;!-- Start your template code here. for tipps and tools for template development, please refer to our help-section --&amp;gt;{{#invoke:CargoUtil|queryParserHelper}}&amp;lt;!--Last line of your template code--&amp;gt;&amp;lt;noinclude&amp;gt;&lt;br /&gt;
{{documentation|content=This is a helper template that prepares the output of a cargo query so it can easily be parsed in a lua table. See [[Module:CargoUtil]] for more information.}}&lt;br /&gt;
&amp;lt;!-- Add categories to the /doc subpage, not here! --&amp;gt;[[Category:Query templates]][[Category:Metatemplates]][[Category:Class engine]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;|3=no}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Class engine]]&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Categories go here if you wish an additional category to that set in {{module rating}} above automatically. --&amp;gt;&lt;br /&gt;
[[Category:Lua metamodules]]&lt;br /&gt;
}}&amp;lt;/includeonly&amp;gt;&lt;/div&gt;</summary>
		<author><name>mw&gt;Oetterer</name></author>
	</entry>
</feed>