From 88d5f0df436efe5c4e6e51095ac77c186d1c42c9 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Tue, 6 Feb 2024 22:26:44 -0800 Subject: [PATCH] Renove http basic. --- .../config/rest/RestAppConfig.java | 2 +- .../config/rest/ServletConfig.java | 29 ------------------- .../wisemapping/dao/MindmapManagerImpl.java | 5 ++-- .../java/com/wisemapping/model/Mindmap.java | 11 +++---- 4 files changed, 7 insertions(+), 40 deletions(-) delete mode 100644 wise-api/src/main/java/com/wisemapping/config/rest/ServletConfig.java diff --git a/wise-api/src/main/java/com/wisemapping/config/rest/RestAppConfig.java b/wise-api/src/main/java/com/wisemapping/config/rest/RestAppConfig.java index 65546bd1..7ee683a9 100644 --- a/wise-api/src/main/java/com/wisemapping/config/rest/RestAppConfig.java +++ b/wise-api/src/main/java/com/wisemapping/config/rest/RestAppConfig.java @@ -54,7 +54,7 @@ public class RestAppConfig { })) .csrf(AbstractHttpConfigurer::disable) .sessionManagement(session -> session.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) - .httpBasic(withDefaults()) +// .httpBasic(withDefaults()) .build(); } } diff --git a/wise-api/src/main/java/com/wisemapping/config/rest/ServletConfig.java b/wise-api/src/main/java/com/wisemapping/config/rest/ServletConfig.java deleted file mode 100644 index bd2cccb1..00000000 --- a/wise-api/src/main/java/com/wisemapping/config/rest/ServletConfig.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright [2022] [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.config.rest; - -import org.springframework.boot.web.server.WebServerFactoryCustomizer; -import org.springframework.boot.web.servlet.server.ConfigurableServletWebServerFactory; -import org.springframework.context.annotation.Configuration; - -@Configuration -public class ServletConfig implements WebServerFactoryCustomizer { - public void customize(ConfigurableServletWebServerFactory factory){ - factory.setPort(8081); - } -} \ No newline at end of file diff --git a/wise-api/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java b/wise-api/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java index be680f03..a1f7c971 100644 --- a/wise-api/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java +++ b/wise-api/src/main/java/com/wisemapping/dao/MindmapManagerImpl.java @@ -124,17 +124,16 @@ public class MindmapManagerImpl @Override public Mindmap getMindmapByTitle(final String title, final User user) { - final Mindmap result; + final TypedQuery query = entityManager.createQuery("from com.wisemapping.model.Mindmap wisemapping where title=:title and creator=:creator", Mindmap.class); query.setParameter("title", title); query.setParameter("creator", user); List mindMaps = query.getResultList(); + Mindmap result = null; if (mindMaps != null && !mindMaps.isEmpty()) { result = mindMaps.get(0); - } else { - result = null; } return result; } diff --git a/wise-api/src/main/java/com/wisemapping/model/Mindmap.java b/wise-api/src/main/java/com/wisemapping/model/Mindmap.java index ea8787db..3c90eae5 100644 --- a/wise-api/src/main/java/com/wisemapping/model/Mindmap.java +++ b/wise-api/src/main/java/com/wisemapping/model/Mindmap.java @@ -311,13 +311,10 @@ public class Mindmap implements Serializable { } public static String getDefaultMindmapXml(@NotNull final String title) { - - final StringBuilder result = new StringBuilder(); - result.append(""); - result.append(""); - return result.toString(); + return "" + + ""; } static private String escapeXmlAttribute(String attValue) {