mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2025-01-09 11:45:16 +01:00
WIP
This commit is contained in:
parent
169c6e6538
commit
b74ebc0d4f
@ -2,17 +2,20 @@
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>wise-webapp</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<name>WiseMapping Webapp</name>
|
||||
<url>http://www.wisemapping.org</url>
|
||||
<parent>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
<version>5.1.0-SNAPSHOT</version>
|
||||
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>3.1.2</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
<com.wisemapping.version>5.1.0-SNAPSHOT</com.wisemapping.version>
|
||||
<maven.compiler.source>17</maven.compiler.source>
|
||||
<maven.compiler.target>17</maven.compiler.target>
|
||||
<org.springframework.version>6.0.11</org.springframework.version>
|
||||
<org.springframework.addons>6.1.2</org.springframework.addons>
|
||||
<hibernate.version>6.2.6.Final</hibernate.version>
|
||||
@ -33,6 +36,27 @@
|
||||
<version>1.7</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
@ -45,39 +69,33 @@
|
||||
<version>12.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-messaging</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-websocket</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-messaging</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-websocket</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.5.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-tx</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-beans</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-tx</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-taglibs</artifactId>
|
||||
@ -90,6 +108,12 @@
|
||||
<version>5.6.15.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>jakarta.xml.bind</groupId>
|
||||
<artifactId>jakarta.xml.bind-api</artifactId>
|
||||
<version>4.0.0</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Hibernate Validator -->
|
||||
<dependency>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
@ -97,78 +121,72 @@
|
||||
<version>8.0.1.Final</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.data</groupId>
|
||||
<artifactId>spring-data-jpa</artifactId>
|
||||
<version>2.6.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-test</artifactId>
|
||||
<version>5.3.15</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-orm</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-context</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-web</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-oxm</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-context-support</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.data</groupId>-->
|
||||
<!-- <artifactId>spring-data-jpa</artifactId>-->
|
||||
<!-- <version>3.1.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-test</artifactId>-->
|
||||
<!-- <version>6.0.6</version>-->
|
||||
<!-- <scope>test</scope>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${org.springframework.addons}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-core</artifactId>
|
||||
<version>${org.springframework.addons}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>aopalliance</groupId>
|
||||
<artifactId>aopalliance</artifactId>
|
||||
<version>1.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-aop</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>runtime</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework.security</groupId>-->
|
||||
<!-- <artifactId>spring-security-core</artifactId>-->
|
||||
<!-- <version>${org.springframework.addons}</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.springframework</groupId>-->
|
||||
<!-- <artifactId>spring-jdbc</artifactId>-->
|
||||
<!-- <version>${org.springframework.version}</version>-->
|
||||
<!-- <scope>runtime</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>aopalliance</groupId>-->
|
||||
<!-- <artifactId>aopalliance</artifactId>-->
|
||||
<!-- <version>1.0</version>-->
|
||||
<!-- <scope>compile</scope>-->
|
||||
<!-- </dependency>-->
|
||||
<dependency>
|
||||
<groupId>jakarta.mail</groupId>
|
||||
<artifactId>jakarta.mail-api</artifactId>
|
||||
@ -179,11 +197,11 @@
|
||||
<artifactId>mysql-connector-j</artifactId>
|
||||
<version>8.1.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-dbcp2</artifactId>
|
||||
<version>2.9.0</version>
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.apache.commons</groupId>-->
|
||||
<!-- <artifactId>commons-dbcp2</artifactId>-->
|
||||
<!-- <version>2.9.0</version>-->
|
||||
<!-- </dependency>-->
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>org.hibernate</groupId>-->
|
||||
<!-- <artifactId>hibernate-ehcache</artifactId>-->
|
||||
@ -282,10 +300,9 @@
|
||||
<dependency>
|
||||
<groupId>org.hsqldb</groupId>
|
||||
<artifactId>hsqldb</artifactId>
|
||||
<version>2.7.1</version>
|
||||
<version>2.7.2</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<executions>
|
||||
<execution>
|
||||
<id>drop-schemas</id>
|
||||
@ -357,27 +374,6 @@
|
||||
</profiles>
|
||||
<build>
|
||||
<plugins>
|
||||
<!-- <plugin>-->
|
||||
<!-- <groupId>org.hibernate.orm.tooling</groupId>-->
|
||||
<!-- <artifactId>hibernate-enhance-maven-plugin</artifactId>-->
|
||||
<!-- <version>${hibernate.version}</version>-->
|
||||
<!-- <executions>-->
|
||||
<!-- <execution>-->
|
||||
<!-- <phase>compile</phase>-->
|
||||
<!-- <configuration>-->
|
||||
<!-- <failOnError>true</failOnError>-->
|
||||
<!-- <enableLazyInitialization>true</enableLazyInitialization>-->
|
||||
<!-- <enableDirtyTracking>true</enableDirtyTracking>-->
|
||||
<!-- <enableAssociationManagement>true</enableAssociationManagement>-->
|
||||
<!-- <enableExtendedEnhancement>false</enableExtendedEnhancement>-->
|
||||
<!-- <enableExtendedEnhancement>false</enableExtendedEnhancement>-->
|
||||
<!-- </configuration>-->
|
||||
<!-- <goals>-->
|
||||
<!-- <goal>enhance</goal>-->
|
||||
<!-- </goals>-->
|
||||
<!-- </execution>-->
|
||||
<!-- </executions>-->
|
||||
<!-- </plugin>-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-war-plugin</artifactId>
|
||||
@ -418,6 +414,8 @@
|
||||
</webResources>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
|
@ -1,37 +0,0 @@
|
||||
package com.wisemapping.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.web.servlet.HandlerExceptionResolver;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
||||
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.JstlView;
|
||||
|
||||
@EnableWebMvc
|
||||
@Configuration
|
||||
public class AppConfig {
|
||||
|
||||
@Bean
|
||||
HandlerExceptionResolver errorHandler() {
|
||||
final SimpleMappingExceptionResolver result = new SimpleMappingExceptionResolver();
|
||||
|
||||
//mapping status code with view response.
|
||||
result.addStatusCode("reactInclude", 403);
|
||||
|
||||
//setting default error view
|
||||
result.setDefaultErrorView("reactInclude");
|
||||
result.setDefaultStatusCode(500);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ViewResolver viewResolver(){
|
||||
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
|
||||
resolver.setPrefix("/WEB-INF/views/");
|
||||
resolver.setSuffix(".jsp");
|
||||
resolver.setViewClass(JstlView.class);
|
||||
return resolver;
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
package com.wisemapping.config;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.jdbc.DataSourceBuilder;
|
||||
import org.springframework.context.annotation.*;
|
||||
import org.springframework.web.servlet.HandlerExceptionResolver;
|
||||
import org.springframework.web.servlet.ViewResolver;
|
||||
import org.springframework.web.servlet.handler.SimpleMappingExceptionResolver;
|
||||
import org.springframework.web.servlet.view.InternalResourceViewResolver;
|
||||
import org.springframework.web.servlet.view.JstlView;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
||||
@SpringBootApplication
|
||||
@ImportResource("spring/wisemapping.xml")
|
||||
@ComponentScan
|
||||
public class Application {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
@Bean
|
||||
HandlerExceptionResolver errorHandler() {
|
||||
final SimpleMappingExceptionResolver result = new SimpleMappingExceptionResolver();
|
||||
|
||||
//mapping status code with view response.
|
||||
result.addStatusCode("reactInclude", 403);
|
||||
|
||||
//setting default error view
|
||||
result.setDefaultErrorView("reactInclude");
|
||||
result.setDefaultStatusCode(500);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public ViewResolver viewResolver() {
|
||||
InternalResourceViewResolver resolver = new InternalResourceViewResolver();
|
||||
resolver.setPrefix("/WEB-INF/views/");
|
||||
resolver.setSuffix(".jsp");
|
||||
resolver.setViewClass(JstlView.class);
|
||||
return resolver;
|
||||
}
|
||||
// @Bean
|
||||
// public DataSource getDataSource() {
|
||||
// DataSourceBuilder dataSourceBuilder = DataSourceBuilder.create();
|
||||
// dataSourceBuilder.username("SA");
|
||||
// dataSourceBuilder.password("");
|
||||
// dataSourceBuilder.url("jdbc:hsqldb:file:/db/wisemapping");
|
||||
// dataSourceBuilder.driverClassName("org.hsqldb.jdbc.JDBCDriver");
|
||||
// return dataSourceBuilder.build();
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,9 +20,9 @@ import org.springframework.web.servlet.handler.HandlerMappingIntrospector;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableWebSecurity
|
||||
//@EnableWebSecurity
|
||||
public class SecurityConfig {
|
||||
@Autowired
|
||||
// @Autowired
|
||||
UserService userService;
|
||||
|
||||
@Value("${admin.user}")
|
||||
@ -122,11 +122,11 @@ public class SecurityConfig {
|
||||
|
||||
return http.authorizeHttpRequests(
|
||||
(auth) ->
|
||||
auth.requestMatchers(restfullMapper.pattern("/static/**")).permitAll().
|
||||
requestMatchers(restfullMapper.pattern("/css/**")).permitAll().
|
||||
requestMatchers(restfullMapper.pattern("/js/**")).permitAll().
|
||||
requestMatchers(restfullMapper.pattern("/images/**")).permitAll().
|
||||
requestMatchers(restfullMapper.pattern("/*")).permitAll()
|
||||
auth.requestMatchers("/static/**").permitAll().
|
||||
requestMatchers("/css/**").permitAll().
|
||||
requestMatchers("/js/**").permitAll().
|
||||
requestMatchers("/images/**").permitAll().
|
||||
requestMatchers("/*").permitAll()
|
||||
).build();
|
||||
}
|
||||
|
||||
|
@ -21,11 +21,6 @@ package com.wisemapping.dao;
|
||||
import com.wisemapping.model.*;
|
||||
import com.wisemapping.util.ZipUtils;
|
||||
import jakarta.persistence.Query;
|
||||
import org.hibernate.Criteria;
|
||||
import org.hibernate.criterion.Junction;
|
||||
import org.hibernate.criterion.Order;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.criterion.SimpleExpression;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.orm.hibernate5.HibernateTemplate;
|
||||
@ -62,13 +57,14 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public List<MindMapHistory> getHistoryFrom(int mindmapId) {
|
||||
final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mindmapId));
|
||||
hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
|
||||
// This line throws errors in some environments, so getting all history and taking firsts 10 records
|
||||
hibernateCriteria.setMaxResults(30);
|
||||
return hibernateCriteria.list();
|
||||
// final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
// hibernateCriteria.add(Restrictions.eq("mindmapId", mindmapId));
|
||||
// hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
//
|
||||
// // This line throws errors in some environments, so getting all history and taking firsts 10 records
|
||||
// hibernateCriteria.setMaxResults(30);
|
||||
// return hibernateCriteria.list();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -83,11 +79,11 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public void purgeHistory(int mapId) throws IOException {
|
||||
final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mapId));
|
||||
hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
// final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
// hibernateCriteria.add(Restrictions.eq("mindmapId", mapId));
|
||||
// hibernateCriteria.addOrder(Order.desc("creationTime"));
|
||||
|
||||
final List<MindMapHistory> historyList = hibernateCriteria.list();
|
||||
final List<MindMapHistory> historyList = null;
|
||||
|
||||
final Mindmap mindmap = this.getMindmapById(mapId);
|
||||
if (mindmap != null) {
|
||||
@ -127,30 +123,31 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public List<Mindmap> search(MindMapCriteria criteria, int maxResult) {
|
||||
final Criteria hibernateCriteria = currentSession().createCriteria(Mindmap.class);
|
||||
//always search public maps
|
||||
hibernateCriteria.add(Restrictions.like("public", Boolean.TRUE));
|
||||
|
||||
if (criteria != null) {
|
||||
final Junction junction;
|
||||
if (criteria.isOrCriteria()) {
|
||||
junction = Restrictions.disjunction();
|
||||
} else {
|
||||
junction = Restrictions.conjunction();
|
||||
}
|
||||
|
||||
if (criteria.getTitle() != null && criteria.getTitle().length() > 0) {
|
||||
final SimpleExpression titleRestriction = Restrictions.like("title", "%" + criteria.getTitle() + "%");
|
||||
junction.add(titleRestriction);
|
||||
}
|
||||
|
||||
if (criteria.getDescription() != null && criteria.getDescription().length() > 0) {
|
||||
final SimpleExpression descriptionRestriction = Restrictions.like("description", "%" + criteria.getDescription() + "%");
|
||||
junction.add(descriptionRestriction);
|
||||
}
|
||||
hibernateCriteria.add(junction);
|
||||
}
|
||||
return hibernateCriteria.list();
|
||||
// final Criteria hibernateCriteria = currentSession().createCriteria(Mindmap.class);
|
||||
// //always search public maps
|
||||
// hibernateCriteria.add(Restrictions.like("public", Boolean.TRUE));
|
||||
//
|
||||
// if (criteria != null) {
|
||||
// final Junction junction;
|
||||
// if (criteria.isOrCriteria()) {
|
||||
// junction = Restrictions.disjunction();
|
||||
// } else {
|
||||
// junction = Restrictions.conjunction();
|
||||
// }
|
||||
//
|
||||
// if (criteria.getTitle() != null && criteria.getTitle().length() > 0) {
|
||||
// final SimpleExpression titleRestriction = Restrictions.like("title", "%" + criteria.getTitle() + "%");
|
||||
// junction.add(titleRestriction);
|
||||
// }
|
||||
//
|
||||
// if (criteria.getDescription() != null && criteria.getDescription().length() > 0) {
|
||||
// final SimpleExpression descriptionRestriction = Restrictions.like("description", "%" + criteria.getDescription() + "%");
|
||||
// junction.add(descriptionRestriction);
|
||||
// }
|
||||
// hibernateCriteria.add(junction);
|
||||
// }
|
||||
// return hibernateCriteria.list();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -221,17 +218,17 @@ public class MindmapManagerImpl
|
||||
|
||||
@Override
|
||||
public void removeMindmap(@NotNull final Mindmap mindmap) {
|
||||
// Delete history first ...
|
||||
final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
hibernateCriteria.add(Restrictions.eq("mindmapId", mindmap.getId()));
|
||||
final List list = hibernateCriteria.list();
|
||||
getHibernateTemplate().deleteAll(list);
|
||||
|
||||
// Remove collaborations ...
|
||||
mindmap.removedCollaboration(mindmap.getCollaborations());
|
||||
|
||||
// Delete mindmap ....
|
||||
getHibernateTemplate().delete(mindmap);
|
||||
// // Delete history first ...
|
||||
// final Criteria hibernateCriteria = currentSession().createCriteria(MindMapHistory.class);
|
||||
// hibernateCriteria.add(Restrictions.eq("mindmapId", mindmap.getId()));
|
||||
// final List list = hibernateCriteria.list();
|
||||
// getHibernateTemplate().deleteAll(list);
|
||||
//
|
||||
// // Remove collaborations ...
|
||||
// mindmap.removedCollaboration(mindmap.getCollaborations());
|
||||
//
|
||||
// // Delete mindmap ....
|
||||
// getHibernateTemplate().delete(mindmap);
|
||||
}
|
||||
|
||||
private void saveHistory(@NotNull final Mindmap mindMap) {
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
|
||||
# HSQL Configuration properties
|
||||
database.base.url=/Users/veigap/repos/wisemapping-open-source/wise-webapp/target/
|
||||
database.url=jdbc:hsqldb:file:${database.base.url}/db/wisemapping
|
||||
database.driver=org.hsqldb.jdbc.JDBCDriver
|
||||
database.hibernate.dialect=org.hibernate.dialect.HSQLDialect
|
||||
@ -89,7 +90,7 @@ google.recaptcha2.secretKey = 6LeIxAcTAAAAAGG-vFI1TnRWxMZNFuojJ4WifJWe
|
||||
admin.user = admin@wisemapping.org
|
||||
|
||||
# Base URL where WiseMapping is deployed. By default, It will be automatically inferred.
|
||||
#site.baseurl = http://localhost:8080
|
||||
site.baseurl = http://localhost:8080
|
||||
|
||||
# Site Homepage URL. This will be used as URL for homepage location.
|
||||
site.homepage = c/login
|
||||
@ -149,9 +150,7 @@ security.oauth2.google.confirmUrl=https://oauth2.googleapis.com/token
|
||||
# Google service for get user data (name, email, etc)
|
||||
security.oauth2.google.userinfoUrl=https://www.googleapis.com/oauth2/v3/userinfo
|
||||
# Url for starting auth process with google
|
||||
security.oauth2.google.url=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=${security.oauth2.google.callbackUrl}&prompt=consent&response_type=code&client_id=${security.oauth2.google.clientId}&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&state=wisemapping&include_granted_scopes=true
|
||||
|
||||
|
||||
security.oauth2.google.url=https://accounts.google.com/o/oauth2/v2/auth?redirect_uri=${security.oauth2.google.callbackUrl:''}&prompt=consent&response_type=code&client_id=${security.oauth2.google.clientId:''}&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email&access_type=offline&state=wisemapping&include_granted_scopes=true
|
||||
|
||||
|
||||
#######################################################################################
|
||||
@ -161,3 +160,10 @@ security.oauth2.google.url=https://accounts.google.com/o/oauth2/v2/auth?redirect
|
||||
# Coma separated list of domains and emails ban
|
||||
#accounts.exclusion.domain=
|
||||
|
||||
|
||||
#spring.main.allow-bean-definition-overriding=true
|
||||
|
||||
spring.datasource.driver-class-name=org.hsqldb.jdbc.JDBCDriver
|
||||
spring.datasource.url=jdbc:hsqldb:file:/Users/veigap/repos/wisemapping-open-source/wise-webapp/target/db/wisemapping
|
||||
spring.datasource.username=sa
|
||||
spring.datasource.password=
|
1
wise-webapp/src/main/resources/public/static/mindplot
Symbolic link
1
wise-webapp/src/main/resources/public/static/mindplot
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../../wise-ui/target/wisemapping-mindplot/package/dist
|
1
wise-webapp/src/main/resources/public/static/webapp
Symbolic link
1
wise-webapp/src/main/resources/public/static/webapp
Symbolic link
@ -0,0 +1 @@
|
||||
../../../../../wise-ui/target/wisemapping-webapp/package/dist
|
@ -22,7 +22,7 @@
|
||||
|
||||
<bean id="updateSecurityAdvisor"
|
||||
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||
<property name="advice" ref="updateSecurityAdvice"/>
|
||||
<!-- <property name="advice" ref="updateSecurityAdvice"/>-->
|
||||
<property name="mappedNames">
|
||||
<list>
|
||||
<value>save*</value>
|
@ -5,7 +5,7 @@
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="mindmapSessionFactory" class="org.springframework.orm.hibernate5.LocalSessionFactoryBean">
|
||||
<property name="dataSource" ref="wiseDataSource"/>
|
||||
<property name="dataSource" ref="dataSource"/>
|
||||
<property name="annotatedClasses">
|
||||
<list>
|
||||
<value>com.wisemapping.model.User</value>
|
@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<!-- <bean id="wiseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" destroy-method="close">-->
|
||||
<!-- <property name="driverClassName" value="${database.driver}"/>-->
|
||||
<!-- <property name="url" value="${database.url}"/>-->
|
||||
<!-- <property name="username" value="${database.username}"/>-->
|
||||
<!-- <property name="password" value="${database.password}"/>-->
|
||||
<!-- <property name="testOnBorrow" value="${database.validation.enabled:true}"/>-->
|
||||
<!-- <property name="defaultQueryTimeout" value="15"/>-->
|
||||
<!-- <property name="maxTotal" value="100"/>-->
|
||||
<!-- <property name="maxIdle" value="30"/>-->
|
||||
<!-- <property name="initialSize" value="5"/>-->
|
||||
<!-- <property name="maxWaitMillis" value="10000"/>-->
|
||||
<!-- <property name="validationQuery" value="${database.validation.query:SELECT 1}"/>-->
|
||||
<!-- </bean>-->
|
||||
|
||||
<!--<!– Optional configuration for external connexion pool–>-->
|
||||
<!-- <bean id="wiseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" >-->
|
||||
<!-- <property name="jndiName">-->
|
||||
<!-- <value>java:comp/env/jdbc/wisemapping</value>-->
|
||||
<!-- </property>-->
|
||||
<!-- </bean>-->
|
||||
</beans>
|
46
wise-webapp/src/main/resources/spring/wisemapping-rest.xml
Normal file
46
wise-webapp/src/main/resources/spring/wisemapping-rest.xml
Normal file
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--suppress SpringModelInspection -->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
||||
|
||||
<!-- <mvc:annotation-driven>-->
|
||||
<!-- <mvc:message-converters>-->
|
||||
<!-- <bean class="com.wisemapping.rest.DebugMappingJacksonHttpMessageConverter"/>-->
|
||||
<!-- <bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter"/>-->
|
||||
<!-- </mvc:message-converters>-->
|
||||
<!-- </mvc:annotation-driven>-->
|
||||
|
||||
<!-- <bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">-->
|
||||
<!-- <property name="favorParameter" value="true"/>-->
|
||||
<!-- <property name="parameterName" value="mediaType"/>-->
|
||||
<!-- <property name="defaultContentType" value="application/json" />-->
|
||||
|
||||
<!-- <property name="mediaTypes">-->
|
||||
<!-- <map>-->
|
||||
<!-- <entry key="xml" value="application/xml"/>-->
|
||||
<!-- <entry key="json" value="application/json"/>-->
|
||||
<!-- </map>-->
|
||||
<!-- </property>-->
|
||||
<!-- </bean>-->
|
||||
|
||||
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
||||
<property name="contentNegotiationManager" ref="contentNegotiationManager"/>
|
||||
<property name="viewResolvers">
|
||||
<list>
|
||||
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="defaultViews">
|
||||
<list>
|
||||
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
|
||||
<property name="extractValueFromSingleKeyModel" value="true"/>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
@ -1,33 +1,28 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd">
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<context:property-placeholder location="/WEB-INF/app.properties" ignore-unresolvable="true"/>
|
||||
<!-- <context:property-placeholder location="/WEB-INF/app.properties" ignore-unresolvable="true"/>-->
|
||||
|
||||
<bean id="mailer" class="com.wisemapping.mail.Mailer">
|
||||
<constructor-arg index="0" value="${mail.serverSendEmail}"/>
|
||||
<constructor-arg index="1" value="${mail.supportEmail}"/>
|
||||
<constructor-arg index="2" value="${mail.errorReporterEmail}"/>
|
||||
|
||||
<property name="mailSender" ref="mailSender"/>
|
||||
<property name="velocityEngineWrapper" ref="velocityEngineWrapper"/>
|
||||
</bean>
|
||||
|
||||
<bean id="httpInvoker" class="com.wisemapping.service.google.http.HttpInvoker">
|
||||
</bean>
|
||||
<bean id="httpInvoker" class="com.wisemapping.service.google.http.HttpInvoker"/>
|
||||
|
||||
<bean id="googleService" class="com.wisemapping.service.google.GoogleService">
|
||||
<property name="httpInvoker" ref="httpInvoker"/>
|
||||
<property name="optinConfirmUrl" value="${security.oauth2.google.confirmUrl}"/>
|
||||
<property name="accountBasicDataUrl" value="${security.oauth2.google.userinfoUrl}"/>
|
||||
<property name="clientId" value="${security.oauth2.google.clientId}"/>
|
||||
<property name="clientSecret" value="${security.oauth2.google.clientSecret}"/>
|
||||
<property name="callbackUrl" value="${security.oauth2.google.callbackUrl}"/>
|
||||
<property name="clientId" value="${security.oauth2.google.clientId:''}"/>
|
||||
<property name="clientSecret" value="${security.oauth2.google.clientSecret:''}"/>
|
||||
<property name="callbackUrl" value="${security.oauth2.google.callbackUrl:''}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userServiceTarget" class="com.wisemapping.service.UserServiceImpl">
|
||||
@ -49,7 +44,7 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="mindMapServiceTarget" class="com.wisemapping.service.MindmapServiceImpl">
|
||||
<bean id="mindmapService" class="com.wisemapping.service.MindmapServiceImpl">
|
||||
<property name="mindmapManager" ref="mindmapManager"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="notificationService" ref="notificationService"/>
|
||||
@ -60,17 +55,17 @@
|
||||
<property name="recaptchaSecret" value="${google.recaptcha2.secretKey}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mindmapService" class="org.springframework.aop.framework.ProxyFactoryBean">
|
||||
<property name="proxyInterfaces" value="com.wisemapping.service.MindmapService"/>
|
||||
<property name="interceptorNames">
|
||||
<list>
|
||||
<value>txInterceptor</value>
|
||||
<value>viewSecurityAdvisor</value>
|
||||
<value>updateSecurityAdvisor</value>
|
||||
</list>
|
||||
</property>
|
||||
<property name="target" ref="mindMapServiceTarget"/>
|
||||
</bean>
|
||||
<!-- <bean id="mindmapService" class="org.springframework.aop.framework.ProxyFactoryBean">-->
|
||||
<!-- <property name="proxyInterfaces" value="com.wisemapping.service.MindmapService"/>-->
|
||||
<!-- <property name="interceptorNames">-->
|
||||
<!-- <list>-->
|
||||
<!-- <value>txInterceptor</value>-->
|
||||
<!-- <value>viewSecurityAdvisor</value>-->
|
||||
<!-- <value>updateSecurityAdvisor</value>-->
|
||||
<!-- </list>-->
|
||||
<!-- </property>-->
|
||||
<!-- <property name="target" ref="mindMapServiceTarget"/>-->
|
||||
<!-- </bean>-->
|
||||
|
||||
|
||||
<bean id="labelServiceTarget" class="com.wisemapping.service.LabelServiceImpl">
|
||||
@ -102,8 +97,7 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="velocityEngineWrapper" class="com.wisemapping.util.VelocityEngineWrapper">
|
||||
</bean>
|
||||
<bean id="velocityEngineWrapper" class="com.wisemapping.util.VelocityEngineWrapper"/>
|
||||
|
||||
<bean id="notificationService" class="com.wisemapping.mail.NotificationService">
|
||||
<property name="baseUrl" value="${site.baseurl:http://localhost:8080/}"/>
|
||||
@ -111,14 +105,14 @@
|
||||
<property name="messageSource" ref="messageSource"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
<!-- <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">-->
|
||||
<!-- <property name="defaultEncoding" value="UTF-8"/>-->
|
||||
<!-- <property name="basenames">-->
|
||||
<!-- <list>-->
|
||||
<!-- <value>messages</value>-->
|
||||
<!-- </list>-->
|
||||
<!-- </property>-->
|
||||
<!-- </bean>-->
|
||||
|
||||
<import resource="wisemapping-security-${security.type}.xml"/>
|
||||
<!-- <import resource="wisemapping-security-${security.type}.xml"/>-->
|
||||
</beans>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
||||
|
||||
<!-- Interceptors Registration -->
|
||||
<mvc:interceptors>
|
||||
<bean id="userLocaleInterceptor" class="com.wisemapping.filter.UserLocaleInterceptor"/>
|
||||
<bean id="requestInterceptor" class="com.wisemapping.filter.RequestPropertiesInterceptor"/>
|
||||
</mvc:interceptors>
|
||||
|
||||
<!-- <bean id="localeResolver"-->
|
||||
<!-- class="org.springframework.web.servlet.i18n.SessionLocaleResolver">-->
|
||||
<!-- </bean>-->
|
||||
|
||||
</beans>
|
26
wise-webapp/src/main/resources/spring/wisemapping.xml
Normal file
26
wise-webapp/src/main/resources/spring/wisemapping.xml
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<import resource="wisemapping-dao.xml"/>
|
||||
<import resource="wisemapping-aop.xml"/>
|
||||
|
||||
<import resource="wisemapping-model.xml"/>
|
||||
<import resource="wisemapping-service.xml"/>
|
||||
|
||||
<import resource="wisemapping-rest.xml"/>
|
||||
<import resource="wisemapping-servlet.xml"/>
|
||||
<import resource="wisemapping-datasource.xml"/>
|
||||
<import resource="wisemapping-security-db.xml"/>
|
||||
</beans>
|
@ -90,29 +90,29 @@
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>mvc-servlet</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-servlet.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<!-- <servlet>-->
|
||||
<!-- <servlet-name>mvc-servlet</servlet-name>-->
|
||||
<!-- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>-->
|
||||
<!-- <init-param>-->
|
||||
<!-- <param-name>contextConfigLocation</param-name>-->
|
||||
<!-- <param-value>-->
|
||||
<!-- /WEB-INF/wisemapping-servlet.xml-->
|
||||
<!-- </param-value>-->
|
||||
<!-- </init-param>-->
|
||||
<!-- <load-on-startup>1</load-on-startup>-->
|
||||
<!-- </servlet>-->
|
||||
|
||||
<servlet>
|
||||
<servlet-name>mvc-rest</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-rest.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
</servlet>
|
||||
<!-- <servlet>-->
|
||||
<!-- <servlet-name>mvc-rest</servlet-name>-->
|
||||
<!-- <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>-->
|
||||
<!-- <init-param>-->
|
||||
<!-- <param-name>contextConfigLocation</param-name>-->
|
||||
<!-- <param-value>-->
|
||||
<!-- /WEB-INF/wisemapping-rest.xml-->
|
||||
<!-- </param-value>-->
|
||||
<!-- </init-param>-->
|
||||
<!-- <load-on-startup>1</load-on-startup>-->
|
||||
<!-- </servlet>-->
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>mvc-servlet</servlet-name>
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="wiseDataSource" class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close">
|
||||
<property name="driverClassName" value="${database.driver}"/>
|
||||
<property name="url" value="${database.url}"/>
|
||||
<property name="username" value="${database.username}"/>
|
||||
<property name="password" value="${database.password}"/>
|
||||
<property name="testOnBorrow" value="${database.validation.enabled:true}"/>
|
||||
<property name="defaultQueryTimeout" value="15"/>
|
||||
<property name="maxTotal" value="100"/>
|
||||
<property name="maxIdle" value="30"/>
|
||||
<property name="initialSize" value="5"/>
|
||||
<property name="maxWaitMillis" value="10000"/>
|
||||
<property name="validationQuery" value="${database.validation.query:SELECT 1}"/>
|
||||
</bean>
|
||||
|
||||
<!-- Optional configuration for external connexion pool -->
|
||||
<!-- <bean id="wiseDataSource" class="org.springframework.jndi.JndiObjectFactoryBean" >-->
|
||||
<!-- <property name="jndiName">-->
|
||||
<!-- <value>java:comp/env/jdbc/wisemapping</value>-->
|
||||
<!-- </property>-->
|
||||
<!-- </bean>-->
|
||||
</beans>
|
@ -1,64 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--suppress SpringModelInspection -->
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
||||
|
||||
<context:component-scan base-package="com.wisemapping.rest"/>
|
||||
<context:annotation-config/>
|
||||
|
||||
<mvc:annotation-driven>
|
||||
<mvc:message-converters>
|
||||
<bean class="com.wisemapping.rest.DebugMappingJacksonHttpMessageConverter"/>
|
||||
<bean class="org.springframework.http.converter.xml.Jaxb2RootElementHttpMessageConverter"/>
|
||||
</mvc:message-converters>
|
||||
</mvc:annotation-driven>
|
||||
|
||||
<bean id="contentNegotiationManager" class="org.springframework.web.accept.ContentNegotiationManagerFactoryBean">
|
||||
<property name="favorParameter" value="true"/>
|
||||
<property name="parameterName" value="mediaType"/>
|
||||
<property name="defaultContentType" value="application/json" />
|
||||
|
||||
<property name="mediaTypes">
|
||||
<map>
|
||||
<entry key="xml" value="application/xml"/>
|
||||
<entry key="json" value="application/json"/>
|
||||
</map>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
||||
<property name="contentNegotiationManager" ref="contentNegotiationManager"/>
|
||||
<property name="viewResolvers">
|
||||
<list>
|
||||
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="defaultViews">
|
||||
<list>
|
||||
<bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView">
|
||||
<property name="extractValueFromSingleKeyModel" value="true"/>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
<!-- Configuration Bean -->
|
||||
<context:property-placeholder location="/WEB-INF/app.properties" ignore-unresolvable="true"/>
|
||||
</beans>
|
@ -1,37 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns:context="http://www.springframework.org/schema/context"
|
||||
xmlns:mvc="http://www.springframework.org/schema/mvc"
|
||||
xsi:schemaLocation="
|
||||
http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context.xsd
|
||||
http://www.springframework.org/schema/mvc
|
||||
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
|
||||
|
||||
<context:component-scan base-package="com.wisemapping"/>
|
||||
<context:annotation-config/>
|
||||
<mvc:annotation-driven/>
|
||||
<context:property-placeholder location="/WEB-INF/app.properties" ignore-unresolvable="true"/>
|
||||
|
||||
<!-- Interceptors Registration -->
|
||||
<mvc:interceptors>
|
||||
<bean id="userLocaleInterceptor" class="com.wisemapping.filter.UserLocaleInterceptor"/>
|
||||
<bean id="requestInterceptor" class="com.wisemapping.filter.RequestPropertiesInterceptor"/>
|
||||
</mvc:interceptors>
|
||||
|
||||
<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="defaultEncoding" value="UTF-8"/>
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</beans>
|
Loading…
x
Reference in New Issue
Block a user