Changes between Version 100 and Version 101 of TaggingPresets


Ignore:
Timestamp:
2014-11-07T17:40:08+01:00 (11 years ago)
Author:
skyper
Comment:

typo + removed unneeded formating + forgotten important part about match

Legend:

Unmodified
Added
Removed
Modified
  • TaggingPresets

    v100 v101  
    4242=== Tags ===
    4343==== The document prolog ====
    44  '''<presets>'''::
    45    Has to be the main tag of the file. Supports following attributes
    46    * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''
    47    * '''author''' - the name of the author of the preset
    48    * '''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).
    49    * '''description''' (i18n) - description what the file contains
    50    * '''shortdescription''' (i18n) - very short overview description i.e. the "name" of the preset
    51    * '''link''' (i18n) - web link to further details (optional)
    52    * '''icon''' - informational icon for the whole preset. (This is nedded to display the icon in the table at [[Presets]].)
    53 (i18n) means the values may also be localized (e.g. de.description).
     44 <presets>::
     45  Has to be the main tag of the file. Supports following attributes
     46  * '''xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"'''
     47  * '''author''' - the name of the author of the preset
     48  * '''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).
     49  * '''description''' (i18n) - description what the file contains
     50  * '''shortdescription''' (i18n) - very short overview description i.e. the "name" of the preset
     51  * '''link''' (i18n) - web link to further details (optional)
     52  * '''icon''' - informational icon for the whole preset. (This is nedded to display the icon in the table at [[Presets]].)
     53
     54  (i18n) means the values may also be localized (e.g. de.description).
     55
    5456==== Comments ====
    55  '''<!-- this is an example comment -->'''::
     57 <!-- this is an example comment -->::
    5658  The document can contain embedded comments.
     59
    5760==== Menu creation ====
    58  '''<group>'''::
    59    Used to group items in sub menus. ''name'' is required, ''icon'' is optional attribute.
    60  '''<item>'''::
    61    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.
    62  '''<separator/>'''::
    63    Insert a line separator into the menu.
     61 <group>::
     62  Used to group items in sub menus. ''name'' is required, ''icon'' is optional attribute.
     63 <item>::
     64  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.
     65 <separator/>::
     66  Insert a line separator into the menu.
     67
    6468==== Preset window layout ====
    65  '''<label>'''::
    66    Labels are static texts for display. ''text'' is a required attribute, ''icon'' and ''icon_size'' are optional.
    67  '''<space />'''::
    68    Add some space (ie a newline).
    69  '''<optional>'''::
    70    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 />
    71  '''<item_separator />'''::
    72    Add a horizontal separator line between items.
    73  '''<link>'''::
    74    Specify a web link for this feature or to anything else of use. The ''href'' attribute is required.
    75  '''<checkgroup>'''::
    76    To group checks. The ''columns'' attribute is required.
    77  '''<roles>'''::
    78    This is required around <role> and adds the heading ("Availible roles role count elements") to the table which is generated by several <role>.
    79  '''<role>'''::
    80    To specify possible roles of members in relations. The ''key'' attribute is required, ''text'', ''requisite'', ''count'', ''type'' and ''member_expression'' are optional.
    81  '''<preset_link>'''::
    82    Adds a link to an other preset. The ''preset_name'' attribute is required.
     69 <label>::
     70  Labels are static texts for display. ''text'' is a required attribute, ''icon'' and ''icon_size'' are optional.
     71 <space />::
     72  Add some space (ie a newline).
     73 <optional>::
     74  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 />
     75 <item_separator />::
     76  Add a horizontal separator line between items.
     77 <link>::
     78  Specify a web link for this feature or to anything else of use. The ''href'' attribute is required.
     79 <checkgroup>::
     80  To group checks. The ''columns'' attribute is required.
     81 <roles>::
     82  This is required around <role> and adds the heading ("Availible roles role count elements") to the table which is generated by several <role>.
     83 <role>::
     84  To specify possible roles of members in relations. The ''key'' attribute is required, ''text'', ''requisite'', ''count'', ''type'' and ''member_expression'' are optional.
     85 <preset_link>::
     86  Adds a link to an other preset. The ''preset_name'' attribute is required.
     87
    8388==== Set a fixed key value pair ====
    84  '''<key>'''::
    85    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.
     89 <key>::
     90  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 and is set to ''match=keyvalue'' if ''value'' is present.
     91
    8692==== Attribute entry and selection dialog boxes ====
    87  '''<text>'''::
    88    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
    89  '''<combo>'''::
    90    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.
    91    If editable is true (default), combo boxes can be edited as if they were text fields (additional to the drop down menu). Non editable
    92    combo boxes can only contain one of the specified values.
    93  '''<multiselect>'''::
    94    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.
    95  '''<list_entry>'''::
    96    Used in <combo> and <multiselect>. More information see ''short_descriptions''. The attributes are ''value'', ''display_value'', ''short_description'', ''icon'' and ''icon_size''.
    97  '''<check>'''::
    98    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.
     93 <text>::
     94  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
     95 <combo>::
     96  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.\\
     97  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.
     98 <multiselect>::
     99  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.
     100 <list_entry>::
     101  Used in <combo> and <multiselect>. More information see ''short_descriptions''. The attributes are ''value'', ''display_value'', ''short_description'', ''icon'' and ''icon_size''.
     102 <check>::
     103  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.
     104
    99105==== Templates ====
    100  '''<chunk>'''::
    101    To define a template of elements for later (repeated) use. The ''id'' attribute is mandatory.
    102  '''<reference>'''::
    103    To include an earlier defined template. The ''ref'' attribute is mandatory.
     106 <chunk>::
     107  To define a template of elements for later (repeated) use. The ''id'' attribute is mandatory.
     108 <reference>::
     109  To include an earlier defined template. The ''ref'' attribute is mandatory.
    104110
    105111=== Attributes ===
    106112The attributes of the tags have the following meaning:
    107  '''name="a_name"'''::
    108    Specify a name for an item. This name will be used in the GUI to display the tagging preset.
    109  '''name_context="context"'''::
    110    Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
    111  '''type="data_type"'''::
    112    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.
    113  '''icon="iconname"'''::
    114    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.
    115  '''icon_size="a number"'''::
    116    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>).
    117  '''key="some_key"'''::
    118    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.
    119  '''text="Any text"'''::
    120    The description, that will be displayed before (after in case of <check>) the gui element. Also used for <label> and <optional>.
    121  '''text_context="context"'''::
    122    Translation context for text attribute to separate equals words with different meaning (not required for in-file translations).
    123  '''default="default_value"'''::
    124    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 "".
    125  '''values="entry1,entry2,entry3"'''::
    126    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.
    127  '''values_from="JAVA code"'''::
    128    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".
    129  '''values_context="context"'''::
    130    Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
    131  '''display_values="Entry1,Entry2,Entry3"'''::
    132    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>.
    133  '''value="foobar"'''::
    134    Specify a value to be entered in the <key> tag.
    135  '''value_on="foobar"'''::
    136    Specify the true value to be entered in the <key> tag of a checked <check> (default is "yes").
    137  '''value_off="foobar"'''::
    138    Specify the false value to be entered in the <key> tag of a unchecked <check> (default is "no").
    139  '''disable_off="true"'''::
    140    Whether the off value of a <check> is disabled in the dialog, i.e., only unset or yes are provided.
    141  '''editable="false"'''::
    142    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.
    143  '''use_last_as_default="true|false|force"'''::
    144    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".
    145  '''rows="count"'''::
    146    Specify the number of rows to display in <multiselect> entry (default -1).
    147  '''name_template="template", name_template_filter="search expression"'''::
    148    Custom name formatter for osm primitives matching this preset. See [[NameTemplate]] for details.
    149  '''match="none|key|key!|keyvalue|keyvalue!"'''::
    150     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].
    151     * none: neutral, i.e., do not consider this item for matching
    152     * key: positive if key matches, neutral otherwise
    153     * key!: positive if key matches, negative otherwise
    154     * keyvalue: positive if key and value matches, neutral otherwise
    155     * keyvalue!: positive if key and value matches, negative otherwise
    156    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>.
    157  '''id="unique_identifier"'''::
    158    the unique identifier for this chunk
    159  '''ref="unique_identifier"'''::
    160    the unique identifier of the (already defined) template to include
    161  '''columns="a number"'''::
    162    the number of columns of grouped checks
    163  '''requisite="optional|required"'''::
    164    If a relation member is optional or required. Default is "optional".
    165  '''count="a number"'''::
    166    How often can a role occur (if not given unlimited number is assumed)
    167  '''member_expression="an expression"'''::
    168    an expression (cf. search dialog) for objects of this role
    169  '''preset_name="exact_name"'''::
    170    The exact name of the preset to link to.
    171  '''preset_name_label="false|true"'''::
    172    Whether to insert "[preset name]" label in dialog (defaults to "false" for backward-compatibility on external presets).
    173  '''length="a number"'''::
    174    The length of a <text> or <combo> box (number of characters allowed).
    175  '''alternative_autocomplete_keys="some_key(s)"'''::
    176    A comma separated list of alternative keys to use for autocompletion of <text>.
    177  '''auto_increment="-2,-1,+1,+2"'''::
    178    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''.
    179  '''delimiter="special character"'''::
    180    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>.
    181  '''short_descriptions=""Entry1,Entry2,Entry3"'''::
    182    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="" />
    183  '''values_searchable="true|false"'''::
    184    Whether to search in <combo> or <multiselect> (display_)values when searching for presets.
     113 name="a_name"::
     114  Specify a name for an item. This name will be used in the GUI to display the tagging preset.
     115 name_context="context"::
     116  Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     117 type="data_type"::
     118  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.
     119 icon="iconname"::
     120  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.
     121 icon_size="a number"::
     122  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>).
     123 key="some_key"::
     124  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.
     125 text="Any text"::
     126  The description, that will be displayed before (after in case of <check>) the gui element. Also used for <label> and <optional>.
     127 text_context="context"::
     128  Translation context for text attribute to separate equals words with different meaning (not required for in-file translations).
     129 default="default_value"::
     130  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 "".
     131 values="entry1,entry2,entry3"::
     132  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.
     133 values_from="JAVA code"::
     134  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".
     135 values_context="context"::
     136  Translation context for name attribute to separate equals words with different meaning (not required for in-file translations).
     137 display_values="Entry1,Entry2,Entry3"::
     138  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>.
     139 value="foobar"::
     140  Specify a value to be entered in the <key> tag.
     141 value_on="foobar"::
     142  Specify the true value to be entered in the <key> tag of a checked <check> (default is "yes").
     143 value_off="foobar"::
     144  Specify the false value to be entered in the <key> tag of a unchecked <check> (default is "no").
     145 disable_off="true"::
     146  Whether the off value of a <check> is disabled in the dialog, i.e., only unset or yes are provided.
     147 editable="false"::
     148  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.
     149 use_last_as_default="true|false|force"::
     150  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".
     151 rows="count"::
     152  Specify the number of rows to display in <multiselect> entry (default -1).
     153 name_template="template", name_template_filter="search expression"'''::
     154  Custom name formatter for osm primitives matching this preset. See [[NameTemplate]] for details.
     155 match="none|key|key!|keyvalue|keyvalue!"::
     156  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].
     157  * none: neutral, i.e., do not consider this item for matching
     158  * key: positive if key matches, neutral otherwise
     159  * key!: positive if key matches, negative otherwise
     160  * keyvalue: positive if key and value matches, neutral otherwise
     161  * keyvalue!: positive if key and value matches, negative otherwise
     162
     163  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>.
     164 id="unique_identifier"::
     165  the unique identifier for this chunk
     166 ref="unique_identifier"::
     167  the unique identifier of the (already defined) template to include
     168 columns="a number"::
     169  the number of columns of grouped checks
     170 requisite="optional|required"'''::
     171  If a relation member is optional or required. Default is "optional".
     172 count="a number"::
     173  How often can a role occur (if not given unlimited number is assumed)
     174 member_expression="an expression"'''::
     175  an expression (cf. search dialog) for objects of this role
     176 preset_name="exact_name"::
     177  The exact name of the preset to link to.
     178 preset_name_label="false|true"::
     179  Whether to insert "[preset name]" label in dialog (defaults to "false" for backward-compatibility on external presets).
     180 length="a number"::
     181  The length of a <text> or <combo> box (number of characters allowed).
     182 alternative_autocomplete_keys="some_key(s)"'''::
     183  A comma separated list of alternative keys to use for autocompletion of <text>.
     184 auto_increment="-2,-1,+1,+2"::
     185  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''.
     186 delimiter="special character"::
     187  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>.
     188 short_descriptions=""Entry1,Entry2,Entry3"::
     189  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="" />
     190 values_searchable="true|false"::
     191  Whether to search in <combo> or <multiselect> (display_)values when searching for presets.
    185192
    186193== Translation ==