1616
1717import goc .webtemplate .Breadcrumb ;
1818import goc .webtemplate .Constants ;
19+ import goc .webtemplate .ContextualFooter ;
1920import goc .webtemplate .CustomSearch ;
2021import goc .webtemplate .FooterLink ;
2122import goc .webtemplate .FooterSection ;
3233import goc .webtemplate .Utility ;
3334import goc .webtemplate .WebAnalyticsInfo ;
3435
36+ import static goc .webtemplate .component .JsonRenderer .gson ;
37+
3538import goc .webtemplate .component .jsonentities .AppFooter ;
3639import goc .webtemplate .component .jsonentities .AppTop ;
3740import goc .webtemplate .component .jsonentities .CDTSEnvironment ;
6063 *
6164 */
6265public abstract class AbstractCoreBean {
63- /**
64- * Object used for JSON serialization. (https://github.com/google/gson)
65- *
66- * According to documentation (http://www.javadoc.io/doc/com.google.code.gson/gson/2.8.0)
67- * and source code, Gson objects are thread-safe.
68- */
69- //NOTE: Doesn't render null values by default, which is what we want
70- //NOTE: Escapes HTML by default, which is what we want (though URLs still need to be encoded)
71- //NOTE: Indented output can be obtained by chaining a call to setPrettyPrinting()
72- private static Gson gson = new com .google .gson .GsonBuilder ()
73- .setFieldNamingPolicy (com .google .gson .FieldNamingPolicy .IDENTITY )
74- .create ();
75-
7666 /**
7767 * Hold the table of CDTS environment configuration objects (loaded the first time it is accessed).
7868 */
@@ -154,6 +144,9 @@ private enum Themes { GCWEB, GCINTRANET }
154144 private String footerPath = null ;
155145 private boolean hidePlaceholderMenu = false ;
156146 private InfoBanner infoBanner = null ;
147+ private ContextualFooter contextualFooter = null ;
148+ private boolean hideMainFooter = false ;
149+ private boolean hideCorporateFooter = false ;
157150 //-------------------------------------------------------
158151
159152 //-------------------------------------------------------
@@ -1494,6 +1487,63 @@ public void setInfoBanner(InfoBanner value) {
14941487 this .infoBanner = value ;
14951488 }
14961489
1490+ /**
1491+ * Returns whether to display a contextual footer band that can display up to 3 links
1492+ *
1493+ * can be overriden programatically.
1494+ */
1495+ public ContextualFooter getContextualFooter () {
1496+ this .initializeOnce ();
1497+ return this .contextualFooter ;
1498+ }
1499+
1500+ /**
1501+ * Sets whether to display a contextual footer band that can display up to 3 links
1502+ *
1503+ * can be overriden programatically.
1504+ */
1505+ public void setContextualFooter (ContextualFooter value ) {
1506+ this .contextualFooter = value ;
1507+ }
1508+
1509+ /**
1510+ * Returns whether to hide the main footer
1511+ *
1512+ * can be overriden programatically.
1513+ */
1514+ public boolean getHideMainFooter () {
1515+ this .initializeOnce ();
1516+ return this .hideMainFooter ;
1517+ }
1518+
1519+ /**
1520+ * Sets whether to hide the main footer
1521+ *
1522+ * can be overriden programatically.
1523+ */
1524+ public void setHideMainFooter (boolean value ) {
1525+ this .hideMainFooter = value ;
1526+ }
1527+
1528+ /**
1529+ * Returns whether to hide corporate footer links
1530+ *
1531+ * can be overriden programatically.
1532+ */
1533+ public boolean getHideCorporateFooter () {
1534+ this .initializeOnce ();
1535+ return this .hideCorporateFooter ;
1536+ }
1537+
1538+ /**
1539+ * Sets whether to hide corporate footer links
1540+ *
1541+ * can be overriden programatically.
1542+ */
1543+ public void setHideCorporateFooter (boolean value ) {
1544+ this .hideCorporateFooter = value ;
1545+ }
1546+
14971547 /**
14981548 * Returns a copy of the breadcrumb list, ready for JSON serialization
14991549 */
@@ -2010,9 +2060,12 @@ public String getRenderFooter() {
20102060 true , //showFooter,
20112061 this .getShowFeatures (),
20122062 this .buildContactLinks (),
2013- null , //privacyLink
2014- null , //termsLink
2015- JsonValueUtils .getNonEmptyString (this .getLocalPath ())
2063+ JsonValueUtils .getFooterLinkContext (this .getPrivacyLink (), true ),
2064+ JsonValueUtils .getFooterLinkContext (this .getTermsConditionsLink (), true ),
2065+ JsonValueUtils .getNonEmptyString (this .getLocalPath ()),
2066+ this .contextualFooter ,
2067+ this .hideMainFooter ,
2068+ this .hideCorporateFooter
20162069 ));
20172070 }
20182071
@@ -2027,9 +2080,12 @@ public String getRenderTransactionalFooter() {
20272080 false , //showFooter
20282081 this .getShowFeatures (),
20292082 this .buildContactLinks (),
2030- JsonValueUtils .getNonEmptySingleItemLinkList (this .getPrivacyLink ()),
2031- JsonValueUtils .getNonEmptySingleItemLinkList (this .getTermsConditionsLink ()),
2032- JsonValueUtils .getNonEmptyString (this .getLocalPath ())
2083+ JsonValueUtils .getFooterLinkContext (this .getPrivacyLink (), false ),
2084+ JsonValueUtils .getFooterLinkContext (this .getTermsConditionsLink (), false ),
2085+ JsonValueUtils .getNonEmptyString (this .getLocalPath ()),
2086+ null , //contextualFooter
2087+ false , //hideMainFooter
2088+ false //hideCorporateFooter
20332089 ));
20342090 }
20352091
0 commit comments