From 10e869ab70da76a532901ac853ff7322c65c55f0 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Thu, 21 Jun 2012 22:18:04 -0300 Subject: [PATCH] Add Google Crome Frame support. --- .../GoogleChromeFrameRequiredException.java | 23 +++++++++++ .../filter/BrowserSupportInterceptor.java | 8 ++++ .../com/wisemapping/filter/UserAgent.java | 5 ++- .../ncontroller/PublicPagesController.java | 24 +++++------ .../WEB-INF/classes/messages.properties | 11 +---- .../main/webapp/WEB-INF/defs/definitions.xml | 8 ++-- .../webapp/WEB-INF/wisemapping-security.xml | 2 + .../webapp/WEB-INF/wisemapping-servlet.xml | 2 + .../css/{mymaps.less => mindmapList.less} | 0 .../src/main/webapp/css/pageHeaders.css | 15 ------- .../src/main/webapp/css/pageTemplate.css | 22 ---------- .../src/main/webapp/jsp/GCFInstall.jsp | 17 ++++++++ .../src/main/webapp/jsp/GCFPluginRequired.jsp | 11 +++++ .../main/webapp/jsp/dialogFullTemplate.jsp | 6 ++- .../src/main/webapp/jsp/dialogTemplate.jsp | 2 + .../src/main/webapp/jsp/editorHeader.jsp | 41 ------------------- .../src/main/webapp/jsp/errorTemplate.jsp | 6 ++- .../src/main/webapp/jsp/gcfPluginNeeded.jsp | 13 ------ wise-webapp/src/main/webapp/jsp/init.jsp | 6 --- .../src/main/webapp/jsp/installCFG.jsp | 23 ----------- .../src/main/webapp/jsp/mindmapEditor.jsp | 2 - .../src/main/webapp/jsp/mindmapList.jsp | 5 ++- wise-webapp/src/main/webapp/jsp/template.jsp | 1 - 23 files changed, 99 insertions(+), 154 deletions(-) create mode 100644 wise-webapp/src/main/java/com/wisemapping/exceptions/GoogleChromeFrameRequiredException.java rename wise-webapp/src/main/webapp/css/{mymaps.less => mindmapList.less} (100%) create mode 100644 wise-webapp/src/main/webapp/jsp/GCFInstall.jsp create mode 100644 wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/editorHeader.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/gcfPluginNeeded.jsp delete mode 100644 wise-webapp/src/main/webapp/jsp/installCFG.jsp diff --git a/wise-webapp/src/main/java/com/wisemapping/exceptions/GoogleChromeFrameRequiredException.java b/wise-webapp/src/main/java/com/wisemapping/exceptions/GoogleChromeFrameRequiredException.java new file mode 100644 index 00000000..88394b29 --- /dev/null +++ b/wise-webapp/src/main/java/com/wisemapping/exceptions/GoogleChromeFrameRequiredException.java @@ -0,0 +1,23 @@ +/* +* Copyright [2011] [wisemapping] +* +* Licensed under WiseMapping Public License, Version 1.0 (the "License"). +* It is basically the Apache License, Version 2.0 (the "License") plus the +* "powered by wisemapping" text requirement on every single page; +* you may not use this file except in compliance with the License. +* You may obtain a copy of the license at +* +* http://www.wisemapping.org/license +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +package com.wisemapping.exceptions; + +public class GoogleChromeFrameRequiredException extends Exception { + +} diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/BrowserSupportInterceptor.java b/wise-webapp/src/main/java/com/wisemapping/filter/BrowserSupportInterceptor.java index 2e37c327..771c4b7a 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/BrowserSupportInterceptor.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/BrowserSupportInterceptor.java @@ -18,6 +18,7 @@ package com.wisemapping.filter; +import com.wisemapping.exceptions.GoogleChromeFrameRequiredException; import org.jetbrains.annotations.NotNull; import org.springframework.web.servlet.handler.HandlerInterceptorAdapter; @@ -57,6 +58,13 @@ public class BrowserSupportInterceptor extends HandlerInterceptorAdapter { if (!userAgent.isBrowserSupported()) { throw new UnsupportedBrowserException(); } + + // Is a Explorer 9 or less without Google Chrome Frame ?. + if (!userAgent.needsGCF()) { + throw new GoogleChromeFrameRequiredException(); + } + + } return true; } diff --git a/wise-webapp/src/main/java/com/wisemapping/filter/UserAgent.java b/wise-webapp/src/main/java/com/wisemapping/filter/UserAgent.java index 5104352e..c85360d6 100644 --- a/wise-webapp/src/main/java/com/wisemapping/filter/UserAgent.java +++ b/wise-webapp/src/main/java/com/wisemapping/filter/UserAgent.java @@ -331,8 +331,9 @@ public class UserAgent implements Serializable { } public boolean needsGCF() { - final UserAgent.Product product = this.getProduct(); - return product == UserAgent.Product.EXPLORER && this.isVersionLessThan(9) && this.getOs() == UserAgent.OS.WINDOWS && !this.hasGCFInstalled; + return true; +// final UserAgent.Product product = this.getProduct(); +// return product == UserAgent.Product.EXPLORER && this.isVersionLessThan(9) && this.getOs() == UserAgent.OS.WINDOWS && !this.hasGCFInstalled; } } diff --git a/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java b/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java index 3e67e690..165f1789 100644 --- a/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java +++ b/wise-webapp/src/main/java/com/wisemapping/ncontroller/PublicPagesController.java @@ -34,32 +34,32 @@ public class PublicPagesController { @RequestMapping(value = "aboutUs") - public ModelAndView aboutUs() { - return new ModelAndView("aboutUs"); + public String aboutUs() { + return "aboutUs"; } @RequestMapping(value = "crew") - public ModelAndView crew() { - return new ModelAndView("crew"); + public String crew() { + return "crew"; } - @RequestMapping(value = "installCFG") - public ModelAndView installCFG() { - return new ModelAndView("installCFG"); + @RequestMapping(value = "GCFInstall") + public String showGCFInstallationPage() { + return "GCFInstall"; } @RequestMapping(value = "keyboard") - public ModelAndView newsPage() { - return new ModelAndView("keyboard"); + public String newsPage() { + return "keyboard"; } @RequestMapping(value = "home") - public ModelAndView home() { - return new ModelAndView("homepage"); + public String home() { + return "homepage"; } @RequestMapping(value = "iframeWrapper") - public ModelAndView showIframe(@RequestParam(required = true) String url) { + public ModelAndView showIframePage(@RequestParam(required = true) String url) { return new ModelAndView("iframeWrapper", "url", url); } } diff --git a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties index fb4ed472..8843bfbf 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties +++ b/wise-webapp/src/main/webapp/WEB-INF/classes/messages.properties @@ -47,7 +47,6 @@ FAQ=Frequent Asked Questions SHORT_FAQ=FAQ LOGIN=Login SUBJECT=Subject -SUBJECT_MESSAGE= has shared a mind map with you at WiseMapping MSG=Message PROBLEM_DETAIL=Description EXPORT=Export @@ -291,18 +290,12 @@ UNDO=Undo REDO_EDITION=Redo Edition REDO=Redo -BY=By -MODIFIED=Modified -LAST_UPDATE=Last Update -LAST_UPDATE_BY=Last Updated By - HISTORY_MSG=Looking for an old modification of you map?. Here is the place. NO_HISTORY_RESULTS= No History Information was found. HISTORY_INFO = Here is the list of the last revisions of you map. REVERT=revert -SAMPLE_MAPS=Sample Maps -INSTALL_CFG=Google Chrome Frame Plugin Needed -INSTALL_CFG_REASON =

You need to install the Google Chrome Frame Plugin


We used to support IE 7/8 by rendering VML instead of SVG. In a few words, VML was the SVG equivalent in the Microsoft world, and we have invested a lot of energy in VML during several years solving several performance and instability issues among others things. Since Internet Explorer 9 has support for HTML 5.0 (thus SVG support), we decided to deprecate the support of VML. The side effect of this is that all users using Internet Explorer 7/8 will have to install a plugin from Google that enables the display of HTML 5.0 web pages.
You might have to reopen the browser after you have installed the plugin.

We highly recommend using Firefox, Chrome or Internet Explorer 9 where this plugin is not required and the performance is much better.

+INSTALL_CFG=You need to install the Google Chrome Frame Plugin +INSTALL_CFG_REASON = We used to support IE 7/8 by rendering VML instead of SVG. In a few words, VML was the SVG equivalent in the Microsoft world, and we have invested a lot of energy in VML during several years solving several performance and instability issues among others things. Since Internet Explorer 9 has support for HTML 5.0 (thus SVG support), we decided to deprecate the support of VML. The side effect of this is that all users using Internet Explorer 7/8 will have to install a plugin from Google that enables the display of HTML 5.0 web pages.
You might have to reopen the browser after you have installed the plugin.

We highly recommend using Firefox, Chrome or Internet Explorer 9 where this plugin is not required and the performance is much better. INSTALL_CFG_CLICK_HERE=To install Google Chrome Frame Plugin click here INVALID_EMAIL_ERROR = The e-mail was not verified diff --git a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml index 34bf48d0..4dc7e9a6 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/defs/definitions.xml @@ -37,13 +37,13 @@ - - + + - - + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml index d810f0b7..db78e509 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml @@ -29,6 +29,8 @@ + + diff --git a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml index b6430755..6a29d300 100644 --- a/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml +++ b/wise-webapp/src/main/webapp/WEB-INF/wisemapping-servlet.xml @@ -25,6 +25,7 @@ /c/home /c/j_spring_security /c/login + /c/GCFInstall /service/ /c/maps/*/embed /c/maps/*/public @@ -50,6 +51,7 @@ browserNotSupported + GCFPluginRequired securityError diff --git a/wise-webapp/src/main/webapp/css/mymaps.less b/wise-webapp/src/main/webapp/css/mindmapList.less similarity index 100% rename from wise-webapp/src/main/webapp/css/mymaps.less rename to wise-webapp/src/main/webapp/css/mindmapList.less diff --git a/wise-webapp/src/main/webapp/css/pageHeaders.css b/wise-webapp/src/main/webapp/css/pageHeaders.css index ddae6bde..1d88919c 100644 --- a/wise-webapp/src/main/webapp/css/pageHeaders.css +++ b/wise-webapp/src/main/webapp/css/pageHeaders.css @@ -120,21 +120,6 @@ div#paypal { cursor: pointer; } -#headerLoading { - padding-left: 40px; - background: url('../images/ajax-loader.gif') #BBB4D6 no-repeat left; - position: absolute; - right: 3px; - top: 5px; - width: 75px; - height: 20px; - color: white; - font-weight: bold; - border: 1px solid; - border-color: #f5f5f5; - background-position: 5px 2px; - visibility: hidden; -} div#headerActions { padding-right: 8px; diff --git a/wise-webapp/src/main/webapp/css/pageTemplate.css b/wise-webapp/src/main/webapp/css/pageTemplate.css index ae5c08b0..0e18af7b 100644 --- a/wise-webapp/src/main/webapp/css/pageTemplate.css +++ b/wise-webapp/src/main/webapp/css/pageTemplate.css @@ -110,28 +110,6 @@ div.pageBodyContent li { border: 1px dotted gray; } -div.installCFG { - width: 100%; - font-size: 130%; -} - -div.installCFG h1 { - width: 100%; - font-size: 130%; -} - -div.installCFG h2 { - font-size: 100%; - border-bottom: 0 solid black; -} - -.chromeFrameInstallDefaultStyle { - position: relative; - left: 0; - top: 0; - margin: 0; -} - div.fform { background: #eeeeee; border: 1px solid #cfcfcf; diff --git a/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp b/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp new file mode 100644 index 00000000..a271aee2 --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/GCFInstall.jsp @@ -0,0 +1,17 @@ +<%@ page autoFlush="true" buffer="none" %> +<%@ include file="/jsp/init.jsp" %> + +
+
+ +
+
+ + + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp b/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp new file mode 100644 index 00000000..0ce893bc --- /dev/null +++ b/wise-webapp/src/main/webapp/jsp/GCFPluginRequired.jsp @@ -0,0 +1,11 @@ +<%@ page autoFlush="true" buffer="none" %> +<%@ include file="/jsp/init.jsp" %> + +

+ +

+ +
+ +
+ diff --git a/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp index b34bc117..fcd79e35 100644 --- a/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp +++ b/wise-webapp/src/main/webapp/jsp/dialogFullTemplate.jsp @@ -1,3 +1,5 @@ + + <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <%@ include file="/jsp/init.jsp" %> @@ -8,7 +10,9 @@ - + diff --git a/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp b/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp index aad76fc0..6fa10405 100644 --- a/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp +++ b/wise-webapp/src/main/webapp/jsp/dialogTemplate.jsp @@ -1,3 +1,5 @@ + + <%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %> <%@ include file="/jsp/init.jsp" %> diff --git a/wise-webapp/src/main/webapp/jsp/editorHeader.jsp b/wise-webapp/src/main/webapp/jsp/editorHeader.jsp deleted file mode 100644 index c5a82d54..00000000 --- a/wise-webapp/src/main/webapp/jsp/editorHeader.jsp +++ /dev/null @@ -1,41 +0,0 @@ -<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %> -<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> -<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> - -
-
- -
${mindmap.title} 
-
- - -
- - , ${principal.firstname} - | "> - - - | "> - - - | "> - - -
-
- -
- - "> - - -
-
-
-
-
-
- -
diff --git a/wise-webapp/src/main/webapp/jsp/errorTemplate.jsp b/wise-webapp/src/main/webapp/jsp/errorTemplate.jsp index be7ba916..230cedf7 100644 --- a/wise-webapp/src/main/webapp/jsp/errorTemplate.jsp +++ b/wise-webapp/src/main/webapp/jsp/errorTemplate.jsp @@ -1,3 +1,5 @@ + + <%@ page import="org.apache.log4j.Logger" %> <%@ page autoFlush="true" buffer="none" %> <%@ include file="/jsp/init.jsp" %> @@ -5,9 +7,9 @@ <%! final Logger logger = Logger.getLogger("com.wisemapping"); %> -

+

-

+

diff --git a/wise-webapp/src/main/webapp/jsp/gcfPluginNeeded.jsp b/wise-webapp/src/main/webapp/jsp/gcfPluginNeeded.jsp deleted file mode 100644 index 217818d9..00000000 --- a/wise-webapp/src/main/webapp/jsp/gcfPluginNeeded.jsp +++ /dev/null @@ -1,13 +0,0 @@ -<%@ page import="org.apache.log4j.Logger" %> -<%@ page autoFlush="true" buffer="none" %> -<%@ include file="/jsp/init.jsp" %> - -<%! - final Logger logger = Logger.getLogger("com.wisemapping"); -%> -

- -

- -
- diff --git a/wise-webapp/src/main/webapp/jsp/init.jsp b/wise-webapp/src/main/webapp/jsp/init.jsp index f3f9ff45..0ba722e3 100644 --- a/wise-webapp/src/main/webapp/jsp/init.jsp +++ b/wise-webapp/src/main/webapp/jsp/init.jsp @@ -10,10 +10,4 @@ <% User user = Utils.getUser(false); request.setAttribute("principal", user); - - UserAgent userAgent = null; - final HttpSession session = request.getSession(); - if (session != null) { - userAgent = (UserAgent) session.getAttribute(BrowserSupportInterceptor.USER_AGENT); - } %> diff --git a/wise-webapp/src/main/webapp/jsp/installCFG.jsp b/wise-webapp/src/main/webapp/jsp/installCFG.jsp deleted file mode 100644 index 85c53f52..00000000 --- a/wise-webapp/src/main/webapp/jsp/installCFG.jsp +++ /dev/null @@ -1,23 +0,0 @@ -<%@ page autoFlush="true" buffer="none" %> -<%@ include file="/jsp/init.jsp" %> - -
-
- -
-
- - - \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp index 687825d4..f2ee337d 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditor.jsp @@ -11,11 +11,9 @@ <spring:message code="SITE.TITLE"/> - ${mindmap.title} - - diff --git a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp index 96555dcd..fc0d9103 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapList.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapList.jsp @@ -6,11 +6,14 @@ <spring:message code="SITE.TITLE"/> + - + diff --git a/wise-webapp/src/main/webapp/jsp/template.jsp b/wise-webapp/src/main/webapp/jsp/template.jsp index a24ee9ff..9aee940d 100644 --- a/wise-webapp/src/main/webapp/jsp/template.jsp +++ b/wise-webapp/src/main/webapp/jsp/template.jsp @@ -36,7 +36,6 @@
-