Changes between Version 15 and Version 16 of De:TaggingPresets


Ignore:
Timestamp:
2014-11-11T22:46:55+01:00 (10 years ago)
Author:
Klumbumbus
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • De:TaggingPresets

    v15 v16  
    1 [[TranslatedPages(revision=100,outdated=Die Abschnitte 'XML Format Beschreibung' und 'Übersetzung' müssen noch übersetzt werden. Außerdem sollte das Beispiel geändert werden weil es für OSM ungewöhnliche Schlüssel-Wert-Kombinationen nutzt und Straßen normalerweise NICHT Einbahnstraßen sind.)]]
     1[[TranslatedPages(revision=104,outdated=Die Abschnitte 'XML Format Beschreibung' und 'Übersetzung' müssen noch übersetzt werden. Außerdem sollte das Beispiel geändert werden weil es für OSM ungewöhnliche Schlüssel-Wert-Kombinationen nutzt und Straßen normalerweise NICHT Einbahnstraßen sind.)]]
    22[[PageOutline(2-10,Inhaltsverzeichnis)]]
    33= Objektvorlagen =
     
    4343=== Tags ===
    4444==== The document prolog ====
    45  '''<presets>'''::
    46    Has to be the main tag of the file. Supports following attributes
    47    * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''
    48    * '''author''' - the name of the author of the preset
    49    * '''version''' - the version number of the file. For automatical version adjustment of presets managed in this wiki you can use two internal variables: `[[revision]]` (the latest version number of the wiki page) and `[[date]]` (the date of the last edit).
    50    * '''description''' (i18n) - description what the file contains
    51    * '''shortdescription''' (i18n) - very short overview description i.e. the "name" of the preset
    52    * '''link''' (i18n) - web link to further details (optional)
    53    * '''icon''' - informational icon for the whole preset. (This is nedded to display the icon in the table at [[Presets]].)
    54 (i18n) means the values may also be localized (e.g. de.description).
     45 <presets>::
     46  Has to be the main tag of the file. Supports following attributes
     47  * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''
     48  * '''author''' - the name of the author of the preset
     49  * '''version''' - the version number of the file. For automatical version adjustment of presets managed in this wiki you can use two internal variables: `[[revision]]` (the latest version number of the wiki page) and `[[date]]` (the date of the last edit).
     50  * '''description''' (i18n) - description what the file contains
     51  * '''shortdescription''' (i18n) - very short overview description i.e. the "name" of the preset
     52  * '''link''' (i18n) - web link to further details (optional)
     53  * '''icon''' - informational icon for the whole preset. (This is nedded to display the icon in the table at [[Presets]].)
     54
     55  (i18n) means the values may also be localized (e.g. de.description).
     56[[BR]]
    5557==== Comments ====
    56  '''<!-- this is an example comment -->'''::
     58 <!-- this is an example comment -->::
    5759  The document can contain embedded comments.
     60[[BR]]
    5861==== Menu creation ====
    59  '''<group>'''::
    60    Used to group items in sub menus. ''name'' is required, ''icon'' is optional attribute.
    61  '''<item>'''::
    62    Every item is one annotation set to select from. ''name'' is required, ''type'' and ''preset_name_label'' are recommended, ''icon'' and ''name_template'' are optional attributes.
    63  '''<separator/>'''::
    64    Insert a line separator into the menu.
     62 <group>::
     63  Used to group items in sub menus. ''name'' is required, ''icon'' is optional attribute.
     64 <item>::
     65  Every item is one annotation set to select from. ''name'' is required, ''type'' and ''preset_name_label'' are recommended, ''icon'' and ''name_template'' are optional attributes.
     66 <separator/>::
     67  Insert a line separator into the menu.
     68[[BR]]
    6569==== Preset window layout ====
    66  '''<label>'''::
    67    Labels are static texts for display. ''text'' is a required attribute, ''icon'' and ''icon_size'' are optional.
    68  '''<space />'''::
    69    Add some space (ie a newline).
    70  '''<optional>'''::
    71    Used to group some optional elements of an item. The ''text'' attribute is optional. If used without ''text'' then this is equivalent to <space /><label text="Optional Attributes:"/><space />
    72  '''<item_separator />'''::
    73    Add a horizontal separator line between items.
    74  '''<link>'''::
    75    Specify a web link for this feature or to anything else of use. The ''href'' attribute is required.
    76  '''<checkgroup>'''::
    77    To group checks. The ''columns'' attribute is required.
    78  '''<roles>'''::
    79    This is required around <role> and adds the heading ("Availible roles role count elements") to the table which is generated by several <role>.
    80  '''<role>'''::
    81    To specify possible roles of members in relations. The ''key'' attribute is required, ''text'', ''requisite'', ''count'', ''type'' and ''member_expression'' are optional.
    82  '''<preset_link>'''::
    83    Adds a link to an other preset. The ''preset_name'' attribute is required.
     70 <label>::
     71  Labels are static texts for display. ''text'' is a required attribute, ''icon'' and ''icon_size'' are optional.
     72 <space />::
     73  Add some space (ie a newline).
     74 <optional>::
     75  Used to group some optional elements of an item. The ''text'' attribute is optional. If used without ''text'' then this is equivalent to <space /><label text="Optional Attributes:"/><space />
     76 <item_separator />::
     77  Add a horizontal separator line between items.
     78 <link>::
     79  Specify a web link for this feature or to anything else of use. The ''href'' attribute is required.
     80 <checkgroup>::
     81  To group checks. The ''columns'' attribute is required.
     82 <roles>::
     83  This is required around <role> and adds the heading ("Availible roles role count elements") to the table which is generated by several <role>.
     84 <role>::
     85  To specify possible roles of members in relations. The ''key'' attribute is required, ''text'', ''requisite'', ''count'', ''type'' and ''member_expression'' are optional.
     86 <preset_link>::
     87  Adds a link to an other preset. The ''preset_name'' attribute is required.
     88[[BR]]
    8489==== Set a fixed key value pair ====
    85  '''<key>'''::
    86    This tag will always set a key to a specific value. ''key'' is required and if ''value'' is present, the key will be set. If ''value'' attribute is ommited, the key is removed. The ''match'' attribute is optional.
     90 <key>::
     91  This tag will always set a key to a specific value. ''key'' is required and if ''value'' is present, the key will be set. If ''value'' attribute is ommited, the key is removed. The ''match'' attribute is optional.
     92[[BR]]
    8793==== Attribute entry and selection dialog boxes ====
    88  '''<text>'''::
    89    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'' and ''match'' is optional
    90  '''<combo>'''::
    91    Displays a multiple choice combo box. ''key'' and ''values'' are mandatory, ''text'', ''default'', ''editable'', ''delimiter'', ''values_from'', ''display_values'', ''schort_descriptions'', ''use_last_as_default'', ''values_searchable'', ''length'' and ''match'' is optional.
    92    If editable is true (default), combo boxes can be edited as if they were text fields (additional to the drop down menu). Non editable
    93    combo boxes can only contain one of the specified values.
    94  '''<multiselect>'''::
    95    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'' and ''match'' 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 multiselect 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 "combo" element, the "multiselect" 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.
    96  '''<list_entry>'''::
    97    Used in <combo> and <multiselect>. More information see ''short_descriptions''. The attributes are ''value'', ''display_value'', ''short_description'', ''icon'' and ''icon_size''.
    98  '''<check>'''::
    99    A checkbox which the user can only select or deselect (or set as unset). The ''key'' attribute is mandatory. ''text'', ''default'', ''match'', ''value_on'' , ''value_off'' and ''disable_off'' are optional.
     94 <text>::
     95  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'' and ''match'' is optional
     96 <combo>::
     97  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'' and ''match'' is optional.\\
     98  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.
     99 <multiselect>::
     100  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'' and ''match'' 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 multiselect 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 "combo" element, the "multiselect" 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.
     101 <list_entry>::
     102  Used in <combo> and <multiselect>. More information see ''short_descriptions''. The attributes are ''value'', ''display_value'', ''short_description'', ''icon'' and ''icon_size''.
     103 <check>::
     104  A checkbox which the user can only select or deselect (or set as unset). The ''key'' attribute is mandatory. ''text'', ''default'', ''match'', ''value_on'' , ''value_off'' and ''disable_off'' are optional.
     105[[BR]]
    100106==== Templates ====
    101  '''<chunk>'''::
    102    To define a template of elements for later (repeated) use. The ''id'' attribute is mandatory.
    103  '''<reference>'''::
    104    To include an earlier defined template. The ''ref'' attribute is mandatory.
    105 
     107 <chunk>::
     108  To define a template of elements for later (repeated) use. The ''id'' attribute is mandatory.
     109 <reference>::
     110  To include an earlier defined template. The ''ref'' attribute is mandatory.
     111[[BR]]
    106112=== Attributes ===
    107113The attributes of the tags have the following meaning:
    108  '''name="a_name"'''::
    109    Specify a name for an item. This name will be used in the GUI to display the tagging preset.
    110  '''name_context="context"'''::
    111    Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
    112  '''type="data_type"'''::
    113    When specified, only objects of the given type will be changed at all by this tagging preset. Can be "node", "relation", "way", "closedway" or any comma separated combination of them. Also used in the <role> tag to specify which object types are allowed for a specific relation member.
    114  '''icon="iconname"'''::
    115    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 <item>, <label> and <list_entry>. The icon should be quadratic in size. See [[Styles#Iconhandling]] how icons can be specified.
    116  '''icon_size="a number"'''::
    117    The maximal size of an icon in px. If no value is given, default is 16 for <label> and the default icon size for <list_entry /> (in <combo> and <multiselect>).
    118  '''key="some_key"'''::
    119    This specifies the property key that will be modified by the item. In case of <role> it is the role name used in a relation.
    120  '''text="Any text"'''::
    121    The description, that will be displayed before (after in case of <check>) the gui element. Also used for <label> and <optional>.
    122  '''text_context="context"'''::
    123    Translation context for text attribute to separate equals words with different meaning (not required for in-file translations).
    124  '''default="default_value"'''::
    125    The default value for the item. If not specified, the current value of the key is chosen as default (if applicable). In case of <check> whether the checkbox is ticked on or off by default (default is "off"). In case of <text>, <combo> and <multiselct> defaults to "".
    126  '''values="entry1,entry2,entry3"'''::
    127    A list of entries (for the <combo> box and <multiselect>). The list has to be separated by commas (for the combo box) or by the specified delimiter (for the multiselect). If a value contains the delimiter, the delimiter may be escaped with a backslash. If a value contains a backslash, it must also be escaped with a backslash.
    128  '''values_from="JAVA code"'''::
    129    To use instead of "values" if the list of values has to be obtained with a Java method of this form: public static String[] getValues(); The value must be: "full.package.name.ClassName#methodName".
    130  '''values_context="context"'''::
    131    Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
    132  '''display_values="Entry1,Entry2,Entry3"'''::
    133    A list of entries that is displayed to the user. Must be the same number and order of entries as values and ''editable'' must be false or not specified. For the delimiter character and escaping, see the remarks at ''values''. Used in <combo> and <multiselect>.
    134  '''value="foobar"'''::
    135    Specify a value to be entered in the <key> tag.
    136  '''value_on="foobar"'''::
    137    Specify the true value to be entered in the <key> tag of a checked <check> (default is "yes").
    138  '''value_off="foobar"'''::
    139    Specify the false value to be entered in the <key> tag of a unchecked <check> (default is "no").
    140  '''disable_off="true"'''::
    141    Whether the off value of a <check> is disabled in the dialog, i.e., only unset or yes are provided.
    142  '''editable="false"'''::
    143    The combo box is readonly, which means that the user can only select an item in the list. Default is "true", which means, the user can add other values as text.
    144  '''use_last_as_default="true|false|force"'''::
    145    For <combo>, <multiselect> or <text> fields the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".
    146  '''rows="count"'''::
    147    Specify the number of rows to display in <multiselect> entry (default -1).
    148  '''name_template="template", name_template_filter="search expression"'''::
    149    Custom name formatter for osm primitives matching this preset. See [[NameTemplate]] for details.
    150  '''match="none|key|key!|keyvalue|keyvalue!"'''::
    151     Allows to change the matching process, i.e., determining whether the tags of an OSM object fit into this preset. If a preset fits then it is linked in the [wiki:Help/Dialog/TagsMembership Tags/Membership dialog].
    152     * none: neutral, i.e., do not consider this item for matching
    153     * key: positive if key matches, neutral otherwise
    154     * key!: positive if key matches, negative otherwise
    155     * keyvalue: positive if key and value matches, neutral otherwise
    156     * keyvalue!: positive if key and value matches, negative otherwise
    157    Note that for a match, at least one positive and no negative is required. Default is "keyvalue!" for <key> and "none" for <text>, <combo>, <multiselect> and <check>.
    158  '''id="unique_identifier"'''::
    159    the unique identifier for this chunk
    160  '''ref="unique_identifier"'''::
    161    the unique identifier of the (already defined) template to include
    162  '''columns="a number"'''::
    163    the number of columns of grouped checks
    164  '''requisite="optional|required"'''::
    165    If a relation member is optional or required. Default is "optional".
    166  '''count="a number"'''::
    167    How often can a role occur (if not given unlimited number is assumed)
    168  '''member_expression="an expression"'''::
    169    an expression (cf. search dialog) for objects of this role
    170  '''preset_name="exact_name"'''::
    171    The exact name of the preset to link to.
    172  '''preset_name_label="false|true"'''::
    173    Whether to insert "[preset name]" label in dialog (defaults to "false" for backward-compatibility on external presets).
    174  '''length="a number"'''::
    175    The length of a <text> or <combo> box (number of characters allowed).
    176  '''alternative_autocomplete_keys="some_key(s)"'''::
    177    A comma separated list of alternative keys to use for autocompletion of <text>.
    178  '''auto_increment="-2,-1,+1,+2"'''::
    179    May contain a comma separated list of integer increments or decrements, e.g. "-2,-1,+1,+2". A button will be shown next to the <text> field for each value, allowing the user to select auto-increment with the given stepping. Auto-increment only happens if the user selects it. There is also a button to deselect auto-increment. Default is no auto-increment. Mutually exclusive with ''use_last_as_default''.
    180  '''delimiter="special character"'''::
    181    The character that separates values. In case of <combo> the default is comma. In case of <multiselect> the default is semicolon and this will also be used to separate selected values in the tag. More information see <multiselect>.
    182  '''short_descriptions=""Entry1,Entry2,Entry3"'''::
    183    A delimiter-separated list of texts to be displayed below each ''display_value''. (Only if it is not possible to describe the entry in 2-3 words.) Instead of comma separated list instead using values, display_values and short_descriptions, the following form is also supported: <list_entry value="" display_value="" short_description="" icon="" icon_size="" />
    184  '''values_searchable="true|false"'''::
    185    Whether to search in <combo> or <multiselect> (display_)values when searching for presets.
     114 name="a_name"::
     115  Specify a name for an item. This name will be used in the GUI to display the tagging preset.
     116 name_context="context"::
     117  Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     118 type="data_type"::
     119  When specified, only objects of the given type will be changed at all by this tagging preset. Can be "node", "relation", "way", "closedway" or any comma separated combination of them. Also used in the <role> tag to specify which object types are allowed for a specific relation member.
     120 icon="iconname"::
     121  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 <item>, <label> and <list_entry>. The icon should be quadratic in size. See [[Styles#Iconhandling]] how icons can be specified.
     122 icon_size="a number"::
     123  The maximal size of an icon in px. If no value is given, default is 16 for <label> and the default icon size for <list_entry /> (in <combo> and <multiselect>).
     124 key="some_key"::
     125  This specifies the property key that will be modified by the item. In case of <role> it is the role name used in a relation.
     126 text="Any text"::
     127  The description, that will be displayed before (after in case of <check>) the gui element. Also used for <label> and <optional>.
     128 text_context="context"::
     129  Translation context for text attribute to separate equals words with different meaning (not required for in-file translations).
     130 default="default_value"::
     131  The default value for the item. If not specified, the current value of the key is chosen as default (if applicable). In case of <check> whether the checkbox is ticked on or off by default (default is "off"). In case of <text>, <combo> and <multiselct> defaults to "".
     132 values="entry1,entry2,entry3"::
     133  A list of entries (for the <combo> box and <multiselect>). The list has to be separated by commas (for the combo box) or by the specified delimiter (for the multiselect). If a value contains the delimiter, the delimiter may be escaped with a backslash. If a value contains a backslash, it must also be escaped with a backslash.
     134 values_from="JAVA code"::
     135  To use instead of "values" if the list of values has to be obtained with a Java method of this form: public static String[] getValues(); The value must be: "full.package.name.ClassName#methodName".
     136 values_context="context"::
     137  Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     138 display_values="Entry1,Entry2,Entry3"::
     139  A list of entries that is displayed to the user. Must be the same number and order of entries as values and ''editable'' must be false or not specified. For the delimiter character and escaping, see the remarks at ''values''. Used in <combo> and <multiselect>.
     140 value="foobar"::
     141  Specify a value to be entered in the <key> tag.
     142 value_on="foobar"::
     143  Specify the true value to be entered in the <key> tag of a checked <check> (default is "yes").
     144 value_off="foobar"::
     145  Specify the false value to be entered in the <key> tag of a unchecked <check> (default is "no").
     146 disable_off="true"::
     147  Whether the off value of a <check> is disabled in the dialog, i.e., only unset or yes are provided.
     148 editable="false"::
     149  The combo box is readonly, which means that the user can only select an item in the list. Default is "true", which means, the user can add other values as text.
     150 use_last_as_default="true|false|force"::
     151  For <combo>, <multiselect> or <text> fields the last value is used as default. Using "force" enforces this behaviour also for already tagged objects. Default is "false".
     152 rows="count"::
     153  Specify the number of rows to display in <multiselect> entry (default -1).
     154 name_template="template", name_template_filter="search expression"'''::
     155  Custom name formatter for osm primitives matching this preset. See [[NameTemplate]] for details.
     156 match="none|key|key!|keyvalue|keyvalue!"::
     157  Allows to change the matching process, i.e., determining whether the tags of an OSM object fit into this preset. If a preset fits then it is linked in the [wiki:Help/Dialog/TagsMembership Tags/Membership dialog].
     158  * none: neutral, i.e., do not consider this item for matching
     159  * key: positive if key matches, neutral otherwise
     160  * key!: positive if key matches, negative otherwise
     161  * keyvalue: positive if key and value matches, neutral otherwise
     162  * keyvalue!: positive if key and value matches, negative otherwise
     163
     164  Note that for a match, at least one positive and no negative is required. Default is "keyvalue!" for <key> and "none" for <text>, <combo>, <multiselect> and <check>.
     165 id="unique_identifier"::
     166  the unique identifier for this chunk
     167 ref="unique_identifier"::
     168  the unique identifier of the (already defined) template to include
     169 columns="a number"::
     170  the number of columns of grouped checks
     171 requisite="optional|required"'''::
     172  If a relation member is optional or required. Default is "optional".
     173 count="a number"::
     174  How often can a role occur (if not given unlimited number is assumed)
     175 member_expression="an expression"'''::
     176  an expression (cf. search dialog) for objects of this role
     177 preset_name="exact_name"::
     178  The exact name of the preset to link to.
     179 preset_name_label="false|true"::
     180  Whether to insert "[preset name]" label in dialog (defaults to "false" for backward-compatibility on external presets).
     181 length="a number"::
     182  The length of a <text> or <combo> box (number of characters allowed).
     183 alternative_autocomplete_keys="some_key(s)"'''::
     184  A comma separated list of alternative keys to use for autocompletion of <text>.
     185 auto_increment="-2,-1,+1,+2"::
     186  May contain a comma separated list of integer increments or decrements, e.g. "-2,-1,+1,+2". A button will be shown next to the <text> field for each value, allowing the user to select auto-increment with the given stepping. Auto-increment only happens if the user selects it. There is also a button to deselect auto-increment. Default is no auto-increment. Mutually exclusive with ''use_last_as_default''.
     187 delimiter="special character"::
     188  The character that separates values. In case of <combo> the default is comma. In case of <multiselect> the default is semicolon and this will also be used to separate selected values in the tag. More information see <multiselect>.
     189 short_descriptions=""Entry1,Entry2,Entry3"::
     190  A delimiter-separated list of texts to be displayed below each ''display_value''. (Only if it is not possible to describe the entry in 2-3 words.) Instead of comma separated list instead using values, display_values and short_descriptions, the following form is also supported: <list_entry value="" display_value="" short_description="" icon="" icon_size="" />
     191 values_searchable="true|false"::
     192  Whether to search in <combo> or <multiselect> (display_)values when searching for presets.
    186193
    187194== Übersetzung ==