-
Notifications
You must be signed in to change notification settings - Fork 19
Templates
An application template is basically an application, where some information is still missing. Typically, a template allows you to download an application of your choice from a website which offers a plethora of downloads, like softpedia.com, by using only the template plus some information like the application name.
If you want to create (and possibly share) application templates, you can export an existing application as template by choosing Application Template
as output file type for File
→ Export
. After that, you can add placeholders
to the exported XML. When a user imports an application template with placeholders
, he will be asked to insert values for them. To add a placeholder
, just add <placeholder name="This will be shown to the user" />
to the exported XML where the replacement content should appear. You can add as many as you like. The user will only be prompted once for multiple placeholders
with the same name. The following attributes for the placeholder
XML element are available:
Name | Description | Version Required |
---|---|---|
name | Name of the placeholder, each unique name will be prompted only once. Also, the text will be shown to the user as prompt. | 1.1 |
options | Specifies a list of options, separated by a pipe ("|"). Instead of a text box, a combo box with dropdown is shown so that the user can select one of the given values. | 1.1 |
regex | Specifies a regular expression which is to be applied to the user entered value. The result of the regular expression is used instead of the value. | 1.1 |
value | Default value, user does not have to enter a value to proceed. | 1.1 |
variable | Upon creation of the template, Ketarin attempts to resolve the specified (without braces) variable and use the resulting value for this placeholder. If the variable cannot be determined (no internet connection etc.), the user is asked to enter a value manually. | 1.5 |
Sometimes, it may be necessary to adjust an application template to accomodate any changes to the website it has been created for. If you change the template, you would have to re-create all applications from the new template though, which is quite tedious. In order to prevent that, you can attach a 'random' GUID to a template which has placeholders:
<ApplicationJob xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Guid="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx">
If you then ever import a changed template with the same GUID, Ketarin will ask whether or not to update existing applications with a new template. All fields with the same name
value will be preserved. It's important not to change the name
of fields between different versions of a template as it will create problems. Likewise, if you manually edit the values of a template-based application job then your changes can prevent the updated template from applying.
- <placeholder name="Changelog" variable="changelog" />
- <placeholder name="Bits" options="x64|x86|ARM64" value="x64" />
- <placeholder name="Operating system" options="Windows|Linux|macOS" value="Windows" />
Click File
→ Import
, then select the XML file that contains the template
. You will be prompted for all necessary placeholders
. You can find many templates in the forum.