Changes between Version 8 and Version 9 of UserGuidelines/SAMBRO/Implement


Ignore:
Timestamp:
08/10/15 13:31:47 (9 years ago)
Author:
Nuwan Waidyanatha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/SAMBRO/Implement

    v8 v9  
    2424[[Image(http://i.imgur.com/K98gj.png)]]
    2525
     26=== Configuring Implementation Parameters ===
     27
     28[[http://www.youtube.com/watch?v=nfW4vs7j5Kw | Watch the Video]]
     29
     30The implementation specific data parameters can be configured using the deployment settings. In this section we show how to set the following parameters:
     31* Identifier prefix and post-fix
     32* Warning priorities
     33
     34The following settings can be set as follows
     35
     36{{{
     37    settings.cap.identifier_prefix = "prefix"  # string
     38    settings.cap.identifier_suffix = "suffix"  # string
     39    settings.cap.codes = [...]           # key-value pairs
     40    settings.cap.parameters = [...]      # key-value pairs
     41    settings.cap.geocodes = [...]        # key-value pairs
     42    settings.cap.base64 = False          # boolean
     43    settings.cap.languages = OrderedDict([
     44                                 ("en-US", "English"),
     45                                 ("fr", "Français")
     46                                 ...])
     47    settings.cap.priorities = OrderedDict([
     48                                  ("<value>, "<Translated title>", <urgency>, <severity>, <certainty>, <color>),
     49                                  ...
     50                              ])
     51
     52}}}
     53
     54Key-value pairs above are python lists containing many dictionaries detailing the behavior and parameters for the key-value pair.
     55It should take the following form
     56
     57{{{
     58    kvpairs = [
     59        dict(key="<key>", value="<value>", comment="<help text>", immutable=<immutable>, options=[("<value>", "<Value title>"), ...]),
     60        ...
     61    ]
     62
     63}}}
     64
     65* Here the comment and options dictionary values are optional.
     66* The options argument is a list of ("<value>", "<value title>") pairs and provides a drop-down to pick the value for the key from.
     67* The mutable argument is a bit-map saying whether to lock the key field or the value field or both in the key-value user interface. (by locking we mean disabling.) You can use it like so:
     68{{{
     69    KEY_MUTABLE = 1
     70    VALUE_MUTABLE = 2
     71
     72    immutable = KEY_IMMUTABLE # only key is immutable
     73    immutable = VALUE_IMMUTABLE # only value is immutable
     74    immutable = KEY_IMMUTABLE | VALUE_MUTABLE # both immutable
     75    immutable = 0 # both immutable
     76}}}
     77