Cookies helfen uns bei der Bereitstellung des IMT HilfeWikis. Bei der Nutzung vom IMT HilfeWiki werden die in der Datenschutzerklärung beschriebenen Cookies gespeichert.Weitere Informationen

Modul:Classgenerator/config

IMT HilfeWiki - das Wiki
Wechseln zu:Navigation, Suche
Documentation icon Module documentation[view] [edit] [history] [purge]

This module provides data for Module:Classgenerator/class

Usage

local cfg = mw.loadData('Module:Classgenerator/config')

local superglobal = mw.loadData( 'Module:Foundationclass/globalconfig' )

local global = {
	debugLevel = nil, -- set this to the level you wish to display at render. false if disabled. this is a global setting, causing all children to debug. you can set this individually at any class
	cargoTable = nil,	-- if you use dataStore cargo, name the table here
	category = 'Generated classes',	-- the mediawiki category, the entity is placed into
	delimiter = ',',	-- see to it, that the delimiter is not a character, that will be encoded by mw.text.encode. CargoUtil.store encodes the data for security reasons
	description = 'An object class used on this wiki. The object class complex encompasses a base module, a class module, a template, a category page (if desired) and a form. ' ..
		'Including documentation if necessary.',	-- a short description of the entity. will be displayed on the template documentation page for example
	entityTitle = 'Objectclass',	-- generic title for the entity
	gardeningCategory = 'Classes with errors',
	namespace = 'Class',	-- if you put this entity on a special namespace, name it here
	restrictedTo = superglobal.restrictionRole,	-- so we want the class only be created by a certain role. Since we can't limit the form to a role, we have to limit all fields to a role. This is that role.
}

local form = {
	enable = true,
	name = 'Classgenerator',	-- the name of the form
	teaserText = 'With this form you can configure and eventually create a complete data pipeline on your wiki: form, template, module, category ' ..
		'- including display and storage of data. State the name of your class below. If it contains spaces, the module will be placed on that page but your class name in your class file will be camelCased.',
	typeCreateLink = 'forminput',
	createInfotext = 'Name of your class (module):', 
	createInputPlaceholder = 'Class name',
	createInputQueryString = nil,
	createLinkPageName = nil,
	createLinkQueryString = nil,
	createLinkType = nil,
	labelCreate = 'Create Class configuration',	-- label for create entity
	labelEdit = 'Edit Class configuration',	-- label for edit entity
	headerText = 'Generates a data pipeline. After the respectice pages are generated, you can use this form to update the configuration, ' ..
		'put you have to manually save them on the configuration page.',	-- this is the text displayed above the form
	notification = '<b>WARNING:</b> Be extra careful on data input. Once the class is generated, the update process has to be done mostly manual!!',	-- this notification will be displayed above your form
	sectionList = nil,
	allowsFreeText = nil,
	buttons = {'save', 'preview', 'changes', 'cancel'},	-- which buttons should appera below the form
	fieldSize = 80,	-- what is the default size= for the form fields
	textareaAttributes = {	-- the defaults for your textarea fields
		rows = 4,
		cols = 80,
		autogrow = true,
		editor = false,
	},
	fieldOrder = {	-- the order in which the form fields appear. NOTE: a parameter not in this list, will not appear in the form!!
		'global_edit_timestamp',
		'global_entityTitle',
		'global_description',
		'global_category',
		'global_gardeningCategory_chooser',
		'global_gardeningCategory',
		'global_namespace',
		'global_cargoTable',
		'global_smwUseStorage',
		'global_smwIsSubobject',
		'global_restrictedTo',
		'global_delimiter',
		'global_autocreate_module',
		'global_autocreate_template',
		'global_autocreate_form',
		'global_autocreate_category',
		'global_autocreate_property',
		'global_customization',
		'form_enable',
		'form_name',
		'form_teaserText',
		'form_typeCreateLink',
		'form_createInfotext',
		'form_createInputPlaceholder',
		'form_createInputQueryString',
		'form_createLinkInfo',
		'form_createLinkPageName',
		'form_createLinkQueryString',
		'form_createLinkType',
		'form_labelCreate',
		'form_labelEdit',
		'form_headerText',
		'form_notification',
		'form_sectionList',
		'form_allowsFreeText',
		'form_freeTextPreload',
		'form_buttons',
		'form_fieldSize',
		'form_textareaAttributes_cols',
		'form_textareaAttributes_rows',
		'form_textareaAttributes_autogrow',
		'form_textareaAttributes_editor',
		'form_customization',
		'template_name',
		'template_templateDocumentationSeeAlso',
		'template_customization',
		'parameter_parameter',
	},
}

