[[TranslatedPages(revision=197,outdated=XML-Anteil unvollständig übersetzt)]]
[[PageOutline(2-10,Inhaltsverzeichnis)]]
''Wenn Sie die Installationsschritte für Voreinstellungen lernen wollen, sehen Sie sich die [[JOSMImage(dialogs/propertiesdialog)]] [wikitr:/Help/Preferences/TaggingPresetPreference Objektvorlagen-Übersicht] in den [[JOSMImage(preference)]] [wikitr:/Help/Action/Preferences Einstellungen]'' an \\
''Wenn Sie Objektvorlagen verwenden wollen oder eine vollständige Referenz der Vorlagen benötigen, siehe [wikitr:/Presets Objektvorlagen]''
= Objektvorlagen =
JOSM unterstützt verteilte Objektvorlagen. Dies ist eine XML-Konfigurationsdatei, die eine grafische Benutzeroberfläche für die Eingabe von Merkmalen (oder Eigenschaften, Anmerkungen, manchmal auch Kartenmerkmale genannt) beschreibt.
Die Voreinstellungen können an beliebiger Stelle im Web oder im lokalen Dateisystem des Benutzers abgelegt werden. JOSM kann für die Verwendung benutzerdefinierter lokaler oder entfernter Voreinstellungen konfiguriert werden.
== Eine neue Objektvorlage erstellen ==
Die Beschreibung einer Objektvorlage geschieht in einem einfachen XML Format. Details siehe [#XML unten].
Siehe **[source:/trunk/resources/data/defaultpresets.xml defaultpresets.xml]** als Beispiel, welches die meisten der unten aufgelisteten Möglichkeiten abdeckt.
Beispiel:
[[Image(wiki:TaggingPresets:Change 1 object.png,right,link=,margin-left=15)]]
{{{
#!preset
}}}
\\
== XML Format Beschreibung ==#XML
Das vollständige XSD Schema ist im Namensraum URI (http://josm.openstreetmap.de/tagging-preset-1.0) sowie [source:trunk/resources/data/tagging-preset.xsd im Quellverzeichnis] verfügbar.
=== Merkmale ===
==== Anfang des Dokuments ====
::
Muss das Hauptmerkmal der Datei sein. Unterstützt folgende Attribute
* **xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"**
* **author** - Der Name des Autors der Vorlage
* **version** - die Versionsnummer der Datei. Für die automatische Versionsanpassung von Vorlagen, die in diesem Wiki verwaltet werden, müssen Sie zwei interne Variablen verwenden: `[[revision]]` (die letzte Versionsnummer der Wikiseite) und `[[date]]` (das Datum der letzten Bearbeitung), z.B. `version="1.[[revision]]_[[date]]"`.
* **description** (i18n) - Beschreibung, was die Datei enthält
* **shortdescription** (i18n) - sehr kurze Übersichtsbeschreibung, z.B. der "Name" der Vorlage
* **link** (i18n) - Webseite für weitere Details (optional)
* **icon** - Bild für die gesamte Vorlage
* **baselanguage** - wenn die Basissprache nicht Englisch ist, geben Sie diese hier an (die Verwendung von nicht englischen Vorlagen-Texten wird die automatische Übersetzung verhindern, sobald sie implementiert ist (#11392))
(i18n) bedeutet, dass die Werte auch lokalisiert werden können (z. B. `de.description`).
\\
==== Kommentare ====
::
Das Dokument kann eingebettete Kommentare enthalten.
\\
==== Erstellung von Vorlagengruppen ====
::
Wird verwendet, um Elemente in Untermenüs zu gruppieren. `name=""` ist erforderlich, `icon=""` ist ein optionales Attribut.
::
Jedes Element ist ein Anmerkungssatz, aus dem ausgewählt werden kann. `name=""` ist erforderlich, `type=""` und `preset_name_label=""` werden empfohlen, `icon=""`, `name_template=""` und `match_expression=""` sind optionale Attribute.
::
Einen Zeilentrenner in das Menü einfügen.
\\
==== Gestaltung des Vorlagenfensters ====
::
Beschriftungen sind statische Texte für die Anzeige. `text=""` ist ein erforderliches Attribut, `icon=""` und `icon_size=""` sind optional.
::
Etwas Freiraum (z.B. eine Leerzeile) einfügen.
::
Dient zur Gruppierung einiger optionaler Elemente eines Eintrags. Das Attribut `text=""` ist optional. Wird es ohne `text=""` verwendet, entspricht dies ``
::
Eine horizontale Trennlinie zwischen den Einträgen einfügen.
::
Einen Weblink für diese Funktion oder für etwas anderes Nützliches angeben. Entweder ist das Attribut `wiki=""` (das auf eine OSM-Wiki-Seite verweist, z.B. `"Tag:leisure=park"`) oder das Attribut `href=""` (vollständige URL) sind erforderlich. Wenn das Attribut `wiki=""` verwendet wird, verweist der Link auf die Wikiseite der Sprache, auf die JOSM eingestellt ist. Existiert diese nicht, wird die englische Seite angezeigt. Wenn `wiki=""` verwendet wird, darf die OSM-Wiki-Seite nicht URL-kodiert sein, z.B. darf sie nicht `"Tag:leisure%3Dpark"` heißen, sondern muss stattdessen `"Tag:leisure=park"` lauten.
::
Um Ankreuzfelder zu gruppieren. Das Attribut `columns=""` ist erforderlich.
::
Dies wird zum Gruppieren von `` benötigt und fügt die Überschrift („Verfügbare Rollen Rolle Anzahl Elemente“) zu der Tabelle hinzu, die durch mehrere Angaben von `` erzeugt wird.
::
Zur Angabe möglicher Rollen von Mitgliedern in Relationen. Das Attribut `key=""` ist erforderlich, `text=""`, `requisite=""`, `count=""`, `type=""`, `member_expression=""` und `regexp=""` sind optional.
::
To specify possible roles of members in relations. The `key=""` attribute is required, `text=""`, `requisite=""`, `count=""`, `type=""`, `member_expression=""` and `regexp=""` are optional.
::
Fügt einen Link zu einer anderen Vorlage mit einer Beschriftung darüber hinzu. Das Attribut `preset_name=""` ist erforderlich, `text=""` zum Überschreiben der Beschriftung (Standard ist `„Bearbeite auch ...“`) und `text_context=""` sind optional. Eine Folge von `` ohne `text=""` oder einem identischen `text=""` werden unter einer Beschriftung gruppiert. \\
**Achtung** bei Vorlagen mit identischem **`name=""`**, da es nicht vorhersehbar ist, zu welcher Vorlage der Link führt, siehe #12716. \\
Das gleiche Merkmale in beiden Vorlagen zu haben, funktioniert nicht, siehe #18992. \\
Die Verwendung von `` in Vorlagen, die über den [wikitr:/Help/Dialog/RelationEditor Relationseditor] geöffnet werden, führt zu Fehlern, siehe #20044.
\\
==== Ein festes Merkmalspaar festlegen ====
::
Mit diesem Element wird ein Merkmal immer auf einen bestimmten Wert gesetzt. `key=""` ist erforderlich und wenn `value=""` vorhanden ist, wird das Merkmal gesetzt. Wenn das Attribut `value=""` weggelassen wird, wird das Merkmal entfernt. Das Attribut `match=""` ist optional.
\\
==== Attribute entry and selection dialog boxes ====#EntrySelectionBoxes
::
A text edit field to enter any arbitrary string from the user. `key=""` is mandatory, `text=""`, `default=""`, `use_last_as_default=""`, `auto_increment=""`, `length=""`, `alternative_autocomplete_keys=""`, `match=""`, `icon=""` and `icon_size=""` (both since r17605) are optional.
::
Displays a multiple choice combo box. `key=""` and `values=""` are mandatory, `text=""`, `default=""`, `editable=""`, `delimiter=""`, `values_from=""`, `display_values=""`, `short_descriptions=""`, `use_last_as_default=""`, `values_searchable=""`, `length=""`, `values_no_i18n=""`, `values_sort=""`, `match=""`, `icon=""` and `icon_size=""` (both since r17605) are optional.\\
If `editable=""` is `true` (default), combo boxes can be edited as if they were text fields (additional to the drop down menu). Non editable combo boxes can only contain one of the specified values.\\
If the key is `colour` or `colour:*` or `*:colour`, a color preview and color picker is added on the right (see #8352).
[=#multiselect]
::
Displays a list from which zero or more items can be chosen. `key=""` and `values=""` are mandatory, and `text=""`, `default=""`, `delimiter=""`, `values_from=""`, `rows=""`, `display_values=""`, `short_descriptions=""`, `use_last_as_default=""`, `values_searchable=""`, `values_no_i18n=""`, `values_sort=""`, `match=""`, `icon=""` and `icon_size=""` (both since r17605) are optional. The selected values will be concatenated with the specified delimiter (default: semicolon, `;`) and written to the tag value. If a tag value has already been set when the preset dialog is opened, the `` will attempt to mark the appropriate items in the list as select. If the tag value cannot be represented by a combination of choices in the list, then the list will be disabled so that the user cannot accidentally overwrite a custom value. In contrast to the `` element, the `` expects the list of values, descriptions etc. to use the specified delimiter, i.e. by default you will have to use a semicolon. You can specify `delimiter=","` but then a comma will also be used in the tag value.
::
Used in `` and ``. More information see `short_descriptions=""`, [#short_description below]. The attributes are `value=""`, `display_value=""`, `short_description=""`, `icon=""` and `icon_size=""`.
::
A checkbox which the user can select, deselect or set as unset. The `key=""` attribute is mandatory. `text=""`, `default=""`, `match=""`, `value_on=""` , `value_off=""`, `disable_off=""`, `icon=""` and `icon_size=""` (both since r15437) are optional.
\\
==== Templates ====
::
To define a template of elements for later (repeated) use. The `id=""` attribute is mandatory.
::
To include an earlier defined template. The `ref=""` attribute is mandatory.
\\
=== Attributes ===
The attributes of the tags have the following meaning:
name="a_name"::
Specify a name for an item. This name will be used in the GUI to display the tagging preset.
name_context="context"::
Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
type="data_type"::
When specified, only objects of the given type will work with this tagging preset. Can be `"node"`, `"way"`, `"closedway"`, `"multipolygon"`, `"relation"` or any comma separated combination of them. Note that `"multipolygon"` is not included in `"relation"`, so if the preset should apply for multipolygons and other relation types, you need to specify both: `"multipolygon,relation"`. Also used in the `` tag to specify which object types are allowed for a specific relation member.
icon="iconname"::
A name or link to an icon. The image will be used as icon to display in the selection list and when adding the preset to the toolbar. Icons can also be used in ``, ``, plus all [#EntrySelectionBoxes attribute entry and selection dialog boxes] (since r17605, before it was only `` and ``). It is placed in front of `` The icon should be quadratic in size. See [wikitr:/Styles#Iconhandling Icon handling] how icons can be specified.
icon_size="a number"::
The maximal size of an icon in px. If no value is given, default is 16 for `` and the default icon size for `` (in `` and ``).
key="some_key"::
This specifies the property key that will be modified by the item. In case of `` it is the role name used in a relation.
text="Any text"::
The description, that will be displayed before the gui element, (in case of `` after the gui element and the optional icon). Also used for `