Default Jobsheet Viewer

Change Calls to Action (CTA's) Activated by Default

Purpose:

Make "Stay away" CTA be activated by default for an Areal Flood Watch.

Tasks:

  1. In the Localization Perspective, expand Hazard Services, then expand Common Meta Data.
  2. Double click the CommonMetaData.py BASE file to open it in the editor and locate the CTA method ctaStayAway.
  3. Note the value of the identifier specified in that method, which is "stayAwayCTA."
  4. Right click on the MetaData_FA_A.py BASE file and select Create Override File, then select Site.
  5. Double click on the newly created SITE level file to open it in the editor.
  6. 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"]
                   }
     
  7. Save.