Changes between Version 4 and Version 5 of UserGuidelines/SAMBRO/Implement


Ignore:
Timestamp:
08/10/15 07:53:58 (9 years ago)
Author:
Nuwan Waidyanatha
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UserGuidelines/SAMBRO/Implement

    v4 v5  
    2222
    2323== Configure the Broker ==
     24
     25[[http://www.youtube.com/watch?v=nfW4vs7j5Kw | Watch the Video]]
     26
     27CAP profiles can be configured using the deployment settings.
     28
     29The following settings can be set as follows
     30
     31{{{
     32    settings.cap.identifier_prefix = "prefix"  # string
     33    settings.cap.identifier_suffix = "suffix"  # string
     34    settings.cap.codes = [...]           # key-value pairs
     35    settings.cap.parameters = [...]      # key-value pairs
     36    settings.cap.geocodes = [...]        # key-value pairs
     37    settings.cap.base64 = False          # boolean
     38    settings.cap.languages = OrderedDict([
     39                                 ("en-US", "English"),
     40                                 ("fr", "Français")
     41                                 ...])
     42    settings.cap.priorities = OrderedDict([
     43                                  ("<value>, "<Translated title>", <urgency>, <severity>, <certainty>, <color>),
     44                                  ...
     45                              ])
     46
     47}}}
     48
     49Key-value pairs above are python lists containing many dictionaries detailing the behavior and parameters for the key-value pair.
     50It should take the following form
     51
     52{{{
     53    kvpairs = [
     54        dict(key="<key>", value="<value>", comment="<help text>", immutable=<immutable>, options=[("<value>", "<Value title>"), ...]),
     55        ...
     56    ]
     57
     58}}}
     59
     60* Here the comment and options dictionary values are optional.
     61* The options argument is a list of ("<value>", "<value title>") pairs and provides a drop-down to pick the value for the key from.
     62* 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:
     63{{{
     64    KEY_MUTABLE = 1
     65    VALUE_MUTABLE = 2
     66
     67    immutable = KEY_IMMUTABLE # only key is immutable
     68    immutable = VALUE_IMMUTABLE # only value is immutable
     69    immutable = KEY_IMMUTABLE | VALUE_MUTABLE # both immutable
     70    immutable = 0 # both immutable
     71}}}
     72