Changes between Version 56 and Version 57 of TaggingPresets


Ignore:
Timestamp:
2014-10-29T11:16:36+01:00 (11 years ago)
Author:
stoecker
Comment:

Copy text from XML

Legend:

Unmodified
Added
Removed
Modified
  • TaggingPresets

    v56 v57  
    1 [[TranslatedPages(outdated=The preset syntax has changed and this page needs to be adjusted to reflect the changes)]]
     1[[TranslatedPages(outdated=The preset syntax has changed and the copy from XML files needs to be joined with normal description)]]
    22= Tagging Presets =
    33JOSM supports distributed tagging presets. This is a XML config file that describes a GUI for entering tags (or properties, annotations, sometimes called map features). The XML files can be placed anywhere in the web or at the users local file system. Presets can be added by the users at a central page [wiki:Presets].
     
    144144To support translations, all textual elements may be used in translated form. E.g. "de.name" would represent the name in case German language support is loaded.
    145145
     146=== Format description from XML document (needs to be joined with above texts) ===
     147
     148item:
     149  name: the text to display
     150  icon: the icon to display
     151  - relative to the icon path
     152  - URL's are also supported to allow remote icons (are cached locally)
     153  type: the data types - way,node,relation,closedway (separated by comma)
     154  name_template: define custom formatting for OSM primitives
     155                 see [[NameTemplate]]
     156  preset_name_label: whether to insert "[preset name]" label in dialog
     157                     (defaults to "false" for backward-compatibility on external presets)
     158
     159group: a group of items (same syntax as "item")
     160
     161link: link to the relating map features website
     162  href: the URL
     163
     164preset_link: a link to an other preset
     165  preset_name: the exact name of the preset to link to
     166
     167label: simple static text label
     168  text: the text to display
     169  icon: location of icon to display (optional)
     170  icon_size: maximal size of icon (optional). If no value is given, default is 16px
     171
     172space: empty line
     173
     174optional: optional tags, short for "space" plus "label" plus "space"
     175  text: the text to display (defaults to "Optional Attributes:")
     176
     177separator: separator line in menus
     178
     179item_separator: horizontal separator line between items (in window)
     180
     181key: fixed key/value pair to be set
     182  key: key to set
     183  value: value to set
     184  match: none/key/key!/keyvalue/keyvalue! (default is "keyvalue!", see below for more information)
     185
     186text: text box
     187  key: key to set
     188  text: fixed label to display
     189  default: default string to display (defaults to "")
     190  use_last_as_default: true/false/force (default is "false")
     191  auto_increment: may contain a comma separated list of integer increments or
     192                  decrements, e.g. "-2,-1,+1,+2"; a button will be shown next
     193                  to the text field for each value, allowing the user to select
     194                  auto-increment with the given stepping. auto-increment only
     195                  happens if the user selects it. default is no auto-increment;
     196                  mutually exclusive with use_last_as_default.
     197  match: none/key/key!/keyvalue/keyvalue! (default is "none", see below for more information)
     198  length: length of input box (number of characters allowed)
     199  alternative_autocomplete_keys: comma separated list of alternative keys to use for autocompletion
     200
     201combo: combo box, with multiple choices and possible to enter free form text
     202  key: key to set
     203  text: fixed label to display
     204  delimiter: character that separates values (default: comma)
     205  values: separated list of values
     206  values_from: to use instead of "values" if the list of values has to be obtained with a Java method
     207               of this form: public static String[] getValues();
     208               The value must be: "full.package.name.ClassName#methodName"
     209  display_values: comma separated list of values to be displayed instead of the
     210                  database values, order and number must be equal to values
     211  short_descriptions: comma separated list of texts to be displayed below each
     212                      display_value. (Only if it is not possible to describe
     213                      the entry in 2-3 words.) Instead of comma separated list
     214  instead using values, display_values and short_descriptions, the following form is also supported:
     215    <list_entry value="" display_value="" short_description="" icon="" icon_size="" />
     216        icon: location of icon
     217        icon_size: maximal size of icon. If tag is not setup it is taken default size of icon file
     218  default: default string to display (defaults to "")
     219  use_last_as_default: true/false/force (default is "false")
     220  editable: allow to add other values as text (default is "true")
     221  match: none/key/key!/keyvalue/keyvalue! (default is none, see below for more information)
     222  values_searchable: true/false (whether to search in combo (display_)values when searching for presets)
     223  length: length of input box (number of characters allowed)
     224
     225multiselect: list of values from which zero or more can be selected
     226  key: key to set
     227  text: fixed label to display
     228  delimiter: character that separates values (default: semicolon) - this
     229             will also be used to separate selected values in the tag.
     230  values: delimiter-separated list of values (delimiter can be escaped with backslash)
     231  values_from: to use instead of "values" if the list of values has to be obtained with a Java method
     232               of this form: public static String[] getValues();
     233               The value must be: "full.package.name.ClassName#methodName"
     234  rows: specify the number of rows to display (default -1)
     235  display_values: delimiter-separated list of values to be displayed instead of the
     236                  database values, order and number must be equal to values
     237  short_descriptions: delimiter-separated list of texts to be displayed below each
     238                      display_value. (Only if it is not possible to describe
     239                      the entry in 2-3 words.) Instead of a separated list
     240  instead using values, display_values and short_descriptions, the following form is also supported:
     241    <list_entry value="" display_value="' short_description="" icon="" icon_size="" />
     242        icon: location of icon
     243        icon_size: maximal size of icon. If tag is not setup it is taken default size of icon file
     244  default: default string to display (defaults to "")
     245  use_last_as_default: true/false/force (default is "false")
     246  match: none/key/key!/keyvalue/keyvalue! (default is "none", see below for more information)
     247  values_searchable: true/false (whether to search in multiselect (display_)values when searching for presets)
     248
     249checkgroup: group of checks
     250  columns: number of columns
     251
     252check: checkbox
     253  key: key to set
     254  text: fixed label to display
     255  default: ticked on/off (default is "off")
     256  value_on: the value to set when checked (default is "yes")
     257  value_off: the value to set when unchecked (default is "no")
     258  disable_off: whether the off value is disabled in the dialog, i.e., only unset or yes are provided
     259  match: none/key/key!/keyvalue/keyvalue! (default is "none", see below for more information)
     260
     261role: type to specify possible roles in relations
     262  key: the role name used in relation
     263  text: fixed label to display
     264  requisite: optional/required (default is "optional")
     265  count: how often can the role occur (if not given unlimited number is assumed)
     266  type: the data types - way,node,relation,closedway (separated by comma)
     267  member_expression: an expression (cf. search dialog) for objects of this role
     268
     269chunk: a template of elements for later (repeated) use
     270  id: the unique identifier for this chunk
     271
     272reference: include an earlier defined template
     273  ref: the unique identifier of the (already defined) template to include
     274
     275 presets: For external files <presets> should have following attributes:
     276   author: the author of the preset
     277   version: a version number of some sort (e.g. creation date)
     278   description: what is your preset meant to be
     279   shortdescription: very short description
     280   link: a link to a helpful website (optional)
     281   icon: an icon for the whole presets
     282 The fields description, shortdescription and link may also be localized (e.g. de.link)
     283
     284The fields "name", "text", "display_values" may also be localized (e.g. de.name).
     285When translations of equal words but different meanings may conflict, a translation
     286context should be specified. Use "name_context", "text_context" or "values_context"
     287for this. The context should be a meaningful short description to help translators.
     288
     289In JOSM internally all "name", "text" and "display_values" are translated when
     290no specific translation has been given in XML file. When no "display_values"
     291are supplied, then "values" will be treated as "display_values" and translated instead.
     292
     293The match attribute allows to change the matching process, i.e., determining whether
     294the tags of an OSM object fit into this preset.
     295 - none: neutral, i.e., do not consider this item for matching
     296 - key: positive if key matches, neutral otherwise
     297 - key!: positive if key matches, negative otherwise
     298 - keyvalue: positive if key and value matches, neutral otherwise
     299 - keyvalue!: positive if key and value matches, negative otherwise
     300Note that for a match, at least one positive and no negative is required.
     301
    146302=== Icon handling ===
    147303See [wiki:Styles#Iconhandling Styles].