<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/index.php?action=history&amp;feed=atom&amp;title=Writing_ACF_Models</id>
	<title>Writing ACF Models - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/index.php?action=history&amp;feed=atom&amp;title=Writing_ACF_Models"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;action=history"/>
	<updated>2026-04-30T05:22:02Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=7013&amp;oldid=prev</id>
		<title>Dubiousjim: delete Category:HOWTO</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=7013&amp;oldid=prev"/>
		<updated>2012-03-21T16:05:24Z</updated>

		<summary type="html">&lt;p&gt;delete Category:HOWTO&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:05, 21 March 2012&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-l18&quot;&gt;Line 18:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 18:&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;  local modelresult = versioncontroller.model:get()&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;  local modelresult = versioncontroller.model:get()&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;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; 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;[[Category:ACF&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;]] [[Category:HOWTO&lt;/del&gt;]]&lt;/div&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Category:ACF]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dubiousjim</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=6812&amp;oldid=prev</id>
		<title>Dubiousjim: Category:ACF</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=6812&amp;oldid=prev"/>
		<updated>2012-03-12T07:07:42Z</updated>

		<summary type="html">&lt;p&gt;Category:ACF&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;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 07:07, 12 March 2012&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-l17&quot;&gt;Line 17:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 17:&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;  -- Here&amp;#039;s how you call the model directly&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;  -- Here&amp;#039;s how you call the model directly&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;  local modelresult = versioncontroller.model:get()&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;  local modelresult = versioncontroller.model:get()&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&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: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:ACF]] [[Category:HOWTO]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Dubiousjim</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=2364&amp;oldid=prev</id>
		<title>Ttrask: New page: The model provides the core functionality of ACF.  The model can read and write files, launch applications, and do anything else necessary to implement the desired functionality.  Generall...</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Writing_ACF_Models&amp;diff=2364&amp;oldid=prev"/>
		<updated>2008-07-09T19:12:38Z</updated>

		<summary type="html">&lt;p&gt;New page: The model provides the core functionality of ACF.  The model can read and write files, launch applications, and do anything else necessary to implement the desired functionality.  Generall...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The model provides the core functionality of ACF.  The model can read and write files, launch applications, and do anything else necessary to implement the desired functionality.  Generally, models provide the ability to modify the system configuration and start/stop services.&lt;br /&gt;
&lt;br /&gt;
= Model Basics =&lt;br /&gt;
The model should implement functions that provide all of the application functionality for its particular purpose.  Models should be limited in scope to a particular purpose - i.e. managing a particular service.  The controller will call the model functions to implement the user-requested actions.&lt;br /&gt;
&lt;br /&gt;
= Input =&lt;br /&gt;
Model function inputs are specific to the function.  Models have access to all of the common Lua libraries.  The &amp;#039;&amp;#039;modelfunctions&amp;#039;&amp;#039; library is specifically designed to be used by the model and handles some common functionality.&lt;br /&gt;
&lt;br /&gt;
= Handling Forms =&lt;br /&gt;
One of the common functions in a model is to edit certain system variables.  In order to work well with the controller (specifically the &amp;#039;&amp;#039;controllerfunctions.handle_form&amp;#039;&amp;#039; function), the model should implement a pair of get/set or read/write functions.  The get function will create a group of cfe&amp;#039;s describing the parameters and containing their current values.  The set function will expect to receive the same group of cfe&amp;#039;s with new values to be set.  Both the get and set functions should validate the values and fill in the cfe errtxt fields.  The set function should set all or none of the variables and should fill in the group cfe errtxt field if the set fails.  For creating a new object, the same pattern can be followed, with the get function returning empty values.&lt;br /&gt;
&lt;br /&gt;
= Advanced =&lt;br /&gt;
== Loading Another Controller ==&lt;br /&gt;
When writing some more advanced or higher-level models, a designer may need to use functionality already implemented in another controller/model.  Rather than reimplementing the functionality, the model should load the existing controller and call the controller or model functions directly.  Since the model is not using the dispatch function, access to this controller is outside the application&amp;#039;s permission checking.&lt;br /&gt;
 local versioncontroller = self:new(&amp;quot;alpine-baselayout/alpineversion&amp;quot;)&lt;br /&gt;
 local versionresult = versioncontroller:read()&lt;br /&gt;
 -- Here&amp;#039;s how you call the model directly&lt;br /&gt;
 local modelresult = versioncontroller.model:get()&lt;/div&gt;</summary>
		<author><name>Ttrask</name></author>
	</entry>
</feed>