Purpose:
Make "Stay away" CTA be activated by default for an Areal Flood Watch.
Tasks:
- In the Localization Perspective, expand Hazard Services, then expand Common Meta Data.
- Double click the CommonMetaData.py BASE file to open it in the editor and locate the CTA method ctaStayAway.
- Note the value of the identifier specified in that method, which is "stayAwayCTA."
- Right click on the MetaData_FA_A.py BASE file and select Create Override File, then select Site.
- Double click on the newly created SITE level file to open it in the editor.
- To create a SITE level override for the getCTAs() method, copy and paste the following text:
class MetaData(CommonMetaData.MetaData):
def getCTAs(self, values=None):
pageFields = {
"fieldType":"CheckBoxes",
"fieldName": "cta",
"showAllNoneButtons" : False,
"choices": self.getCTA_Choices()
}
if values is not None:
pageFields["values"] = values
else :
pageFields['values'] = [ "stayAwayCTA" ]
return {
"fieldType": "ExpandBar",
"fieldName": "CTABar",
"expandHorizontally": True,
"pages": [
{
"pageName": "Calls to Action",
"pageFields": [pageFields]
}
],
"expandedPages": ["Calls to Action"]
}
- Save.