| 68 | == Configuring CAP Profile == |
| 69 | |
| 70 | CAP profiles can be configured using the deployment settings. |
| 71 | |
| 72 | The following settings can be set as follows |
| 73 | |
| 74 | {{{ |
| 75 | settings.cap.identifier_prefix = "prefix" # string |
| 76 | settings.cap.identifier_suffix = "suffix" # string |
| 77 | settings.cap.codes = [...] # key-value pairs |
| 78 | settings.cap.parameters = [...] # key-value pairs |
| 79 | settings.cap.geocodes = [...] # key-value pairs |
| 80 | settings.cap.base64 = False # boolean |
| 81 | settings.cap.languages = OrderedDict([ |
| 82 | ("en-US", "English"), |
| 83 | ("fr", "Français") |
| 84 | ...]) |
| 85 | settings.cap.priorities = OrderedDict([ |
| 86 | ("<value>, "<Translated title>", <urgency>, <severity>, <certainty>, <color>), |
| 87 | ... |
| 88 | ]) |
| 89 | |
| 90 | }}} |
| 91 | |
| 92 | Key-value pairs above are python lists containing many dictionaries detailing the behavior and parameters for the key-value pair. |
| 93 | It should take the following form |
| 94 | |
| 95 | {{{ |
| 96 | kvpairs = [ |
| 97 | dict(key="<key>", value="<value>", comment="<help text>", immutable=<immutable>, options=[("<value>", "<Value title>"), ...]), |
| 98 | ... |
| 99 | ] |
| 100 | |
| 101 | }}} |
| 102 | |
| 103 | * Here the comment and options dictionary values are optional. |
| 104 | * The options argument is a list of ("<value>", "<value title>") pairs and provides a drop-down to pick the value for the key from. |
| 105 | * 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: |
| 106 | {{{ |
| 107 | KEY_MUTABLE = 1 |
| 108 | VALUE_MUTABLE = 2 |
| 109 | |
| 110 | immutable = KEY_IMMUTABLE # only key is immutable |
| 111 | immutable = VALUE_IMMUTABLE # only value is immutable |
| 112 | immutable = KEY_IMMUTABLE | VALUE_MUTABLE # both immutable |
| 113 | immutable = 0 # both immutable |
| 114 | }}} |
| 115 | |