bug6060: clientConfigurationContext is now stored as Map<String, Object> in request context

This commit is contained in:
Axel Uhl
2025-08-15 17:04:28 +02:00
parent a7f855d5ec
commit 3d1d7c386c
44 changed files with 231 additions and 308 deletions
@@ -9,11 +9,11 @@
<head>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="images/dashboardicon${applicationScope['clientConfigurationContext.whitelabeled']}.png" />
<link href='images/dashboardicon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/dashboardicon${clientConfigurationContext['whitelabeled']}.png" />
<link href='images/dashboardicon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<title>Dashboard</title>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script type="text/javascript"
src="com.sap.sailing.dashboards.gwt.RibDashboard/com.sap.sailing.dashboards.gwt.RibDashboard.nocache.js"></script>
@@ -9,7 +9,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
@@ -18,13 +18,13 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Administration Console</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Administration Console</title>
<!-- AdminConsole is not prepared to work with nomalize. -->
<!-- <link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css"> -->
@@ -38,7 +38,7 @@
<!-- Client-side QR code generation -->
<script type="text/javascript" src="qrcode/qrcode.min.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- TODO remove this when the above works...
<script type="text/javascript" src="/gwt-base/api/client_configuration_context"></script>
-->
@@ -132,7 +132,7 @@
<div id="loading" class="loading">
<p class="sapsailing">${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics</p>
<p class="sapsailing">${clientConfigurationContext['brandTitle']}Sailing Analytics</p>
<noscript>
<p style="margin: 10px 40px;">
By delivering real time analytics around race rankings, speeds, maneuvers, bearings etc., SAP is helping
+5 -5
View File
@@ -10,7 +10,7 @@
<meta name="apple-mobile-web-app-capable" content="yes">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
@@ -20,13 +20,13 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics AutoPlay</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics AutoPlay</title>
<link rel="stylesheet" type="text/css" href="/sailing-reset-2.0.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
@@ -45,7 +45,7 @@
<script>
videojs.options.techOrder = ['vimeo', 'html5'];
</script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="com.sap.sailing.gwt.autoplay.AutoPlay/com.sap.sailing.gwt.autoplay.AutoPlay.nocache.js"></script>
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
@@ -2,7 +2,7 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<title>Your browser is unsupported</title>
</head>
+4 -4
View File
@@ -8,22 +8,22 @@
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- This module isn't compatible with normalize. -->
<!-- <link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css"> -->
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="DataMining.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.ui.DataMining/com.sap.sailing.gwt.ui.DataMining.nocache.js"></script>
@@ -6,13 +6,13 @@
<meta http-equiv="REFRESH" content="0; url=/browser-info.html">
<![endif]-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Race Board</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Race Board</title>
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!--<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic' rel='stylesheet' type='text/css'>-->
<!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700,300,300italic' rel='stylesheet' type='text/css'>-->
@@ -97,7 +97,7 @@
style="position:absolute;width:0;height:0;border:0"></iframe>
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<div id="loading" class="loading">
<p class="sapsailing">${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics</p>
<p class="sapsailing">${clientConfigurationContext['brandTitle']}Sailing Analytics</p>
<noscript>
<p style="margin: 10px 40px;">
By delivering real time analytics around race rankings, speeds, maneuvers, bearings etc., SAP is helping
+6 -6
View File
@@ -4,16 +4,16 @@
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon' selenium-id="appIcon">
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon' selenium-id="appIcon">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing - Homepage</title>
<title>${clientConfigurationContext['brandTitle']}Sailing - Homepage</title>
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
@@ -28,7 +28,7 @@
<script src="js/Youtube.js"></script>
<script src="js/videojs-vimeo.js"></script>
<script src="https://js.chargebee.com/v2/chargebee.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script src="com.sap.sailing.gwt.home.Home/com.sap.sailing.gwt.home.Home.nocache.js"></script>
<style type="text/css">
.loading {
@@ -102,7 +102,7 @@
<iframe src="javascript:''" id="__gwt_historyFrame" tabIndex='-1' style="position:absolute;width:0;height:0;border:0"></iframe>
<div id="loading" class="loading">
<p class="sapsailing">${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics</p>
<p class="sapsailing">${clientConfigurationContext['brandTitle']}Sailing Analytics</p>
<noscript>
<p class="description">
By delivering real time analytics around race rankings, speeds, maneuvers, bearings etc., SAP is helping to simplify and demystify the complex sport of sailing.
+5 -5
View File
@@ -6,27 +6,27 @@
<meta http-equiv="REFRESH" content="0; url=http://www.sapsailing.com/browser-info.html">
<![endif]-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Leaderboard</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Leaderboard</title>
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Leaderboard.css">
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="com.sap.sailing.gwt.ui.Leaderboard/com.sap.sailing.gwt.ui.Leaderboard.nocache.js"></script>
</head>
@@ -9,13 +9,13 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
@@ -24,13 +24,13 @@
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Leaderboard Editing</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Leaderboard Editing</title>
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="SettingsDialog.css">
<link rel="stylesheet" type="text/css" href="Leaderboard.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
@@ -9,7 +9,7 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
@@ -18,13 +18,13 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Administration Console</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Administration Console</title>
<!-- AdminConsole is not prepared to work with nomalize. -->
<!-- <link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css"> -->
@@ -38,7 +38,7 @@
<!-- Client-side QR code generation -->
<script type="text/javascript" src="qrcode/qrcode.min.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
@@ -127,7 +127,7 @@
<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
<div id="loading" class="loading">
<p class="sapsailing">${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics</p>
<p class="sapsailing">${clientConfigurationContext['brandTitle']}Sailing Analytics</p>
<noscript>
<p style="margin: 10px 40px;">
By delivering real time analytics around race rankings, speeds, maneuvers, bearings etc., SAP is helping
+5 -5
View File
@@ -6,27 +6,27 @@
<meta http-equiv="REFRESH" content="0; url=http://www.sapsailing.com/browser-info.html">
<![endif]-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics PairingList</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics PairingList</title>
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="PairingList.css">
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="com.sap.sailing.gwt.ui.PairingList/com.sap.sailing.gwt.ui.PairingList.nocache.js"></script>
</head>
+5 -5
View File
@@ -6,20 +6,20 @@
<meta http-equiv="REFRESH" content="0; url=http://www.sapsailing.com/browser-info.html">
<![endif]-->
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Race Board</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Race Board</title>
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!--<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic' rel='stylesheet' type='text/css'>-->
<!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700,300,300italic' rel='stylesheet' type='text/css'>-->
@@ -36,7 +36,7 @@
<script>
videojs.options.techOrder = [ 'vimeo', 'html5' ];
</script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.ui.RaceBoard/com.sap.sailing.gwt.ui.RaceBoard.nocache.js"></script>
</head>
@@ -9,19 +9,19 @@
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Regatta Overview</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Regatta Overview</title>
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script
type="text/javascript"
language="javascript"
+5 -5
View File
@@ -3,20 +3,20 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Race Simulator</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Race Simulator</title>
<meta content='width = device-width, initial-scale = 1.0, user-scalable = yes' name='viewport'>
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!--<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic' rel='stylesheet' type='text/css'>-->
<!-- <link href='http://fonts.googleapis.com/css?family=Open+Sans+Condensed:700,300,300italic' rel='stylesheet' type='text/css'>-->
@@ -25,7 +25,7 @@
<link rel="stylesheet" type="text/css" href="Simulator.css">
<script type="text/javascript" src="js/jquery-3.6.0.min.js"></script>
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" src="com.sap.sailing.gwt.ui.Simulator/com.sap.sailing.gwt.ui.Simulator.nocache.js"></script>
</head>
+5 -5
View File
@@ -13,15 +13,15 @@
<meta content='yes' name='apple-mobile-web-app-capable'>
<meta content='black' name='apple-mobile-web-app-status-bar-style'>
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<!-- <link href='iphone-splash-screen.png' rel='apple-touch-startup-image'> -->
<link href='images/sap-sailing-app-icon${applicationScope['clientConfigurationContext.whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link href='images/sap-sailing-app-icon${clientConfigurationContext['whitelabeled']}.png' rel='apple-touch-icon'>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!--<link href='http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700,300italic,400italic,500italic,700italic' rel='stylesheet' type='text/css'>-->
<!-- -->
@@ -31,13 +31,13 @@
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Spectator Vision</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Spectator Vision</title>
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="/sailing-fontface-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Spectator.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
+3 -3
View File
@@ -2,9 +2,9 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Video</title>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<title>${clientConfigurationContext['brandTitle']}Sailing Video</title>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.ui.VideoPopup/com.sap.sailing.gwt.ui.VideoPopup.nocache.js"></script>
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
@@ -2,9 +2,9 @@
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Video</title>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<title>${clientConfigurationContext['brandTitle']}Sailing Video</title>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<script type="text/javascript" language="javascript" src="com.sap.sailing.gwt.ui.YoutubePopup/com.sap.sailing.gwt.ui.YoutubePopup.nocache.js"></script>
<style type="text/css">
html {overflow: auto;}
+1 -1
View File
@@ -13,6 +13,6 @@
<c:out value="Jetty JSP Example, remove it when everything is set up."></c:out>
<br />
Current date is: <%=new java.util.Date()%>
${applicationScope['org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern']}
${requestScope['org.eclipse.jetty.server.webapp.ContainerIncludeJarPattern']}
</body>
</html>
+3 -3
View File
@@ -1,10 +1,10 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Suite - Unsupported Browser!</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Suite - Unsupported Browser!</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link href="start.css" rel="stylesheet" type="text/css" />
<link href="/sailing-normalize-3.0.2.cache.css" rel="stylesheet" type="text/css" />
<link href="browser-info.css" rel="stylesheet" type="text/css" />
@@ -12,7 +12,7 @@
<body>
<div class="logoAndTitlePanel">
<script>
if (!${applicationScope['clientConfigurationContext.debrandingActive']}){
if (!${clientConfigurationContext['debrandingActive']}){
document.write("<a class=\"sapLogo\" href=\"http://www.sap.com?campaigncode=CRM-XH21-OSP-Sailing\"><img class=\"sapLogoImage\" src=\"/images/logo-small@2x.png\" alt=\"SAP Website\"/></a>\r\n");
}
</script>
+4 -4
View File
@@ -1,24 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Suite</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Suite</title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta http-equiv="content-style-type" content="text/css" />
<meta property="og:type" content="website" />
<meta property="og:title" content="${applicationScope['clientConfigurationContext.brandTitle']}Sailing" />
<meta property="og:title" content="${clientConfigurationContext['brandTitle']}Sailing" />
<meta property="og:description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<meta property="og:image" content="https://s3-eu-west-1.amazonaws.com/media.sapsailing.com/2014/505Worlds/Images_Homepage/505Worlds2014_eventteaser.jpg" />
<meta property="description" content="Help sailors analyze performance and optimize strategy &#8226; Bring fans closer to the action
&#8226; Provide the media with information and insights to deliver a greater informed commentary" />
<link rel="shortcut icon" type="image/x-icon" href="/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link rel="shortcut icon" type="image/x-icon" href="/sap${clientConfigurationContext['whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<link href="/sailing-normalize-3.0.2.cache.css" rel="stylesheet" type="text/css" />
<link href="start.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logoAndTitlePanel">
<script>
if (!${applicationScope['clientConfigurationContext.debrandingActive']}){
if (!${clientConfigurationContext['debrandingActive']}){
document.write("<a class=\"sapLogo\" href=\"https://www.sap.com?campaigncode=CRM-XH21-OSP-Sailing\"><img class=\"sapLogoImage\" src=\"/images/logo-small@2x.png\" alt=\"SAP Website\"/></a>\r\n");
}
</script>
@@ -4,13 +4,13 @@
<link href="sailing-fontface-1.0.cache.css" media="screen" rel="stylesheet" title="Default stylesheet" type="text/css" />
<link href="start.css" rel="stylesheet" type="text/css" />
<link href="release_notes.css" rel="stylesheet" type="text/css" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics - Admin Console Release Notes</title>
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" selenium-id="shortcutIcon"/>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics - Admin Console Release Notes</title>
</head>
<body>
<div class="logoAndTitlePanel">
<script>
if (!${applicationScope['clientConfigurationContext.debrandingActive']}){
if (!${clientConfigurationContext['debrandingActive']}){
document.write("<a class=\"sapLogo\" href=\"https://www.sap.com?campaigncode=CRM-XH21-OSP-Sailing\"><img class=\"sapLogoImage\" src=\"/images/logo-small@2x.png\" alt=\"SAP Website\"/></a>\r\n");
}
</script>
@@ -1,5 +1,7 @@
package com.sap.sse.branding.sap;
import java.util.Optional;
import com.sap.sse.branding.shared.BrandingConfiguration;
public class SAPBrandingConfiguration implements BrandingConfiguration {
@@ -11,17 +13,17 @@ public class SAPBrandingConfiguration implements BrandingConfiguration {
}
@Override
public String getDefaultBrandingLogoURL() {
public String getDefaultBrandingLogoURL(Optional<String> locale) {
return defaultBrandingLogoURL;
}
@Override
public String getGreyTransparentLogoURL() {
public String getGreyTransparentLogoURL(Optional<String> locale) {
return greyTransparentLogoURL;
}
@Override
public String getBrandTitle() {
public String getBrandTitle(Optional<String> locale) {
return "SAP";
}
@@ -6,7 +6,9 @@ Automatic-Module-Name: com.sap.sse.branding
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.sap.sse.util,
Import-Package: com.sap.sse.common,
com.sap.sse.rest,
com.sap.sse.util,
javax.servlet;version="3.1.0",
javax.servlet.http;version="3.1.0",
javax.ws.rs.core;version="1.1.1",
-18
View File
@@ -10,22 +10,4 @@
</parent>
<artifactId>com.sap.sse.branding</artifactId>
<packaging>eclipse-plugin</packaging>
<build>
<plugins>
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-source-plugin</artifactId>
<version>${tycho-version}</version>
<executions>
<execution>
<id>plugin-source</id>
<phase>generate-sources</phase>
<goals>
<goal>plugin-source</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
@@ -3,6 +3,8 @@ package com.sap.sse.branding;
import java.util.Map;
import java.util.Optional;
import javax.servlet.ServletContext;
import com.sap.sse.branding.shared.BrandingConfiguration;
/**
@@ -41,11 +43,18 @@ public interface BrandingConfigurationService {
String BRANDING_ID_PROPERTY_NAME = "com.sap.sse.branding";
/**
* This is the prefix used for JSP properties that are set by the {@link ClientConfigurationListener}. To the value
* of this constant, property names as defined, e.g., by {@link #BRAND_TITLE_WITH_TRAILING_SPACE_JSP_PROPERTY_NAME} or
* {@link #BRANDING_ACTIVE_JSP_PROPERTY_NAME} are appended.
* This is the name of the property holding the map of JSP properties that are set by the {@link ClientConfigurationListener}. The keys of
* the map found under this property name are defined, e.g., by {@link BrandingConfigurationProperty#BRAND_TITLE_WITH_TRAILING_SPACE_JSP_PROPERTY_NAME} or
* {@link BrandingConfigurationProperty#BRANDING_ACTIVE_JSP_PROPERTY_NAME} and their respective {@link BrandingConfigurationProperty#getPropertyName()}.
*/
String JSP_PROPERTY_NAME_PREFIX = "clientConfigurationContext.";
String JSP_PROPERTY_NAME_PREFIX = "clientConfigurationContext";
/**
* Attribute name used in the {@link ServletContext}, value being a map from a pair of locale (e.g. "en") and
* branding ID (see {@link BrandingConfiguration#getId()}) to a map of JSP properties that can be used to set it
* to the {@link #JSP_PROPERTY_NAME_PREFIX} attribute in the {@link HttpServletRequest} scope.
*/
String JSP_PROPERTIES_BY_LOCALE_AND_BRANDING_ID = "clientConfigurationContextsByLocaleAndBrandingId";
public static enum BrandingConfigurationProperty {
/**
@@ -1,7 +1,10 @@
package com.sap.sse.branding;
import java.util.HashMap;
import java.util.Map;
import java.util.Optional;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import javax.servlet.ServletContext;
import javax.servlet.ServletRequestEvent;
@@ -9,10 +12,12 @@ import javax.servlet.http.HttpServletRequest;
import com.sap.sse.branding.BrandingConfigurationService.BrandingConfigurationProperty;
import com.sap.sse.branding.impl.Activator;
import com.sap.sse.common.Util.Pair;
import com.sap.sse.rest.GwtLocaleFromHttpRequestUtil;
/**
* JSP servlet is registered on *.html within web.xml. Use the following JSP expression
* <pre>applicationScope['clientConfigurationContext.variableName']}</pre> to get strings replaced within the page. Among others, the
* <pre>${clientConfigurationContext['variableName']}</pre> to get strings replaced within the page. Among others, the
* variables listed below are available for replacements:
* <table border="1">
* <tr>
@@ -39,8 +44,6 @@ import com.sap.sse.branding.impl.Activator;
* <p>
* For a full list of variables, see the {@link BrandingConfigurationService.BrandingConfigurationProperty} enumeration type.<p>
*
* TODO bug6060 some String properties may depend on the locale; should we use a map keyed by the locale? How to index that map in the JSP expressions?
*
* Register a the jsp servlet for all the URLs that produce such static pages that you'd like to run replacements on. Example
* registration in a {@code web.xml} configuration file:
*
@@ -58,31 +61,61 @@ import com.sap.sse.branding.impl.Activator;
*
*/
public class ClientConfigurationListener implements javax.servlet.ServletRequestListener {
/**
* In the {@link ServletContext} maintains an attribute
* {@link BrandingConfigurationService.LOCALES_JSP_PROPERTY_NAME} which is a map from a pair of locale (e.g. "en")
* and branding ID (possibly {@code null} for a debranded configuration) to {@link String}-keyed maps of properties
* that can be used in JSP EL expressions in those HTML pages. The map is initialized lazily, so the locale- and
* branding configuration-specific properties are added the first time a request for that combination of locale and
* branding configuration is seen here.
* <p>
*
* The properties are constructed using
* {@link BrandingConfigurationService#getBrandingConfigurationPropertiesForJspContext(Optional)} with the locale as
* argument, where the property names are derived from the {@link BrandingConfigurationProperty#getPropertyName()}
* method which get appended to the {@link BrandingConfigurationService#JSP_PROPERTY_NAME_PREFIX} prefix.
* <p>
*
* For the current request, the properties map is then fetched from the {@link ServletContext} and set for the
* {@code requestScope}. This way, the maps don't need to be created for every request.
*/
@Override
public void requestInitialized(ServletRequestEvent sre) {
if (sre.getServletRequest().getScheme().startsWith("http")) {
final String path = ((HttpServletRequest) sre.getServletRequest()).getServletPath();
final Map<String, String[]> parameterMap = ((HttpServletRequest) sre.getServletRequest()).getParameterMap();
final Optional<String> locale;
if (parameterMap != null && parameterMap.containsKey("locale")) {
locale = Optional.of(parameterMap.get("locale")[0]);
} else {
locale = Optional.empty();
}
final HttpServletRequest httpServletRequest = (HttpServletRequest) sre.getServletRequest();
final String path = httpServletRequest.getServletPath();
// populate JSP scopes (applicationScope and requestScope) only for HTML pages or "/" requests
if (path != null && (path.endsWith("/") || path.endsWith(".html"))) {
final ServletContext ctx = sre.getServletContext();
final Boolean ctxBrandingActive = (Boolean) ctx.getAttribute(
BrandingConfigurationService.JSP_PROPERTY_NAME_PREFIX+BrandingConfigurationProperty.BRANDING_ACTIVE_JSP_PROPERTY_NAME.getPropertyName());
final BrandingConfigurationService brandingConfigurationService = Activator.getDefaultBrandingConfigurationService();
final boolean brandingActive = brandingConfigurationService.isBrandingActive();
if (ctxBrandingActive == null || brandingActive != ctxBrandingActive.booleanValue()) { // FIXME now we also need to check the locale
brandingConfigurationService.getBrandingConfigurationPropertiesForJspContext(locale).forEach((k, v) -> {
ctx.setAttribute(BrandingConfigurationService.JSP_PROPERTY_NAME_PREFIX + k.getPropertyName(), v);
});
}
final ServletContext servletContext = httpServletRequest.getServletContext();
Optional<String> requestLocale = GwtLocaleFromHttpRequestUtil.getLocaleFromHttpRequest(httpServletRequest);
final Map<String, Object> brandingProperties = getAndCacheBrandingConfigurationPropertiesFromServletContext(
servletContext, requestLocale, Activator.getDefaultBrandingConfigurationService());
httpServletRequest.setAttribute(BrandingConfigurationService.JSP_PROPERTY_NAME_PREFIX, brandingProperties);
}
}
}
private Map<String, Object> getAndCacheBrandingConfigurationPropertiesFromServletContext(
ServletContext servletContext, Optional<String> locale, BrandingConfigurationService brandingConfigurationService) {
@SuppressWarnings("unchecked")
ConcurrentMap<Pair<String, String>, Map<String, Object>> brandingProperties =
(ConcurrentMap<Pair<String, String>, Map<String, Object>>) servletContext.getAttribute(BrandingConfigurationService.JSP_PROPERTIES_BY_LOCALE_AND_BRANDING_ID);
if (brandingProperties == null) {
brandingProperties = new ConcurrentHashMap<>();
servletContext.setAttribute(BrandingConfigurationService.JSP_PROPERTIES_BY_LOCALE_AND_BRANDING_ID, brandingProperties);
}
final Pair<String, String> key = new Pair<>(locale.orElse(null),
brandingConfigurationService.isBrandingActive() ? brandingConfigurationService.getActiveBrandingConfiguration().getId() : null);
return brandingProperties.computeIfAbsent(key, k->computeBrandingConfigurationProperties(brandingConfigurationService, locale));
}
private Map<String, Object> computeBrandingConfigurationProperties(BrandingConfigurationService brandingConfigurationService, Optional<String> requestLocale) {
final Map<String, Object> brandingProperties = new HashMap<>(); // no concurrency control needed within single request
brandingConfigurationService.getBrandingConfigurationPropertiesForJspContext(requestLocale).forEach((k, v) -> {
brandingProperties.put(k.getPropertyName(), v);
});
return brandingProperties;
}
@Override
public void requestDestroyed(ServletRequestEvent sre) {
@@ -58,7 +58,7 @@ public class BrandingConfigurationServiceImpl implements BrandingConfigurationSe
final String title;
final String whitelabeled;
if (brandingConfiguration != null) {
title = brandingConfiguration.getBrandTitle()+" ";
title = brandingConfiguration.getBrandTitle(locale)+" ";
whitelabeled = "";
} else {
title = "";
@@ -1,11 +1,13 @@
package com.sap.sse.branding.shared;
import java.util.Optional;
public interface BrandingConfiguration {
String getBrandTitle();
String getBrandTitle(Optional<String> locale);
String getDefaultBrandingLogoURL();
String getDefaultBrandingLogoURL(Optional<String> locale);
String getGreyTransparentLogoURL();
String getGreyTransparentLogoURL(Optional<String> locale);
/**
* The ID by which to find or set this configuration in {@code BrandingConfigurationService#setActiveBrandingConfigurationById(String)}
+1 -3
View File
@@ -15,9 +15,7 @@ Require-Bundle: com.google.gwt.user;bundle-version="2.10.0";resolution:=optional
com.sap.sse
Bundle-ActivationPolicy: lazy
Web-ContextPath: /gwt-base
Import-Package: com.sap.sse.branding,
com.sap.sse.branding.shared,
com.sap.sse.security,
Import-Package: com.sap.sse.branding.shared,
com.sun.jersey.spi.container.servlet;version="[1.17.0,2.0.0)",
javax.servlet;version="3.1.0",
javax.servlet.descriptor;version="3.1.0",
+1 -1
View File
@@ -12,7 +12,7 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
@@ -12,7 +12,7 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
-17
View File
@@ -35,21 +35,4 @@
<servlet-name>CrossDomainStorageConfigurationService</servlet-name>
<url-pattern>/service/crossdomainstorageconfiguration</url-pattern>
</servlet-mapping>
<servlet>
<servlet-name>Jersey REST API</servlet-name>
<servlet-class>com.sap.sse.gwt.jaxrs.RestServletContainer</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.sap.sse.gwt.jaxrs.api.RestApiApplication</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.config.feature.DisableWADL</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>Jersey REST API</servlet-name>
<url-pattern>/api/*</url-pattern>
</servlet-mapping>
</web-app>
@@ -1,42 +0,0 @@
package com.sap.sse.gwt.jaxrs;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.ws.rs.core.Application;
import org.osgi.framework.BundleContext;
import org.osgi.util.tracker.ServiceTracker;
import com.sap.sse.branding.BrandingConfigurationService;
import com.sap.sse.util.ServiceTrackerFactory;
import com.sun.jersey.spi.container.servlet.ServletContainer;
public class RestServletContainer extends ServletContainer {
private static final long serialVersionUID = 3129261471808425410L;
private static final String OSGI_RFC66_WEBBUNDLE_BUNDLECONTEXT_NAME = "osgi-bundlecontext";
public static final String BRANDING_CONFIGURATION_SERVICE_TRACKER_NAME = "brandingConfigurationServiceTracker";
private ServiceTracker<BrandingConfigurationService, BrandingConfigurationService> brandingConfigurationServiceTracker;
public RestServletContainer() {
super();
}
public RestServletContainer(Application app) {
super(app);
}
public RestServletContainer(Class<? extends Application> appClass) {
super(appClass);
}
@Override
public void init(ServletConfig config) throws ServletException {
super.init(config);
BundleContext context = (BundleContext) config.getServletContext().getAttribute(OSGI_RFC66_WEBBUNDLE_BUNDLECONTEXT_NAME);
brandingConfigurationServiceTracker = ServiceTrackerFactory.createAndOpen(context, BrandingConfigurationService.class, null);
config.getServletContext().setAttribute(BRANDING_CONFIGURATION_SERVICE_TRACKER_NAME, brandingConfigurationServiceTracker);
}
}
@@ -1,74 +0,0 @@
package com.sap.sse.gwt.jaxrs.api;
import java.util.Map.Entry;
import java.util.Optional;
import javax.servlet.ServletContext;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.Response;
import org.json.simple.JSONObject;
import org.osgi.util.tracker.ServiceTracker;
import com.sap.sse.branding.BrandingConfigurationService;
import com.sap.sse.branding.BrandingConfigurationService.BrandingConfigurationProperty;
import com.sap.sse.gwt.client.context.data.ClientConfigurationContextDataJSO;
import com.sap.sse.gwt.client.context.impl.ClientConfigurationContextDataFactoryImpl;
import com.sap.sse.gwt.jaxrs.RestServletContainer;
import com.sap.sse.gwt.shared.ClientConfiguration;
/**
* Generates a JavaScript snippet that assigns an object to {@code document.clientConfigurationContext} from where it is
* read by the GWT client code to configure the client application. The reading counterpart is the
* {@link ClientConfigurationContextDataFactoryImpl} class in conjunction with the {@link ClientConfiguration} and the
* {@link ClientConfigurationContextDataJSO} class.<p>
*
* The script should be used in a {@code script} tag in the HTML page that starts the GWT client code, like this:
* <pre>
* &lt;script type="text/javascript" src="/gwt-base/api/client_configuration_context"&gt;&lt;/script&gt;
* </pre>
* The {@link ClientConfiguration} instance can then be obtained from the GWT client code using
* {@link ClientConfiguration#getInstance()}.
*
* @author Axel Uhl (d043530)
*
*/
@Path("/client_configuration_context")
public class ClientConfigurationContextScriptGenerator {
@Context
ServletContext servletContext;
private ServiceTracker<BrandingConfigurationService, BrandingConfigurationService> getBrandingConfigurationServiceTracker() {
@SuppressWarnings("unchecked")
ServiceTracker<BrandingConfigurationService, BrandingConfigurationService> tracker = (ServiceTracker<BrandingConfigurationService, BrandingConfigurationService>) servletContext
.getAttribute(RestServletContainer.BRANDING_CONFIGURATION_SERVICE_TRACKER_NAME);
return tracker;
}
@GET
@Produces("text/javascript;charset=UTF-8")
public Response generateClientConfigurationContextScript() {
final Response result;
final BrandingConfigurationService brandingService = getBrandingConfigurationServiceTracker().getService();
if (brandingService == null) {
result = Response.status(Response.Status.INTERNAL_SERVER_ERROR)
.entity("Branding configuration service is not available.")
.build();
} else {
final StringBuilder scriptBuilder = new StringBuilder();
scriptBuilder.append("document.clientConfigurationContext=");
final JSONObject jsonObject = new JSONObject();
for (final Entry<BrandingConfigurationProperty, Object> brandingConfigurationPropertyAndValue : brandingService
.getBrandingConfigurationPropertiesForJspContext(Optional.empty() /* TODO */ ).entrySet()) {
jsonObject.put(brandingConfigurationPropertyAndValue.getKey().getPropertyName(), brandingConfigurationPropertyAndValue.getValue());
}
scriptBuilder.append(jsonObject.toJSONString());
scriptBuilder.append(";");
result = Response.ok(scriptBuilder.toString()).build();
}
return result;
}
}
@@ -1,15 +0,0 @@
package com.sap.sse.gwt.jaxrs.api;
import java.util.HashSet;
import java.util.Set;
import javax.ws.rs.core.Application;
public class RestApiApplication extends Application {
public Set<Class<?>> getClasses() {
HashSet<Class<?>> classes = new HashSet<>();
// RESTlets
classes.add(ClientConfigurationContextScriptGenerator.class);
return classes;
}
}
@@ -3,11 +3,9 @@ package com.sap.sse.gwt.shared;
import java.util.Optional;
import com.google.gwt.core.client.GWT;
import com.sap.sse.branding.BrandingConfigurationService;
import com.sap.sse.branding.shared.BrandingConfiguration;
import com.sap.sse.gwt.client.context.data.ClientConfigurationContextDataJSO;
import com.sap.sse.gwt.client.context.impl.ClientConfigurationContextDataFactoryImpl;
import com.sap.sse.gwt.jaxrs.api.ClientConfigurationContextScriptGenerator;
/**
* Provides information for the GWT client if debranding/whitelabeling is currently brandingActive.
@@ -80,17 +78,17 @@ public class ClientConfiguration implements BrandingConfiguration {
}
@Override
public String getBrandTitle() {
public String getBrandTitle(Optional<String> locale) {
return brandTitle;
}
@Override
public String getDefaultBrandingLogoURL() {
public String getDefaultBrandingLogoURL(Optional<String> locale) {
return defaultBrandingLogoURL;
}
@Override
public String getGreyTransparentLogoURL() {
public String getGreyTransparentLogoURL(Optional<String> locale) {
return greyTransparentLogoURL;
}
@@ -12,17 +12,17 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Login</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Login</title>
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Register.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
@@ -12,17 +12,17 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Login</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Login</title>
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Register.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
+2 -2
View File
@@ -18,12 +18,12 @@
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics Login</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics Login</title>
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Login.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
+1 -1
View File
@@ -12,7 +12,7 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
+3 -3
View File
@@ -12,18 +12,18 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
<!-- Any title is fine -->
<!-- -->
<title>${applicationScope['clientConfigurationContext.brandTitle']}Sailing Analytics - Registration</title>
<title>${clientConfigurationContext['brandTitle']}Sailing Analytics - Registration</title>
<link rel="stylesheet" type="text/css" href="/sailing-normalize-3.0.2.cache.css">
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="Register.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
@@ -12,7 +12,7 @@
<!-- -->
<!-- Consider inlining CSS to reduce the number of requested files -->
<!-- -->
<link rel="shortcut icon" type="image/x-icon" href="images/sap${applicationScope['clientConfigurationContext.whitelabeled']}.ico" />
<link rel="shortcut icon" type="image/x-icon" href="images/sap${clientConfigurationContext['whitelabeled']}.ico" />
<!-- -->
@@ -22,7 +22,7 @@
<link rel="stylesheet" type="text/css" href="/clean/sailing-clean-1.0.cache.css">
<link rel="stylesheet" type="text/css" href="UserManagement.css">
<script>${applicationScope['clientConfigurationContext.scriptForClientConfigurationContextToDocument']}</script>
<script>${clientConfigurationContext['scriptForClientConfigurationContextToDocument']}</script>
<!-- -->
<!-- This script loads your compiled module. -->
<!-- If you add any GWT meta tags, they must -->
@@ -7,7 +7,6 @@ Bundle-Activator: com.sap.sse.security.impl.Activator
Bundle-Vendor: SAP
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: com.sap.sse.branding,
com.sap.sse.branding.shared,
javax.mail;version="1.4.0",
javax.mail.internet;version="1.4.0",
javax.ws.rs;version="1.1.1",
@@ -0,0 +1,46 @@
package com.sap.sse.rest;
import java.util.Map;
import java.util.Optional;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.core.HttpHeaders;
public class GwtLocaleFromHttpRequestUtil {
public static Optional<String> getLocaleFromHttpRequest(HttpServletRequest httpServletRequest) {
Optional<String> locale = Optional.empty();
final Map<String, String[]> parameterMap = httpServletRequest.getParameterMap();
if (parameterMap != null && parameterMap.containsKey("locale")) {
locale = Optional.of(parameterMap.get("locale")[0]);
} else {
if (httpServletRequest.getCookies() != null) {
for (final Cookie cookie : httpServletRequest.getCookies()) {
if (cookie.getName().equals("GWT_LOCALE")) {
locale = Optional.of(cookie.getValue());
break;
}
}
}
if (!locale.isPresent()) {
final String acceptLanguageHeader = httpServletRequest.getHeader(HttpHeaders.ACCEPT_LANGUAGE);
if (acceptLanguageHeader != null) {
locale = Optional.of(getFirstFromAcceptLanguage(acceptLanguageHeader));
}
}
}
return locale;
}
private static String getFirstFromAcceptLanguage(String acceptLanguageHeader) {
if (acceptLanguageHeader == null) return null;
String[] langs = acceptLanguageHeader.split(",");
final String result;
if (langs.length > 0) {
result = langs[0].split(";")[0].trim();
} else {
result = null;
}
return result;
}
}