7 Commits

Author SHA1 Message Date
Paulo Gustavo Veiga
8a65c0cfb3 Revert "Implement REST Console support."
This reverts commit f4017e6362.

Conflicts:
	wise-webapp/pom.xml
2014-01-26 22:39:35 -03:00
Paulo Gustavo Veiga
a02e8435bf Enable Java 1.7 compilation. 2014-01-26 22:22:36 -03:00
Paulo Gustavo Veiga
054521e072 Bug WISE-205 fixed.
Fix IE 11 browser detection.
2014-01-26 22:15:01 -03:00
Paulo Gustavo Veiga
9e3806f73a Add Jira Issue Integration.
Conflicts:
	wise-webapp/pom.xml
2014-01-26 22:14:37 -03:00
Paulo Gustavo Veiga
5ca8c4718f Merge branch 'release/v3.0.2' of bitbucket.org:wisemapping/wisemapping-open-source into release/v3.0.2 2014-01-24 20:26:54 -03:00
Paulo Gustavo Veiga
f4017e6362 Implement REST Console support. 2014-01-24 09:11:24 -03:00
Paulo Gustavo Veiga
023e4b8f9f Bug WISE-122 fixed.
Display proper message for change password for account based on OpenId.
2014-01-16 01:21:59 -03:00
14 changed files with 351 additions and 317 deletions

View File

@@ -105,8 +105,8 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<source>1.7</source>
<target>1.7</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>

View File

@@ -361,7 +361,7 @@
<includes>
<include>config/database/hsql/drop-schemas.sql</include>
<include>config/database/hsql/create-schemas.sql</include>
<include>config/database/hsql/atest-data.sql</include>
<include>config/database/hsql/apopulate-schemas.sql</include>
</includes>
</fileset>
</configuration>

View File

