[mapguide-commits] r9407 - in trunk/MgDev: . Oem/fusionMG/templates/mapguide Oem/fusionMG/templates/mapguide/aqua Oem/fusionMG/templates/mapguide/limegold Oem/fusionMG/templates/mapguide/maroon Oem/fusionMG/templates/mapguide/slate Oem/fusionMG/templates/mapguide/turquoiseyellow
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Aug 10 22:58:25 PDT 2018
Author: jng
Date: 2018-08-10 22:58:24 -0700 (Fri, 10 Aug 2018)
New Revision: 9407
Added:
trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua/index.templ
trunk/MgDev/Oem/fusionMG/templates/mapguide/images/
trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.templ
trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.templ
trunk/MgDev/Oem/fusionMG/templates/mapguide/slate/index.templ
trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.templ
Modified:
trunk/MgDev/
trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua.xml
trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold.xml
trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon.xml
trunk/MgDev/Oem/fusionMG/templates/mapguide/slate.xml
trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow.xml
Log:
RFC 167: Merged revision(s) 9400-9406 from sandbox/jng/fusion_entrypoint_refactor
Index: trunk/MgDev
===================================================================
--- trunk/MgDev 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev 2018-08-11 05:58:24 UTC (rev 9407)
Property changes on: trunk/MgDev
___________________________________________________________________
Modified: svn:mergeinfo
## -15,6 +15,7 ##
/sandbox/jng/coordsys_mapagent:9231-9254
/sandbox/jng/createruntimemap:7486-7555
/sandbox/jng/dwftk:8321-8324,8328-8329,8331,8352
+/sandbox/jng/fusion_entrypoint_refactor:9400-9406
/sandbox/jng/geoprocessing:9205-9229
/sandbox/jng/geos34x:8256-8259
/sandbox/jng/ogc:9240-9255
## -24,4 +25,5 ##
/sandbox/jng/tiling:8174-8208
/sandbox/jng/utfgrid:9179-9212
/sandbox/jng/v30:8212-8227
-/sandbox/rfc94:5099-5163
\ No newline at end of property
+/sandbox/rfc94:5099-5163
+/trunk/MgDev:9397-9399
\ No newline at end of property
Copied: trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua/index.templ (from rev 9406, sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/aqua/index.templ)
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua/index.templ (rev 0)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua/index.templ 2018-08-11 05:58:24 UTC (rev 9407)
@@ -0,0 +1,268 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Aqua</title>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="%__LIB_BASE__%/%__FUSION_SCRIPT__%.js"></script>
+%__SCRIPTS__%
+<link rel="stylesheet" href="%__LIB_BASE__%/jxLib/themes/delicious/jxtheme.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/aqua.css" type="text/css" media="screen" charset="utf-8" />
+<!--[if lte IE 6]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie6.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<!--[if IE 7]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie7.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/icons.css" type="text/css" media="screen" charset="utf-8" />
+<script type="text/javascript">
+
+var dOverviewMap;
+var dTasks;
+var dLegend;
+var appDefJson = %__APPDEF_JSON__%;
+
+window.onload = function() {
+ Fusion.initializeLocale(); //need to call this first if String.Translate is to be used in the onload
+
+ var main = new Jx.Layout('AppContainer');
+ new Jx.Layout('FileMenu', {height: 34, bottom: null});
+ new Jx.Layout('Toolbar', {height: 25, top: 34, bottom: null});
+ new Jx.Layout('ToolbarVertical', {width: 25, right: null, top: 59, bottom: 21});
+ new Jx.Layout('Map', {left: 25, right: 0, top: 59, bottom: 21});
+ new Jx.Layout('StatusbarContainer', {height: 21, top: null, bottom: 0});
+ new Jx.Layout('Statusbar', {height: 21, right: 159, top: null, bottom: 0});
+
+ dOverviewMap = new Jx.Dialog({
+ id: 'dialogOverviewMap',
+ label: OpenLayers.i18n('ovmapTitle'),
+ modal: false,
+ resize: false,
+ horizontal: 'right -10',
+ vertical: 'bottom -10',
+ width: 300,
+ height: 300,
+ contentId: 'OverviewMap'
+ });
+ dOverviewMap.open();
+
+ dLegend = new Jx.Dialog({
+ id: 'dialogLegend',
+ label: OpenLayers.i18n('legendTitle'),
+ modal: false,
+ resize: true,
+ horizontal: 'right -10',
+ vertical: '10 top',
+ width: 300,
+ height: 400,
+ contentId: 'Legend'
+ });
+
+ dTasks = new Jx.Dialog({
+ id: 'dialogTasks',
+ label: OpenLayers.i18n('taskPaneTitle'),
+ modal: false,
+ resize: true,
+ horizontal: '50 left',
+ vertical: 'bottom -10',
+ width: 400,
+ height: 400,
+ contentId: 'TaskPane'
+ });
+
+ dSelection = new Jx.Dialog({
+ id: 'dialogSelection',
+ label: OpenLayers.i18n('selectionPanelTitle'),
+ modal: false,
+ resize: true,
+ horizontal: '50 left',
+ vertical: '10 top',
+ width: 400,
+ height: 400,
+ contentId: 'SelectionPanel'
+ });
+
+ main.addEvent('sizeChange', function(){
+ if (dOverviewMap.domObj.getStyle('display') != 'none'){
+ dOverviewMap.show();
+ }
+ if (dLegend.domObj.getStyle('display') != 'none'){
+ dLegend.show();
+ }
+ if (dTasks.domObj.getStyle('display') != 'none'){
+ dTasks.show();
+ }
+ if (dSelection.domObj.getStyle('display') != 'none'){
+ dSelection.show();
+ }
+
+ });
+ main.resize();
+
+ Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
+ Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
+ Fusion.initialize({
+ appDef: appDefJson
+ });
+}
+
+var showErrorDialog = function(msg) {
+ var errorDialog = new Jx.Dialog({
+ label: "Fusion Error",
+ image: "images/icons/error.png",
+ width: 800,
+ height: 400,
+ modal: true,
+ resize: true,
+ move: true,
+ content: msg
+ });
+ errorDialog.show();
+};
+
+var fusionError = function(eventId, error) {
+ if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
+ var fmtStack = "";
+ for (var i = 0; i < error.stack.length; i++) {
+ var stackFrame = error.stack[i];
+ fmtStack += " - " + (stackFrame.func != "" ? stackFrame.func : "?") + " at " + stackFrame.url + " (line: " + stackFrame.line + ")";
+ fmtStack += "\n";
+ }
+ var message = OpenLayers.i18n("detailedErrorTemplateHtml", {
+ name: error.name,
+ source: error.url,
+ message: error.message,
+ stacktrace: fmtStack
+ });
+ showErrorDialog(message);
+ console.log('Fusion Error: \n' + message);
+ } else {
+ var errorMessage = error.toString();
+ var readableMessage = '';
+
+ //Case 1: For dealing with Function: convertXML (fusion.js)
+ //******************************************
+ // xml2json: function(callback, r, json) {
+ // if (json) {
+ // var o;
+ // eval("o="+r.responseText);
+ // callback(o);
+ // } else {
+ // if (r.status >= 400) {
+ // Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,
+ // 'xml2json: invalid XML document: ' + r.transport.responseText + " : " + r.request.url));
+ // return;
+ // }
+ //******************************************
+ var tagStart = '<h2>';
+ var tagEnd = '</h2>';
+ var indexStart = errorMessage.indexOf(tagStart);
+ var indexEnd = errorMessage.indexOf(tagEnd, tagStart);
+ if (indexStart != -1 && indexEnd != -1) {
+ readableMessage = errorMessage.substring(indexStart + tagStart.length, indexEnd);
+ readableMessage = readableMessage.replace(/\\n/g, '\n');
+ readableMessage = readableMessage.replace(/\\t/g, '\t');
+ readableMessage = readableMessage.replace(/\\'/g, '\'');
+ }
+
+ if (readableMessage != '') {
+ showErrorDialog(readableMessage);
+ }
+ else {
+ showErrorDialog('Fusion Error: \n' + errorMessage);
+ }
+ console.log('Fusion Error: \n' + errorMessage);
+ }
+}
+
+var fusionInitialized = function() {
+
+ $('AppContainer').resize({forceResize: true});
+ $('AppContainer').style.visibility = 'visible';
+ var mapWidget = Fusion.getMapById('Map');
+ mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+}
+
+var isTaskPaneRegistered = false;
+
+var initPanelHandler = function() {
+ if(isTaskPaneRegistered) return;
+ //register this with MAP_LOADED so that the initial layout will remain
+ Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
+ isTaskPaneRegistered = true;
+}
+
+var showOverviewMap = function() {
+ dOverviewMap.open();
+}
+
+var showTaskPane = function() {
+ dTasks.open();
+}
+
+var showLegend = function() {
+ dLegend.open();
+}
+
+var showSelectionPanel = function() {
+ dSelection.open();
+}
+
+</script>
+</head>
+
+<body>
+
+<div id="AppContainer" style="visibility: hidden;">
+
+ <div id="Map">
+ <div id="Navigator"></div>
+ </div>
+
+ <!-- File Menu -->
+ <div id="FileMenu"></div>
+ <!-- /File Menu -->
+
+ <!-- Toolbar -->
+ <div id="Toolbar"></div>
+ <!-- /Toolbar -->
+
+ <!-- Toolbar Vertical -->
+ <div id="ToolbarVertical"></div>
+ <!-- /Toolbar Vertical -->
+
+ <div id="StatusbarContainer">
+ <div id="Statusbar"></div>
+ <div id="StatusOverviewMap"></div>
+ <div id="pbmg"><img src="images/pbmg.png" alt=""></div>
+ </div>
+
+ <div id="Maptip"></div>
+
+</div>
+
+<!--
+<div id="TaskPane"></div>
+<div id="OverviewMap"></div>
+<div id="Legend"></div>
+<div id="SelectionPanel"></div>
+-->
+</body>
+</html>
Modified: trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua.xml
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua.xml 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/aqua.xml 2018-08-11 05:58:24 UTC (rev 9407)
@@ -1,6 +1,6 @@
<TemplateInfo>
<Name>Aqua</Name>
-<LocationUrl>fusion/templates/mapguide/aqua/index.html</LocationUrl>
+<LocationUrl>fusion/templates/mapguide/index.php?template=aqua</LocationUrl>
<Description>Aqua template</Description>
<PreviewImageUrl>fusion/templates/mapguide/aqua/preview.png</PreviewImageUrl>
Copied: trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.templ (from rev 9406, sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/limegold/index.templ)
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.templ (rev 0)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold/index.templ 2018-08-11 05:58:24 UTC (rev 9407)
@@ -0,0 +1,266 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>LimeGold</title>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="%__LIB_BASE__%/%__FUSION_SCRIPT__%.js"></script>
+%__SCRIPTS__%
+<link rel="stylesheet" href="%__LIB_BASE__%/jxLib/themes/delicious/jxtheme.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/limegold.css" type="text/css" media="screen" charset="utf-8" />
+<!--[if lte IE 6]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie6.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<!--[if IE 7]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie7.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/icons.css" type="text/css" media="screen" charset="utf-8" />
+<script type="text/javascript">
+var tab1;
+var tab2;
+var tab3;
+var tabbox1;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
+var appDefJson = %__APPDEF_JSON__%;
+
+window.onload = function() {
+ Fusion.initializeLocale(); //need to call this first if String.Translate is to be used in the onload
+
+ var main = new Jx.Layout('AppContainer');
+ new Jx.Layout('FileMenu', {height: 34, bottom: null});
+ new Jx.Layout('Toolbar', {height: 24, top: 34, bottom: null});
+ new Jx.Layout('ToolbarSecondary', {height: 24, top: 58, bottom: null});
+ new Jx.Layout('SplitterArea', {left: 0, right: 0, top: 82, bottom: 21});
+ new Jx.Layout('StatusbarContainer', {height: 21, top: null, bottom: 0});
+ new Jx.Layout('Statusbar', {height: 21, right: 141, top: null});
+ new Jx.Layout('Map');
+
+ var splitter = new Jx.Splitter('SplitterArea', {
+ splitInto:2,
+ elements:[$('Main'),$('Sidebar')],
+ layout:'horizontal',
+ containerOptions: [{},{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 214}],
+ barOptions: [{
+ snap: 'after',
+ snapElement: $('SidebarCollapse'),
+ snapEvents: ['click']
+ }]
+ });
+
+ var splitter2 = new Jx.Splitter('Sidebar', {
+ splitInto:2,
+ elements:[$('Info'),$('Bottom')],
+ layout:'vertical',
+ containerOptions: [
+ {},
+ {height: 214, minHeight: 214, maxHeight: 214}
+ ]
+ });
+
+ /* create dynamic content */
+ tabbox1 = new Jx.TabBox({parent: splitter2.elements[0]});
+
+ tab1 = new Jx.Tab({
+ label: OpenLayers.i18n('taskPaneTitle'),
+ contentId: 'TaskPane'
+ });
+
+ tab2 = new Jx.Tab({
+ label: OpenLayers.i18n('legendTitle'),
+ contentId: 'Legend'
+ });
+
+ tab3 = new Jx.Tab({
+ label: OpenLayers.i18n('selectionPanelTitle'),
+ contentId: 'SelectionPanel'
+ });
+
+ tabbox1.add(tab1, tab2, tab3);
+
+ var tabbox2 = new Jx.TabBox({parent: splitter2.elements[1]});
+
+ var tab4 = new Jx.Tab({
+ label: OpenLayers.i18n('ovmapTitle'),
+ contentId: 'OverviewMap'});
+
+ tabbox2.add(tab4);
+
+ main.resize();
+
+ Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
+ Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
+ Fusion.initialize({
+ appDef: appDefJson
+ });
+}
+
+var showErrorDialog = function(msg) {
+ var errorDialog = new Jx.Dialog({
+ label: "Fusion Error",
+ image: "images/icons/error.png",
+ width: 800,
+ height: 400,
+ modal: true,
+ resize: true,
+ move: true,
+ content: msg
+ });
+ errorDialog.show();
+};
+
+var fusionError = function(eventId, error) {
+ if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
+ var fmtStack = "";
+ for (var i = 0; i < error.stack.length; i++) {
+ var stackFrame = error.stack[i];
+ fmtStack += " - " + (stackFrame.func != "" ? stackFrame.func : "?") + " at " + stackFrame.url + " (line: " + stackFrame.line + ")";
+ fmtStack += "\n";
+ }
+ var message = OpenLayers.i18n("detailedErrorTemplateHtml", {
+ name: error.name,
+ source: error.url,
+ message: error.message,
+ stacktrace: fmtStack
+ });
+ showErrorDialog(message);
+ console.log('Fusion Error: \n' + message);
+ } else {
+ var errorMessage = error.toString();
+ var readableMessage = '';
+
+ //Case 1: For dealing with Function: convertXML (fusion.js)
+ //******************************************
+ // xml2json: function(callback, r, json) {
+ // if (json) {
+ // var o;
+ // eval("o="+r.responseText);
+ // callback(o);
+ // } else {
+ // if (r.status >= 400) {
+ // Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,
+ // 'xml2json: invalid XML document: ' + r.transport.responseText + " : " + r.request.url));
+ // return;
+ // }
+ //******************************************
+ var tagStart = '<h2>';
+ var tagEnd = '</h2>';
+ var indexStart = errorMessage.indexOf(tagStart);
+ var indexEnd = errorMessage.indexOf(tagEnd, tagStart);
+ if (indexStart != -1 && indexEnd != -1) {
+ readableMessage = errorMessage.substring(indexStart + tagStart.length, indexEnd);
+ readableMessage = readableMessage.replace(/\\n/g, '\n');
+ readableMessage = readableMessage.replace(/\\t/g, '\t');
+ readableMessage = readableMessage.replace(/\\'/g, '\'');
+ }
+
+ if (readableMessage != '') {
+ showErrorDialog(readableMessage);
+ }
+ else {
+ showErrorDialog('Fusion Error: \n' + errorMessage);
+ }
+ console.log('Fusion Error: \n' + errorMessage);
+ }
+}
+
+var fusionInitialized = function() {
+ $('AppContainer').resize({forceResize: true});
+ //Fusion.getWidgetById('ToolbarSecondary').checkPosition();
+ var mapWidget = Fusion.getMapById('Map');
+ mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+}
+
+var isTaskPaneRegistered = false;
+
+var initPanelHandler = function() {
+ if(isTaskPaneRegistered) return;
+ //register this with MAP_LOADED so that the initial layout will remain
+ Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
+ isTaskPaneRegistered = true;
+}
+
+var showOverviewMap = function() {
+ showSidebarIfCollapsed();
+}
+
+var showSidebarIfCollapsed = function() {
+ if ($("Sidebar").getWidth() <= COLLAPSED_SIDEBAR_WIDTH)
+ $("SidebarCollapse").fireEvent("click");
+};
+
+var showTaskPane = function() {
+ showSidebarIfCollapsed();
+ tab1.setActive(true);
+}
+
+var showLegend = function() {
+ showSidebarIfCollapsed();
+ tab2.setActive(true);
+}
+
+var showSelectionPanel = function() {
+ showSidebarIfCollapsed();
+ tab3.setActive(true);
+}
+
+</script>
+</head>
+
+<body>
+
+<div id="AppContainer">
+
+ <div id="FileMenu"></div>
+ <div id="Toolbar"></div>
+ <div id="ToolbarSecondary"></div>
+
+ <div id="SplitterArea">
+
+ <div id="Sidebar">
+ <div id="Info"></div>
+ <div id="Bottom"></div>
+ <!-- Collapse Sidebar -->
+ <div id="SidebarCollapse">
+ <div id="SidebarCollapseTop"></div>
+ <div id="SidebarCollapseContent">
+ <a id="SidebarCollapseButton" href="#"></a>
+ </div>
+ <div id="SidebarCollapseBottom"></div>
+ </div>
+ </div>
+
+ <div id="Main">
+ <div id="Map">
+ <div id="Navigator"></div>
+ </div>
+ </div>
+ </div>
+
+ <div id="StatusbarContainer">
+ <div id="Statusbar"></div>
+ <div id="pbmg"><img src="images/pbmg.png" alt=""></div>
+ </div>
+
+</div>
+
+<div id="Maptip"></div>
+
+</body>
+</html>
Modified: trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold.xml
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold.xml 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/limegold.xml 2018-08-11 05:58:24 UTC (rev 9407)
@@ -1,6 +1,6 @@
<TemplateInfo>
<Name>LimeGold</Name>
-<LocationUrl>fusion/templates/mapguide/limegold/index.html</LocationUrl>
+<LocationUrl>fusion/templates/mapguide/index.php?template=limegold</LocationUrl>
<Description>Lime-Gold template</Description>
<PreviewImageUrl>fusion/templates/mapguide/limegold/preview.png</PreviewImageUrl>
Copied: trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.templ (from rev 9406, sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/maroon/index.templ)
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.templ (rev 0)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon/index.templ 2018-08-11 05:58:24 UTC (rev 9407)
@@ -0,0 +1,281 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Maroon</title>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="%__LIB_BASE__%/%__FUSION_SCRIPT__%.js"></script>
+%__SCRIPTS__%
+<link rel="stylesheet" href="%__LIB_BASE__%/jxLib/themes/delicious/jxtheme.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/maroon.css" type="text/css" media="screen" charset="utf-8" />
+<!--[if lte IE 6]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie6.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<!--[if IE 7]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie7.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/icons.css" type="text/css" media="screen" charset="utf-8" />
+<script type="text/javascript">
+
+var panel1;
+var panel2;
+var panel3;
+var panel4;
+var panelman;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
+var appDefJson = %__APPDEF_JSON__%;
+
+window.onload = function() {
+ Fusion.initializeLocale(); //need to call this first if String.Translate is to be used in the onload
+
+ var main = new Jx.Layout('AppContainer');
+ new Jx.Layout('FileMenu', {
+ left: 5,
+ right: 5,
+ top: 5,
+ height: 25
+ });
+ new Jx.Layout('Toolbar', {
+ left: 5,
+ right: 5,
+ top: 30,
+ height: 24
+ });
+ new Jx.Layout('ToolbarVertical', {
+ left: 5,
+ width: 28,
+ top: 54,
+ bottom: 21
+ });
+ new Jx.Layout('SplitterArea', {
+ left: 33,
+ top: 54,
+ right: 5,
+ bottom: 22
+ });
+
+ new Jx.Layout('MapArea');
+ new Jx.Layout('Map');
+
+ new Jx.Layout('StatusbarContainer', {
+ height: 22,
+ bottom: 0,
+ top: null
+ });
+ new Jx.Layout('Statusbar', {
+ right: 159
+ });
+
+ var splitter = new Jx.Splitter('SplitterArea', {
+ splitInto:2,
+ elements:[$('MapArea'),$('Sidebar')],
+ layout:'horizontal',
+ containerOptions: [{},{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 218}],
+ barOptions: [
+ {
+ snap: 'after',
+ snapElement: $('SidebarCollapse'),
+ snapEvents: ['click']
+ }
+ ]
+ });
+
+ /* create dynamic content */
+ panel1 = new Jx.Panel({
+ label: OpenLayers.i18n('legendTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'Legend'});
+ panel1.content.id = 'Legend';
+
+ panel2 = new Jx.Panel({
+ label: OpenLayers.i18n('selectionPanelTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'SelectionPanel'});
+
+ panel3 = new Jx.Panel({
+ label: OpenLayers.i18n('taskPaneTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'TaskPane'});
+
+ panel4 = new Jx.Panel({
+ label: OpenLayers.i18n('ovmapTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'OverviewMap'});
+
+ panelman = new Jx.PanelSet({parent: splitter.elements[1], panels: [panel1, panel2, panel3, panel4]});
+
+ main.resize();
+
+ Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
+ Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
+ Fusion.initialize({
+ appDef: appDefJson
+ });
+}
+
+var showErrorDialog = function(msg) {
+ var errorDialog = new Jx.Dialog({
+ label: "Fusion Error",
+ image: "images/icons/error.png",
+ width: 800,
+ height: 400,
+ modal: true,
+ resize: true,
+ move: true,
+ content: msg
+ });
+ errorDialog.show();
+};
+
+var fusionError = function(eventId, error) {
+ if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
+ var fmtStack = "";
+ for (var i = 0; i < error.stack.length; i++) {
+ var stackFrame = error.stack[i];
+ fmtStack += " - " + (stackFrame.func != "" ? stackFrame.func : "?") + " at " + stackFrame.url + " (line: " + stackFrame.line + ")";
+ fmtStack += "\n";
+ }
+ var message = OpenLayers.i18n("detailedErrorTemplateHtml", {
+ name: error.name,
+ source: error.url,
+ message: error.message,
+ stacktrace: fmtStack
+ });
+ showErrorDialog(message);
+ console.log('Fusion Error: \n' + message);
+ } else {
+ var errorMessage = error.toString();
+ var readableMessage = '';
+
+ //Case 1: For dealing with Function: convertXML (fusion.js)
+ //******************************************
+ // xml2json: function(callback, r, json) {
+ // if (json) {
+ // var o;
+ // eval("o="+r.responseText);
+ // callback(o);
+ // } else {
+ // if (r.status >= 400) {
+ // Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,
+ // 'xml2json: invalid XML document: ' + r.transport.responseText + " : " + r.request.url));
+ // return;
+ // }
+ //******************************************
+ var tagStart = '<h2>';
+ var tagEnd = '</h2>';
+ var indexStart = errorMessage.indexOf(tagStart);
+ var indexEnd = errorMessage.indexOf(tagEnd, tagStart);
+ if (indexStart != -1 && indexEnd != -1) {
+ readableMessage = errorMessage.substring(indexStart + tagStart.length, indexEnd);
+ readableMessage = readableMessage.replace(/\\n/g, '\n');
+ readableMessage = readableMessage.replace(/\\t/g, '\t');
+ readableMessage = readableMessage.replace(/\\'/g, '\'');
+ }
+
+ if (readableMessage != '') {
+ showErrorDialog(readableMessage);
+ }
+ else {
+ showErrorDialog('Fusion Error: \n' + errorMessage);
+ }
+ console.log('Fusion Error: \n' + errorMessage);
+ }
+}
+
+var fusionInitialized = function() {
+ $('AppContainer').resize({forceResize: true});
+ var mapWidget = Fusion.getMapById('Map');
+ mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+}
+
+var isTaskPaneRegistered = false;
+
+var initPanelHandler = function() {
+ if(isTaskPaneRegistered) return;
+ //register this with MAP_LOADED so that the initial layout will remain
+ Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
+ isTaskPaneRegistered = true;
+}
+
+var showSidebarIfCollapsed = function() {
+ if ($("Sidebar").getWidth() <= (COLLAPSED_SIDEBAR_WIDTH + 1)) //Template-specific
+ $("SidebarCollapse").fireEvent("click");
+};
+
+var showOverviewMap = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel4);
+}
+
+var showTaskPane = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel3);
+}
+
+var showLegend = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel1);
+}
+
+var showSelectionPanel = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel2);
+}
+
+</script>
+
+</head>
+
+<body>
+
+<div id="AppContainer">
+
+ <div id="FileMenu"></div>
+
+ <div id="SplitterArea">
+ <div id="MapArea">
+ <div id="Map"></div>
+ <div id="Navigator"></div>
+ </div>
+ <div id="Sidebar">
+ <!-- Collapse Sidebar -->
+ <div id="SidebarCollapse">
+ <a id="SidebarCollapseButton" href="#"></a>
+ </div>
+ </div>
+ </div>
+
+ <div id="Toolbar"></div>
+ <div id="ToolbarVertical"></div>
+ <div id="StatusbarContainer">
+ <div id="Statusbar"></div>
+ <div id="pbmg"><img src="images/pbmg.gif" alt=""></div>
+ </div>
+
+</div>
+
+<div id="Maptip"></div>
+
+</body>
+</html>
Modified: trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon.xml
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon.xml 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/maroon.xml 2018-08-11 05:58:24 UTC (rev 9407)
@@ -1,6 +1,6 @@
<TemplateInfo>
<Name>Maroon</Name>
-<LocationUrl>fusion/templates/mapguide/maroon/index.html</LocationUrl>
+<LocationUrl>fusion/templates/mapguide/index.php?template=maroon</LocationUrl>
<Description>Maroon template</Description>
<PreviewImageUrl>fusion/templates/mapguide/maroon/preview.png</PreviewImageUrl>
Copied: trunk/MgDev/Oem/fusionMG/templates/mapguide/slate/index.templ (from rev 9406, sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/slate/index.templ)
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/slate/index.templ (rev 0)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/slate/index.templ 2018-08-11 05:58:24 UTC (rev 9407)
@@ -0,0 +1,301 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Slate</title>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="%__LIB_BASE__%/%__FUSION_SCRIPT__%.js"></script>
+%__SCRIPTS__%
+<link rel="stylesheet" href="%__LIB_BASE__%/jxLib/themes/delicious/jxtheme.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/slate.css" type="text/css" media="screen" charset="utf-8" />
+<!--[if lte IE 6]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie6.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<!--[if IE 7]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie7.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/icons.css" type="text/css" media="screen" charset="utf-8" />
+<script type="text/javascript">
+var panel1;
+var panel2;
+var panel3;
+var panelman;
+var dOverviewMap;
+var COLLAPSED_SIDEBAR_WIDTH = 8;
+var appDefJson = %__APPDEF_JSON__%;
+
+window.onload = function() {
+ Fusion.initializeLocale(); //need to call this first if String.Translate is to be used in the onload
+
+ var main = new Jx.Layout('AppContainer');
+ new Jx.Layout('FileMenuContainer', {height: 24, top: 0, bottom: null});
+ new Jx.Layout('SplitterArea', {left: 2, right: 2, top: 2, bottom: 23});
+ new Jx.Layout('ToolbarContainer', {height: 56, top: 26, bottom: null});
+ new Jx.Layout('Map', {left: 0, right: 0, top: 76, bottom: 0});
+ new Jx.Layout('StatusbarContainer', {height: 21, left: 0, right: 0, top: null, bottom: 0});
+ new Jx.Layout('Statusbar', {height: 21, left: 0, right: 159, top: null, bottom: 0});
+
+ var splitter = new Jx.Splitter('SplitterArea', {
+ splitInto:2,
+ elements:[$('Sidebar'),$('MapArea')],
+ layout:'horizontal',
+ containerOptions: [{minWidth:COLLAPSED_SIDEBAR_WIDTH, width: 218}],
+ barOptions: [{
+ snap: 'before',
+ snapElement: $('SidebarCollapse'),
+ snapEvents: ['click']
+ }]
+ });
+
+ panel1 = new Jx.Panel({
+ label: OpenLayers.i18n('legendTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'Legend'
+ });
+
+ panel2 = new Jx.Panel({
+ label: OpenLayers.i18n('selectionPanelTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'SelectionPanel'
+ });
+
+ panel3 = new Jx.Panel({
+ label: OpenLayers.i18n('taskPaneTitle'),
+ collapse: true,
+ maximize: true,
+ contentId: 'TaskPane'
+ });
+
+ panelman = new Jx.PanelSet({
+ parent: splitter.elements[0],
+ panels: [panel1, panel2, panel3]
+ });
+
+ dOverviewMap = new Jx.Dialog({
+ id: 'dialogNavigator',
+ label: OpenLayers.i18n('ovmapTitle'),
+ modal: false,
+ resize: false,
+ collapse: false,
+ horizontal: 'right -10',
+ vertical: 'bottom -10',
+ width: 200,
+ height: 200
+ });
+ dOverviewMap.content.id = 'OverviewMap';
+ main.addEvent('sizeChange', function(){
+ if (dOverviewMap.domObj.getStyle('display') != 'none'){
+ dOverviewMap.show();
+ }
+ });
+ main.resize();
+
+ Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
+ Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
+ Fusion.initialize({
+ appDef: appDefJson
+ });
+
+ dOverviewMap.open();
+}
+
+var showErrorDialog = function(msg) {
+ var errorDialog = new Jx.Dialog({
+ label: "Fusion Error",
+ image: "images/icons/error.png",
+ width: 800,
+ height: 400,
+ modal: true,
+ resize: true,
+ move: true,
+ content: msg
+ });
+ errorDialog.show();
+};
+
+var fusionError = function(eventId, error) {
+ if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
+ var fmtStack = "";
+ for (var i = 0; i < error.stack.length; i++) {
+ var stackFrame = error.stack[i];
+ fmtStack += " - " + (stackFrame.func != "" ? stackFrame.func : "?") + " at " + stackFrame.url + " (line: " + stackFrame.line + ")";
+ fmtStack += "\n";
+ }
+ var message = OpenLayers.i18n("detailedErrorTemplateHtml", {
+ name: error.name,
+ source: error.url,
+ message: error.message,
+ stacktrace: fmtStack
+ });
+ showErrorDialog(message);
+ console.log('Fusion Error: \n' + message);
+ } else {
+ var errorMessage = error.toString();
+ var readableMessage = '';
+
+ //Case 1: For dealing with Function: convertXML (fusion.js)
+ //******************************************
+ // xml2json: function(callback, r, json) {
+ // if (json) {
+ // var o;
+ // eval("o="+r.responseText);
+ // callback(o);
+ // } else {
+ // if (r.status >= 400) {
+ // Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,
+ // 'xml2json: invalid XML document: ' + r.transport.responseText + " : " + r.request.url));
+ // return;
+ // }
+ //******************************************
+ var tagStart = '<h2>';
+ var tagEnd = '</h2>';
+ var indexStart = errorMessage.indexOf(tagStart);
+ var indexEnd = errorMessage.indexOf(tagEnd, tagStart);
+ if (indexStart != -1 && indexEnd != -1) {
+ readableMessage = errorMessage.substring(indexStart + tagStart.length, indexEnd);
+ readableMessage = readableMessage.replace(/\\n/g, '\n');
+ readableMessage = readableMessage.replace(/\\t/g, '\t');
+ readableMessage = readableMessage.replace(/\\'/g, '\'');
+ }
+
+ if (readableMessage != '') {
+ showErrorDialog(readableMessage);
+ }
+ else {
+ showErrorDialog('Fusion Error: \n' + errorMessage);
+ }
+ console.log('Fusion Error: \n' + errorMessage);
+ }
+}
+
+var fusionInitialized = function() {
+ $('AppContainer').resize({forceResize: true});
+ var mapWidget = Fusion.getMapById('Map');
+ mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+}
+
+var isTaskPaneRegistered = false;
+
+var initPanelHandler = function() {
+ if(isTaskPaneRegistered) return;
+ //register this with MAP_LOADED so that the initial layout will remain
+ Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
+ isTaskPaneRegistered = true;
+}
+
+var showOverviewMap = function() {
+ dOverviewMap.open();
+}
+
+var showSidebarIfCollapsed = function() {
+ if ($("Sidebar").getWidth() <= COLLAPSED_SIDEBAR_WIDTH)
+ $("SidebarCollapse").fireEvent("click");
+};
+
+var showTaskPane = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel3);
+}
+
+var showLegend = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel1);
+}
+
+var showSelectionPanel = function() {
+ showSidebarIfCollapsed();
+ panelman.maximizePanel(panel2);
+}
+
+</script>
+<!--style type="text/css">
+body { overflow: hidden }
+#StatusNavigator {
+ position: absolute;
+ right: 139px;
+ padding-top: 2px;
+}
+
+#pbmg {
+ position: absolute;
+ right: 0px;
+ padding-top: 2px;
+}
+
+</style-->
+</head>
+
+<body>
+
+<div id="AppContainer">
+
+ <div id="SplitterArea">
+ <div id="Sidebar">
+ <!-- Collapse Sidebar -->
+ <div id="SidebarCollapse">
+ <div id="SidebarCollapseTop"></div>
+ <div id="SidebarCollapseContent">
+ <a id="SidebarCollapseButton" href="#"></a>
+ </div>
+ <div id="SidebarCollapseBottom"></div>
+ </div>
+ </div>
+ <div id="MapArea">
+ <!-- File Menu -->
+ <div id="FileMenuContainer">
+ <div id="FileMenu"></div>
+ <div id="FileMenuLeft"></div>
+ <div id="FileMenuRight"></div>
+ </div>
+ <!-- /File Menu -->
+ <!-- Toolbar -->
+ <div id="ToolbarContainer">
+ <div id="Toolbar"></div>
+ <div id="ToolbarLeft"></div>
+ <div id="ToolbarRight"></div>
+
+ <!-- I dont know about this one... -->
+ <div id="ToolbarSecondary"></div>
+ <div id="ToolbarSecondaryLeft"></div>
+ <div id="ToolbarSecondaryRight"></div>
+ </div>
+ <!-- /Toolbar -->
+ <div id="Map">
+ <div id="Navigator"></div>
+ </div>
+ </div>
+ </div>
+ <!-- /Collapse Sidebar -->
+
+ <!--<div id="OverviewMapContent"></div>-->
+
+ <div id="StatusbarContainer">
+ <div id="Statusbar"></div>
+ <div id="StatusNavigator"></div>
+ <div id="pbmg"><img src="%__TEMPLATE_BASE__%/images/pbmg.png" alt=""></div>
+ </div>
+
+</div>
+<div id="Maptip"></div>
+
+</body>
+</html>
Modified: trunk/MgDev/Oem/fusionMG/templates/mapguide/slate.xml
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/slate.xml 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/slate.xml 2018-08-11 05:58:24 UTC (rev 9407)
@@ -1,6 +1,6 @@
<TemplateInfo>
<Name>Slate</Name>
-<LocationUrl>fusion/templates/mapguide/slate/index.html</LocationUrl>
+<LocationUrl>fusion/templates/mapguide/index.php?template=slate</LocationUrl>
<Description>Slate template</Description>
<PreviewImageUrl>fusion/templates/mapguide/slate/preview.png</PreviewImageUrl>
Copied: trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.templ (from rev 9406, sandbox/jng/fusion_entrypoint_refactor/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.templ)
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.templ (rev 0)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow/index.templ 2018-08-11 05:58:24 UTC (rev 9407)
@@ -0,0 +1,242 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>TurquoiseYellow</title>
+<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<meta http-equiv="X-UA-Compatible" content="IE=edge" />
+<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
+<script type="text/javascript" src="%__LIB_BASE__%/%__FUSION_SCRIPT__%.js"></script>
+%__SCRIPTS__%
+<link rel="stylesheet" href="%__LIB_BASE__%/jxLib/themes/delicious/jxtheme.css" type="text/css" media="screen" charset="utf-8" />
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/turquoiseyellow.css" type="text/css" media="screen" charset="utf-8" />
+<!--[if lte IE 6]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie6.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<!--[if IE 7]>
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/ie7.css" type="text/css" media="screen" charset="utf-8" />
+<![endif]-->
+<link rel="stylesheet" href="%__TEMPLATE_BASE__%/icons.css" type="text/css" media="screen" charset="utf-8" />
+<script type="text/javascript">
+
+var tab1;
+var tab2;
+var tab3;
+var tabbox1;
+var appDefJson = %__APPDEF_JSON__%;
+
+window.onload = function() {
+ Fusion.initializeLocale(); //need to call this first if String.Translate is to be used in the onload
+
+ var main = new Jx.Layout('AppContainer');
+ new Jx.Layout('SplitterArea', {left: 3, right: 3, bottom: 24});
+ new Jx.Layout('FileMenu', {height: 34, bottom: null});
+ new Jx.Layout('Toolbar', {height: 25, top: 34, bottom: null});
+ new Jx.Layout('StatusbarContainer', {height: 21, top: null});
+ new Jx.Layout('Statusbar', {height: 21, right: 159, top: null, bottom: 0});
+ new Jx.Layout('MapArea', {top: 62});
+ new Jx.Layout('ToolbarVertical', {width: 28, right: null});
+ new Jx.Layout('Map', {left: 28});
+
+ var splitter = new Jx.Splitter('SplitterArea',
+ {splitInto:2,
+ elements:[$('Sidebar'),$('Main')],
+ layout:'horizontal',
+ containerOptions: [{minWidth: 50, width: 214}, {}],
+ snappers: [$('SidebarCollapse'),null]});
+
+ var splitter2 = new Jx.Splitter('Sidebar',
+ {splitInto:2,
+ elements:[$('Info'),$('Bottom')],
+ layout:'vertical',
+ containerOptions: [{}, {height: 214}]});
+
+ tabbox1 = new Jx.TabBox({parent: splitter2.elements[0]});
+
+ tab1 = new Jx.Tab({
+ label: OpenLayers.i18n('taskPaneTitle'),
+ contentId: 'TaskPane'});
+
+ tab2 = new Jx.Tab({
+ label: OpenLayers.i18n('legendTitle'),
+ contentId: 'Legend'});
+
+ tab3 = new Jx.Tab({
+ label: OpenLayers.i18n('selectionPanelTitle'),
+ contentId: 'SelectionPanel'});
+
+ tabbox1.add(tab1, tab2, tab3);
+
+ var tabbox2 = new Jx.TabBox({parent: splitter2.elements[1]});
+
+ var tab4 = new Jx.Tab({
+ label: OpenLayers.i18n('ovmapTitle'),
+ contentId: 'OverviewMap'});
+
+ tabbox2.add(tab4);
+
+ main.resize();
+
+ Fusion.registerForEvent(Fusion.Event.FUSION_INITIALIZED, fusionInitialized);
+ Fusion.registerForEvent(Fusion.Event.FUSION_ERROR, fusionError);
+ Fusion.initialize({
+ appDef: appDefJson
+ });
+}
+
+var showErrorDialog = function(msg) {
+ var errorDialog = new Jx.Dialog({
+ label: "Fusion Error",
+ image: "images/icons/error.png",
+ width: 800,
+ height: 400,
+ modal: true,
+ resize: true,
+ move: true,
+ content: msg
+ });
+ errorDialog.show();
+};
+
+var fusionError = function(eventId, error) {
+ if (error instanceof Fusion.DetailedError) {
+ //Case 1: Session Expiry
+ //
+ //
+ if (error.message.indexOf("MgSessionExpiredException") >= 0) {
+ var sessionId = Fusion.getQueryParam("Session");
+ var map = Fusion.getMapByIndice(0);
+ //Graceful reload is only possible if session id was not passed in as a query parameter
+ if (sessionId == "") {
+ map.message.error(OpenLayers.i18n('sessionExpired') + ' <a href="javascript:window.location.reload()">' + OpenLayers.i18n("reload") + '</a>');
+ } else {
+ map.message.error(OpenLayers.i18n('sessionExpired'));
+ }
+ return;
+ }
+
+ //Default Case: Show a formatted summary of the error
+ var fmtStack = "";
+ for (var i = 0; i < error.stack.length; i++) {
+ var stackFrame = error.stack[i];
+ fmtStack += " - " + (stackFrame.func != "" ? stackFrame.func : "?") + " at " + stackFrame.url + " (line: " + stackFrame.line + ")";
+ fmtStack += "\n";
+ }
+ var message = OpenLayers.i18n("detailedErrorTemplateHtml", {
+ name: error.name,
+ source: error.url,
+ message: error.message,
+ stacktrace: fmtStack
+ });
+ showErrorDialog(message);
+ console.log('Fusion Error: \n' + message);
+ } else {
+ var errorMessage = error.toString();
+ var readableMessage = '';
+
+ //Case 1: For dealing with Function: convertXML (fusion.js)
+ //******************************************
+ // xml2json: function(callback, r, json) {
+ // if (json) {
+ // var o;
+ // eval("o="+r.responseText);
+ // callback(o);
+ // } else {
+ // if (r.status >= 400) {
+ // Fusion.reportError(new Fusion.Error(Fusion.Error.FATAL,
+ // 'xml2json: invalid XML document: ' + r.transport.responseText + " : " + r.request.url));
+ // return;
+ // }
+ //******************************************
+ var tagStart = '<h2>';
+ var tagEnd = '</h2>';
+ var indexStart = errorMessage.indexOf(tagStart);
+ var indexEnd = errorMessage.indexOf(tagEnd, tagStart);
+ if (indexStart != -1 && indexEnd != -1) {
+ readableMessage = errorMessage.substring(indexStart + tagStart.length, indexEnd);
+ readableMessage = readableMessage.replace(/\\n/g, '\n');
+ readableMessage = readableMessage.replace(/\\t/g, '\t');
+ readableMessage = readableMessage.replace(/\\'/g, '\'');
+ }
+
+ if (readableMessage != '') {
+ showErrorDialog(readableMessage);
+ }
+ else {
+ showErrorDialog('Fusion Error: \n' + errorMessage);
+ }
+ console.log('Fusion Error: \n' + errorMessage);
+ }
+}
+
+var fusionInitialized = function() {
+ $('AppContainer').resize({forceResize: true});
+ var mapWidget = Fusion.getMapById('Map');
+ mapWidget.registerForEvent(Fusion.Event.MAP_LOADED, initPanelHandler);
+}
+
+var isTaskPaneRegistered = false;
+
+var initPanelHandler = function() {
+ if(isTaskPaneRegistered) return;
+ //register this with MAP_LOADED so that the initial layout will remain
+ Fusion.registerForEvent(Fusion.Event.TASK_PANE_LOADED, showTaskPane);
+ isTaskPaneRegistered = true;
+}
+
+var showOverviewMap = function() {
+}
+
+var showTaskPane = function() {
+ tab1.setActive(true);
+}
+
+var showLegend = function() {
+ tab2.setActive(true);
+}
+
+var showSelectionPanel = function() {
+ tab3.setActive(true);
+}
+
+</script>
+
+</head>
+
+<body>
+
+<!--
+ Start App Container
+ Wraps entire application
+-->
+<div id="AppContainer">
+
+ <div id="SplitterArea">
+
+ <div id="Sidebar">
+ <div id="Info"></div>
+ <div id="Bottom"></div>
+ </div>
+
+ <div id="Main">
+ <div id="FileMenu"></div>
+ <div id="Toolbar"></div>
+ <div id="MapArea">
+ <div id="ToolbarVertical"></div>
+ <div id="Map">
+ <div id="Navigator"></div>
+ </div>
+ </div>
+ </div>
+
+ </div>
+
+ <div id="StatusbarContainer">
+ <div id="Statusbar"></div>
+ <div id="pbmg"><img src="images/pbmg.png" alt=""></div>
+ </div>
+
+</div>
+<div id="Maptip"></div>
+
+</body>
+</html>
Modified: trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow.xml
===================================================================
--- trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow.xml 2018-08-09 04:58:45 UTC (rev 9406)
+++ trunk/MgDev/Oem/fusionMG/templates/mapguide/turquoiseyellow.xml 2018-08-11 05:58:24 UTC (rev 9407)
@@ -1,6 +1,6 @@
<TemplateInfo>
<Name>TurquoiseYellow</Name>
-<LocationUrl>fusion/templates/mapguide/turquoiseyellow/index.html</LocationUrl>
+<LocationUrl>fusion/templates/mapguide/index.php?template=turquoiseyellow</LocationUrl>
<Description>Turquoise-Yellow template</Description>
<PreviewImageUrl>fusion/templates/mapguide/turquoiseyellow/preview.png</PreviewImageUrl>
More information about the mapguide-commits
mailing list