Update copyright year.

This commit is contained in:
Paulo Gustavo Veiga
2012-10-04 20:48:01 -03:00
parent d17b8397f7
commit cc57fae5cf
260 changed files with 650 additions and 278 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -27,7 +27,7 @@ public class AccessDeniedSecurityException
public AccessDeniedSecurityException(@NotNull String msg)
{
super(msg);
super(msg,Severity.FATAL);
}
@NotNull

View File

@@ -6,8 +6,11 @@ import org.springframework.context.MessageSource;
import java.util.Locale;
abstract public class ClientException extends WiseMappingException {
public ClientException(@NotNull String message) {
private Severity severity;
public ClientException(@NotNull String message, @NotNull Severity severity) {
super(message);
this.severity = severity;
}
protected abstract
@@ -17,4 +20,8 @@ abstract public class ClientException extends WiseMappingException {
public String getMessage(@NotNull final MessageSource messageSource, final @NotNull Locale locale) {
return messageSource.getMessage(this.getMsgBundleKey(), null, locale);
}
public Severity getSeverity() {
return this.severity;
}
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -27,7 +27,7 @@ public class EditionSessionExpiredException
public EditionSessionExpiredException(@NotNull String msg)
{
super(msg);
super(msg,Severity.INFO);
}
@NotNull

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -24,7 +24,7 @@ public class LockException
extends ClientException
{
public LockException(@NotNull String message) {
super(message);
super(message,Severity.INFO);
}
@NotNull

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -27,7 +27,7 @@ public class MultipleSessionsOpenException
public MultipleSessionsOpenException(@NotNull String msg)
{
super(msg);
super(msg,Severity.INFO);
}
@NotNull

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -20,15 +20,17 @@ package com.wisemapping.exceptions;
import com.wisemapping.model.Collaborator;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class SessionExpiredException
extends ClientException
{
extends ClientException {
public static final String MSG_KEY = "MINDMAP_TIMESTAMP_OUTDATED";
@Nullable
private Collaborator lastUpdater;
public SessionExpiredException(@NotNull String msg,@NotNull Collaborator newEditor)
{
super(msg);
public SessionExpiredException(@Nullable Collaborator lastUpdater) {
super("Map has been updated by " + (lastUpdater != null ? lastUpdater.getEmail() : ""), Severity.FATAL);
this.lastUpdater = lastUpdater;
}
@NotNull

View File

@@ -0,0 +1,25 @@
/*
* Copyright [2012] [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 enum Severity {
INFO,
WARNING,
SEVERE,
FATAL
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.importer;
import java.io.OutputStream;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.importer;
import java.util.*;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -20,6 +20,7 @@ package com.wisemapping.rest;
import com.wisemapping.exceptions.ClientException;
import com.wisemapping.exceptions.ImportUnexpectedException;
import com.wisemapping.exceptions.Severity;
import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.User;
import com.wisemapping.rest.model.RestErrors;
@@ -59,7 +60,7 @@ public class BaseController {
@ResponseBody
public RestErrors handleClientErrors(@NotNull IllegalArgumentException ex) {
ex.printStackTrace();
return new RestErrors(ex.getMessage());
return new RestErrors(ex.getMessage(), Severity.SEVERE);
}
@ExceptionHandler(Exception.class)
@@ -101,7 +102,7 @@ public class BaseController {
if (cause instanceof ClientException) {
result = handleClientErrors((ClientException) cause);
} else {
result = new RestErrors(ex.getMessage());
result = new RestErrors(ex.getMessage(), Severity.INFO);
}
return result;
}
@@ -110,6 +111,6 @@ public class BaseController {
@ResponseStatus(HttpStatus.BAD_REQUEST)
public RestErrors handleClientErrors(@NotNull ClientException ex) {
final Locale locale = LocaleContextHolder.getLocale();
return new RestErrors(ex.getMessage(messageSource, locale));
return new RestErrors(ex.getMessage(messageSource, locale),ex.getSeverity());
}
}

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest;
import org.apache.commons.io.IOUtils;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest;
class JsonHttpMessageNotReadableException extends org.springframework.http.converter.HttpMessageNotReadableException {

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the
@@ -151,7 +151,7 @@ public class MindmapController extends BaseController {
}
// Could the map be updated ?
checkUpdate(mindmap, user, session, timestamp);
verifyLock(mindmap, user, session, timestamp);
// Update collaboration properties ...
final CollaborationProperties collaborationProperties = mindmap.findCollaborationProperties(user);
@@ -174,30 +174,32 @@ public class MindmapController extends BaseController {
return lockInfo.getTimestamp();
}
private void checkUpdate(@NotNull Mindmap mindmap, @NotNull User user, long session, long timestamp) throws WiseMappingException {
// The lock was lost, reclaim as the ownership of it.
final LockManager lockManager = mindmapService.getLockManager();
final boolean lockLost = lockManager.isLocked(mindmap);
if (!lockLost) {
lockManager.lock(mindmap, user, session);
}
private void verifyLock(@NotNull Mindmap mindmap, @NotNull User user, long session, long timestamp) throws WiseMappingException {
throw new SessionExpiredException(user);
final LockInfo lockInfo = lockManager.getLockInfo(mindmap);
if (lockInfo.getCollaborator().equals(user)) {
final boolean outdated = mindmap.getLastModificationTime().getTimeInMillis() > timestamp;
if (lockInfo.getSession() == session) {
// Timestamp might not be returned to the client. This try to cover this case, ignoring the client timestamp check.
final User lastEditor = mindmap.getLastEditor();
if (outdated && (lockInfo.getPreviousTimestamp() != timestamp || lastEditor == null || !lastEditor.equals(user))) {
throw new MultipleSessionsOpenException("The map has been updated and not by you. Session lost.");
}
} else if (outdated) {
throw new MultipleSessionsOpenException("The map has been updated and not by you. Session lost.");
}
} else {
throw new SessionExpiredException("You have lost the edition session", lockInfo.getCollaborator());
}
// // The lock was lost, reclaim as the ownership of it.
// final LockManager lockManager = mindmapService.getLockManager();
// final boolean lockLost = lockManager.isLocked(mindmap);
// if (!lockLost) {
// lockManager.lock(mindmap, user, session);
// }
//
// final LockInfo lockInfo = lockManager.getLockInfo(mindmap);
// if (lockInfo.getCollaborator().equals(user)) {
// final boolean outdated = mindmap.getLastModificationTime().getTimeInMillis() > timestamp;
// if (lockInfo.getSession() == session) {
// // Timestamp might not be returned to the client. This try to cover this case, ignoring the client timestamp check.
// final User lastEditor = mindmap.getLastEditor();
// if (outdated && (lockInfo.getPreviousTimestamp() != timestamp || lastEditor == null || !lastEditor.equals(user))) {
// throw new SessionExpiredException(lastEditor);
// }
// } else if (outdated) {
// throw new MultipleSessionsOpenException("The map has been updated and not by you. Session lost.");
// }
// } else {
// throw new SessionExpiredException(lockInfo.getCollaborator());
//
// }
}
/**

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;
import com.wisemapping.model.Collaborator;

View File

@@ -1,6 +1,24 @@
/*
* Copyright [2012] [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.rest.model;
import com.wisemapping.exceptions.Severity;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
@@ -35,6 +53,9 @@ public class RestErrors {
@JsonIgnore
MessageSource messageSource;
@JsonIgnore
Severity gSeverity;
public RestErrors() {
}
@@ -44,11 +65,13 @@ public class RestErrors {
this.errors = errors;
this.messageSource = messageSource;
this.gErrors = this.processGlobalErrors(errors, messageSource);
this.gSeverity = Severity.WARNING;
}
public RestErrors(@NotNull String errorMsg) {
public RestErrors(@NotNull String errorMsg, @NotNull Severity severity) {
gErrors = new ArrayList<String>();
gErrors.add(errorMsg);
this.gSeverity = severity;
}
private List<String> processGlobalErrors(@NotNull Errors errors, @NotNull MessageSource messageSource) {
@@ -84,5 +107,11 @@ public class RestErrors {
// Implemented only for XML serialization contract ...
}
public void setGlobalSeverity(@NotNull String severity) {
// Implemented only for XML serialization contract ...
}
public String getGlobalSeverity() {
return this.gSeverity.toString();
}
}

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,3 +1,21 @@
/*
* Copyright [2012] [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.rest.model;

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

View File

@@ -1,5 +1,5 @@
/*
* Copyright [2011] [wisemapping]
* Copyright [2012] [wisemapping]
*
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
* It is basically the Apache License, Version 2.0 (the "License") plus the

Some files were not shown because too many files have changed in this diff Show More