Support for Java 11
This commit is contained in:
@@ -24,20 +24,20 @@ public class LabelManagerImpl extends HibernateDaoSupport
|
||||
@NotNull
|
||||
@Override
|
||||
public List<Label> getAllLabels(@NotNull final User user) {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
|
||||
return (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where creator_id=?", user.getId());
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Label getLabelById(int id, @NotNull final User user) {
|
||||
List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
|
||||
List<Label> labels = (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where id=? and creator=?", new Object[]{id, user});
|
||||
return getFirst(labels);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public Label getLabelByTitle(@NotNull String title, @NotNull final User user) {
|
||||
final List<Label> labels = getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
|
||||
final List<Label> labels = (List<Label>) getHibernateTemplate().find("from com.wisemapping.model.Label wisemapping where title=? and creator=?", new Object[]{title, user});
|
||||
return getFirst(labels);
|
||||
}
|
||||
|
||||
|
@@ -40,7 +40,7 @@ public class MindmapManagerImpl
|
||||
@Override
|
||||
public Collaborator findCollaborator(@NotNull final String email) {
|
||||
final Collaborator collaborator;
|
||||
final List<Collaborator> collaborators = getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email);
|
||||
final List<Collaborator> collaborators = (List<Collaborator>) getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email);
|
||||
if (collaborators != null && !collaborators.isEmpty()) {
|
||||
assert collaborators.size() == 1 : "More than one user with the same email!";
|
||||
collaborator = collaborators.get(0);
|
||||
@@ -154,19 +154,19 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public List<Collaboration> findCollaboration(final long collaboratorId) {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where colaborator_id=?", collaboratorId);
|
||||
return (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where colaborator_id=?", collaboratorId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Collaboration> findCollaboration(final CollaborationRole collaborationRole) {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where roleId=?", collaborationRole.ordinal());
|
||||
return (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where roleId=?", collaborationRole.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collaboration findCollaboration(final int mindmapId, final User user) {
|
||||
final Collaboration result;
|
||||
|
||||
final List<Collaboration> mindMaps = getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where mindMap.id=? and colaborator_id=?", new Object[]{mindmapId, user.getId()});
|
||||
final List<Collaboration> mindMaps = (List<Collaboration>) getHibernateTemplate().find("from com.wisemapping.model.Collaboration collaboration where mindMap.id=? and colaborator_id=?", new Object[]{mindmapId, user.getId()});
|
||||
if (mindMaps != null && !mindMaps.isEmpty()) {
|
||||
result = mindMaps.get(0);
|
||||
} else {
|
||||
@@ -194,7 +194,7 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public List<Mindmap> getAllMindmaps() {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping");
|
||||
return (List<Mindmap>) getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -206,7 +206,7 @@ public class MindmapManagerImpl
|
||||
@Override
|
||||
public Mindmap getMindmapByTitle(final String title, final User user) {
|
||||
final Mindmap result;
|
||||
List<Mindmap> mindMaps = getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping where title=? and creator=?", new Object[]{title, user});
|
||||
List<Mindmap> mindMaps = (List<Mindmap>) getHibernateTemplate().find("from com.wisemapping.model.Mindmap wisemapping where title=? and creator=?", new Object[]{title, user});
|
||||
if (mindMaps != null && !mindMaps.isEmpty()) {
|
||||
result = mindMaps.get(0);
|
||||
} else {
|
||||
|
@@ -43,14 +43,14 @@ public class UserManagerImpl
|
||||
}
|
||||
|
||||
public List<User> getAllUsers() {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.User user");
|
||||
return (List<User>) getHibernateTemplate().find("from com.wisemapping.model.User user");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public User getUserBy(@NotNull final String email) {
|
||||
User user = null;
|
||||
final List<User> users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where email=?", email);
|
||||
final List<User> users = (List<User>) getHibernateTemplate().find("from com.wisemapping.model.User colaborator where email=?", email);
|
||||
if (users != null && !users.isEmpty()) {
|
||||
assert users.size() == 1 : "More than one user with the same email!";
|
||||
user = users.get(0);
|
||||
|
@@ -30,13 +30,13 @@ import org.apache.batik.transcoder.TranscoderOutput;
|
||||
import org.apache.batik.transcoder.image.ImageTranscoder;
|
||||
import org.apache.batik.transcoder.image.JPEGTranscoder;
|
||||
import org.apache.batik.transcoder.image.PNGTranscoder;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.fop.svg.PDFTranscoder;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.w3c.dom.*;
|
||||
import org.xml.sax.InputSource;
|
||||
import org.xml.sax.SAXException;
|
||||
import sun.misc.BASE64Encoder;
|
||||
|
||||
import javax.servlet.ServletContext;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
@@ -51,6 +51,7 @@ import javax.xml.xpath.*;
|
||||
import java.awt.geom.AffineTransform;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Base64;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class ExporterFactory {
|
||||
@@ -266,8 +267,8 @@ public class ExporterFactory {
|
||||
final File iconFile = iconFile(imgUrl);
|
||||
final ByteArrayOutputStream bos = new ByteArrayOutputStream();
|
||||
fis = new FileInputStream(iconFile);
|
||||
BASE64Encoder encoder = new BASE64Encoder();
|
||||
encoder.encode(fis, bos);
|
||||
Base64.Encoder enc = Base64.getEncoder();
|
||||
bos.write(enc.encode(IOUtils.toByteArray(fis)));
|
||||
|
||||
elem.setAttribute("xlink:href", "data:image/png;base64," + bos.toString("8859_1"));
|
||||
elem.appendChild(document.createTextNode(" "));
|
||||
|
@@ -26,13 +26,11 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.servlet.http.HttpSession;
|
||||
|
||||
import com.wisemapping.exceptions.UnsupportedBrowserException;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
public class BrowserSupportInterceptor extends HandlerInterceptorAdapter {
|
||||
private Set<String> exclude;
|
||||
public static final String USER_AGENT = "wisemapping.user_agent";
|
||||
private static final String USER_AGENT = "wisemapping.user_agent";
|
||||
|
||||
public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServletResponse response, Object object) throws Exception {
|
||||
|
||||
@@ -54,15 +52,16 @@ public class BrowserSupportInterceptor extends HandlerInterceptorAdapter {
|
||||
}
|
||||
}
|
||||
|
||||
// It's a supported browser ?.
|
||||
if (!userAgent.isBrowserSupported()) {
|
||||
throw new UnsupportedBrowserException();
|
||||
}
|
||||
|
||||
// Is a Explorer 9 or less without Google Chrome Frame ?.
|
||||
if (userAgent.needsGCF()) {
|
||||
throw new GoogleChromeFrameRequiredException();
|
||||
}
|
||||
return true;
|
||||
// // It's a supported browser ?.
|
||||
// if (!userAgent.isBrowserSupported()) {
|
||||
// throw new UnsupportedBrowserException();
|
||||
// }
|
||||
//
|
||||
// // Is a Explorer 9 or less without Google Chrome Frame ?.
|
||||
// if (userAgent.needsGCF()) {
|
||||
// throw new GoogleChromeFrameRequiredException();
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
@@ -135,7 +135,7 @@ public class FreemindImporter
|
||||
result.setTitle(mapName);
|
||||
result.setDescription(description);
|
||||
|
||||
} catch (JAXBException | IOException | TransformerException e) {
|
||||
} catch (JAXBException | TransformerException e) {
|
||||
throw new ImporterException(e);
|
||||
}
|
||||
return result;
|
||||
|
@@ -1,20 +1,20 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
* 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.rest;
|
||||
|
||||
|
@@ -1,36 +1,39 @@
|
||||
/*
|
||||
* Copyright [2015] [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.
|
||||
*/
|
||||
* Copyright [2015] [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 com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpInputMessage;
|
||||
import org.springframework.http.converter.json.MappingJacksonHttpMessageConverter;
|
||||
import org.springframework.http.converter.HttpMessageNotReadableException;
|
||||
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
|
||||
public class DebugMappingJacksonHttpMessageConverter extends MappingJacksonHttpMessageConverter {
|
||||
public class DebugMappingJacksonHttpMessageConverter extends MappingJackson2HttpMessageConverter {
|
||||
|
||||
@Override
|
||||
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws IOException, JsonHttpMessageNotReadableException {
|
||||
protected Object readInternal(Class<?> clazz, HttpInputMessage inputMessage) throws JsonHttpMessageNotReadableException {
|
||||
try {
|
||||
final byte[] bytes = IOUtils.toByteArray(inputMessage.getBody());
|
||||
final ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
|
||||
@@ -38,9 +41,7 @@ public class DebugMappingJacksonHttpMessageConverter extends MappingJacksonHttpM
|
||||
|
||||
return super.readInternal(clazz, wrap);
|
||||
|
||||
} catch (org.springframework.http.converter.HttpMessageNotReadableException e) {
|
||||
throw new JsonHttpMessageNotReadableException("Request Body could not be read", e);
|
||||
} catch (IOException e) {
|
||||
} catch (HttpMessageNotReadableException | IOException e) {
|
||||
throw new JsonHttpMessageNotReadableException("Request Body could not be read", e);
|
||||
}
|
||||
}
|
||||
@@ -57,7 +58,7 @@ class WrapHttpInputMessage implements HttpInputMessage {
|
||||
}
|
||||
|
||||
@Override
|
||||
public InputStream getBody() throws IOException {
|
||||
public InputStream getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
|
@@ -85,9 +85,10 @@ import java.util.Set;
|
||||
@Api(value = "mindmap", description = "User Mindmap Objects.")
|
||||
@Controller
|
||||
public class MindmapController extends BaseController {
|
||||
final Logger logger = Logger.getLogger("com.wisemapping");
|
||||
private final static Logger logger = Logger.getLogger("com.wisemapping");
|
||||
|
||||
private static final String LATEST_HISTORY_REVISION = "latest";
|
||||
|
||||
public static final String LATEST_HISTORY_REVISION = "latest";
|
||||
@Qualifier("mindmapService")
|
||||
@Autowired
|
||||
private MindmapService mindmapService;
|
||||
|
@@ -19,10 +19,9 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.wisemapping.model.Collaboration;
|
||||
import com.wisemapping.model.CollaborationRole;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -19,7 +19,7 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -18,19 +18,16 @@
|
||||
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.util.TimeUtils;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
|
||||
@XmlRootElement(name = "collaborator")
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
|
@@ -18,10 +18,10 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.exceptions.Severity;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.context.MessageSource;
|
||||
|
@@ -1,17 +1,18 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.model.Label;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.NONE;
|
||||
import static org.codehaus.jackson.annotate.JsonAutoDetect.Visibility.PUBLIC_ONLY;
|
||||
|
||||
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;
|
||||
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.PUBLIC_ONLY;
|
||||
|
||||
@XmlRootElement(name = "label")
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
|
@@ -1,7 +1,7 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.wisemapping.model.Label;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -19,10 +19,10 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.service.LockInfo;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@@ -19,7 +19,7 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -19,6 +19,9 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.exceptions.WiseMappingException;
|
||||
import com.wisemapping.model.CollaborationProperties;
|
||||
import com.wisemapping.model.CollaborationRole;
|
||||
@@ -26,9 +29,6 @@ import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.util.TimeUtils;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
|
@@ -19,10 +19,10 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.model.MindMapHistory;
|
||||
import com.wisemapping.model.User;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*
|
||||
/**
|
||||
* Copyright [2015] [wisemapping]
|
||||
*
|
||||
* Licensed under WiseMapping Public License, Version 1.0 (the "License").
|
||||
@@ -19,7 +19,7 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -19,6 +19,9 @@
|
||||
package com.wisemapping.rest.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.model.Collaboration;
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.Label;
|
||||
@@ -26,9 +29,6 @@ import com.wisemapping.model.Mindmap;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.security.Utils;
|
||||
import com.wisemapping.util.TimeUtils;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
@@ -36,7 +36,6 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.util.Calendar;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
@@ -1,27 +1,27 @@
|
||||
/*
|
||||
* Copyright [2015] [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.
|
||||
*/
|
||||
* Copyright [2015] [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;
|
||||
import com.wisemapping.model.Mindmap;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
|
@@ -1,28 +1,28 @@
|
||||
/*
|
||||
* Copyright [2015] [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.
|
||||
*/
|
||||
* Copyright [2015] [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.fasterxml.jackson.annotation.JsonAutoDetect;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.wisemapping.model.User;
|
||||
import org.codehaus.jackson.annotate.JsonAutoDetect;
|
||||
import org.codehaus.jackson.annotate.JsonIgnore;
|
||||
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import javax.xml.bind.annotation.XmlAccessType;
|
||||
@@ -32,7 +32,6 @@ import java.util.Calendar;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
|
||||
@XmlRootElement(name = "user")
|
||||
@XmlAccessorType(XmlAccessType.PROPERTY)
|
||||
@JsonAutoDetect(
|
||||
@@ -54,6 +53,7 @@ public class RestUser {
|
||||
this.password = user.getPassword();
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public Calendar getCreationDate() {
|
||||
return user.getCreationDate();
|
||||
}
|
||||
@@ -82,10 +82,6 @@ public class RestUser {
|
||||
user.setLastname(lastname);
|
||||
}
|
||||
|
||||
// public boolean isActive() {
|
||||
// return user.isActive();
|
||||
// }
|
||||
|
||||
public long getId() {
|
||||
return user.getId();
|
||||
}
|
||||
@@ -102,10 +98,6 @@ public class RestUser {
|
||||
user.setEmail(email);
|
||||
}
|
||||
|
||||
public void setCreationDate(Calendar creationDate) {
|
||||
// user.setCreationDate(creationDate);
|
||||
}
|
||||
|
||||
public void setPassword(final String password) {
|
||||
this.user.setPassword(password);
|
||||
this.password = password;
|
||||
|
@@ -24,8 +24,8 @@ public class AuthenticationSuccessHandler extends SavedRequestAwareAuthenticatio
|
||||
public void onAuthenticationSuccess(HttpServletRequest request, HttpServletResponse response, Authentication authentication) throws ServletException, IOException {
|
||||
|
||||
SavedRequest savedRequest = cache.getRequest(request, response);
|
||||
if (savedRequest!=null && savedRequest.getRedirectUrl().contains("c/restful")) {
|
||||
cache.removeRequest(request,response);
|
||||
if (savedRequest != null && savedRequest.getRedirectUrl().contains("c/restful")) {
|
||||
cache.removeRequest(request, response);
|
||||
}
|
||||
super.onAuthenticationSuccess(request, response, authentication);
|
||||
}
|
||||
|
@@ -6,7 +6,6 @@ import org.apache.http.NameValuePair;
|
||||
import org.apache.http.client.fluent.Form;
|
||||
import org.apache.http.client.fluent.Request;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
|
@@ -27,6 +27,7 @@ import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.Marshaller;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import java.io.*;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -34,11 +35,11 @@ public class JAXBUtils {
|
||||
|
||||
private final static Map<String, JAXBContext> context = new HashMap<String, JAXBContext>();
|
||||
|
||||
public static Object getMapObject(@NotNull InputStream is, @NotNull final String pakage) throws JAXBException, UnsupportedEncodingException {
|
||||
public static Object getMapObject(@NotNull InputStream is, @NotNull final String pakage) throws JAXBException {
|
||||
|
||||
final JAXBContext context = getInstance(pakage);
|
||||
final Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
final Reader reader = new InputStreamReader(is, "UTF-8");
|
||||
final Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
|
||||
return unmarshaller.unmarshal(reader);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user