local template = {
	addCommentsToConfig = false, -- you can add explanatory comments to your autocreated config file. makes it more verbose, but increases size
	autoCreationTimeDiff = 30*60, -- let me explain: the botton for "autocreate this page type" actually sets the global_autocreate_<pagetype> to the current timestamp
		-- current being here the timestamp of the loading of the page. this diff states how long after this moment the template will acutually create the page
	createPages = true,	-- you have to install AutoCreatePage extension and patch AutoCreatePage.php: in line 86 disable check for content namespace for this to actually work
	name = 'Classgenerator',	-- the name of your template. e.g.: your template can be found on the page [[Template:nameOfYourTemplate]]
	placeHolderClassName = '###~~~CLASSNAME~~~###',
	templateDocumentationSeeAlso = {'Classgenerator/parameter'}	-- used in the see also-section of your template documentation
}
-- because configIntro makes a selfreference, we have to define it later
template.configIntro = '-- This is the configuration for ' .. template.placeHolderClassName .. '. It has been autocreated by Module:Classgenerator.\n' ..
		'-- It is strongly suggested, you use the form to make alterations and copy the new configuration an this page!\n\n' ..
		'local superglobal = mw.loadData(\'Module:Foundationclass/globalconfig\')\n\n'

local parameter = {
	-- this is your list of parameters. you put all data here, that you would like to handle
	--	* parameters of your form (and thus your template)
	--		* when you fill td_type, your parameter will be treated as a template parameter
	--		* when you add the parameter name to form.fieldOrder, it will be added to the form
	--	* and also data, that you only want to store (omit these from form.fieldOrder and leave the sf table).
	-- *****
	global_edit_timestamp = {	-- this one is not used in class creation but helps monitoring maintenance
		cardinality = 'single',
		description = 'Das Datum der entsprechenden Revision. Womit das Datum der aktuellen Revision das Datum der letzten Änderung ist.',
		label = 'Änderungsdatum',
		severity = 'mandatory',
		sf = {
			default = '{{((}}REVISIONTIMESTAMP{{))}}',
			hidden = true,
			restricted = global.restrictedTo,
		},
		td_default = '{{REVISIONTIMESTAMP}}',
		td_type = 'date',
	},
	-- here starts all form variables
	form_enable = {
		cardinality = 'single',
		description = 'Do you want to create a form for this class? Note: When you don\'t want to have a form _page_, but need this to be a part of another form (as a holds-template form), set this to true!',
		label = 'Create form',
		severity = 'mandatory',
			sf = {
			default = 'Yes',
			input_type = 'radiobutton',
			restricted = global.restrictedTo,
			show_on_select = { Yes = {'form_allowsFreeText', 'form_buttons', 'form_fieldSize', 'form_headerText', 'form_labelCreate', 'form_labelEdit', 'form_name', 'form_notification', 'form_placeholderInputBox', 'form_sectionList', 'form_typeCreateLink',
				'form_teaserText', 'form_textareaAttributes_cols', 'form_textareaAttributes_rows', 'form_textareaAttributes_autogrow', 'form_textareaAttributes_editor', 'form_customization', 'form_createLinkPageName',	-- note: last one is part of another show_on_select. could botch up the show/hide
			}},
		},
		td_type = 'boolean',
		values = {'Yes', 'No'},
	},
	form_allowsFreeText = {
		cardinality = 'single',
		description = 'Should there be a free text field right before the form buttons?',
		label = 'Allow free text field',
		severity = 'mandatory',
		sf = {
			default = 'false',
			input_type = 'radiobutton',
			restricted = global.restrictedTo,
			show_on_select = {}, -- filled later down below
		},
		td_type = 'boolean',
		values = {'true', 'false'},
	},
	form_freeTextPreload = {
		cardinality = 'single',
		description = 'When this is set your free text will have a preload= statement. The contents of the page you enter here will be used as preload template text for the free text field.',
		label = 'Free text preload',
		severity = 'suggested',
		sf = {
			input_type = 'Combobox',
			placeholder = 'Preload page',
			restricted = global.restrictedTo,
			values_from_category = 'Preload text templates'
		},
		td_type = 'line',
	},
	form_buttons = {
		cardinality = 'list',
		description = 'Which buttons other than \'save\' and \'cancel\' should appera below the form',	-- do not use a " or templateDocumentation will fail!
		label = 'Form Buttons',
		severity = 'suggested',
		sf = {
			default = 'preview,changes',
			existing_values_only = true,
			input_type = 'checkboxes',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
		values = {'preview', 'save and continue', 'changes', 'summary', 'minor edit', 'watch'},
	},
	form_createInfotext = {
		cardinality = 'single',
		description = 'This is the short text that appears right above the input field. Short being the important part. Please limit yourself to a short sentence.',	-- do not use a " or templateDocumentation will fail!
		label = 'Inputfield Infotext',
		severity = 'mandatory',
		sf = {
			input_type = 'text',
			placeholder = 'Infotext',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_createInputPlaceholder = {
		cardinality = 'single',
		description = 'Placeholder text that is shwon in the form create input field',	-- do not use a " or templateDocumentation will fail!
		label = 'Placeholder text',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = ':) this is placeholdertext for placeholdertext.',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_createInputQueryString = {
		cardinality = 'single',
		description = 'You can use this option to pass information to the form; this information generally takes the form of \'\'templateName[fieldName]=value\'\'. It should look like a typical URL query string; an example would be "query string=namespace=User&User[Is_employee]=yes".',
		label = 'Create input query string',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'templateName[fieldName]=value',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_createLinkInfo = {
		-- this is just info text shown, when link type link is chosen
		description = 'If you want to use formlink together with page name, you have to add the output of your class\'s sfGenerateFormInfoTag() in comments to your form page!!!. Class generator produces the appropriate content, ' ..
			'you have to paste it into your form page anew, every time you change this value here. This is a workaround for a semantic forms bug. see https://phabricator.wikimedia.org/T123230 for more information',
		label = 'Important',
	},
	form_createLinkPageName = {
		cardinality = 'single',
		description = 'With this, you can have the name of the page created by the form to be set automatically. You can use any of the parameters \'\'&lt;template-name[field-name]&gt;\'\' or \'\'&lt;unique number&gt;\'\'. ' .. 
			'The latter takes options start=x, unique, random, and a number (length of id string, default 6). Note: this cannot start with the UNIQUE NUMBER tag due to a bug in Semantic Forms!' .. 
			'IMPORTANT: If you want to use this, you have to add the output of your class\'s sfGenerateFormInfoTag() in comments to your form page!!!. Class generator produces the appropriate content, you have to paste it ' ..
			'into your form page anew, every time you change this value here. This is a workaround for a semantic forms bug. see https://phabricator.wikimedia.org/T123230 for more information',
		label = 'Create link page name',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'Object <unique number;start=00000001',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_createLinkQueryString = {
		cardinality = 'single',
		description = 'You can use this option to pass information to the form; this information generally takes the form of \'\'templateName[fieldName]=value\'\'. It should look like a typical URL query string; an example would be "query string=namespace=User&User[Is_employee]=yes".',
		label = 'Create link query string',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'templateName[fieldName]=value',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_createLinkType = {
		cardinality = 'single',
		description = 'This field lets you choose, what kind of form link is used to link to the form page: is it a plain link or a button (with parameter submission via get or post)',
		label = 'Create link type',
		severity = 'mandatory',
		sf = {
			default = 'plain',
			input_type = 'dropdown',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
		values = { 'plain', 'button', 'post button' },
	},
	-- no sf field for fieldOrder. Input from Classgenerator/parameter must be processed to calculate the field order
	form_fieldOrder = {
		cardinality = 'list',
		description = 'the order in which the form fields appear. NOTE: a parameter not in this list, will not appear in the form!!',
		label = 'Order of form fields',
		severity = 'mandatory',
	},
	form_fieldSize = {
		cardinality = 'single',
		description = 'Here, you define a default \'size\' for input fields. You will still be able to overwrite this in your parameter definition.',	-- do not use a " or templateDocumentation will fail!
		label = 'Default size',
		severity = 'mandatory',
		sf = {
			default = '80',
			input_type = 'regexp',
			maxlength = 3,
			placeholder = 'Input field size',
			regexp = '/^[0-9]+$/',
			restricted = global.restrictedTo,
		},
		td_type = 'number',
	},
	form_headerText = {
		cardinality = 'single',
		description = 'This is the text displayed above the form',	-- do not use a " or templateDocumentation will fail!
		label = 'Header text',
		severity = 'mandatory',
		sf = {
			input_type = 'textarea',
			placeholder = 'Header text',
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	form_labelCreate = {
		cardinality = 'single',
		description = 'Label for the signal/action for \'create entity\'.  Shows on buttons and and the form label.',	-- do not use a " or templateDocumentation will fail!
		label = 'Create entity',
		severity = 'mandatory',
		sf = {
			default = 'create',
			input_type = 'text',
			maxlength = 32,
			placeholder = 'label',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_labelEdit = {
		cardinality = 'single',
		description = 'Label for the signal/action for \'edit entity\'. Shows on buttons and and the form label.',	-- do not use a " or templateDocumentation will fail!
		label = 'Edit entity',
		severity = 'mandatory',
		sf = {
			default = 'edit',
			input_type = 'text',
			placeholder = 'label',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_name = {
		cardinality = 'single',
		description = 'The name of the form, i.e. the form will be placed an page [[Form:Formname]]. If you don\'t need an actual form page, leave this empty (e.g. if this is a prot of another form as holds-template or such).',	-- do not use a " or templateDocumentation will fail!
		label = 'Form name',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'Form name',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_notification = {
		cardinality = 'single',
		description = 'this notification test will be displayed above your form',	-- do not use a " or templateDocumentation will fail!
		label = 'Notification',
		severity = '',
		sf = {
			input_type = 'textarea',
			placeholder = 'Notifcation text',
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	form_sectionList = {
		cardinality = 'list',
		description = 'If you want to have hl2 sections of text after the datafields and before the freetext/formbutton, name them here. Use strings for names of section headlines',
		label = 'Sections',
		severity = 'suggested',
		sf = {
			input_type = 'tokens',
			placeholder = 'Section headlines',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_teaserText = {
		cardinality = 'single',
		description = 'This is the text displayed on the form:name page (before you see the actual form)',	-- do not use a " or templateDocumentation will fail!
		label = 'Form teaser text',
		severity = 'suggested',
		sf = {
			input_type = 'textarea',
			placeholder = 'Teaser text',
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	form_textareaAttributes_cols = {
		cardinality = 'single',
		description = 'You can set a default for the columns attribute of your textarea fields',	-- do not use a " or templateDocumentation will fail!
		label = 'textarea default cols',
		severity = 'mandatory',
		sf = {
			default = 80,
			input_type = 'regexp',
			maxlength = 3,
			placeholder = '#of cols',
			regexp = '/^[0-9]+$/',
			restricted = global.restrictedTo,
		},
		td_type = 'number',
	},
	form_textareaAttributes_rows = {
		cardinality = 'single',
		description = 'You can set a default for the rows attribute of your textarea fields',	-- do not use a " or templateDocumentation will fail!
		label = 'textarea default rows',
		severity = 'mandatory',
		sf = {
			default = 4,
			input_type = 'regexp',
			maxlength = 2,
			placeholder = '#of rows',
			regexp = '/^[0-9]+$/',
			restricted = global.restrictedTo,
		},
		td_type = 'number',
	},
	form_textareaAttributes_autogrow = {
		cardinality = 'single',
		description = 'You can set a default for the autogrow attribute of your textarea fields',	-- do not use a " or templateDocumentation will fail!
		label = 'textarea default autogrow',
		severity = 'mandatory',
		sf = {
			default = 'true',
			existing_values_only = true,
			input_type = 'radiobutton',
			restricted = global.restrictedTo,
		},
		td_type = 'boolean',
		values = {'true', 'false'},
	},
	form_textareaAttributes_editor = {
		cardinality = 'single',
		description = 'You can set a default for the editor attribute of your textarea fields. As of now, semantic forms only supports wikieditor (or none).',	-- do not use a " or templateDocumentation will fail!
		label = 'textarea default editor',
		severity = 'mandatory',
		sf = {
			default = 'wikieditor',
			input_type = 'text with autocomplete',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	form_typeCreateLink = {
		cardinality = 'single',
		description = 'This field lets you choose, what kind of object create link is provided to the user on the form page: is there none, a formlink, or a forminput field?',
		label = 'Form create link',
		severity = 'mandatory',
		sf = {
			default = 'none',
			input_type = 'dropdown',
			restricted = global.restrictedTo,
			show_on_select = { forminput = {'form_createInfotext', 'form_createInputPlaceholder', 'form_createInputQueryString' },
				formlink = {'form_createInfotext', 'form_createLinkPageName', 'form_createLinkQueryString', 'form_createLinkType', 'form_createLinkInfo'},
				none = {'form_createLinkPageName'} },	-- why?	because, maybe I don't want to have a formlink on the form page, but still wont to {{#formlink}} from somewhere else. then I need this field
		},
		td_type = 'line',
		values = { 'none', 'forminput', 'formlink' },
	},
	form_customization = {
		cardinality = 'single',
		description = 'This field allows you to add customized entries to your form-configuration. Use one \'fieldname = value,\' entry per line.',	-- do not use a " or templateDocumentation will fail!
		label = 'Form custom config',
		severity = 'optional',
		sf = {
			input_type = 'textarea',
			placeholder = 'field1 = value,',
			rows = 6,
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	global_cargoTable = {
		cardinality = 'single',
		description = 'The name of the cargo table to store class\'s data in, if you use data store cargo.',	-- do not use a " or templateDocumentation will fail!
		label = 'Cargo table',
		severity = 'suggested',
		sf = {
			default = '', -- dynamically set to class name
			hidden = false,
			input_type = 'text',
			placeholder = 'Table name',
			restricted = global.restrictedTo,
			unique = true,
		},
		td_type = 'line',
	},
	global_category = {
		cardinality = 'single',
		description = 'The mediawiki category, the entity is placed into. If left empty or set to NIL, no categegory tag will be placed an object page. No category page will be created.',
		label = 'Category',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'Category name',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_delimiter = {
		cardinality = 'single',
		description = 'The default delimiter used on multivalue fields. Can be overwritten by each paramter. ',	-- do not use a " or templateDocumentation will fail!
		label = 'Default delimiter',
		severity = 'mandatory',
		sf = {
			default = ',',
			input_type = 'text',
			maxlength = 7,
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_description = {
		cardinality = 'single',
		description = 'A short description of the entity. Will be displayed on the template documentation page, for example.',	-- do not use a " or templateDocumentation will fail!
		label = 'Description',
		severity = 'mandatory',
		sf = {
			input_type = 'textarea',
			placeholder = 'Short description',
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	global_entityTitle = {
		cardinality = 'single',
		description = 'Generic title for the entity.',	-- do not use a " or templateDocumentation will fail!
		label = 'Title',
		severity = 'mandatory',
		sf = {
			default = '',	-- class name dynamically
			input_type = 'text',
			placeholder = 'Title of entity',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_gardeningCategory = {
		cardinality = 'single',
		description = 'This is the name of the class\'s gardning category. Objects/class entities with implausible/erroneous input will be placed in this category automatically.',
		label = 'Gardening category name',
		severity = 'mandatory',
		sf = {
			default = false,
			input_type = 'text',
			placeholder = 'Category name',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_gardeningCategory_chooser = {
		cardinality = 'single',
		description = 'This field lets you choose, whether you want to have a gardening category for this class and - if so - if you want an individual one or the global category.',
		label = 'Gardening category',
		severity = 'mandatory',
		sf = {
			default = 'individual',
			input_type = 'dropdown',
			restricted = global.restrictedTo,
			show_on_select = { individual = 'global_gardeningCategory' },
		},
		td_type = 'line',
		values = { 'none', 'individual', 'global' },
	},
	global_namespace = {
		cardinality = 'single',
		description = 'If you put this entity on a special namespace, name it here. NOTE: You have to be precise. This is case sensitive. But omit the colon. NOTE: Remember to add the namespace in your LocalSettings.php.',
		label = 'Namespace',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'Namespace',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_restrictedTo = {
		cardinality = 'single',
		description = 'You can define a default for the \'restricted\' attribute of your fields here.',	-- do not use a " or templateDocumentation will fail!
		label = 'Default restricted',
		severity = 'suggested',
		sf = {
			input_type = 'text',
			placeholder = 'User group',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_smwUseStorage = {
		cardinality = 'single',
		description = 'If you use dataStore smw, set this to true if you actually want persistant smw data to be stored for that class!',
		label = 'Store objects semantically',
		severity = 'mandatory',
		sf = {
			default = 'false',
			input_type = 'radiobutton',
			restricted = global.restrictedTo,
			show_on_select = {} -- will be defined later to {true = 'global_smwIsSubobject'}
		},
		td_type = 'boolean',
		values = {'true', 'false'},
	},
	global_smwIsSubobject = {
		cardinality = 'single',
		description = 'When using datastore smw, should this be stored as subobject (and not as normal data)?',
		label = 'Is subobject',
		severity = 'mandatory',
		sf = {
			default = 'false',
			input_type = 'radiobutton',
			restricted = global.restrictedTo,
		},
		td_type = 'boolean',
		values = {'true', 'false'},
	},
	global_autocreate_module = {
		cardinality = 'single',
		description = 'Should the module pages and their documentation page be created automatically by the template',	-- do not use a " or templateDocumentation will fail!
		label = 'Module autocreation',
		severity = 'mandatory',
		sf = {
			default = 'No',
			hidden = true,
			input_type = '',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_autocreate_template = {
		cardinality = 'single',
		description = 'Should the template page and its documentation page be created automatically by the template',	-- do not use a " or templateDocumentation will fail!
		label = 'Template autocreation',
		severity = 'mandatory',
		sf = {
			default = 'No',
			hidden = true,
			input_type = '',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_autocreate_form = {
		cardinality = 'single',
		description = 'Should the form page be created automatically by the template',	-- do not use a " or templateDocumentation will fail!
		label = 'Form autocreation',
		severity = 'mandatory',
		sf = {
			default = 'No',
			hidden = true,
			input_type = '',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_autocreate_category = {
		cardinality = 'single',
		description = 'Should the category page - if there is any - be created automatically by the template',	-- do not use a " or templateDocumentation will fail!
		label = 'Category autocreation',
		severity = 'mandatory',
		sf = {
			default = 'No',
			hidden = true,
			input_type = '',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_autocreate_property = {
		cardinality = 'single',
		description = 'Should the property pages - if store smw is active and the class stores its data sematically - be created automatically by the template',	-- do not use a " or templateDocumentation will fail!
		label = 'Property autocreation',
		severity = 'mandatory',
		sf = {
			default = 'No',
			hidden = true,
			input_type = '',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	global_customization = {
		cardinality = 'single',
		description = 'This field allows you to add custimized entries to your global-configuration. Use one \'fieldname = value,\' entry per line.',	-- do not use a " or templateDocumentation will fail!
		label = 'Global costum config',
		severity = 'optional',
		sf = {
			input_type = 'textarea',
			placeholder = 'field1 = value,',
			rows = 6,
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
	parameter_parameter = {
		cardinality = 'single',
		description = 'This is your list of parameters. You put all data here, that you would like to handle - be it data you process normally, data you would only like to gather vai form or data you simply want to store',
		label = 'Parameters',
		severity = 'mandatory',
		sf = {
			holds_template = true,
		},
		td_type = 'string',
	},
	template_name = {
		cardinality = 'single',
		description = 'The name of your template. i.e.: your template can be found on the page [[Template:nameOfYourTemplate]]. Unless there is a very good reason, this should be the same as your class\'s name!',
		label = 'Template name',
		severity = 'mandatory',
		sf = {
			default = '',	-- set to pagename dynamically
			input_type = 'text',
			placeholder = 'Template name',
			restricted = global.restrictedTo,
		},
		td_type = 'line',
	},
	template_templateDocumentationSeeAlso = {
		cardinality = 'list',
		description = 'Used in the see also-section of your template documentation. Please omit the template: from each entry!',	-- do not use a " or templateDocumentation will fail!
		label = 'Related templates',
		severity = 'suggested',
		sf = {
			input_type = 'tokens',
			placeholder = 'Templatename(s)',
			restricted = global.restrictedTo,
			values_from_category = 'Templates',
		},
		td_type = 'line',
	},
	template_customization = {
		cardinality = 'single',
		description = 'This field allows you to add custimized entries to your template-configuration. Use one \'fieldname = value,\' entry per line.',	-- do not use a " or templateDocumentation will fail!
		label = 'Template costum config',
		severity = 'optional',
		sf = {
			input_type = 'textarea',
			placeholder = 'field1 = value,',
			rows = 6,
			restricted = global.restrictedTo,
		},
		td_type = 'string',
	},
}

parameter.global_smwUseStorage.sf.show_on_select['true'] = 'global_smwIsSubobject'
parameter.form_allowsFreeText.sf.show_on_select['true'] = 'form_freeTextPreload'


return {
	form = form,
	global = global,
	parameter = parameter,
	template = template,
}