Example to turn off features

From: Thompson, Sonya (HAL)
Sent: Thursday, May 03, 2012 2:37 PM
To: Fillman, Eric (HAL); Bojja, Sridhar (HAL Contractor); Phatak, Sheetal (HAL); Ruckman, Maurice (HAL); Klein, Brian (HAL); Hartman, Mario (HAL Contractor); Florencia Castro (fcastro@hexacta.com); Daniela Greca (dgreca@hexacta.com)
Cc: Augustine, Anila (HAL)
Subject: Created a new teamsite file in support of continuous integration

Dev team,

In support of continuous integration, here's a way to "turn a feature off" or "hide a feature from end users".

Add an element to this new teamsite file: //prdcms01/default/main/hollandamerica/WORKAREA/baseline/cms/web/copy/features/featureToggles.xml

<?xml version="1.0" encoding="utf-8"?>
<toggles>
<cancelFeeDetailsDE><![CDATA[false]]></cancelFeeDetailsDE>
<upsellCategories_hal><![CDATA[true]]></upsellCategories_hal>
<upsellCategories_sbn><![CDATA[true]]></upsellCategories_sbn>
</toggles>

In your JSP, import the teamsite file:
<s:set var="featureMap" value="#application.staticXmlDataList.staticXmlFileMap['web.copy.features.featureToggles.xml']"/>

Add an if statement around the new feature in your JSP:
<s:if test="#featureMap['toggles.upsellCategories_hal'] == 'true'">
<%--put your feature code here-->
</s:if>