13 | | An '''alert template''' is a pre-populated CAP message that is created to speed-up with the message creation as well as preserving the consistency of a message. Wherever the event specific information such as the DATE or LOCATION or other information you may create place holders for those values within the text. You should mark up places in the text that need to be changed within a pair of square brackets with capitalized text inside as shown below. |
14 | | |
15 | | ''Example'' the ''headline'' text in a CAP message template for a flood event could be something like this: '''''[YYYY] [MMM]''' heavy rains have caused flash floods in the '''[LOCATION]''' area''. If the floods was in Varnasi area on 2012-09-25, then the message creator would replace the MMM YYYY and LOCATION to create the headline to be specific as such: '''''2012 September''' heavy rains have caused flash floods in the '''Varnasi''' area''. |
16 | | |
17 | | * '''template name''' - the template name should be a generic name such as earthquake, cyclone, epidemic, et; one that a message creator can easily identify. |
18 | | * '''Locked''' - If you mark a field as locked, it cannot be edited in the actual alert message that inherits the template and extends it. |
19 | | * '''Status''' - Make sure the set the message ''status'' to '''''Draft'''''. At the time of issuing the message, the message creator will change that to ''Actual, Exercise, System, Test'', |
20 | | * '''All the values''' - enter all other values as you deem essential, then apply the syntax mentioned earlier in creating place holders for words or sentences that should be replaces at the time of creating the actual message with hazard event specific information. |
21 | | |
22 | | [[Image(http://i.imgur.com/K98gj.png)]] |
23 | | |
24 | | == Configure the Broker == |
25 | | |
26 | | [[http://www.youtube.com/watch?v=nfW4vs7j5Kw | Watch the Video]] |
27 | | |
28 | | CAP profiles can be configured using the deployment settings. |
29 | | |
30 | | The following settings can be set as follows |
31 | | |
32 | | {{{ |
33 | | settings.cap.identifier_prefix = "prefix" # string |
34 | | settings.cap.identifier_suffix = "suffix" # string |
35 | | settings.cap.codes = [...] # key-value pairs |
36 | | settings.cap.parameters = [...] # key-value pairs |
37 | | settings.cap.geocodes = [...] # key-value pairs |
38 | | settings.cap.base64 = False # boolean |
39 | | settings.cap.languages = OrderedDict([ |
40 | | ("en-US", "English"), |
41 | | ("fr", "Français") |
42 | | ...]) |
43 | | settings.cap.priorities = OrderedDict([ |
44 | | ("<value>, "<Translated title>", <urgency>, <severity>, <certainty>, <color>), |
45 | | ... |
46 | | ]) |
47 | | |
48 | | }}} |
49 | | |
50 | | Key-value pairs above are python lists containing many dictionaries detailing the behavior and parameters for the key-value pair. |
51 | | It should take the following form |
52 | | |
53 | | {{{ |
54 | | kvpairs = [ |
55 | | dict(key="<key>", value="<value>", comment="<help text>", immutable=<immutable>, options=[("<value>", "<Value title>"), ...]), |
56 | | ... |
57 | | ] |
58 | | |
59 | | }}} |
60 | | |
61 | | * Here the comment and options dictionary values are optional. |
62 | | * The options argument is a list of ("<value>", "<value title>") pairs and provides a drop-down to pick the value for the key from. |
63 | | * 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: |
64 | | {{{ |
65 | | KEY_MUTABLE = 1 |
66 | | VALUE_MUTABLE = 2 |
67 | | |
68 | | immutable = KEY_IMMUTABLE # only key is immutable |
69 | | immutable = VALUE_IMMUTABLE # only value is immutable |
70 | | immutable = KEY_IMMUTABLE | VALUE_MUTABLE # both immutable |
71 | | immutable = 0 # both immutable |
72 | | }}} |
73 | | |
| 13 | An '''alert template''' is a pre-populated CAP message that is created to sp |