<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="de">
	<id>https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AClassgenerator%2Fclass%2Fdoc</id>
	<title>Modul:Classgenerator/class/doc - Versionsgeschichte</title>
	<link rel="self" type="application/atom+xml" href="https://www.verzauberte-welten.de/index.php?action=history&amp;feed=atom&amp;title=Modul%3AClassgenerator%2Fclass%2Fdoc"/>
	<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Modul:Classgenerator/class/doc&amp;action=history"/>
	<updated>2026-04-05T23:30:24Z</updated>
	<subtitle>Versionsgeschichte dieser Seite in Verzauberte Welten e.V.</subtitle>
	<generator>MediaWiki 1.39.8</generator>
	<entry>
		<id>https://www.verzauberte-welten.de/index.php?title=Modul:Classgenerator/class/doc&amp;diff=4399&amp;oldid=prev</id>
		<title>imported&gt;Oetterer: /* Interface messages */</title>
		<link rel="alternate" type="text/html" href="https://www.verzauberte-welten.de/index.php?title=Modul:Classgenerator/class/doc&amp;diff=4399&amp;oldid=prev"/>
		<updated>2016-01-15T13:11:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Interface messages&lt;/span&gt;&lt;/span&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 is a Class Module. It implements a class in Lua using [[Module:Middleclass]] and the template class [[Module:Foundationclass]]. This class provides methods for PURPOSE.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{code|lang=lua|code=&lt;br /&gt;
local name = args[1] or args.name or mw.title.getCurrentTitle().rootText&lt;br /&gt;
local Class = require('Module:Name/class')&lt;br /&gt;
local me = Class:new(name)&lt;br /&gt;
me:initDataFromArgs(args)&lt;br /&gt;
me:storeData()&lt;br /&gt;
me:addInfobox()&lt;br /&gt;
me:addPageBody()&lt;br /&gt;
return me:render()&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Methods ==&lt;br /&gt;
=== Constructor ===&lt;br /&gt;
==== new(uid) ====&lt;br /&gt;
Creates a new Object for the class.&lt;br /&gt;
;uid&lt;br /&gt;
:variable, optional&lt;br /&gt;
:used to identify the object&lt;br /&gt;
;return&lt;br /&gt;
:object, of the class&lt;br /&gt;
&lt;br /&gt;
=== public methods ===&lt;br /&gt;
==== addInfobox() ====&lt;br /&gt;
If no errors and data is present, adds an infobox to the object's output.&lt;br /&gt;
{{small|&lt;br /&gt;
;return&lt;br /&gt;
:boolean, whether adding was successful or not&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== addPageBody() ====&lt;br /&gt;
Adds a page body (all content besides the infobox) to the object's output: Errors and Warnings, sample configuration, statistics, ... Of course, only if there is data.&lt;br /&gt;
{{small|&lt;br /&gt;
;return&lt;br /&gt;
:boolean, whether adding was successful or not&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== myArgumentProcessing(coreData) ====&lt;br /&gt;
Performs the individual argument processing in [[#initDataFromArgs(args)|initDataFromArgs(args)]] right before inititializing it.&lt;br /&gt;
{{small|&lt;br /&gt;
;coreData&lt;br /&gt;
:table, mandatory&lt;br /&gt;
:the core data of the object. the one to process individually before initialization&lt;br /&gt;
;return&lt;br /&gt;
:table, the new core data array to be used&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== myPlausibilityTest(args) ====&lt;br /&gt;
Performs the individual plausibility tests in [[#initDataFromArgs(args)|initDataFromArgs(args)]] before entering the initialization part.&lt;br /&gt;
NOTE: The return value will be ignored. If this finds errors, it must add them to the list of errors via [[#addError(errortext)|addError(errortext)]].&lt;br /&gt;
{{small|&lt;br /&gt;
;args&lt;br /&gt;
:table, mandatory&lt;br /&gt;
:arguments passed to the template to be checked&lt;br /&gt;
;return&lt;br /&gt;
:boolean, whether the object is plausible or not.&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== myStashAdjustments(self, stash) ====&lt;br /&gt;
Performs the adjusts the stash in [[#storeData()|storeData()]] right before storing it.&lt;br /&gt;
{{small|&lt;br /&gt;
;stash&lt;br /&gt;
:table, mandatory&lt;br /&gt;
:the array of data to be saved (in the form fieldname: value)&lt;br /&gt;
;return&lt;br /&gt;
:boolean, the new stash&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== static methods ===&lt;br /&gt;
==== ClassClassgenerator:mySfDynamicFieldAttribute(fieldname, attribute, value) ====&lt;br /&gt;
For some semantic form fields there are attribute values, that are not static, thus can not be provided at forehand in the [[#Configuration Data|configuration file]]. This method does the trick to adapt them at runtime shortly before the field is rendered. Essentially: the method checks, if it has a special rule for the pair fieldname:attribute and if so, calculates the new value. if not, the old value is returned.&lt;br /&gt;
{{small|&lt;br /&gt;
;fieldname&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:the form field's name, needed to match current paring to an existing special treatment rule&lt;br /&gt;
;attribute&lt;br /&gt;
:string, mandatory&lt;br /&gt;
:the form field's attribute, needed to match current paring to an existing special treatment rule&lt;br /&gt;
;value&lt;br /&gt;
:variable, mandatory&lt;br /&gt;
:the value, that is already provided in the [[#Configuration Data|configuration file]]. this will be adapted by the method, if there is a special rule for the pair fieldname:attribute.&lt;br /&gt;
;return&lt;br /&gt;
:string, the value to be used forthwith (which can be the old one or a freshly calculated)&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=== private methods ===&lt;br /&gt;
==== _debug(self, level, text) ====&lt;br /&gt;
Adds output to the internal debug log.&lt;br /&gt;
{{small|&lt;br /&gt;
;self&lt;br /&gt;
:object, me&lt;br /&gt;
;level&lt;br /&gt;
:int; mandatory&lt;br /&gt;
:debug level for the message&lt;br /&gt;
;text&lt;br /&gt;
:string; mandatory&lt;br /&gt;
:debug message text&lt;br /&gt;
;return&lt;br /&gt;
:void&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== _namespaceName (self, namespaceId) ====&lt;br /&gt;
Takes the id of a namespace and converts it to the human readable name. Normally returns mw.site.namespaces[id].canonicalName...&lt;br /&gt;
{{small|&lt;br /&gt;
;self&lt;br /&gt;
:object, me&lt;br /&gt;
;namespaceId&lt;br /&gt;
:int; mandatory&lt;br /&gt;
:for which namespace id the name should be returned&lt;br /&gt;
;return&lt;br /&gt;
:string, name of namespace&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==== _processAttribute(self, attr, indent, name) ====&lt;br /&gt;
Takes an attribute and builds from that (and self:getCoreData()) one entry in the class's config file.&lt;br /&gt;
{{small|&lt;br /&gt;
;self&lt;br /&gt;
:object, me&lt;br /&gt;
;attr&lt;br /&gt;
:string; mandatory&lt;br /&gt;
:for which attribute should the entry be build&lt;br /&gt;
;indent&lt;br /&gt;
:string; mandatory&lt;br /&gt;
:indentation of line&lt;br /&gt;
;name&lt;br /&gt;
:string; optional&lt;br /&gt;
:normally the parameter name will be constructed out of attr. if you have special needs as a name, you can supply them via this parameter. name takes precedence, if provided.&lt;br /&gt;
;return&lt;br /&gt;
:string, the entry that can directly be added to the config file/string&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Properties ==&lt;br /&gt;
=== static ===&lt;br /&gt;
See also [[#Static Properties|Static Properties]]&lt;br /&gt;
;ClassName.myConfiguration&lt;br /&gt;
:this is your configuration. It is devided in several section, each a&lt;br /&gt;
:table, holds configuration data found in Module:Name/config&lt;br /&gt;
::'''WARNING:''' This is a read only table and besides functions ''pairs()'' and ''ipairs()'' nothing else will work on it, especially not the functions of the table library!&lt;br /&gt;
&amp;lt;ul&amp;gt;&lt;br /&gt;
* form, table, holds data used to create the form. here are some of them:&lt;br /&gt;
** formButtons, table, which buttons should be printed at the bottom&lt;br /&gt;
** fieldOrder, table, in which order the form fields should appear (note: only fields listed here will be added to the form)&lt;br /&gt;
* global, table, holds some global configuration data&lt;br /&gt;
* parameter, table, holds all data about all parameter used in the module (be they form only, data store only or normal). The table has the form ''paramname = { table of paramdata }''. The tables for the parameter have data as follows:&lt;br /&gt;
** cardinality, string, mandatory, one of singe or list&lt;br /&gt;
** cargo_type, string, optional, if the parameter is to be stored in cargo, add the field type here (one of Page, Text, Integer, Float, Date, Datetime, Boolean (which should be provided as 1 or 0), Coordinates, Wikitext, File, String, URL, or Email)&lt;br /&gt;
** description, string, mandatory, a description of this parameter&lt;br /&gt;
** label, string, mandatory, the label used in the form and the template documentation&lt;br /&gt;
** severity, string, optional, if provided one of mandatory, suggested&lt;br /&gt;
** sf, table, optional, used to add more attributes to the semantic forms field. ref [[Module:SFfield/config]] for all possible attributes. Note that the table is of type attribute_name : value. Value can be of type string, integer, boolean, and (in case of 'show on select') a table. Please note, that the attribute name cannot contain a &amp;quot; &amp;quot; (space). Use the underscore instead.&lt;br /&gt;
** td_default, string, optional, if you want a default value to be indicated in the template data section on the documentation page, add it here&lt;br /&gt;
** td_type, string, optional, if the parameter should be present in the template documentation page, fill this field. all possible values are listed [https://www.mediawiki.org/wiki/Extension:TemplateData#Format here]&lt;br /&gt;
** values, table, optional, if you want the possible values to be restricted to a specific set, fill this table&lt;br /&gt;
* template, table, holds some data used only in the template&lt;br /&gt;
&amp;lt;/ul&amp;gt;&lt;br /&gt;
;className.publicStaticProperty&lt;br /&gt;
:type, explanation&lt;br /&gt;
;_privateStaticProperty&lt;br /&gt;
:type, explanation&lt;br /&gt;
&lt;br /&gt;
=== private ===&lt;br /&gt;
Note: all private properties are stored in table ''_private[self]''. _private is a static array that is indexed by ''self'', so the table ''_private[self]'' holds all properties for instance ''self''.&lt;br /&gt;
;dbg&lt;br /&gt;
:object, my instance of [[Module:Debug/class]] for debugging purposes. only present afer first call of [[#_debug(self, level, text)|_debug(self, level, text)]]&lt;br /&gt;
&lt;br /&gt;
== Configuration Data ==&lt;br /&gt;
This class holds its control data in [[Module:{{BASEPAGENAME}}/config]]. &lt;br /&gt;
&lt;br /&gt;
== Inheritance ==&lt;br /&gt;
=== Methods ===&lt;br /&gt;
'''Note:''' You still reference those either by self:publicMethod() or Classgenerator:staticMethod() and Classgenerator.staticProperty respectively!&lt;br /&gt;
{{MediaWiki:Classengine-content-documentation-methods}}&lt;br /&gt;
=== Static Properties ===&lt;br /&gt;
{{MediaWiki:Classengine-content-documentation-properties}}&lt;br /&gt;
&lt;br /&gt;
== Dependecies ==&lt;br /&gt;
Apart from the obvious (being all pages in [[:Category:Class engine]]), we also need:&lt;br /&gt;
* {{tl|((}}&lt;br /&gt;
* {{tl|))}}&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Extension:Header_Tabs Extension:Header Tabs]&lt;br /&gt;
&lt;br /&gt;
Nice to have:&lt;br /&gt;
* [https://www.mediawiki.org/wiki/Extension:AutoCreatePage Extension:AutoCreatePage]&lt;br /&gt;
&lt;br /&gt;
Please check also [[Module:Foundationclass#Dependecies|Foundationclass's dependencies]].&lt;br /&gt;
&lt;br /&gt;
=== Interface messages ===&lt;br /&gt;
To generate your project's meta categories, Classgenerator makes use of the following interface messages:&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-form-category]]&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-gardening-supercategory]]&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-module-category]]&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-property-category]]&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-supercategory]]&lt;br /&gt;
* [[MediaWiki:Classengine-content-project-template-category]]&lt;br /&gt;
You may edit them freely for your convenience to suit your needs.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{#invoke:Foundationclass/classDoc|categorize}}&amp;lt;includeonly&amp;gt;{{#ifeq:{{SUBPAGENAME}}|sandbox||&lt;br /&gt;
&amp;lt;!-- Also: the class engine sets the category &amp;quot;Lua class modules&amp;quot; automatically in message MediaWiki:Classengine-content-documentation-methods --&amp;gt;&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>imported&gt;Oetterer</name></author>
	</entry>
</feed>