@@ -47,7 +47,7 @@ public class SupportedUserAgent implements Serializable {
boolean result = browser == Browser.FIREFOX && majorVersion >= 10;
result = result || browser == Browser.FIREFOX2 && majorVersion >= 17;
result = result || browser == Browser.IE8 || browser == Browser.IE9;
result = result || browser == Browser.IE8 || browser == Browser.IE9 || browser == Browser.IE11 ;
result = result || browser == Browser.IE && majorVersion >= 8;
result = result || browser == Browser.OPERA10 && majorVersion >= 11;
result = result || browser == Browser.CHROME && majorVersion >= 18;

View File

@@ -104,8 +104,6 @@ class LockManagerImpl implements LockManager {
}
private void unlock(int mapId) {
System.out.println("Unlocking:"+mapId);
logger.debug("Unlock map id:" + mapId);
lockInfoByMapId.remove(mapId);
}

View File

@@ -44,8 +44,8 @@ import java.util.regex.Pattern;
/**
* Enum constants for most common browsers, including e-mail clients and bots.
* @author harald
*
* @author harald
*/
public enum Browser {
@@ -73,6 +73,11 @@ public enum Browser {
*/
OUTLOOK2010(Manufacturer.MICROSOFT, Browser.OUTLOOK, 108, "Outlook 2010", new String[]{"MSOffice 14"}, null, BrowserType.EMAIL_CLIENT, RenderingEngine.WORD, null), // before IE7
/**
* Family of Internet Explorer browsers
*/
IE11(Manufacturer.MICROSOFT, null, 1, "Internet Explorer", new String[]{") like Gecko"}, null, BrowserType.WEB_BROWSER, RenderingEngine.TRIDENT, "Mozilla/5.0 (([\\d]+)\\.([\\w]+))"), // before Mozilla
/**
* Family of Internet Explorer browsers
*/
@@ -155,8 +160,6 @@ public enum Browser {
DOWNLOAD(Manufacturer.OTHER, null, 16, "Downloading Tool", new String[]{"cURL", "wget"}, null, BrowserType.TEXT_BROWSER, RenderingEngine.OTHER, null),
UNKNOWN(Manufacturer.OTHER, null, 14, "Unknown", new String[0], null, BrowserType.UNKNOWN, RenderingEngine.OTHER, null);
private final short id;
private final String name;
private final String[] aliases;
@@ -172,7 +175,7 @@ public enum Browser {
this.id = (short) ((manufacturer.getId() << 8) + (byte) versionId);
this.name = name;
this.parent = parent;
this.children = new ArrayList<Browser>();
this.children = new ArrayList<>();
if (this.parent != null) {
this.parent.children.add(this);
}
@@ -186,6 +189,45 @@ public enum Browser {
}
}
/**
* Iterates over all Browsers to compare the browser signature with
* the user agent string. If no match can be found Browser.UNKNOWN will
* be returned.
*
* @param agentString
* @return Browser
*/
public static Browser parseUserAgentString(String agentString) {
for (Browser browser : Browser.values()) {
// only check top level objects
if (browser.parent == null) {
Browser match = browser.checkUserAgent(agentString);
if (match != null) {
return match; // either current operatingSystem or a child object
}
}
}
return Browser.UNKNOWN;
}
/**
* Returns the enum constant of this type with the specified id.
* Throws IllegalArgumentException if the value does not exist.
*
* @param id
* @return
*/
public static Browser valueOf(short id) {
for (Browser browser : Browser.values()) {
if (browser.getId() == id)
return browser;
}
// same behavior as standard valueOf(string) method
throw new IllegalArgumentException(
"No enum const for id " + id);
}
public short getId() {
return id;
}
@@ -207,6 +249,7 @@ public enum Browser {
/**
* Detects the detailed version information of the browser. Depends on the userAgent to be available.
* Returns null if it can not detect the version information.
*
* @return Version
*/
public Version getVersion(String userAgentString) {
@@ -260,10 +303,8 @@ public enum Browser {
* Checks if the given user-agent string matches to the browser.
* Only checks for one specific browser.
*/
public boolean isInUserAgentString(String agentString)
{
for (String alias : aliases)
{
public boolean isInUserAgentString(String agentString) {
for (String alias : aliases) {
if (agentString.toLowerCase().indexOf(alias.toLowerCase()) != -1)
return true;
}
@@ -273,11 +314,11 @@ public enum Browser {
/**
* Checks if the given user-agent does not contain one of the tokens which should not match.
* In most cases there are no excluding tokens, so the impact should be small.
*
* @param agentString
* @return
*/
private boolean containsExcludeToken(String agentString)
{
private boolean containsExcludeToken(String agentString) {
if (excludeList != null) {
for (String exclude : excludeList) {
if (agentString.toLowerCase().indexOf(exclude.toLowerCase()) != -1)
@@ -306,47 +347,5 @@ public enum Browser {
return null;
}
/**
* Iterates over all Browsers to compare the browser signature with
* the user agent string. If no match can be found Browser.UNKNOWN will
* be returned.
* @param agentString
* @return Browser
*/
public static Browser parseUserAgentString(String agentString)
{
for (Browser browser : Browser.values())
{
// only check top level objects
if (browser.parent == null) {
Browser match = browser.checkUserAgent(agentString);
if (match != null) {
return match; // either current operatingSystem or a child object
}
}
}
return Browser.UNKNOWN;
}
/**
* Returns the enum constant of this type with the specified id.
* Throws IllegalArgumentException if the value does not exist.
* @param id
* @return
*/
public static Browser valueOf(short id)
{
for (Browser browser : Browser.values())
{
if (browser.getId() == id)
return browser;
}
// same behavior as standard valueOf(string) method
throw new IllegalArgumentException(
"No enum const for id " + id);
}
}

View File

@@ -151,19 +151,18 @@ public class MindmapController {
final Locale locale = LocaleContextHolder.getLocale();
// Is the mindmap locked ?.
boolean isLocked = false;
boolean readOnlyMode = !requiresLock || !mindmap.hasPermissions(collaborator, CollaborationRole.EDITOR);
if (!readOnlyMode) {
final LockManager lockManager = this.mindmapService.getLockManager();
if (lockManager.isLocked(mindmap) && !lockManager.isLockedBy(mindmap, collaborator)) {
readOnlyMode = true;
model.addAttribute("mindmapLocked", true);
} else {
model.addAttribute("lockTimestamp", mindmap.getLastModificationTime().getTimeInMillis());
model.addAttribute(LOCK_SESSION_ATTRIBUTE, lockManager.generateSession());
}
model.addAttribute("lockInfo", lockManager.getLockInfo(mindmap));
}
// Set render attributes ...
model.addAttribute("mindmap", mindmapBean);
@@ -171,6 +170,9 @@ public class MindmapController {
model.addAttribute("locale", locale.toString().toLowerCase());
model.addAttribute("principal", collaborator);
model.addAttribute("readOnlyMode", readOnlyMode);
model.addAttribute("memoryPersistence", false);
model.addAttribute("mindmapLocked", isLocked);
return "mindmapEditor";
}

View File

@@ -78,7 +78,7 @@ public class UsersController {
result = new ModelAndView("forgotPasswordError");
}
catch (InvalidAuthSchemaException e) {
result = new ModelAndView("forgotPasswordError");
result = new ModelAndView("userForgotPasswordOpenId");
}
return result;
}

View File

@@ -236,7 +236,8 @@ TUTORIAL.FONT_STYLE=Styles
TUTORIAL.FONT_TYPE=Type
TUTORIAL.SAMPLE_NOTE=This is a simple note !.
SUPPORT=Support
FEEDBACK=Feedback
FEEDBACK=Got Feedback ?
REPORT_BUG=Raise An Issue
CONTACT_US=Contact Us
#Pending for translation ...
@@ -267,6 +268,8 @@ OPEN_OFFICE_EXPORT_FORMAT_DETAILS=Get your map as OpenOffice Write Document
MINDJET_EXPORT_FORMAT=(BETA) MindJet 8.x
MINDJET_EXPORT_FORMAT_DETAILS=Export your maps in MindJet 8.x format
MINDMAP_IS_LOCKED=Mindmap is locked for edition.
OPENID_ACCOUNT_PASSWORD=Registered OpenID account password could not be changed
OPENID_ACCOUNT_PASSWORD_DETAIL=Your account has been registered using OpenId. Try to login using either your Google, AOL or Yahoo account.

View File

@@ -235,7 +235,9 @@ TUTORIAL.FONT_STYLE=Estilos
TUTORIAL.FONT_TYPE=Tipos de Fuente
TUTORIAL.SAMPLE_NOTE=Esto es una Nota !
SUPPORT=Ayuda
FEEDBACK=Feedback
FEEDBACK=Tenes Feedback ?
REPORT_BUG=Reportar Problema
CONTACT_US=Contáctenos

View File

@@ -63,6 +63,11 @@
<put-attribute name="body" value="/jsp/userForgotPasswordError.jsp"/>
</definition>
<definition name="userForgotPasswordOpenId" extends="errorTemplate">
<put-attribute name="title" value="OPENID_ACCOUNT_PASSWORD"/>
<put-attribute name="body" value="/jsp/userForgotPasswordOpenId.jsp"/>
</definition>
<definition name="forgotPasswordSuccess" extends="errorTemplate">
<put-attribute name="title" value="FORGOT_PASSWORD"/>
<put-attribute name="body" value="/jsp/userForgotPasswordSuccess.jsp"/>

View File

@@ -1,19 +1,35 @@
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<div id="footerContainer">
<script type="text/javascript" src="https://wisemapping.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e/en_US-f1g0rh-1988229788/6211/26/1.4.5/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=a47981d6"></script>
<script type="text/javascript" src="https://wisemapping.atlassian.net/s/d41d8cd98f00b204e9800998ecf8427e/en_US-f1g0rh-1988229788/6211/26/1.4.5/_/download/batch/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector/com.atlassian.jira.collector.plugin.jira-issue-collector-plugin:issuecollector.js?collectorId=703b9822"></script>
<div id="footerContainer" class="row">
<div class="span1 offset3">
<a href="https://twitter.com/share" class="twitter-share-button" data-via="wisemapping"
data-related="wisemapping">Tweet</a>
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = "//platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
<script type="text/javascript">
window.ATL_JQ_PAGE_PROPS = $.extend(window.ATL_JQ_PAGE_PROPS, {
"a47981d6": {
triggerFunction: function(showCollectorDialog) {
//Requries that jQuery is available!
jQuery("#feedbackBtn").click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}
}(document, "script", "twitter-wjs");</script>
},
"703b9822":{
triggerFunction: function(showCollectorDialog) {
//Requries that jQuery is available!
jQuery("#reportIssueBtn").click(function(e) {
e.preventDefault();
showCollectorDialog();
});
}
}
});
</script>
<div class="span1 offset3">
<a href="https://twitter.com/share" class="twitter-share-button" data-url="http://www.wisemapping.com" data-text="Check out this site" data-via="wisemapping" data-related="wisemapping">Tweet</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
</div>
<div class="span1">
@@ -35,10 +51,10 @@
</div>
<div class="span4">
<p style="text-align: center;">
<a href="https://groups.google.com/d/forum/wisemapping-support"><spring:message code="SUPPORT"/></a> |
<a href="mailto:feedback@wisemapping.com"><spring:message code="FEEDBACK"/></a> |
<a href="mailto:dev@wisemapping.com"><spring:message code="CONTACT_US"/></a> |
<a href="http://www.wisemapping.org/license"><spring:message code="LICENSE"/></a><br/>
<a href="" id="feedbackBtn"><spring:message code="FEEDBACK"/></a> |
<a href="" id="reportIssueBtn"><spring:message code="REPORT_BUG"/></a> |
<a href="mailto:team@wisemapping.com"><spring:message code="CONTACT_US"/></a> |
<a href="https://wisemapping.atlassian.net/wiki/display/WS/License "><spring:message code="LICENSE"/></a><br/>
<a href="http://www.wisemapping.org/"><spring:message code="COPYRIGHT"/></a>
</p>

View File

@@ -1,7 +1,7 @@
<%@taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%
request.setAttribute("principal", com.wisemapping.security.Utils.getUser());
%>

View File

@@ -0,0 +1,6 @@
<%@page pageEncoding="UTF-8" %>
<%@include file="/jsp/init.jsp" %>
<h2><spring:message code="OPENID_ACCOUNT_PASSWORD"/></h2>
<p><spring:message code="OPENID_ACCOUNT_PASSWORD_DETAIL"/></p>

View File

@@ -49,6 +49,9 @@ public class UserAgentTest {
final SupportedUserAgent mediapartners = SupportedUserAgent.create("Mediapartners-Google/2.1");
Assert.assertEquals(mediapartners.isBrowserSupported(), true);
final SupportedUserAgent ie11 = SupportedUserAgent.create("Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko");
Assert.assertEquals(ie11.isBrowserSupported(), true);
final SupportedUserAgent firefox20 = SupportedUserAgent.create("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:20.0) Gecko/20121215 Firefox/20.0 AppEngine-Google; (+http://code.google.com/appengine; appid: slubuntuk)");
Assert.assertEquals(firefox20.isBrowserSupported(), true);
}