Keep fixing session issues.

This commit is contained in:
Paulo Gustavo Veiga 2012-11-13 13:34:35 -03:00
parent c1318e496c
commit 00fd168489
4 changed files with 10 additions and 12 deletions

View File

@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull;
public class MultipleSessionsOpenException
extends ClientException
{
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
public static final String MSG_KEY = "MINDMAP_OUTDATED_BY_YOU";
public MultipleSessionsOpenException(@NotNull String msg)
{
@ -35,9 +35,4 @@ public class MultipleSessionsOpenException
protected String getMsgBundleKey() {
return MSG_KEY;
}
@Override
protected Object[] getMsgBundleArgs() {
return new String[]{"you"};
}
}

View File

@ -20,10 +20,10 @@ package com.wisemapping.model;
import org.jetbrains.annotations.Nullable;
import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;
import java.io.Serializable;
import java.util.*;
import java.util.Calendar;
import java.util.HashSet;
import java.util.Set;
public class User
extends Collaborator
@ -107,8 +107,10 @@ public class User
}
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (this == o)
return true;
if (o == null || !User.class.getClass().isInstance(o))
return false;
final User user = (User) o;

View File

@ -192,7 +192,7 @@ public class MindmapController extends BaseController {
throw new SessionExpiredException(lastEditor);
}
} else if (outdated) {
throw new MultipleSessionsOpenException("The map has been updated and not by you. Session lost.");
throw new MultipleSessionsOpenException("Sessions:" + session + ":" + lockInfo.getSession() + "Timestamp: " + timestamp + ": " + lockInfo.getTimestamp());
}
} else {
throw new SessionExpiredException(lockInfo.getUser());

View File

@ -250,6 +250,7 @@ TEMPORAL_PASSWORD_SENT=Your temporal password has been sent
TEMPORAL_PASSWORD_SENT_DETAILS=We've sent you an email that will allow you to reset your password. Please check your email now.
TEMPORAL_PASSWORD_SENT_SUPPORT=If you have any problem receiving the email, contact us to <a href\="mailto\:support@wisemapping.com">support@wisemapping.com </a>
MINDMAP_TIMESTAMP_OUTDATED=It's not possible to save your changes because your mindmap has been modified by '{0}'. Refresh the page and try again.
MINDMAP_OUTDATED_BY_YOU=It's not possible to save your changes because map is out of date. Do you have multiple tabs opened ?. Refresh the page and try again.
MINDMAP_LOCKED=Map is being edited by {0} <{1}>. Map is opened in read only mode.