mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-21 21:57:56 +01:00
- Migrate to Spring 3.1
- Remove Acegy - Fix editor partially
This commit is contained in:
parent
2287825292
commit
5fd6ba30f5
@ -1,53 +0,0 @@
|
||||
h1. Documentation
|
||||
|
||||
h2. Architecture
|
||||
|
||||
WiseMapping has been development mainly in Java and JavaScript. The following diagram represents a high level overview of the product
|
||||
[[http://www.wisemapping.org/_/rsrc/1257718018304/documentation/architecture/Wise%20Editor%20Architecture.png]]
|
||||
|
||||
h2. Configuration
|
||||
|
||||
h3. DataBase
|
||||
|
||||
Wisemapping support a wide variety of databases, but we provide the Database’s script initialization for HSQL and MySQL Database. The initialization script are located within <WISEMAPPING_SOURCE_DIR>\trunk\wise-webapp\src\test\sql.
|
||||
|
||||
This directory contains the following 3 scripts::
|
||||
create-schemas.sql: Contains all the SQL statement to create the Wisemapping’s tables.
|
||||
drop-schemas.sql:Contains all the SQL statement to drop all the Wisemapping database.
|
||||
test-data.sql: This script creates a sample data and the test user called test@wisemapping.com and password test.
|
||||
MySQL
|
||||
|
||||
h4. Create Database User
|
||||
|
||||
Using the MySQL Databse Tools run the following command in order to create the database user.
|
||||
|
||||
CREATE DATABASE wisemapping CHARACTER SET='utf8' COLLATE='utf8_unicode_ci';
|
||||
CREATE USER 'wisemapping'@'localhost' IDENTIFIED BY 'd0ndu3nd3';
|
||||
GRANT ALL ON wisemapping.* TO 'wisemapping'@'localhost';
|
||||
|
||||
h3. Configuration
|
||||
|
||||
You can configure Wisemapping through the following file:
|
||||
|
||||
wise-webapp\src\main\webapp\WEB-INF\app.properties.
|
||||
|
||||
This property file contains all the properties to configure the database, mail and other resources used by Wisemapping.
|
||||
|
||||
Property -> Description
|
||||
* database.url -> The Database URL(Ex. dbc:hsqldb:file:target/db/wisemapping)
|
||||
* database.driver-> The Database Driver.(Ex. org.hsqldb.jdbcDriver)
|
||||
* database.hibernate.dialect -> The Database dialect. This value is used by Spring DB.(Ex. org.hibernate.dialect.HSQLDialect)
|
||||
* database.username -> The database username
|
||||
* database.password -> The database password
|
||||
* mail.smtp.socketFactory.port -> The mail port to send email
|
||||
* mail.host -> The email server host
|
||||
* mail.user -> The mail username
|
||||
* mail.password -> The mail password
|
||||
* mail.registrationEmail -> The email used as FROM in the registration emails.
|
||||
* mail.siteEmail -> The email used as FROM in the notification emails.
|
||||
|
||||
h3. Logging Properties
|
||||
|
||||
WiseMapping uses Log4J to log all the events. The configuration file is located in :
|
||||
|
||||
<WISEMAPPING_DIR>\wise-webapp\src\main\webapp\WEB-INF\classes
|
@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>web2d</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<!-- <dependency>
|
||||
|
7
pom.xml
7
pom.xml
@ -2,6 +2,11 @@
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
|
||||
<properties>
|
||||
<com.wisemapping.version>3.0-SNAPSHOT</com.wisemapping.version>
|
||||
</properties>
|
||||
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wisemapping</artifactId>
|
||||
@ -83,5 +88,7 @@
|
||||
<module>wise-webapp</module>
|
||||
<module>wise-editor</module>
|
||||
</modules>
|
||||
|
||||
|
||||
</project>
|
||||
|
||||
|
@ -16,13 +16,13 @@
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>core-js</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>mindplot</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@ -40,7 +40,7 @@
|
||||
<maxIdleTime>60000</maxIdleTime>
|
||||
</connector>
|
||||
</connectors>
|
||||
<webApp>${project.build.directory}/wise-editor-3.0-SNAPSHOT.war</webApp>
|
||||
<webApp>${project.build.directory}/wise-editor-${com.wisemapping.version}.war</webApp>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
@ -27,24 +27,29 @@
|
||||
</repository>
|
||||
</repositories>
|
||||
|
||||
<properties>
|
||||
<org.springframework.version>3.1.0.RELEASE</org.springframework.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>core-js</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wise-editor</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>provided</scope>
|
||||
<type>war</type>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>mindplot</artifactId>
|
||||
<version>3.0-SNAPSHOT</version>
|
||||
<version>${com.wisemapping.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -69,13 +74,35 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc-struts</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<artifactId>spring-web</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-struts</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-oxm</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
<version>2.7.6</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -83,17 +110,35 @@
|
||||
<artifactId>struts-tiles</artifactId>
|
||||
<version>1.3.8</version>
|
||||
<scope>runtime</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>antlr</groupId>
|
||||
<artifactId>antlr</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-orm</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-web</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-config</artifactId>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -111,25 +156,13 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
<version>2.5.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-ws-support</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.ws</groupId>
|
||||
<artifactId>spring-ws-core-tiger</artifactId>
|
||||
<version>1.5.6</version>
|
||||
<version>${org.springframework.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate</artifactId>
|
||||
<version>3.1.3</version>
|
||||
<artifactId>hibernate-entitymanager</artifactId>
|
||||
<version>3.6.0.Final</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -168,46 +201,6 @@
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.acegisecurity</groupId>
|
||||
<artifactId>acegi-security</artifactId>
|
||||
<version>1.0.7</version>
|
||||
<scope>compile</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-aop</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-beans</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-dao</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-jdbc</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-support</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-remoting</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
<artifactId>servlet-api</artifactId>
|
||||
@ -352,13 +345,15 @@
|
||||
<groupId>org.wisemapping</groupId>
|
||||
<artifactId>wise-editor</artifactId>
|
||||
<type>war</type>
|
||||
<targetPath>css</targetPath>
|
||||
<targetPath>/</targetPath>
|
||||
<includes>
|
||||
<include>**/*.css</include>
|
||||
<include>**/*.jpg</include>
|
||||
<include>**/*.png</include>
|
||||
<include>**/*.gif</include>
|
||||
<include>**/*.ico</include>
|
||||
<include>**/*.jpg</include>
|
||||
<include>**/*.less</include>
|
||||
<include>js/editor.js</include>
|
||||
</includes>
|
||||
</overlay>
|
||||
<overlay>
|
||||
@ -404,37 +399,6 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>net.sf.alchim</groupId>
|
||||
<artifactId>yuicompressor-maven-plugin</artifactId>
|
||||
<version>0.7.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>wiseEditorLibrary</id>
|
||||
<phase>generate-resources</phase>
|
||||
<goals>
|
||||
<goal>compress</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<aggregations>
|
||||
<aggregation>
|
||||
<output>
|
||||
${project.build.directory}/${project.build.finalName}/js/editorLib.js
|
||||
</output>
|
||||
<includes>
|
||||
<include>help.js</include>
|
||||
<include>Panel.js</include>
|
||||
</includes>
|
||||
</aggregation>
|
||||
</aggregations>
|
||||
<nosuffix>true</nosuffix>
|
||||
<nomunge>true</nomunge>
|
||||
<jswarn>false</jswarn>
|
||||
<statistics>false</statistics>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
@ -450,17 +414,10 @@
|
||||
|
||||
<plugin>
|
||||
<groupId>org.mortbay.jetty</groupId>
|
||||
<artifactId>maven-jetty-plugin</artifactId>
|
||||
<version>6.1.26</version>
|
||||
<artifactId>jetty-maven-plugin</artifactId>
|
||||
<version>8.1.0.v20120127</version>
|
||||
<configuration>
|
||||
<scanIntervalSeconds>10</scanIntervalSeconds>
|
||||
<connectors>
|
||||
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
|
||||
<port>8080</port>
|
||||
<maxIdleTime>60000</maxIdleTime>
|
||||
</connector>
|
||||
</connectors>
|
||||
<webApp>${project.build.directory}/wisemapping.war</webApp>
|
||||
<war>${project.build.directory}/wisemapping.war</war>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
|
@ -1,142 +1,142 @@
|
||||
/*
|
||||
* 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.dao;
|
||||
|
||||
import com.wisemapping.model.Colaborator;
|
||||
import com.wisemapping.model.MindmapUser;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.model.UserLogin;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class UserManagerImpl
|
||||
extends HibernateDaoSupport
|
||||
implements UserManager {
|
||||
|
||||
private PasswordEncoder passwordEncoder;
|
||||
|
||||
public void setPasswordEncoder(PasswordEncoder passwordEncoder)
|
||||
{
|
||||
this.passwordEncoder = passwordEncoder;
|
||||
}
|
||||
|
||||
public List<User> getAllUsers() {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.User user");
|
||||
}
|
||||
|
||||
public User getUserBy(final String email) {
|
||||
final User user;
|
||||
final List users = 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 = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
public Colaborator getColaboratorBy(final String email) {
|
||||
final Colaborator cola;
|
||||
final List cols = getHibernateTemplate().find("from com.wisemapping.model.Colaborator colaborator where email=?", email);
|
||||
if (cols != null && !cols.isEmpty()) {
|
||||
assert cols.size() == 1 : "More than one colaborator with the same email!";
|
||||
cola = (Colaborator) cols.get(0);
|
||||
} else {
|
||||
cola = null;
|
||||
}
|
||||
return cola;
|
||||
}
|
||||
|
||||
public User getUserBy(long id)
|
||||
{
|
||||
return (User)getHibernateTemplate().get(User.class,id);
|
||||
}
|
||||
|
||||
public User getUserByUsername(String username) {
|
||||
final User user;
|
||||
final List users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where username=?", username);
|
||||
if (users != null && !users.isEmpty()) {
|
||||
assert users.size() == 1 : "More than one user with the same username!";
|
||||
user = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
public boolean authenticate(final String email, final String password) {
|
||||
final boolean result;
|
||||
final User user = getUserBy(email);
|
||||
result = user != null && user.getPassword().equals(password);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void createUser(User user) {
|
||||
assert user != null : "Trying to store a null user";
|
||||
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
getHibernateTemplate().saveOrUpdate(user);
|
||||
}
|
||||
|
||||
public User createUser(User user, Colaborator col)
|
||||
{
|
||||
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
assert user != null : "Trying to store a null user";
|
||||
|
||||
final Set<MindmapUser> set = col.getMindmapUsers();
|
||||
for (MindmapUser mindmapUser : set) {
|
||||
MindmapUser newMapUser = new MindmapUser();
|
||||
newMapUser.setRoleId(mindmapUser.getRole().ordinal());
|
||||
newMapUser.setMindMap(mindmapUser.getMindMap());
|
||||
newMapUser.setColaborator(user);
|
||||
user.addMindmapUser(newMapUser);
|
||||
}
|
||||
|
||||
getHibernateTemplate().delete(col);
|
||||
getHibernateTemplate().flush();
|
||||
getHibernateTemplate().saveOrUpdate(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
public void auditLogin(UserLogin userLogin) {
|
||||
assert userLogin != null : "userLogin is null";
|
||||
getHibernateTemplate().save(userLogin);
|
||||
}
|
||||
|
||||
public void updateUser(User user) {
|
||||
assert user != null : "user is null";
|
||||
user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
getHibernateTemplate().update(user);
|
||||
}
|
||||
|
||||
public User getUserByActivationCode(long code) {
|
||||
final User user;
|
||||
final List users = getHibernateTemplate().find("from com.wisemapping.model.User user where activationCode=?", code);
|
||||
if (users != null && !users.isEmpty()) {
|
||||
assert users.size() == 1 : "More than one user with the same username!";
|
||||
user = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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.dao;
|
||||
|
||||
import com.wisemapping.model.Colaborator;
|
||||
import com.wisemapping.model.MindmapUser;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.model.UserLogin;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
//import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class UserManagerImpl
|
||||
extends HibernateDaoSupport
|
||||
implements UserManager {
|
||||
|
||||
// private PasswordEncoder passwordEncoder;
|
||||
//
|
||||
// public void setEncoder(PasswordEncoder passwordEncoder)
|
||||
// {
|
||||
// this.passwordEncoder = passwordEncoder;
|
||||
// }
|
||||
|
||||
public List<User> getAllUsers() {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.User user");
|
||||
}
|
||||
|
||||
public User getUserBy(final String email) {
|
||||
final User user;
|
||||
final List users = 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 = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
public Colaborator getColaboratorBy(final String email) {
|
||||
final Colaborator cola;
|
||||
final List cols = getHibernateTemplate().find("from com.wisemapping.model.Colaborator colaborator where email=?", email);
|
||||
if (cols != null && !cols.isEmpty()) {
|
||||
assert cols.size() == 1 : "More than one colaborator with the same email!";
|
||||
cola = (Colaborator) cols.get(0);
|
||||
} else {
|
||||
cola = null;
|
||||
}
|
||||
return cola;
|
||||
}
|
||||
|
||||
public User getUserBy(long id)
|
||||
{
|
||||
return (User)getHibernateTemplate().get(User.class,id);
|
||||
}
|
||||
|
||||
public User getUserByUsername(String username) {
|
||||
final User user;
|
||||
final List users = getHibernateTemplate().find("from com.wisemapping.model.User colaborator where username=?", username);
|
||||
if (users != null && !users.isEmpty()) {
|
||||
assert users.size() == 1 : "More than one user with the same username!";
|
||||
user = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
|
||||
public boolean authenticate(final String email, final String password) {
|
||||
final boolean result;
|
||||
final User user = getUserBy(email);
|
||||
result = user != null && user.getPassword().equals(password);
|
||||
return result;
|
||||
}
|
||||
|
||||
public void createUser(User user) {
|
||||
assert user != null : "Trying to store a null user";
|
||||
// user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
getHibernateTemplate().saveOrUpdate(user);
|
||||
}
|
||||
|
||||
public User createUser(User user, Colaborator col)
|
||||
{
|
||||
// user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
assert user != null : "Trying to store a null user";
|
||||
|
||||
final Set<MindmapUser> set = col.getMindmapUsers();
|
||||
for (MindmapUser mindmapUser : set) {
|
||||
MindmapUser newMapUser = new MindmapUser();
|
||||
newMapUser.setRoleId(mindmapUser.getRole().ordinal());
|
||||
newMapUser.setMindMap(mindmapUser.getMindMap());
|
||||
newMapUser.setColaborator(user);
|
||||
user.addMindmapUser(newMapUser);
|
||||
}
|
||||
|
||||
getHibernateTemplate().delete(col);
|
||||
getHibernateTemplate().flush();
|
||||
getHibernateTemplate().saveOrUpdate(user);
|
||||
return user;
|
||||
}
|
||||
|
||||
public void auditLogin(UserLogin userLogin) {
|
||||
assert userLogin != null : "userLogin is null";
|
||||
getHibernateTemplate().save(userLogin);
|
||||
}
|
||||
|
||||
public void updateUser(User user) {
|
||||
assert user != null : "user is null";
|
||||
// user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
getHibernateTemplate().update(user);
|
||||
}
|
||||
|
||||
public User getUserByActivationCode(long code) {
|
||||
final User user;
|
||||
final List users = getHibernateTemplate().find("from com.wisemapping.model.User user where activationCode=?", code);
|
||||
if (users != null && !users.isEmpty()) {
|
||||
assert users.size() == 1 : "More than one user with the same username!";
|
||||
user = (User) users.get(0);
|
||||
} else {
|
||||
user = null;
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
|
@ -1,140 +1,142 @@
|
||||
/*
|
||||
* 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.model;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
public class User
|
||||
extends Colaborator
|
||||
implements Serializable
|
||||
{
|
||||
|
||||
private String firstname;
|
||||
private String lastname;
|
||||
private String password;
|
||||
private long activationCode;
|
||||
private Calendar activationDate;
|
||||
private String username;
|
||||
private Set<String> tags = new HashSet<String>();
|
||||
private boolean allowSendEmail = false;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public void setTags(Set<String> tags)
|
||||
{
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Set<String> getTags()
|
||||
{
|
||||
return tags;
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return activationDate != null;
|
||||
}
|
||||
|
||||
public void setActivationCode(long code) {
|
||||
this.activationCode = code;
|
||||
}
|
||||
|
||||
public long getActivationCode() {
|
||||
return activationCode;
|
||||
}
|
||||
|
||||
public void setActivationDate(Calendar date) {
|
||||
this.activationDate = date;
|
||||
}
|
||||
|
||||
public Calendar getActivationDate() {
|
||||
return activationDate;
|
||||
}
|
||||
|
||||
public boolean isAllowSendEmail()
|
||||
{
|
||||
return allowSendEmail;
|
||||
}
|
||||
|
||||
public void setAllowSendEmail(boolean allowSendEmail)
|
||||
{
|
||||
this.allowSendEmail = allowSendEmail;
|
||||
}
|
||||
|
||||
public boolean getAllowSendEmail()
|
||||
{
|
||||
return allowSendEmail;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
final User user = (User) o;
|
||||
|
||||
if (!getEmail().equals(user.getEmail())) return false;
|
||||
if (firstname != null ? !firstname.equals(user.firstname) : user.firstname != null) return false;
|
||||
if (lastname != null ? !lastname.equals(user.lastname) : user.lastname != null) return false;
|
||||
if (password != null ? !password.equals(user.password) : user.password != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = (firstname != null ? firstname.hashCode() : 0);
|
||||
result = 29 * result + (lastname != null ? lastname.hashCode() : 0);
|
||||
result = 29 * result + (password != null ? password.hashCode() : 0);
|
||||
result = 29 * result + getEmail().hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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.model;
|
||||
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
@XmlRootElement(name="user")
|
||||
public class User
|
||||
extends Colaborator
|
||||
implements Serializable
|
||||
{
|
||||
|
||||
private String firstname;
|
||||
private String lastname;
|
||||
private String password;
|
||||
private long activationCode;
|
||||
private Calendar activationDate;
|
||||
private String username;
|
||||
private Set<String> tags = new HashSet<String>();
|
||||
private boolean allowSendEmail = false;
|
||||
|
||||
public User() {
|
||||
}
|
||||
|
||||
public void setTags(Set<String> tags)
|
||||
{
|
||||
this.tags = tags;
|
||||
}
|
||||
|
||||
public Set<String> getTags()
|
||||
{
|
||||
return tags;
|
||||
}
|
||||
|
||||
public String getFirstname() {
|
||||
return firstname;
|
||||
}
|
||||
|
||||
public void setFirstname(String firstname) {
|
||||
this.firstname = firstname;
|
||||
}
|
||||
|
||||
public String getLastname() {
|
||||
return lastname;
|
||||
}
|
||||
|
||||
public void setLastname(String lastname) {
|
||||
this.lastname = lastname;
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return password;
|
||||
}
|
||||
|
||||
public void setPassword(String password) {
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return activationDate != null;
|
||||
}
|
||||
|
||||
public void setActivationCode(long code) {
|
||||
this.activationCode = code;
|
||||
}
|
||||
|
||||
public long getActivationCode() {
|
||||
return activationCode;
|
||||
}
|
||||
|
||||
public void setActivationDate(Calendar date) {
|
||||
this.activationDate = date;
|
||||
}
|
||||
|
||||
public Calendar getActivationDate() {
|
||||
return activationDate;
|
||||
}
|
||||
|
||||
public boolean isAllowSendEmail()
|
||||
{
|
||||
return allowSendEmail;
|
||||
}
|
||||
|
||||
public void setAllowSendEmail(boolean allowSendEmail)
|
||||
{
|
||||
this.allowSendEmail = allowSendEmail;
|
||||
}
|
||||
|
||||
public boolean getAllowSendEmail()
|
||||
{
|
||||
return allowSendEmail;
|
||||
}
|
||||
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
final User user = (User) o;
|
||||
|
||||
if (!getEmail().equals(user.getEmail())) return false;
|
||||
if (firstname != null ? !firstname.equals(user.firstname) : user.firstname != null) return false;
|
||||
if (lastname != null ? !lastname.equals(user.lastname) : user.lastname != null) return false;
|
||||
if (password != null ? !password.equals(user.password) : user.password != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
int result;
|
||||
result = (firstname != null ? firstname.hashCode() : 0);
|
||||
result = 29 * result + (lastname != null ? lastname.hashCode() : 0);
|
||||
result = 29 * result + (password != null ? password.hashCode() : 0);
|
||||
result = 29 * result + getEmail().hashCode();
|
||||
return result;
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return username;
|
||||
}
|
||||
|
||||
public void setUsername(String username) {
|
||||
this.username = username;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.wisemapping.rest;
|
||||
|
||||
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@Controller
|
||||
public class UserController {
|
||||
private Jaxb2Marshaller jaxb2Mashaller;
|
||||
|
||||
public void setJaxb2Mashaller(@NotNull final Jaxb2Marshaller jaxb2Mashaller) {
|
||||
this.jaxb2Mashaller = jaxb2Mashaller;
|
||||
}
|
||||
|
||||
private static final String XML_VIEW_NAME = "users";
|
||||
|
||||
@RequestMapping(method = RequestMethod.GET, value = "/employee/{id}")
|
||||
public ModelAndView getEmployee(@PathVariable String id) {
|
||||
User user = new User();
|
||||
return new ModelAndView(XML_VIEW_NAME, "object", user);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -1,30 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.AuthenticationException;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public interface AuthenticationHandler
|
||||
{
|
||||
|
||||
AuthenticationToken getAuthenticationToken(HttpServletRequest request) throws AuthenticationException;
|
||||
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
package com.wisemapping.security;
|
||||
|
||||
|
||||
import com.wisemapping.dao.UserManager;
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
import org.springframework.security.authentication.BadCredentialsException;
|
||||
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
|
||||
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.AuthenticationException;
|
||||
|
||||
|
||||
public class AuthenticationProvider implements org.springframework.security.authentication.AuthenticationProvider {
|
||||
private UserManager userManager;
|
||||
|
||||
private PasswordEncoder encoder;
|
||||
|
||||
@Override
|
||||
public Authentication authenticate(@NotNull final Authentication auth) throws AuthenticationException {
|
||||
|
||||
// All your user authentication needs
|
||||
final String email = auth.getName();
|
||||
final User user = userManager.getUserBy(email);
|
||||
final String credentials = (String) auth.getCredentials();
|
||||
if (user == null || credentials == null || !encoder.isPasswordValid(user.getPassword(), credentials, null)) {
|
||||
throw new BadCredentialsException("Username/Password does not match for " + auth.getPrincipal());
|
||||
}
|
||||
|
||||
final UserDetails userDetails = new UserDetails(user);
|
||||
return new UsernamePasswordAuthenticationToken(userDetails, credentials, userDetails.getAuthorities());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(final Class<? extends Object> authentication) {
|
||||
return (UsernamePasswordAuthenticationToken.class.isAssignableFrom(authentication));
|
||||
}
|
||||
|
||||
public void setEncoder(@NotNull PasswordEncoder encoder) {
|
||||
this.encoder = encoder;
|
||||
}
|
||||
|
||||
public void setUserManager(UserManager userManager) {
|
||||
this.userManager = userManager;
|
||||
}
|
||||
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
public class AuthenticationToken
|
||||
{
|
||||
private String username;
|
||||
private String password;
|
||||
|
||||
public AuthenticationToken(String username,String password)
|
||||
{
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public String getUsername()
|
||||
{
|
||||
return username;
|
||||
}
|
||||
|
||||
public String getPassword()
|
||||
{
|
||||
return password;
|
||||
}
|
||||
}
|
@ -1,59 +1,57 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
public class CustomPasswordEncoder
|
||||
implements PasswordEncoder
|
||||
{
|
||||
private PasswordEncoder delegateEncoder;
|
||||
private static final String ENC_PREFIX = "ENC:";
|
||||
|
||||
public void setDelegatedEncoder(PasswordEncoder delegateEncoder)
|
||||
{
|
||||
this.delegateEncoder = delegateEncoder;
|
||||
}
|
||||
|
||||
public String encodePassword(String rawPass, Object salt) throws DataAccessException {
|
||||
|
||||
String password = rawPass;
|
||||
if (!rawPass.startsWith(ENC_PREFIX))
|
||||
{
|
||||
password = ENC_PREFIX + delegateEncoder.encodePassword(rawPass,salt);
|
||||
}
|
||||
|
||||
return password;
|
||||
}
|
||||
|
||||
public boolean isPasswordValid(String encPass, String rawPass, Object salt) throws DataAccessException {
|
||||
|
||||
String pass1 = "" + encPass;
|
||||
String pass2 = rawPass;
|
||||
|
||||
if (pass1.startsWith(ENC_PREFIX))
|
||||
{
|
||||
|
||||
pass2 = encodePassword(rawPass, salt);
|
||||
}
|
||||
|
||||
return pass1.equals(pass2);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.security.authentication.encoding.PasswordEncoder;
|
||||
import org.springframework.security.authentication.encoding.ShaPasswordEncoder;
|
||||
|
||||
public class CustomPasswordEncoder
|
||||
implements PasswordEncoder
|
||||
{
|
||||
private PasswordEncoder delegateEncoder = new ShaPasswordEncoder();
|
||||
|
||||
private static final String ENC_PREFIX = "ENC:";
|
||||
|
||||
public String encodePassword(@NotNull String rawPass, @Nullable Object salt) throws DataAccessException {
|
||||
|
||||
String password = rawPass;
|
||||
if (!rawPass.startsWith(ENC_PREFIX))
|
||||
{
|
||||
password = ENC_PREFIX + delegateEncoder.encodePassword(rawPass,salt);
|
||||
}
|
||||
|
||||
return password;
|
||||
}
|
||||
|
||||
public boolean isPasswordValid(@NotNull String encPass, @NotNull String rawPass, Object salt) throws DataAccessException {
|
||||
|
||||
String pass1 = "" + encPass;
|
||||
String pass2 = rawPass;
|
||||
|
||||
if (pass1.startsWith(ENC_PREFIX))
|
||||
{
|
||||
|
||||
pass2 = encodePassword(rawPass, salt);
|
||||
}
|
||||
return pass1.equals(pass2);
|
||||
}
|
||||
}
|
||||
|
@ -1,40 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices;
|
||||
import org.acegisecurity.Authentication;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
public class CustomTokenBasedRememberMeServices extends
|
||||
TokenBasedRememberMeServices {
|
||||
public void logout(HttpServletRequest request, HttpServletResponse response, Authentication authentication)
|
||||
{
|
||||
if(authentication!=null)
|
||||
super.logout(request, response, authentication);
|
||||
else
|
||||
{
|
||||
logger.debug("Session Already Expired. Authentication is null");
|
||||
response.addCookie(makeCancelCookie(request));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -1,52 +1,50 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import com.wisemapping.dao.UserManager;
|
||||
import org.acegisecurity.userdetails.UserDetailsService;
|
||||
import org.acegisecurity.userdetails.UsernameNotFoundException;
|
||||
import org.acegisecurity.userdetails.UserDetails;
|
||||
import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
import org.acegisecurity.providers.encoding.Md5PasswordEncoder;
|
||||
import org.acegisecurity.providers.dao.SaltSource;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
|
||||
public class DatabaseUserDetailService
|
||||
implements UserDetailsService {
|
||||
private UserManager userManager;
|
||||
|
||||
public UserDetails loadUserByUsername(String email) throws UsernameNotFoundException, DataAccessException {
|
||||
final com.wisemapping.model.User model = userManager.getUserBy(email);
|
||||
|
||||
if (model != null) {
|
||||
return new User(model);
|
||||
} else {
|
||||
throw new UsernameNotFoundException(email);
|
||||
}
|
||||
}
|
||||
|
||||
public UserManager getUserManager() {
|
||||
return userManager;
|
||||
}
|
||||
|
||||
public void setUserManager(UserManager userManager) {
|
||||
this.userManager = userManager;
|
||||
}
|
||||
|
||||
}
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import com.wisemapping.dao.UserManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.security.core.userdetails.UserDetailsService;
|
||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||
|
||||
public class DatabaseUserDetailService
|
||||
implements UserDetailsService {
|
||||
private UserManager userManager;
|
||||
|
||||
@Override
|
||||
public UserDetails loadUserByUsername(@NotNull String email) throws UsernameNotFoundException, DataAccessException {
|
||||
final com.wisemapping.model.User model = userManager.getUserBy(email);
|
||||
|
||||
if (model != null) {
|
||||
return new UserDetails(model);
|
||||
} else {
|
||||
throw new UsernameNotFoundException(email);
|
||||
}
|
||||
}
|
||||
|
||||
public UserManager getUserManager() {
|
||||
return userManager;
|
||||
}
|
||||
|
||||
public void setUserManager(UserManager userManager) {
|
||||
this.userManager = userManager;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.AuthenticationException;
|
||||
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
public class DefaultAuthenticationHandler
|
||||
implements AuthenticationHandler
|
||||
{
|
||||
public AuthenticationToken getAuthenticationToken(HttpServletRequest request)
|
||||
throws AuthenticationException
|
||||
{
|
||||
String username = request.getParameter(AuthenticationProcessingFilter.ACEGI_SECURITY_FORM_USERNAME_KEY);
|
||||
String password = request.getParameter(AuthenticationProcessingFilter.ACEGI_SECURITY_FORM_PASSWORD_KEY);
|
||||
if (username == null) {
|
||||
username = "";
|
||||
}
|
||||
|
||||
if (password == null) {
|
||||
password = "";
|
||||
}
|
||||
return new AuthenticationToken(username,password);
|
||||
}
|
||||
}
|
@ -1,67 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.userdetails.UserDetails;
|
||||
import org.acegisecurity.GrantedAuthority;
|
||||
import org.acegisecurity.GrantedAuthorityImpl;
|
||||
|
||||
public class User implements UserDetails {
|
||||
private com.wisemapping.model.User model;
|
||||
|
||||
public User(com.wisemapping.model.User model) {
|
||||
this.model = model;
|
||||
}
|
||||
|
||||
public GrantedAuthority[] getAuthorities() {
|
||||
return new GrantedAuthority[]{new GrantedAuthorityImpl("ROLE_USER")};
|
||||
}
|
||||
|
||||
public String getPassword() {
|
||||
return model.getPassword();
|
||||
}
|
||||
|
||||
public String getUsername() {
|
||||
return model.getEmail();
|
||||
}
|
||||
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isAccountNonLocked() {
|
||||
return this.model.isActive();
|
||||
}
|
||||
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.model.isActive();
|
||||
}
|
||||
|
||||
public com.wisemapping.model.User getModel() {
|
||||
return model;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return model.getFirstname();
|
||||
}
|
||||
}
|
@ -0,0 +1,77 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.core.GrantedAuthority;
|
||||
import org.springframework.security.core.authority.SimpleGrantedAuthority;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
public class UserDetails implements org.springframework.security.core.userdetails.UserDetails {
|
||||
private com.wisemapping.model.User user;
|
||||
|
||||
public UserDetails(@NotNull final com.wisemapping.model.User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Collection<? extends GrantedAuthority> getAuthorities() {
|
||||
final SimpleGrantedAuthority role_user = new SimpleGrantedAuthority("ROLE_USER");
|
||||
final Collection<GrantedAuthority> result = new ArrayList<GrantedAuthority>();
|
||||
result.add(role_user);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPassword() {
|
||||
return user.getPassword();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsername() {
|
||||
return user.getEmail();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAccountNonLocked() {
|
||||
return this.user.isActive();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCredentialsNonExpired() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEnabled() {
|
||||
return this.user.isActive();
|
||||
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return user;
|
||||
}
|
||||
}
|
@ -1,58 +1,56 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import com.wisemapping.model.User;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.acegisecurity.providers.AbstractAuthenticationToken;
|
||||
import org.acegisecurity.context.SecurityContextHolder;
|
||||
import org.acegisecurity.Authentication;
|
||||
|
||||
|
||||
public class Utils {
|
||||
private Utils() {
|
||||
}
|
||||
|
||||
public static User getUser(final HttpServletRequest request) {
|
||||
|
||||
final AbstractAuthenticationToken token = (AbstractAuthenticationToken) request.getUserPrincipal();
|
||||
User result = null;
|
||||
if (token != null) {
|
||||
final com.wisemapping.security.User user = (com.wisemapping.security.User) token.getPrincipal();
|
||||
result = user.getModel();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static User getUser()
|
||||
{
|
||||
User user = null;
|
||||
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null && auth.getDetails() != null)
|
||||
{
|
||||
final Object principal = auth.getPrincipal();
|
||||
if (principal != null && principal instanceof com.wisemapping.security.User) {
|
||||
user = ((com.wisemapping.security.User)principal).getModel();
|
||||
}
|
||||
}
|
||||
return user;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import com.wisemapping.model.User;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.security.authentication.AbstractAuthenticationToken;
|
||||
import org.springframework.security.core.Authentication;
|
||||
import org.springframework.security.core.context.SecurityContextHolder;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
final public class Utils {
|
||||
private Utils() {
|
||||
}
|
||||
|
||||
public static User getUser(@NotNull final HttpServletRequest request) {
|
||||
|
||||
final AbstractAuthenticationToken token = (AbstractAuthenticationToken) request.getUserPrincipal();
|
||||
User result = null;
|
||||
if (token != null) {
|
||||
final UserDetails userDetails = (UserDetails) token.getPrincipal();
|
||||
result = userDetails.getUser();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static User getUser() {
|
||||
User result = null;
|
||||
final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null && auth.getDetails() != null)
|
||||
{
|
||||
final Object principal = auth.getPrincipal();
|
||||
if (principal != null && principal instanceof UserDetails) {
|
||||
result = ((UserDetails)principal).getUser();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@ -1,66 +0,0 @@
|
||||
/*
|
||||
* 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.security;
|
||||
|
||||
import org.acegisecurity.Authentication;
|
||||
import org.acegisecurity.AuthenticationException;
|
||||
import org.acegisecurity.providers.UsernamePasswordAuthenticationToken;
|
||||
import org.acegisecurity.ui.webapp.AuthenticationProcessingFilter;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
|
||||
public class WiseAuthenticationProcessingFilter
|
||||
extends AuthenticationProcessingFilter
|
||||
{
|
||||
public static final String ACEGI_SECURITY_FORM_SSO_ID_KEY = "j_sso_id";
|
||||
|
||||
private AuthenticationHandler authenticationHandler;
|
||||
|
||||
public void setAuthenticationHandler(AuthenticationHandler ssoAuthenticationHandler)
|
||||
{
|
||||
this.authenticationHandler = ssoAuthenticationHandler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Authentication attemptAuthentication(HttpServletRequest request)
|
||||
throws AuthenticationException
|
||||
{
|
||||
|
||||
final AuthenticationToken ssoToken = authenticationHandler.getAuthenticationToken(request);
|
||||
|
||||
final UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken(ssoToken.getUsername(), ssoToken.getPassword());
|
||||
|
||||
// Place the last username attempted into HttpSession for views
|
||||
request.getSession().setAttribute(ACEGI_SECURITY_LAST_USERNAME_KEY, ssoToken.getUsername());
|
||||
|
||||
// Allow subclasses to set the "details" property
|
||||
setDetails(request, authRequest);
|
||||
|
||||
return this.getAuthenticationManager().authenticate(authRequest);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onPreAuthentication(HttpServletRequest request, HttpServletResponse response)
|
||||
throws AuthenticationException, IOException
|
||||
{
|
||||
assert request != null;
|
||||
}
|
||||
}
|
24
wise-webapp/src/main/webapp/WEB-INF/jsp-rest/users.jsp
Normal file
24
wise-webapp/src/main/webapp/WEB-INF/jsp-rest/users.jsp
Normal file
@ -0,0 +1,24 @@
|
||||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
||||
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>Employees</title>
|
||||
</head>
|
||||
<body>
|
||||
<table border=1>
|
||||
<thead><tr>
|
||||
<th>ID</th>
|
||||
<th>Name</th>
|
||||
<th>Email</th>
|
||||
</tr></thead>
|
||||
<%--<c:forEach var="employee" items="${employees.employees}">--%>
|
||||
<%--<tr>--%>
|
||||
<%--<td>${employee.id}</td>--%>
|
||||
<%--<td>${employee.name}</td>--%>
|
||||
<%--<td>${employee.email}</td>--%>
|
||||
<%--</tr>--%>
|
||||
<%--</c:forEach>--%>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
@ -1,128 +1,142 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<context-param>
|
||||
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
|
||||
<param-value>messages</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-security.xml
|
||||
/WEB-INF/wisemapping-dao.xml
|
||||
/WEB-INF/wisemapping-service.xml
|
||||
/WEB-INF/wisemapping-model.xml
|
||||
/WEB-INF/wisemapping-acegi-security.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
<!--
|
||||
- Loads the root application context of this web app at startup.
|
||||
- The application context is then available via
|
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>com.wisemapping.service.HibernateAppListener</listener-class>
|
||||
</listener>
|
||||
|
||||
|
||||
<filter>
|
||||
<filter-name>charsetFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>charsetFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter>
|
||||
<filter-name>hibernate</filter-name>
|
||||
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>singleSession</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>sessionFactoryBeanName</param-name>
|
||||
<param-value>mindmapSessionFactory</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>Acegi Filter Chain Proxy</filter-name>
|
||||
<filter-class>org.acegisecurity.util.FilterToBeanProxy</filter-class>
|
||||
<init-param>
|
||||
<param-name>targetClass</param-name>
|
||||
<param-value>org.acegisecurity.util.FilterChainProxy</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>Acegi Filter Chain Proxy</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>hibernate</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>wisemapping</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-servlet.xml
|
||||
/WEB-INF/wisemapping-captcha.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>debug</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>wisemapping</servlet-name>
|
||||
<url-pattern>*.htm</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<url-pattern>/dwr/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>
|
||||
index.jsp
|
||||
</welcome-file>
|
||||
</welcome-file-list>
|
||||
<session-config>
|
||||
<session-timeout>180</session-timeout>
|
||||
</session-config>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
|
||||
version="2.4">
|
||||
|
||||
<context-param>
|
||||
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
|
||||
<param-value>messages</param-value>
|
||||
</context-param>
|
||||
|
||||
<context-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-aop.xml
|
||||
/WEB-INF/wisemapping-dao.xml
|
||||
/WEB-INF/wisemapping-service.xml
|
||||
/WEB-INF/wisemapping-model.xml
|
||||
/WEB-INF/wisemapping-security.xml
|
||||
</param-value>
|
||||
</context-param>
|
||||
|
||||
|
||||
<!--
|
||||
- Loads the root application context of this web app at startup.
|
||||
- The application context is then available via
|
||||
- WebApplicationContextUtils.getWebApplicationContext(servletContext).
|
||||
-->
|
||||
<listener>
|
||||
<listener-class>com.wisemapping.service.HibernateAppListener</listener-class>
|
||||
</listener>
|
||||
|
||||
<filter>
|
||||
<filter-name>charsetFilter</filter-name>
|
||||
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>encoding</param-name>
|
||||
<param-value>UTF-8</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>forceEncoding</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>charsetFilter</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
<filter>
|
||||
<filter-name>hibernate</filter-name>
|
||||
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>singleSession</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
<init-param>
|
||||
<param-name>sessionFactoryBeanName</param-name>
|
||||
<param-value>mindmapSessionFactory</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
<filter>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
|
||||
</filter>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>springSecurityFilterChain</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<filter-mapping>
|
||||
<filter-name>hibernate</filter-name>
|
||||
<url-pattern>/*</url-pattern>
|
||||
</filter-mapping>
|
||||
|
||||
<listener>
|
||||
<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>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-servlet.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>mvc-rest</servlet-name>
|
||||
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
|
||||
<load-on-startup>1</load-on-startup>
|
||||
|
||||
<init-param>
|
||||
<param-name>contextConfigLocation</param-name>
|
||||
<param-value>
|
||||
/WEB-INF/wisemapping-rest.xml
|
||||
</param-value>
|
||||
</init-param>
|
||||
|
||||
</servlet>
|
||||
|
||||
<servlet>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
|
||||
<init-param>
|
||||
<param-name>debug</param-name>
|
||||
<param-value>true</param-value>
|
||||
</init-param>
|
||||
</servlet>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>mvc-servlet</servlet-name>
|
||||
<url-pattern>*.htm</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>mvc-rest</servlet-name>
|
||||
<url-pattern>/service/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<servlet-mapping>
|
||||
<servlet-name>dwr-invoker</servlet-name>
|
||||
<url-pattern>/dwr/*</url-pattern>
|
||||
</servlet-mapping>
|
||||
|
||||
<welcome-file-list>
|
||||
<welcome-file>
|
||||
index.jsp
|
||||
</welcome-file>
|
||||
</welcome-file-list>
|
||||
<session-config>
|
||||
<session-timeout>180</session-timeout>
|
||||
</session-config>
|
||||
</web-app>
|
@ -1,167 +1,167 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
|
||||
<property name="filterInvocationDefinitionSource">
|
||||
<value>
|
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
PATTERN_TYPE_APACHE_ANT
|
||||
/**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="shaPasswordEncoder" class="org.acegisecurity.providers.encoding.ShaPasswordEncoder"/>
|
||||
|
||||
<bean id="passwordEncoder" class="com.wisemapping.security.CustomPasswordEncoder">
|
||||
<property name="delegatedEncoder" ref="shaPasswordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="httpSessionContextIntegrationFilter"
|
||||
class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/>
|
||||
|
||||
<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
|
||||
<property name="filterProcessesUrl" value="/c/logout.htm"/>
|
||||
<constructor-arg value="/c/login.htm"/>
|
||||
<!-- URL redirected to after logout -->
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<ref bean="rememberMeServices"/>
|
||||
<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="ssoCustomAuthenticationHandler" class="com.wisemapping.security.DefaultAuthenticationHandler"/>
|
||||
|
||||
<bean id="authenticationProcessingFilter" class="com.wisemapping.security.WiseAuthenticationProcessingFilter">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="authenticationFailureUrl" value="/c/login.htm?login_error=1"/>
|
||||
<property name="defaultTargetUrl" value="/c/login.htm"/>
|
||||
<property name="filterProcessesUrl" value="/c/j_acegi_security_check"/>
|
||||
<property name="rememberMeServices" ref="rememberMeServices"/>
|
||||
<property name="authenticationHandler" ref="ssoCustomAuthenticationHandler"/>
|
||||
<property name="exceptionMappings">
|
||||
<props>
|
||||
<prop key="org.acegisecurity.BadCredentialsException">/c/login.htm?login_error=2</prop>
|
||||
<prop key="org.acegisecurity.LockedException">/c/login.htm?login_error=3</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="securityContextHolderAwareRequestFilter"
|
||||
class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/>
|
||||
|
||||
<bean id="rememberMeProcessingFilter" class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="rememberMeServices" ref="rememberMeServices"/>
|
||||
</bean>
|
||||
|
||||
<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
|
||||
<property name="key" value="changeThis"/>
|
||||
<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
|
||||
<property name="authenticationEntryPoint">
|
||||
<bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
|
||||
<property name="loginFormUrl" value="/c/login.htm"/>
|
||||
<property name="forceHttps" value="false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="accessDeniedHandler">
|
||||
<bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
|
||||
<property name="errorPage" value="/accessDenied.jsp"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="accessDecisionManager">
|
||||
<bean class="org.acegisecurity.vote.AffirmativeBased">
|
||||
<property name="allowIfAllAbstainDecisions" value="false"/>
|
||||
<property name="decisionVoters">
|
||||
<list>
|
||||
<bean class="org.acegisecurity.vote.RoleVoter"/>
|
||||
<bean class="org.acegisecurity.vote.AuthenticatedVoter"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
PATTERN_TYPE_APACHE_ANT
|
||||
/index.jsp=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/login*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/userregistration*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/activation.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/forgotpassword*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/captcha*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/home.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/try.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/search.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/keyboard.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/css/*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/js/**=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/ws/**=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/images/*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/embeddedview.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/export.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/publicview.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/engine.js=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/interface/loggerservice.js=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/call/plaincall/loggerservice.logerror.dwr=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/**=IS_AUTHENTICATED_REMEMBERED
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rememberMeServices" class="com.wisemapping.security.CustomTokenBasedRememberMeServices">
|
||||
<property name="userDetailsService" ref="userDetailsService"/>
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
|
||||
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
|
||||
<property name="providers">
|
||||
<list>
|
||||
<ref local="daoAuthenticationProvider"/>
|
||||
<bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
<bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
|
||||
<property name="userDetailsService" ref="userDetailsService"/>
|
||||
<!-- @Todo: Check if this still required. this was removed in the new spring version.-->
|
||||
<!--<property name="userCache">-->
|
||||
<!--<bean class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">-->
|
||||
<!--<property name="cache">-->
|
||||
<!--<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">-->
|
||||
<!--<property name="cacheManager">-->
|
||||
<!--<bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>-->
|
||||
<!--</property>-->
|
||||
<!--<property name="cacheName" value="userCache"/>-->
|
||||
<!--</bean>-->
|
||||
<!--</property>-->
|
||||
<!--</bean>-->
|
||||
<!--</property>-->
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userDetailsService" class="com.wisemapping.security.DatabaseUserDetailService">
|
||||
<property name="userManager" ref="userManager"/>
|
||||
</bean>
|
||||
|
||||
<!-- This bean is optional; it isn't used by any other bean as it only listens and logs -->
|
||||
<bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
|
||||
</beans>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="filterChainProxy" class="org.acegisecurity.util.FilterChainProxy">
|
||||
<property name="filterInvocationDefinitionSource">
|
||||
<value>
|
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
PATTERN_TYPE_APACHE_ANT
|
||||
/**=httpSessionContextIntegrationFilter,logoutFilter,authenticationProcessingFilter,securityContextHolderAwareRequestFilter,rememberMeProcessingFilter,anonymousProcessingFilter,exceptionTranslationFilter,filterInvocationInterceptor
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="shaPasswordEncoder" class="org.acegisecurity.providers.encoding.ShaPasswordEncoder"/>
|
||||
|
||||
<bean id="encoder" class="com.wisemapping.security.CustomPasswordEncoder">
|
||||
<property name="delegatedEncoder" ref="shaPasswordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="httpSessionContextIntegrationFilter"
|
||||
class="org.acegisecurity.context.HttpSessionContextIntegrationFilter"/>
|
||||
|
||||
<bean id="logoutFilter" class="org.acegisecurity.ui.logout.LogoutFilter">
|
||||
<property name="filterProcessesUrl" value="/c/logout.htm"/>
|
||||
<constructor-arg value="/c/login.htm"/>
|
||||
<!-- URL redirected to after logout -->
|
||||
<constructor-arg>
|
||||
<list>
|
||||
<ref bean="rememberMeServices"/>
|
||||
<bean class="org.acegisecurity.ui.logout.SecurityContextLogoutHandler"/>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="ssoCustomAuthenticationHandler" class="com.wisemapping.security.DefaultAuthenticationHandler"/>
|
||||
|
||||
<bean id="authenticationProcessingFilter" class="com.wisemapping.security.WiseAuthenticationProcessingFilter">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="authenticationFailureUrl" value="/c/login.htm?login_error=1"/>
|
||||
<property name="defaultTargetUrl" value="/c/login.htm"/>
|
||||
<property name="filterProcessesUrl" value="/c/j_acegi_security_check"/>
|
||||
<property name="rememberMeServices" ref="rememberMeServices"/>
|
||||
<property name="authenticationHandler" ref="ssoCustomAuthenticationHandler"/>
|
||||
<property name="exceptionMappings">
|
||||
<props>
|
||||
<prop key="org.acegisecurity.BadCredentialsException">/c/login.htm?login_error=2</prop>
|
||||
<prop key="org.acegisecurity.LockedException">/c/login.htm?login_error=3</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="securityContextHolderAwareRequestFilter"
|
||||
class="org.acegisecurity.wrapper.SecurityContextHolderAwareRequestFilter"/>
|
||||
|
||||
<bean id="rememberMeProcessingFilter" class="org.acegisecurity.ui.rememberme.RememberMeProcessingFilter">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="rememberMeServices" ref="rememberMeServices"/>
|
||||
</bean>
|
||||
|
||||
<bean id="anonymousProcessingFilter" class="org.acegisecurity.providers.anonymous.AnonymousProcessingFilter">
|
||||
<property name="key" value="changeThis"/>
|
||||
<property name="userAttribute" value="anonymousUser,ROLE_ANONYMOUS"/>
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionTranslationFilter" class="org.acegisecurity.ui.ExceptionTranslationFilter">
|
||||
<property name="authenticationEntryPoint">
|
||||
<bean class="org.acegisecurity.ui.webapp.AuthenticationProcessingFilterEntryPoint">
|
||||
<property name="loginFormUrl" value="/c/login.htm"/>
|
||||
<property name="forceHttps" value="false"/>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="accessDeniedHandler">
|
||||
<bean class="org.acegisecurity.ui.AccessDeniedHandlerImpl">
|
||||
<property name="errorPage" value="/accessDenied.jsp"/>
|
||||
</bean>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="filterInvocationInterceptor" class="org.acegisecurity.intercept.web.FilterSecurityInterceptor">
|
||||
<property name="authenticationManager" ref="authenticationManager"/>
|
||||
<property name="accessDecisionManager">
|
||||
<bean class="org.acegisecurity.vote.AffirmativeBased">
|
||||
<property name="allowIfAllAbstainDecisions" value="false"/>
|
||||
<property name="decisionVoters">
|
||||
<list>
|
||||
<bean class="org.acegisecurity.vote.RoleVoter"/>
|
||||
<bean class="org.acegisecurity.vote.AuthenticatedVoter"/>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
</property>
|
||||
<property name="objectDefinitionSource">
|
||||
<value>
|
||||
CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON
|
||||
PATTERN_TYPE_APACHE_ANT
|
||||
/index.jsp=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/login*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/userregistration*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/activation.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/forgotpassword*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/captcha*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/home.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/try.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/search.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/keyboard.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/css/*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/js/**=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/ws/**=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/images/*=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/embeddedview.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/export.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/c/publicview.htm=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/engine.js=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/interface/loggerservice.js=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/dwr/call/plaincall/loggerservice.logerror.dwr=IS_AUTHENTICATED_ANONYMOUSLY
|
||||
/**=IS_AUTHENTICATED_REMEMBERED
|
||||
</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="rememberMeServices" class="com.wisemapping.security.CustomTokenBasedRememberMeServices">
|
||||
<property name="userDetailsService" ref="userDetailsService"/>
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
|
||||
<bean id="authenticationManager" class="org.acegisecurity.providers.ProviderManager">
|
||||
<property name="providers">
|
||||
<list>
|
||||
<ref local="daoAuthenticationProvider"/>
|
||||
<bean class="org.acegisecurity.providers.anonymous.AnonymousAuthenticationProvider">
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
<bean class="org.acegisecurity.providers.rememberme.RememberMeAuthenticationProvider">
|
||||
<property name="key" value="changeThis"/>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="daoAuthenticationProvider" class="org.acegisecurity.providers.dao.DaoAuthenticationProvider">
|
||||
<property name="userDetailsService" ref="userDetailsService"/>
|
||||
<!-- @Todo: Check if this still required. this was removed in the new spring version.-->
|
||||
<!--<property name="userCache">-->
|
||||
<!--<bean class="org.acegisecurity.providers.dao.cache.EhCacheBasedUserCache">-->
|
||||
<!--<property name="cache">-->
|
||||
<!--<bean class="org.springframework.cache.ehcache.EhCacheFactoryBean">-->
|
||||
<!--<property name="cacheManager">-->
|
||||
<!--<bean class="org.springframework.cache.ehcache.EhCacheManagerFactoryBean"/>-->
|
||||
<!--</property>-->
|
||||
<!--<property name="cacheName" value="userCache"/>-->
|
||||
<!--</bean>-->
|
||||
<!--</property>-->
|
||||
<!--</bean>-->
|
||||
<!--</property>-->
|
||||
<property name="encoder" ref="encoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userDetailsService" class="com.wisemapping.security.DatabaseUserDetailService">
|
||||
<property name="userManager" ref="userManager"/>
|
||||
</bean>
|
||||
|
||||
<!-- This bean is optional; it isn't used by any other bean as it only listens and logs -->
|
||||
<bean id="loggerListener" class="org.acegisecurity.event.authentication.LoggerListener"/>
|
||||
</beans>
|
||||
|
||||
|
42
wise-webapp/src/main/webapp/WEB-INF/wisemapping-aop.xml
Executable file
42
wise-webapp/src/main/webapp/WEB-INF/wisemapping-aop.xml
Executable file
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="viewSecurityAdvisor"
|
||||
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||
<property name="advice">
|
||||
<ref local="viewSecurityAdvice"/>
|
||||
</property>
|
||||
<property name="mappedNames">
|
||||
<list>
|
||||
<value>getMindmapUserBy</value>
|
||||
<value>getMindmapById</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="updateSecurityAdvisor"
|
||||
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||
<property name="advice">
|
||||
<ref local="updateSecurityAdvice"/>
|
||||
</property>
|
||||
<property name="mappedNames">
|
||||
<list>
|
||||
<value>update*</value>
|
||||
<value>add*</value>
|
||||
<value>remove*</value>
|
||||
<value>remove*</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="updateSecurityAdvice" class="com.wisemapping.security.aop.UpdateSecurityAdvise">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="viewSecurityAdvice" class="com.wisemapping.security.aop.ViewBaseSecurityAdvise">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@ -1,129 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="colorGenRandomDark" class="com.octo.captcha.component.image.color.RandomRangeColorGenerator">
|
||||
<constructor-arg index="0">
|
||||
<list>
|
||||
<value>0</value>
|
||||
<value>150</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="1">
|
||||
<list>
|
||||
<value>0</value>
|
||||
<value>150</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="2">
|
||||
<list>
|
||||
<value>0</value>
|
||||
<value>150</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
<constructor-arg index="3">
|
||||
<list>
|
||||
<value>255</value>
|
||||
<value>255</value>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="fontArial" class="java.awt.Font">
|
||||
<constructor-arg index="0" value="Arial"/>
|
||||
<constructor-arg index="1" value="0"/>
|
||||
<constructor-arg index="2" value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fontTahoma" class="java.awt.Font">
|
||||
<constructor-arg index="0" value="Tahoma"/>
|
||||
<constructor-arg index="1" value="0"/>
|
||||
<constructor-arg index="2" value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fontVerdana" class="java.awt.Font">
|
||||
<constructor-arg index="0" value="Verdana"/>
|
||||
<constructor-arg index="1" value="0"/>
|
||||
<constructor-arg index="2" value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fontComic" class="java.awt.Font">
|
||||
<constructor-arg index="0" value="Comic sans MS"/>
|
||||
<constructor-arg index="1" value="0"/>
|
||||
<constructor-arg index="2" value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fontLucida" class="java.awt.Font">
|
||||
<constructor-arg index="0" value="Lucida console"/>
|
||||
<constructor-arg index="1" value="0"/>
|
||||
<constructor-arg index="2" value="10"/>
|
||||
</bean>
|
||||
|
||||
<bean id="fontGenRandom" class="com.octo.captcha.component.image.fontgenerator.RandomFontGenerator">
|
||||
<constructor-arg index="0" value="20"/>
|
||||
<constructor-arg index="1" value="30"/>
|
||||
<constructor-arg index="2">
|
||||
<list>
|
||||
<ref bean="fontArial"/>
|
||||
<ref bean="fontTahoma"/>
|
||||
<ref bean="fontVerdana"/>
|
||||
<ref bean="fontComic"/>
|
||||
<ref bean="fontLucida"/>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="backGenUni" class="com.octo.captcha.component.image.backgroundgenerator.UniColorBackgroundGenerator">
|
||||
<constructor-arg index="0" value="150"/>
|
||||
<constructor-arg index="1" value="50"/>
|
||||
</bean>
|
||||
|
||||
<bean id="path" class="java.lang.String">
|
||||
<constructor-arg value="\home\jcaptcha\conf\gimpybackgrounds"/>
|
||||
</bean>
|
||||
|
||||
<bean id="simpleColoredPaster" class="com.octo.captcha.component.image.textpaster.RandomTextPaster">
|
||||
<constructor-arg type="java.lang.Integer" index="0" value="4"/>
|
||||
<constructor-arg type="java.lang.Integer" index="1" value="6"/>
|
||||
<constructor-arg type="com.octo.captcha.component.image.color.ColorGenerator" index="2"
|
||||
ref="colorGenRandomDark"/>
|
||||
<constructor-arg index="3" value="true"/>
|
||||
</bean>
|
||||
|
||||
<bean id="wordtoimage" class="com.octo.captcha.component.image.wordtoimage.ComposedWordToImage">
|
||||
<constructor-arg index="0" ref="fontGenRandom"/>
|
||||
<constructor-arg index="1" ref="backGenUni"/>
|
||||
<constructor-arg index="2" ref="simpleColoredPaster"/>
|
||||
</bean>
|
||||
|
||||
<bean id="filedict" class="com.octo.captcha.component.word.FileDictionary">
|
||||
<constructor-arg index="0" value="toddlist"/>
|
||||
</bean>
|
||||
|
||||
<bean id="wordgen" class="com.octo.captcha.component.word.wordgenerator.ComposeDictionaryWordGenerator">
|
||||
<constructor-arg ref="filedict"/>
|
||||
</bean>
|
||||
|
||||
<bean id="imageCaptchaFactory" class="com.octo.captcha.image.gimpy.GimpyFactory">
|
||||
<constructor-arg ref="wordgen"/>
|
||||
<constructor-arg ref="wordtoimage"/>
|
||||
</bean>
|
||||
|
||||
<bean id="imageEngine" class="com.octo.captcha.engine.GenericCaptchaEngine">
|
||||
<constructor-arg index="0">
|
||||
<list>
|
||||
<ref bean="imageCaptchaFactory"/>
|
||||
</list>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
|
||||
<bean id="captchaService" class="com.octo.captcha.service.multitype.GenericManageableCaptchaService">
|
||||
<constructor-arg index="0" ref="imageEngine"/>
|
||||
<constructor-arg index="1" value="300"/>
|
||||
<constructor-arg index="2" value="200000"/>
|
||||
<!-- Umm... Why this is requred ...-->
|
||||
<constructor-arg index="3" value="200000"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@ -1,15 +1,15 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="userManager" class="com.wisemapping.dao.UserManagerImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<property name="passwordEncoder" ref="passwordEncoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mindmapManager" class="com.wisemapping.dao.MindmapManagerImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="userManager" class="com.wisemapping.dao.UserManagerImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
<!--<property name="encoder" ref="encoder"/>-->
|
||||
</bean>
|
||||
|
||||
<bean id="mindmapManager" class="com.wisemapping.dao.MindmapManagerImpl">
|
||||
<property name="hibernateTemplate" ref="hibernateTemplate"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
54
wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
Normal file
54
wise-webapp/src/main/webapp/WEB-INF/wisemapping-rest.xml
Normal file
@ -0,0 +1,54 @@
|
||||
<?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-3.1.xsd
|
||||
http://www.springframework.org/schema/context
|
||||
http://www.springframework.org/schema/context/spring-context-3.1.xsd">
|
||||
|
||||
<context:component-scan base-package="dw.spring3.rest.controller"/>
|
||||
|
||||
<!-- To enable @RequestMapping process on type level and method level -->
|
||||
<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>
|
||||
<bean class="org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter"/>
|
||||
|
||||
<bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
|
||||
<property name="classesToBeBound">
|
||||
<list>
|
||||
<value>com.wisemapping.model.User</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="employees" class="org.springframework.web.servlet.view.xml.MarshallingView">
|
||||
<constructor-arg ref="jaxbMarshaller"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver">
|
||||
<property name="mediaTypes">
|
||||
<map>
|
||||
<entry key="xml" value="application/xml"/>
|
||||
<entry key="html" value="text/html"/>
|
||||
</map>
|
||||
</property>
|
||||
<property name="viewResolvers">
|
||||
<list>
|
||||
<bean class="org.springframework.web.servlet.view.BeanNameViewResolver"/>
|
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver">
|
||||
<property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/>
|
||||
<property name="prefix" value="/WEB-INF/jsp-rest"/>
|
||||
<property name="suffix" value=".jsp"/>
|
||||
</bean>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--bean id="viewResolver" class="org.springframework.web.servlet.view.BeanNameViewResolver" /-->
|
||||
|
||||
<bean id="employeeController" class="com.wisemapping.rest.UserController">
|
||||
<property name="jaxb2Mashaller" ref="jaxbMarshaller"/>
|
||||
</bean>
|
||||
</beans>
|
103
wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml
Executable file → Normal file
103
wise-webapp/src/main/webapp/WEB-INF/wisemapping-security.xml
Executable file → Normal file
@ -1,42 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="viewSecurityAdvisor"
|
||||
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||
<property name="advice">
|
||||
<ref local="viewSecurityAdvice"/>
|
||||
</property>
|
||||
<property name="mappedNames">
|
||||
<list>
|
||||
<value>getMindmapUserBy</value>
|
||||
<value>getMindmapById</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="updateSecurityAdvisor"
|
||||
class="org.springframework.aop.support.NameMatchMethodPointcutAdvisor">
|
||||
<property name="advice">
|
||||
<ref local="updateSecurityAdvice"/>
|
||||
</property>
|
||||
<property name="mappedNames">
|
||||
<list>
|
||||
<value>update*</value>
|
||||
<value>add*</value>
|
||||
<value>remove*</value>
|
||||
<value>remove*</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="updateSecurityAdvice" class="com.wisemapping.security.aop.UpdateSecurityAdvise">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="viewSecurityAdvice" class="com.wisemapping.security.aop.ViewBaseSecurityAdvise">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:sec="http://www.springframework.org/schema/security"
|
||||
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-3.1.xsd
|
||||
http://www.springframework.org/schema/security
|
||||
http://www.springframework.org/schema/security/spring-security-3.1.xsd">
|
||||
|
||||
<bean id="encoder"
|
||||
class="com.wisemapping.security.CustomPasswordEncoder"/>
|
||||
|
||||
<sec:http pattern="/css/*" security="none"/>
|
||||
<sec:http pattern="/js/*" security="none"/>
|
||||
<sec:http pattern="/images/*" security="none"/>
|
||||
<sec:http pattern="/favicon.ico" security="none"/>
|
||||
<sec:http pattern="/c/login*" security="none"/>
|
||||
<sec:http pattern="/c/userregistration.htm" security="none"/>
|
||||
<sec:http pattern="/c/activation.htm" security="none"/>
|
||||
<sec:http pattern="/c/forgotpassword.htm" security="none"/>
|
||||
<sec:http pattern="/c/home.htm" security="none"/>
|
||||
<sec:http pattern="/c/try.htm" security="none"/>
|
||||
<sec:http pattern="/c/search.htm" security="none"/>
|
||||
<sec:http pattern="/c/keyboard.htm" security="none"/>
|
||||
<sec:http pattern="/c/embeddedview*" security="none"/>
|
||||
<sec:http pattern="/c/export.htm" security="none"/>
|
||||
<sec:http pattern="/c/publicview.htm" security="none"/>
|
||||
<sec:http pattern="/dwr/engine.js" security="none"/>
|
||||
|
||||
<sec:http pattern="/dwr/interface/loggerservice.js" security="none"/>
|
||||
<sec:http pattern="/dwr/call/plaincall/loggerservice.logerror.dwr" security="none"/>
|
||||
|
||||
<sec:http use-expressions="true" >
|
||||
|
||||
<sec:intercept-url pattern="/**/*" access="isFullyAuthenticated()"/>
|
||||
<sec:form-login login-page="/c/login.htm" default-target-url='/c/mymaps.htm'
|
||||
always-use-default-target='true' authentication-failure-url="/c/login.htm?login_error=2"
|
||||
login-processing-url="/j_spring_security_check"/>
|
||||
<sec:remember-me key="rememberMeKey" user-service-ref="userDetailsService"/>
|
||||
<!--<sec:session-management session-fixation-protection="newSession">-->
|
||||
<!--<sec:concurrency-control error-if-maximum-exceeded="true" max-sessions="1"/>-->
|
||||
<!--</sec:session-management>-->
|
||||
<sec:logout logout-url="/c/logout.htm" invalidate-session="true" logout-success-url="/c/login.htm"/>
|
||||
</sec:http>
|
||||
|
||||
<sec:authentication-manager alias="authenticationManager" >
|
||||
<sec:authentication-provider ref="dbAuthenticationProvider"/>
|
||||
<sec:authentication-provider user-service-ref="userDetailsService"/>
|
||||
</sec:authentication-manager>
|
||||
|
||||
<bean id="dbAuthenticationProvider" class="com.wisemapping.security.AuthenticationProvider">
|
||||
<property name="userManager" ref="userManager"/>
|
||||
<property name="encoder" ref="encoder"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userDetailsService" class="com.wisemapping.security.DatabaseUserDetailService">
|
||||
<property name="userManager" ref="userManager"/>
|
||||
</bean>
|
||||
|
||||
</beans>
|
@ -1,347 +1,346 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="/WEB-INF/app.properties"/>
|
||||
</bean>
|
||||
|
||||
<bean id="browserSupportInterceptor" class="com.wisemapping.filter.BrowserSupportInterceptor">
|
||||
<property name="exclude">
|
||||
<list>
|
||||
<value>/</value>
|
||||
<value>/index.jsp</value>
|
||||
<value>/c/home.htm</value>
|
||||
<value>/c/login.htm</value>
|
||||
<value>/c/userRegistration.htm</value>
|
||||
<value>/c/captcha.htm</value>
|
||||
<value>/c/publicView.htm</value>
|
||||
<value>/c/export.htm</value>
|
||||
<value>/c/search.htm</value>
|
||||
<value>/c/keyboard.htm</value>
|
||||
<value>/c/renameMap.htm</value>
|
||||
<value>/c/embeddedView.htm</value>
|
||||
<value>/c/forgotPassword.htm</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionHadlerResolver"
|
||||
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||||
<property name="defaultStatusCode" value="500"/>
|
||||
<property name="defaultErrorView" value="unexpectedError"/>
|
||||
<property name="exceptionMappings">
|
||||
<props>
|
||||
<prop key="com.wisemapping.exceptions.UnsupportedBrowserException">browserNotSupported</prop>
|
||||
<!-- Security exceptions are wrapped in this exceptions -->
|
||||
<prop key="java.lang.reflect.UndeclaredThrowableException">securityError</prop>
|
||||
<prop key="com.wisemapping.exceptions.EmailNotExistsException">emailNotExistsError</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="paramResolverByAction"
|
||||
class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
|
||||
<property name="paramName" value="action"/>
|
||||
</bean>
|
||||
|
||||
<bean id="paramResolverByAction2"
|
||||
class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
|
||||
<property name="paramName" value="actionId"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mindmapController" class="com.wisemapping.controller.MindmapController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver">
|
||||
</bean>-->
|
||||
|
||||
<bean id="homeResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/try.htm">tryEditor</prop>
|
||||
<prop key="/c/installCFG.htm">installCFG</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="homeController" class="com.wisemapping.controller.PublicPagesController">
|
||||
<property name="methodNameResolver" ref="homeResolver"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editorController" class="com.wisemapping.controller.MindmapEditorController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="cookerController" class="com.wisemapping.controller.MindmapCooker">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="loginController" class="com.wisemapping.controller.LoginController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="driver" value="${database.driver}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sharingController" class="com.wisemapping.controller.MindmapSharingController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction2"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="exportController" class="com.wisemapping.controller.ExportController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
<bean id="publishController" class="com.wisemapping.controller.MindmapPublishController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction2"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userValidator" class="com.wisemapping.validator.UserValidator">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userController" class="com.wisemapping.controller.UserController">
|
||||
<property name="captchaService" ref="captchaService"/>
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="user"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.UserBean"/>
|
||||
<property name="validator" ref="userValidator"/>
|
||||
<property name="formView" value="userRegistration"/>
|
||||
<property name="successView" value="userRegistrationConfirmation"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="emailConfirmEnabled" value="${user.confirm.registration}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="forgotPasswordValidator" class="com.wisemapping.validator.ForgotPasswordValidator"/>
|
||||
|
||||
<bean id="forgotPasswordController" class="com.wisemapping.controller.ForgotPasswordController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="forgotPassword"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ForgotPasswordBean"/>
|
||||
<property name="validator" ref="forgotPasswordValidator"/>
|
||||
<property name="formView" value="forgotPassword"/>
|
||||
<property name="successView" value="mindmap"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="settingResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/settings.htm">settings</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="settingsController" class="com.wisemapping.controller.SettingsController">
|
||||
<property name="methodNameResolver" ref="settingResolver"/>
|
||||
</bean>
|
||||
|
||||
<bean id="changePasswordValidator" class="com.wisemapping.validator.ChangePasswordValidator"/>
|
||||
<bean id="changePasswordController" class="com.wisemapping.controller.ChangePasswordController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="changePassword"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ChangePasswordBean"/>
|
||||
<property name="validator" ref="changePasswordValidator"/>
|
||||
<property name="formView" value="changePassword"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editProfileValidator" class="com.wisemapping.validator.EditProfileValidator">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editProfileController" class="com.wisemapping.controller.EditProfileController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="editProfile"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.UserBean"/>
|
||||
<property name="validator" ref="editProfileValidator"/>
|
||||
<property name="formView" value="editProfile"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="renameMapValidator" class="com.wisemapping.validator.RenameMapValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newMapValidator" class="com.wisemapping.validator.MapInfoValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="importMapValidator" class="com.wisemapping.validator.ImportMapValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="renameMapController" class="com.wisemapping.controller.RenameMindmapController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="renameMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.MindMapInfoBean"/>
|
||||
<property name="validator" ref="renameMapValidator"/>
|
||||
<property name="formView" value="renameMap"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="historyController" class="com.wisemapping.controller.HistoryController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newMapController" class="com.wisemapping.controller.NewMindmapController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="newMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.MindMapInfoBean"/>
|
||||
<property name="validator" ref="newMapValidator"/>
|
||||
<property name="formView" value="newMap"/>
|
||||
<property name="errorView" value="newMapError"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="importMapController" class="com.wisemapping.controller.ImportController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="importMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ImportMapBean"/>
|
||||
<property name="validator" ref="importMapValidator"/>
|
||||
<property name="formView" value="importMap"/>
|
||||
<property name="errorView" value="importMapError"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="tagValidator" class="com.wisemapping.validator.TagValidator">
|
||||
</bean>
|
||||
|
||||
<bean id="tagsController" class="com.wisemapping.controller.TagsController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="tag"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.TagBean"/>
|
||||
<property name="validator" ref="tagValidator"/>
|
||||
<property name="formView" value="mindmapTags"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="multipartResolver"
|
||||
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<!-- one of the properties available; the maximum file size in bytes -->
|
||||
<property name="maxUploadSize" value="522240"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activationController" class="com.wisemapping.controller.ActivationController">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="searchController" class="com.wisemapping.controller.SearchController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="keyboardController" class="com.wisemapping.controller.KeyboardController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="publicView" class="com.wisemapping.controller.PublicViewController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="embeddedView" class="com.wisemapping.controller.EmbeddedViewController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="captchaController" class="com.wisemapping.controller.CaptchaController">
|
||||
<property name="captchaService" ref="captchaService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="interceptors">
|
||||
<list>
|
||||
<ref bean="browserSupportInterceptor"/>
|
||||
<ref bean="localeChangeInterceptor"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/mymaps.htm">mindmapController</prop>
|
||||
<prop key="/c/userRegistration.htm">userController</prop>
|
||||
<prop key="/c/sharing.htm">sharingController</prop>
|
||||
<prop key="/c/home.htm">homeController</prop>
|
||||
<prop key="/c/login.htm">loginController</prop>
|
||||
<prop key="/c/captcha.htm">captchaController</prop>
|
||||
<prop key="/c/forgotPassword.htm">forgotPasswordController</prop>
|
||||
<prop key="/c/activation.htm">activationController</prop>
|
||||
<prop key="/c/changePassword.htm">changePasswordController</prop>
|
||||
<prop key="/c/editor.htm">editorController</prop>
|
||||
<prop key="/c/cooker.htm">cookerController</prop>
|
||||
<prop key="/c/settings.htm">settingsController</prop>
|
||||
<prop key="/c/export.htm">exportController</prop>
|
||||
<prop key="/c/publish.htm">publishController</prop>
|
||||
<prop key="/c/editProfile.htm">editProfileController</prop>
|
||||
<prop key="/c/tags.htm">tagsController</prop>
|
||||
<prop key="/c/search.htm">searchController</prop>
|
||||
<prop key="/c/keyboard.htm">keyboardController</prop>
|
||||
<prop key="/c/publicView.htm">publicView</prop>
|
||||
<prop key="/c/embeddedView.htm">embeddedView</prop>
|
||||
<prop key="/c/renameMap.htm">renameMapController</prop>
|
||||
<prop key="/c/importMap.htm">importMapController</prop>
|
||||
<prop key="/c/newMap.htm">newMapController</prop>
|
||||
<prop key="/c/history.htm">historyController</prop>
|
||||
<prop key="/c/installCFG.htm">homeController</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesJstlView"/>
|
||||
</bean>
|
||||
|
||||
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
|
||||
<property name="definitions">
|
||||
<list>
|
||||
<value>/WEB-INF/defs/definitions.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
|
||||
<property name="defaultLocale" value="en"/>
|
||||
</bean>
|
||||
|
||||
<bean id="localeChangeInterceptor"
|
||||
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
|
||||
<property name="paramName" value="language"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="location" value="/WEB-INF/app.properties"/>
|
||||
</bean>
|
||||
|
||||
<bean id="browserSupportInterceptor" class="com.wisemapping.filter.BrowserSupportInterceptor">
|
||||
<property name="exclude">
|
||||
<list>
|
||||
<value>/</value>
|
||||
<value>/index.jsp</value>
|
||||
<value>/c/home.htm</value>
|
||||
<value>/c/login.htm</value>
|
||||
<value>/c/userRegistration.htm</value>
|
||||
<value>/c/captcha.htm</value>
|
||||
<value>/c/publicView.htm</value>
|
||||
<value>/c/export.htm</value>
|
||||
<value>/c/search.htm</value>
|
||||
<value>/c/keyboard.htm</value>
|
||||
<value>/c/renameMap.htm</value>
|
||||
<value>/c/embeddedView.htm</value>
|
||||
<value>/c/forgotPassword.htm</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="exceptionHadlerResolver"
|
||||
class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
|
||||
<property name="defaultStatusCode" value="500"/>
|
||||
<property name="defaultErrorView" value="unexpectedError"/>
|
||||
<property name="exceptionMappings">
|
||||
<props>
|
||||
<prop key="com.wisemapping.exceptions.UnsupportedBrowserException">browserNotSupported</prop>
|
||||
<!-- Security exceptions are wrapped in this exceptions -->
|
||||
<prop key="java.lang.reflect.UndeclaredThrowableException">securityError</prop>
|
||||
<prop key="com.wisemapping.exceptions.EmailNotExistsException">emailNotExistsError</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="paramResolverByAction"
|
||||
class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
|
||||
<property name="paramName" value="action"/>
|
||||
</bean>
|
||||
|
||||
<bean id="paramResolverByAction2"
|
||||
class="org.springframework.web.servlet.mvc.multiaction.ParameterMethodNameResolver">
|
||||
<property name="paramName" value="actionId"/>
|
||||
</bean>
|
||||
|
||||
<bean id="mindmapController" class="com.wisemapping.controller.MindmapController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
|
||||
<property name="basenames">
|
||||
<list>
|
||||
<value>messages</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!--<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.AcceptHeaderLocaleResolver">
|
||||
</bean>-->
|
||||
|
||||
<bean id="homeResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/try.htm">tryEditor</prop>
|
||||
<prop key="/c/installCFG.htm">installCFG</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="homeController" class="com.wisemapping.controller.PublicPagesController">
|
||||
<property name="methodNameResolver" ref="homeResolver"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editorController" class="com.wisemapping.controller.MindmapEditorController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="cookerController" class="com.wisemapping.controller.MindmapCooker">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="loginController" class="com.wisemapping.controller.LoginController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="driver" value="${database.driver}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="sharingController" class="com.wisemapping.controller.MindmapSharingController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction2"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="exportController" class="com.wisemapping.controller.ExportController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
<bean id="publishController" class="com.wisemapping.controller.MindmapPublishController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction2"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userValidator" class="com.wisemapping.validator.UserValidator">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="userController" class="com.wisemapping.controller.UserController">
|
||||
<!--<property name="captchaService" ref="captchaService"/>-->
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="user"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.UserBean"/>
|
||||
<property name="validator" ref="userValidator"/>
|
||||
<property name="formView" value="userRegistration"/>
|
||||
<property name="successView" value="userRegistrationConfirmation"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
<property name="emailConfirmEnabled" value="${user.confirm.registration}"/>
|
||||
</bean>
|
||||
|
||||
<bean id="forgotPasswordValidator" class="com.wisemapping.validator.ForgotPasswordValidator"/>
|
||||
|
||||
<bean id="forgotPasswordController" class="com.wisemapping.controller.ForgotPasswordController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="forgotPassword"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ForgotPasswordBean"/>
|
||||
<property name="validator" ref="forgotPasswordValidator"/>
|
||||
<property name="formView" value="forgotPassword"/>
|
||||
<property name="successView" value="mindmap"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="settingResolver" class="org.springframework.web.servlet.mvc.multiaction.PropertiesMethodNameResolver">
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/settings.htm">settings</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="settingsController" class="com.wisemapping.controller.SettingsController">
|
||||
<property name="methodNameResolver" ref="settingResolver"/>
|
||||
</bean>
|
||||
|
||||
<bean id="changePasswordValidator" class="com.wisemapping.validator.ChangePasswordValidator"/>
|
||||
<bean id="changePasswordController" class="com.wisemapping.controller.ChangePasswordController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="changePassword"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ChangePasswordBean"/>
|
||||
<property name="validator" ref="changePasswordValidator"/>
|
||||
<property name="formView" value="changePassword"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editProfileValidator" class="com.wisemapping.validator.EditProfileValidator">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="editProfileController" class="com.wisemapping.controller.EditProfileController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="editProfile"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.UserBean"/>
|
||||
<property name="validator" ref="editProfileValidator"/>
|
||||
<property name="formView" value="editProfile"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="renameMapValidator" class="com.wisemapping.validator.RenameMapValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newMapValidator" class="com.wisemapping.validator.MapInfoValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="importMapValidator" class="com.wisemapping.validator.ImportMapValidator">
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="renameMapController" class="com.wisemapping.controller.RenameMindmapController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="renameMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.MindMapInfoBean"/>
|
||||
<property name="validator" ref="renameMapValidator"/>
|
||||
<property name="formView" value="renameMap"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="historyController" class="com.wisemapping.controller.HistoryController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="newMapController" class="com.wisemapping.controller.NewMindmapController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="newMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.MindMapInfoBean"/>
|
||||
<property name="validator" ref="newMapValidator"/>
|
||||
<property name="formView" value="newMap"/>
|
||||
<property name="errorView" value="newMapError"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="importMapController" class="com.wisemapping.controller.ImportController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="importMap"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.ImportMapBean"/>
|
||||
<property name="validator" ref="importMapValidator"/>
|
||||
<property name="formView" value="importMap"/>
|
||||
<property name="errorView" value="importMapError"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="tagValidator" class="com.wisemapping.validator.TagValidator">
|
||||
</bean>
|
||||
|
||||
<bean id="tagsController" class="com.wisemapping.controller.TagsController">
|
||||
<property name="sessionForm" value="false"/>
|
||||
<property name="commandName" value="tag"/>
|
||||
<property name="commandClass" value="com.wisemapping.view.TagBean"/>
|
||||
<property name="validator" ref="tagValidator"/>
|
||||
<property name="formView" value="mindmapTags"/>
|
||||
<property name="successView" value="closeDialog"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="multipartResolver"
|
||||
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
|
||||
<!-- one of the properties available; the maximum file size in bytes -->
|
||||
<property name="maxUploadSize" value="522240"/>
|
||||
</bean>
|
||||
|
||||
<bean id="activationController" class="com.wisemapping.controller.ActivationController">
|
||||
<property name="userService" ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="searchController" class="com.wisemapping.controller.SearchController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="keyboardController" class="com.wisemapping.controller.KeyboardController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="publicView" class="com.wisemapping.controller.PublicViewController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<bean id="embeddedView" class="com.wisemapping.controller.EmbeddedViewController">
|
||||
<property name="methodNameResolver" ref="paramResolverByAction"/>
|
||||
<property name="mindmapService" ref="mindmapService"/>
|
||||
</bean>
|
||||
|
||||
<!--<bean id="captchaController" class="com.wisemapping.controller.CaptchaController">-->
|
||||
<!--<property name="captchaService" ref="captchaService"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
|
||||
<property name="interceptors">
|
||||
<list>
|
||||
<ref bean="browserSupportInterceptor"/>
|
||||
<ref bean="localeChangeInterceptor"/>
|
||||
</list>
|
||||
</property>
|
||||
<property name="mappings">
|
||||
<props>
|
||||
<prop key="/c/mymaps.htm">mindmapController</prop>
|
||||
<prop key="/c/userRegistration.htm">userController</prop>
|
||||
<prop key="/c/sharing.htm">sharingController</prop>
|
||||
<prop key="/c/home.htm">homeController</prop>
|
||||
<prop key="/c/login.htm">loginController</prop>
|
||||
<prop key="/c/forgotPassword.htm">forgotPasswordController</prop>
|
||||
<prop key="/c/activation.htm">activationController</prop>
|
||||
<prop key="/c/changePassword.htm">changePasswordController</prop>
|
||||
<prop key="/c/editor.htm">editorController</prop>
|
||||
<prop key="/c/cooker.htm">cookerController</prop>
|
||||
<prop key="/c/settings.htm">settingsController</prop>
|
||||
<prop key="/c/export.htm">exportController</prop>
|
||||
<prop key="/c/publish.htm">publishController</prop>
|
||||
<prop key="/c/editProfile.htm">editProfileController</prop>
|
||||
<prop key="/c/tags.htm">tagsController</prop>
|
||||
<prop key="/c/search.htm">searchController</prop>
|
||||
<prop key="/c/keyboard.htm">keyboardController</prop>
|
||||
<prop key="/c/publicView.htm">publicView</prop>
|
||||
<prop key="/c/embeddedView.htm">embeddedView</prop>
|
||||
<prop key="/c/renameMap.htm">renameMapController</prop>
|
||||
<prop key="/c/importMap.htm">importMapController</prop>
|
||||
<prop key="/c/newMap.htm">newMapController</prop>
|
||||
<prop key="/c/history.htm">historyController</prop>
|
||||
<prop key="/c/installCFG.htm">homeController</prop>
|
||||
</props>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
||||
<property name="viewClass" value="org.springframework.web.servlet.view.tiles.TilesJstlView"/>
|
||||
</bean>
|
||||
|
||||
<bean id="tilesConfigurer" class="org.springframework.web.servlet.view.tiles.TilesConfigurer">
|
||||
<property name="definitions">
|
||||
<list>
|
||||
<value>/WEB-INF/defs/definitions.xml</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="localeResolver"
|
||||
class="org.springframework.web.servlet.i18n.SessionLocaleResolver">
|
||||
<property name="defaultLocale" value="en"/>
|
||||
</bean>
|
||||
|
||||
<bean id="localeChangeInterceptor"
|
||||
class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor">
|
||||
<property name="paramName" value="language"/>
|
||||
</bean>
|
||||
|
||||
|
||||
</beans>
|
@ -1,46 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
|
||||
|
||||
<beans>
|
||||
<bean id="wiseservices" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
|
||||
<constructor-arg value="/WEB-INF/wiseservices.wsdl"/>
|
||||
</bean>
|
||||
|
||||
<bean id="orderEndpoint" class="com.wisemapping.ws.WiseWsEndpoint">
|
||||
<constructor-arg ref="mindmapService"/>
|
||||
<constructor-arg ref="userService"/>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.ws.server.endpoint.adapter.GenericMarshallingMethodEndpointAdapter">
|
||||
<constructor-arg ref="marshaller"/>
|
||||
</bean>
|
||||
|
||||
<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
|
||||
<property name="classesToBeBound">
|
||||
<list>
|
||||
<value>com.wisemapping.ws.LoadMindmapRequest</value>
|
||||
<value>com.wisemapping.ws.LoadMindmapResponse</value>
|
||||
<value>com.wisemapping.ws.AddMindmapRequest</value>
|
||||
<value>com.wisemapping.ws.AddMindmapResponse</value>
|
||||
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
<bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping"/>
|
||||
|
||||
<!-- Security -->
|
||||
<!--<bean id="springSecurityHandler"-->
|
||||
<!--class="org.springframework.ws.soap.security.xwss.callback.SpringPlainTextPasswordValidationCallbackHandler">-->
|
||||
<!--<property name="authenticationManager" ref="wsAuthenticationManager"/>-->
|
||||
<!--</bean>-->
|
||||
|
||||
<!--<bean id="wsAuthenticationManager" class="org.springframework.security.providers.ProviderManager">-->
|
||||
<!--<property name="providers">-->
|
||||
<!--<bean class="org.springframework.security.providers.dao.DaoAuthenticationProvider">-->
|
||||
<!--<property name="userDetailsService" ref="userDetailsService"/>-->
|
||||
<!--</bean>-->
|
||||
<!--</property>-->
|
||||
<!--</bean>-->
|
||||
|
||||
|
||||
</beans>
|
@ -1,20 +1,20 @@
|
||||
<%@ page import="org.acegisecurity.context.SecurityContextHolder" %>
|
||||
<%@ page import="org.acegisecurity.Authentication" %>
|
||||
<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %>
|
||||
|
||||
<h1>Sorry, access is denied</h1>
|
||||
|
||||
|
||||
<p>
|
||||
<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%>
|
||||
|
||||
<p>
|
||||
|
||||
<%
|
||||
|
||||
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (auth != null) {
|
||||
|
||||
%>
|
||||
Authentication object as a String: <%= auth.toString() %><BR><BR>
|
||||
<% } %>
|
||||
<%--<%@ page import="org.acegisecurity.context.SecurityContextHolder" %>--%>
|
||||
<%--<%@ page import="org.acegisecurity.Authentication" %>--%>
|
||||
<%--<%@ page import="org.acegisecurity.ui.AccessDeniedHandlerImpl" %>--%>
|
||||
|
||||
<%--<h1>Sorry, access is denied</h1>--%>
|
||||
|
||||
|
||||
<%--<p>--%>
|
||||
<%--<%= request.getAttribute(AccessDeniedHandlerImpl.ACEGI_SECURITY_ACCESS_DENIED_EXCEPTION_KEY)%>--%>
|
||||
|
||||
<%--<p>--%>
|
||||
|
||||
<%--<%--%>
|
||||
|
||||
<%--Authentication auth = SecurityContextHolder.getContext().getAuthentication();--%>
|
||||
<%--if (auth != null) {--%>
|
||||
|
||||
<%--%>--%>
|
||||
<%--Authentication object as a String: <%= auth.toString() %><BR><BR>--%>
|
||||
<%--<% } %>--%>
|
||||
|
@ -12,8 +12,8 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/embedded.css"/>
|
||||
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-core.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-more.js'></script>
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
|
||||
|
||||
|
@ -1,3 +1,3 @@
|
||||
<%
|
||||
response.sendRedirect(request.getContextPath() + "/c/login.htm");
|
||||
<%
|
||||
response.sendRedirect(request.getContextPath() + "/c/mymaps.htm");
|
||||
%>
|
@ -1,106 +1,106 @@
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<script type="text/javascript">
|
||||
if(typeof isOldIE != "undefined"){
|
||||
window.onload = function() {
|
||||
var simpleButtonGenerator = RUZEE.ShadedBorder.create({ corner:8, border:1 });
|
||||
simpleButtonGenerator.render('login');
|
||||
|
||||
$('submitButton').onclick = displayLoading;
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="loginContent">
|
||||
|
||||
<div id="news" class="sb">
|
||||
<h1>What is New: </h1>
|
||||
<ul>
|
||||
<li>Links Between Nodes</li>
|
||||
<li>FreeMind 0.9 Update</li>
|
||||
<li>Improved HTML 5.0 Support</li>
|
||||
<li>Firefox 4.0 is officially supported</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="login" class="sb">
|
||||
<h1>
|
||||
<spring:message code="SIGN_IN"/>
|
||||
</h1>
|
||||
|
||||
<form action="<c:url value='j_acegi_security_check'/>" method="POST">
|
||||
<table>
|
||||
<tbody>
|
||||
<c:if test="${not empty param.login_error}">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td class="errorMsg">
|
||||
<c:choose>
|
||||
<c:when test="${param.login_error == 3}">
|
||||
<spring:message code="USER_INACTIVE"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<spring:message code="LOGIN_ERROR"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<spring:message code="EMAIL"/>
|
||||
:
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' tabindex="1" id="email" name='j_username'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<spring:message code="PASSWORD"/>
|
||||
:
|
||||
</td>
|
||||
<td>
|
||||
<input type='password' tabindex="2" id="password" name='j_password'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<input type="checkbox" id="rememberme" name="_acegi_security_remember_me"/>
|
||||
</td>
|
||||
<td>
|
||||
<spring:message code="REMEMBER_ME"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="submit" class="btn-primary" id="submitButton"
|
||||
value="<spring:message code="SIGN_IN"/>">
|
||||
|
||||
<div style="text-align:right;"><a href="<c:url value="forgotPassword.htm"/>">
|
||||
<spring:message code="FORGOT_PASSWORD"/>
|
||||
</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="register">
|
||||
<b>
|
||||
<spring:message code="NOT_READY_A_USER"/>
|
||||
</b>
|
||||
<spring:message code="NOT_READY_A_USER_MESSAGE"/>
|
||||
<a href="userRegistration.htm">
|
||||
<spring:message code="JOIN_NOW"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<c:if test="${isHsql== 'true'}">
|
||||
|
||||
|
||||
<div style="padding:10px;background-color: #E0EFFF; border-radius: 5px 5px 5px 5px;border-style:solid;border-color:gray"><img src="../images/info.png" style="margin:0px 4px">Note: Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.5 instead. You can find more information how to configure MySQL <a href="http://www.wisemapping.org/documentation/configu">here</a>.</div>
|
||||
</c:if>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<script type="text/javascript">
|
||||
if(typeof isOldIE != "undefined"){
|
||||
window.onload = function() {
|
||||
var simpleButtonGenerator = RUZEE.ShadedBorder.create({ corner:8, border:1 });
|
||||
simpleButtonGenerator.render('login');
|
||||
|
||||
$('submitButton').onclick = displayLoading;
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<div id="loginContent">
|
||||
|
||||
<div id="news" class="sb">
|
||||
<h1>What is New: </h1>
|
||||
<ul>
|
||||
<li>Links Between Nodes</li>
|
||||
<li>FreeMind 0.9 Update</li>
|
||||
<li>Improved HTML 5.0 Support</li>
|
||||
<li>Firefox 4.0 is officially supported</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div id="login" class="sb">
|
||||
<h1>
|
||||
<spring:message code="SIGN_IN"/>
|
||||
</h1>
|
||||
|
||||
<form action="<c:url value='/j_spring_security_check'/>" method="POST">
|
||||
<table>
|
||||
<tbody>
|
||||
<c:if test="${not empty param.login_error}">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td class="errorMsg">
|
||||
<c:choose>
|
||||
<c:when test="${param.login_error == 3}">
|
||||
<spring:message code="USER_INACTIVE"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<spring:message code="LOGIN_ERROR"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
</tr>
|
||||
</c:if>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<spring:message code="EMAIL"/>
|
||||
:
|
||||
</td>
|
||||
<td>
|
||||
<input type='text' tabindex="1" id="email" name='j_username'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<spring:message code="PASSWORD"/>
|
||||
:
|
||||
</td>
|
||||
<td>
|
||||
<input type='password' tabindex="2" id="password" name='j_password'/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="formLabel">
|
||||
<input type="checkbox" id="rememberme" name="_spring_security_remember_me"/>
|
||||
</td>
|
||||
<td>
|
||||
<spring:message code="REMEMBER_ME"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="submit" class="btn-primary" id="submitButton"
|
||||
value="<spring:message code="SIGN_IN"/>">
|
||||
|
||||
<div style="text-align:right;"><a href="<c:url value="forgotPassword.htm"/>">
|
||||
<spring:message code="FORGOT_PASSWORD"/>
|
||||
</a></div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="register">
|
||||
<b>
|
||||
<spring:message code="NOT_READY_A_USER"/>
|
||||
</b>
|
||||
<spring:message code="NOT_READY_A_USER_MESSAGE"/>
|
||||
<a href="userRegistration.htm">
|
||||
<spring:message code="JOIN_NOW"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<c:if test="${isHsql== 'true'}">
|
||||
|
||||
|
||||
<div style="padding:10px;background-color: #E0EFFF; border-radius: 5px 5px 5px 5px;border-style:solid;border-color:gray"><img src="../images/info.png" style="margin:0px 4px">Note: Although HSQLDB is bundled with WiseMapping by default during the installation, we do not recommend this database for production use. Please consider using MySQL 5.5 instead. You can find more information how to configure MySQL <a href="http://www.wisemapping.org/documentation/configu">here</a>.</div>
|
||||
</c:if>
|
||||
|
@ -1,454 +1,454 @@
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@ page import="com.wisemapping.view.MindMapBean" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Collections" %>
|
||||
<%@ page import="java.util.ArrayList" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="SITE.TITLE"/>
|
||||
</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/mymaps.css"/>
|
||||
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<jsp:include page="header.jsp">
|
||||
<jsp:param name="removeSignin" value="false"/>
|
||||
<jsp:param name="showLogout" value="true"/>
|
||||
</jsp:include>
|
||||
|
||||
|
||||
<c:url value="mymaps.htm" var="mapDetail">
|
||||
<c:param name="action" value="detail"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="deleteSelectedMapUrl">
|
||||
<c:param name="action" value="deleteAll"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
|
||||
<div id="mapListContainer">
|
||||
|
||||
<div id="myDocsContainer">
|
||||
|
||||
<div id="recentFiles" class="sb">
|
||||
<div id="recentText">
|
||||
<spring:message code="RECENT_FILES"/>
|
||||
</div>
|
||||
<div id="recentItems" class="sb">
|
||||
<div class="recentItemContainer">
|
||||
<%
|
||||
int MAX_RECENT_MAPS = 6;
|
||||
List<MindMapBean> list = (List<MindMapBean>) request.getAttribute("wisemapsList");
|
||||
if (list != null && !list.isEmpty()) {
|
||||
List<MindMapBean> recentMaps = new ArrayList<MindMapBean>();
|
||||
recentMaps.addAll(list);
|
||||
Collections.sort(recentMaps, new MindMapBean.MindMapBeanComparator());
|
||||
for (int i = recentMaps.size() - 1; i >= 0 && i >= recentMaps.size() - MAX_RECENT_MAPS; i--) {
|
||||
%>
|
||||
|
||||
<div class="recentItemIcon"></div>
|
||||
<div class="recentItemTitle">
|
||||
<a href="javascript:openMap('<%=recentMaps.get(i).getId()%>')">
|
||||
<%=recentMaps.get(i).getTitle()%>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
%>
|
||||
<div class="recentItemTitle">
|
||||
<spring:message code="EMPTY_MINDMAP_TABLE"/>
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mydocs">
|
||||
<div id="toolbar">
|
||||
<input id="selectedMapIds" type="hidden" value=""/>
|
||||
|
||||
<div class="leftMenu">
|
||||
<div class="button">
|
||||
<a href="newMap.htm" rel="moodalbox 500px 190px" title="<spring:message code="NEW_MAP_MSG"/>">
|
||||
<spring:message code="NEW_MINDMAP"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="button menuLink"
|
||||
onclick="updateLinks($(this).getParent()); new Windoo.Confirm('<spring:message code="DELETE_SELECTED_CONFIRMATION"/>',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:'<spring:message code="DELETE_MAP"/>'
|
||||
},
|
||||
'onConfirm':function(){
|
||||
$(document.toolbarForm.mindmapIds).value=$('selectedMapIds').value;
|
||||
$(document.toolbarForm).action='<c:out value="${deleteSelectedMapUrl}" escapeXml="true"/>';
|
||||
$(document.toolbarForm).submit();
|
||||
}
|
||||
});">
|
||||
<spring:message code="DELETE_SELECTED"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="button">
|
||||
<a href="importMap.htm" rel="moodalbox 500px 250px" title="<spring:message code="IMPORT_MINDMAP_DETAILS"/>">
|
||||
<spring:message code="IMPORT_MINDMAP"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<c:url value="mymaps.htm" var="shareMap">
|
||||
<c:param name="action" value="collaborator"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="deleteMapUrl">
|
||||
<c:param name="action" value="delete"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="changeStatus">
|
||||
<c:param name="action" value="changeStatus"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<div id="docTable">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:3%;"/>
|
||||
<col style="width:3%;"/>
|
||||
<col style="width:15%;"/>
|
||||
<col style="width:30%;"/>
|
||||
<col style="width:14%;"/>
|
||||
<col style="width:10%;"/>
|
||||
<col style="width:20%;"/>
|
||||
<col style="width:5%;"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center">
|
||||
<label for="checkAll"></label><input id="checkAll" type="checkbox" onchange="selectAllMaps(this);">
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="FILE"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="NAME"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="DESCRIPTION"/>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<spring:message code="STATUS"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="CREATOR"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="LAST_EDITOR"/>
|
||||
</th>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${wisemapsList}" var="mindmap">
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align:center;"><input type="checkbox" name="chk" id="chk${mindmap.id}"
|
||||
onclick="addToSelectedMapList(this);"></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="leftMenu">
|
||||
<img src="../images/icon_list.png" class="button" style="display:block;border:0;">
|
||||
|
||||
<div class="subMenu2">
|
||||
<a href="javascript:openMap('${mindmap.id}')" title="<spring:message code="OPEN_MSG"/>">
|
||||
<spring:message code="OPEN"/>
|
||||
</a>
|
||||
<c:if test="${mindmap.owner==requestScope.user}">
|
||||
<a href="renameMap.htm?mapId=${mindmap.id}" rel="moodalbox 400px 180px wizard"
|
||||
title="<spring:message code="RENAME_DETAILS"/>">
|
||||
<spring:message code="RENAME"/>
|
||||
</a>
|
||||
</c:if>
|
||||
<a href="history.htm?action=list&goToMindmapList&mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px wizard" title="<spring:message code="HISTORY_INFO"/>">
|
||||
<spring:message code="HISTORY"/>
|
||||
</a>
|
||||
|
||||
<div class="menuButton menuLink subMenu2Sep"
|
||||
onclick="new Windoo.Confirm('<spring:message code="DELETE_CONFIRMATION"/>',
|
||||
{
|
||||
window: {'theme':Windoo.Themes.wise,
|
||||
title:'<spring:message code="DELETE_MAP"/>'
|
||||
},
|
||||
'onConfirm':function(){
|
||||
var form = new Element('form').setProperties({action: '<c:out value="${deleteMapUrl}" escapeXml="true"/>&mapId=${mindmap.id}', method:'post'}).injectInside(document.body);
|
||||
form.submit();
|
||||
}
|
||||
});">
|
||||
<spring:message code="DELETE"/>
|
||||
</div>
|
||||
<a href="tags.htm?mapId=${mindmap.id}" rel="moodalbox 400px 200px wizard"
|
||||
title="<spring:message code="TAGS_DETAILS"/>">
|
||||
<spring:message code="TAGS"/>
|
||||
</a>
|
||||
<c:if test="${mindmap.owner==requestScope.user}">
|
||||
<a href="<c:out value="${shareMap}" escapeXml="true"/>&mapId=${mindmap.id}"
|
||||
rel="moodalbox 780px 530px wizard"
|
||||
title="<spring:message code="SHARE_DETAILS"/>">
|
||||
<spring:message code="COLLABORATION"/>
|
||||
</a>
|
||||
<a class="subMenu2Sep" href="publish.htm?mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px wizard" title="<spring:message code="PUBLISH_MSG"/>">
|
||||
<spring:message code="PUBLISH"/>
|
||||
</a>
|
||||
</c:if>
|
||||
<%--<a href="export.htm?mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px" title="<spring:message code="EXPORT_DETAILS"/>">
|
||||
<spring:message code="EXPORT"/>
|
||||
</a>--%>
|
||||
<%--<a href="javascript:printMap(${mindmap.id});">
|
||||
<spring:message code="PRINT"/>
|
||||
</a>--%>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<div class="mapTitle">
|
||||
<a href="javascript:openMap('${mindmap.id}')">
|
||||
${mindmap.title}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mapTags">
|
||||
${mindmap.tags}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
${mindmap.description}
|
||||
</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${not mindmap.public}">
|
||||
<img src="../images/key.png"
|
||||
title="<spring:message code="PRIVATE"/>: <spring:message code="ONLY_VIEW_PRIVATE"/>"
|
||||
alt="<spring:message code="PRIVATE"/>"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<img src="../images/world2.png"
|
||||
title="<spring:message code="PUBLIC"/>: <spring:message code="ALL_VIEW_PUBLIC"/>"
|
||||
alt="World"
|
||||
<spring:message code="PUBLIC"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${mindmap.creationUser}</td>
|
||||
<td>${mindmap.lastEditDate} by ${mindmap.lastEditor}</td>
|
||||
<td><a href="<c:out value="${mapDetail}" escapeXml="true"/>&mapId=${mindmap.id}">
|
||||
<spring:message code="DETAIL"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ds1" class="submenu" style="display:none;">
|
||||
<a href="<c:out value="${deleteSelectedMapUrl}" escapeXml="true"/>&mindmapIds=" rel="moodalbox 300px 120px">Delete</a>
|
||||
<a href="#">Tag</a>
|
||||
<a href="#">Publish</a>
|
||||
</div>
|
||||
|
||||
<div id="ds2" class="submenu" style="position:absolute; display:none;">
|
||||
<a href="<c:out value="${shareMap}" escapeXml="true"/>&mapId=" rel="moodalbox 780px 530px"
|
||||
title="Share WiseMap">Share</a>
|
||||
<a href="publish.htm?mapId=" rel="moodalbox 600px 400px wizard" title="<spring:message code="PUBLISH_DETAILS"/>">
|
||||
<spring:message code="PUBLISH"/>
|
||||
</a>
|
||||
<a href="<c:out value="${deleteMapUrl}" escapeXml="true"/>&mapId=" rel="moodalbox 300px 120px"
|
||||
title="Delete Confirmation">
|
||||
Delete
|
||||
</a>
|
||||
<a href="export.htm?mapId=" rel="moodalbox 750px 400px" title="<spring:message code="EXPORT_DETAILS"/>">
|
||||
<spring:message code="EXPORT"/>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:url value="editor.htm" var="mindmapEditorUrl"/>
|
||||
<form name="openForm" action="${mindmapEditorUrl}" method="post">
|
||||
<input type="hidden" name="action" value="open"/>
|
||||
<input type="hidden" name="mapId" value=""/>
|
||||
</form>
|
||||
<form name="toolbarForm" method="post">
|
||||
<input type="hidden" name="mindmapIds"/>
|
||||
</form>
|
||||
<form method="post" id="printForm" name="printForm" action="<c:url value="export.htm"/>" target="new">
|
||||
<input type="hidden" name="action" value="print"/>
|
||||
<input type="hidden" name="mapId" value="${mindmap.id}"/>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function openMap(mapId) {
|
||||
document.openForm.mapId.value = mapId;
|
||||
document.openForm.submit();
|
||||
}
|
||||
function deleteOkButton(url) {
|
||||
var form = document.createElement('form');
|
||||
form.method = 'post';
|
||||
form.action = url;
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
|
||||
Window.onDomReady(initDropDowns);
|
||||
function initDropDowns() {
|
||||
$ES('li[rel="submenu"]', $(document.body)).each(function(el) {
|
||||
var items = $E('ul', el);
|
||||
el.addEvent('click', showMenu.bind(items));
|
||||
}, this);
|
||||
}
|
||||
|
||||
function showMenu(evt) {
|
||||
if ($(document).onclick) {
|
||||
$(document).fireEvent('click', 0);
|
||||
showMenu.delay(110, this, evt);
|
||||
}
|
||||
else {
|
||||
this.myEffect = $(this).effects({duration:100, transition: Fx.Transitions.linear});
|
||||
this.myEffect.start({'opacity':[0,1]});
|
||||
$(document).onclick = hide.bind(this);
|
||||
var event = new Event(evt);
|
||||
event.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
this.myEffect.start({'opacity':[1,0]});
|
||||
$(document).onclick = '';
|
||||
}
|
||||
|
||||
function updateLinks(el) {
|
||||
$ES('a', el).each(function(link) {
|
||||
if (!link.ohref) {
|
||||
link.ohref = link.getProperty('ohref');
|
||||
}
|
||||
link.href = link.ohref + $('selectedMapIds').value;
|
||||
});
|
||||
}
|
||||
|
||||
function openWizard(href, title, rel) {
|
||||
href = href + $('selectedMapIds').value;
|
||||
// MOOdalBox.open(href, title, rel);
|
||||
}
|
||||
|
||||
function addToSelectedMapList(el) {
|
||||
var ids = $('selectedMapIds');
|
||||
var id = el.id.replace(/[^\d]/g, '');
|
||||
|
||||
var value = ids.getProperty("value");
|
||||
|
||||
if (value != "") {
|
||||
var allIds = $A(ids.value.split(','));
|
||||
var changed = false;
|
||||
if (allIds.contains(id) && !el.checked) {
|
||||
allIds.remove(id);
|
||||
changed = true;
|
||||
}
|
||||
else if (!allIds.contains(id) && el.checked) {
|
||||
allIds.extend([id]);
|
||||
changed = true;
|
||||
}
|
||||
if (changed) {
|
||||
var finalIds = "";
|
||||
$each(allIds, function(el) {
|
||||
if (!finalIds == "") {
|
||||
el = "," + el;
|
||||
}
|
||||
finalIds = finalIds + el;
|
||||
});
|
||||
value = finalIds;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (el.checked) {
|
||||
value = id;
|
||||
}
|
||||
}
|
||||
ids.setProperty("value", value);
|
||||
}
|
||||
|
||||
|
||||
function selectAllMaps(elem) {
|
||||
var value = elem.checked;
|
||||
var ids = "";
|
||||
$ES('input[type="checkbox"]', $('docTable')).each(function(el) {
|
||||
if (el.name.contains('chk')) {
|
||||
el.checked = value;
|
||||
var id = el.id.replace(/[^\d]/g, '');
|
||||
if (!ids == "") {
|
||||
id = "," + id;
|
||||
}
|
||||
ids = ids + id;
|
||||
}
|
||||
});
|
||||
if (!value) {
|
||||
$('selectedMapIds').setProperty('value', '');
|
||||
}
|
||||
else {
|
||||
$('selectedMapIds').setProperty('value', ids);
|
||||
}
|
||||
/*var allElems = document.getElementsByName("chk");
|
||||
for (var i = 0; i < allElems.length; i++)
|
||||
{
|
||||
allElems[i].checked = value;
|
||||
}*/
|
||||
}
|
||||
|
||||
function printMap(mapId) {
|
||||
document.printForm.mapId.value = mapId;
|
||||
document.printForm.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function removeCollaborator(collaboratorEmail) {
|
||||
document.removeCollaboratorForm.colaboratorId.value = collaboratorEmail;
|
||||
document.removeCollaboratorForm.submit();
|
||||
//submitDialog('removeCollaboratorForm');
|
||||
}
|
||||
function addFriendsEmails() {
|
||||
var newUsers = "";
|
||||
var ob = $('friendList');
|
||||
while (ob.selectedIndex != -1) {
|
||||
newUsers = newUsers + ", " + ob.options[ob.selectedIndex].value;
|
||||
ob.options[ob.selectedIndex].selected = false;
|
||||
}
|
||||
var dest = $('emailList');
|
||||
if (dest.value == "")
|
||||
newUsers = newUsers.substr(2, newUsers.length);
|
||||
dest.value = dest.value + newUsers;
|
||||
}
|
||||
function changeStatus(collaboratorEmail) {
|
||||
document.removeCollaboratorForm.userEmail.value = collaboratorEmail;
|
||||
submitDialog('removeCollaboratorForm');
|
||||
}
|
||||
|
||||
</script>
|
||||
<jsp:include page="footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE HTML>
|
||||
|
||||
<%@ page import="com.wisemapping.view.MindMapBean" %>
|
||||
<%@ page import="java.util.List" %>
|
||||
<%@ page import="java.util.Collections" %>
|
||||
<%@ page import="java.util.ArrayList" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="SITE.TITLE"/>
|
||||
</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/mymaps.css"/>
|
||||
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type='text/javascript' src='../js/mootools-core.js'></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="content">
|
||||
<jsp:include page="header.jsp">
|
||||
<jsp:param name="removeSignin" value="false"/>
|
||||
<jsp:param name="showLogout" value="true"/>
|
||||
</jsp:include>
|
||||
|
||||
|
||||
<c:url value="mymaps.htm" var="mapDetail">
|
||||
<c:param name="action" value="detail"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="deleteSelectedMapUrl">
|
||||
<c:param name="action" value="deleteAll"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
|
||||
<div id="mapListContainer">
|
||||
|
||||
<div id="myDocsContainer">
|
||||
|
||||
<div id="recentFiles" class="sb">
|
||||
<div id="recentText">
|
||||
<spring:message code="RECENT_FILES"/>
|
||||
</div>
|
||||
<div id="recentItems" class="sb">
|
||||
<div class="recentItemContainer">
|
||||
<%
|
||||
int MAX_RECENT_MAPS = 6;
|
||||
List<MindMapBean> list = (List<MindMapBean>) request.getAttribute("wisemapsList");
|
||||
if (list != null && !list.isEmpty()) {
|
||||
List<MindMapBean> recentMaps = new ArrayList<MindMapBean>();
|
||||
recentMaps.addAll(list);
|
||||
Collections.sort(recentMaps, new MindMapBean.MindMapBeanComparator());
|
||||
for (int i = recentMaps.size() - 1; i >= 0 && i >= recentMaps.size() - MAX_RECENT_MAPS; i--) {
|
||||
%>
|
||||
|
||||
<div class="recentItemIcon"></div>
|
||||
<div class="recentItemTitle">
|
||||
<a href="javascript:openMap('<%=recentMaps.get(i).getId()%>')">
|
||||
<%=recentMaps.get(i).getTitle()%>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<%
|
||||
}
|
||||
} else {
|
||||
%>
|
||||
<div class="recentItemTitle">
|
||||
<spring:message code="EMPTY_MINDMAP_TABLE"/>
|
||||
</div>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="mydocs">
|
||||
<div id="toolbar">
|
||||
<input id="selectedMapIds" type="hidden" value=""/>
|
||||
|
||||
<div class="leftMenu">
|
||||
<div class="button">
|
||||
<a href="newMap.htm" rel="moodalbox 500px 190px" title="<spring:message code="NEW_MAP_MSG"/>">
|
||||
<spring:message code="NEW_MINDMAP"/>
|
||||
</a>
|
||||
</div>
|
||||
<div class="button menuLink"
|
||||
onclick="updateLinks($(this).getParent()); new Windoo.Confirm('<spring:message code="DELETE_SELECTED_CONFIRMATION"/>',
|
||||
{
|
||||
'window': {theme:Windoo.Themes.wise,
|
||||
title:'<spring:message code="DELETE_MAP"/>'
|
||||
},
|
||||
'onConfirm':function(){
|
||||
$(document.toolbarForm.mindmapIds).value=$('selectedMapIds').value;
|
||||
$(document.toolbarForm).action='<c:out value="${deleteSelectedMapUrl}" escapeXml="true"/>';
|
||||
$(document.toolbarForm).submit();
|
||||
}
|
||||
});">
|
||||
<spring:message code="DELETE_SELECTED"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="button">
|
||||
<a href="importMap.htm" rel="moodalbox 500px 250px" title="<spring:message code="IMPORT_MINDMAP_DETAILS"/>">
|
||||
<spring:message code="IMPORT_MINDMAP"/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<c:url value="mymaps.htm" var="shareMap">
|
||||
<c:param name="action" value="collaborator"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="deleteMapUrl">
|
||||
<c:param name="action" value="delete"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<c:url value="mymaps.htm" var="changeStatus">
|
||||
<c:param name="action" value="changeStatus"/>
|
||||
<c:param name="userEmail" value="${pageContext.request.userPrincipal.name}"/>
|
||||
</c:url>
|
||||
<div id="docTable">
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style="width:3%;"/>
|
||||
<col style="width:3%;"/>
|
||||
<col style="width:15%;"/>
|
||||
<col style="width:30%;"/>
|
||||
<col style="width:14%;"/>
|
||||
<col style="width:10%;"/>
|
||||
<col style="width:20%;"/>
|
||||
<col style="width:5%;"/>
|
||||
</colgroup>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="text-align:center">
|
||||
<label for="checkAll"></label><input id="checkAll" type="checkbox" onchange="selectAllMaps(this);">
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="FILE"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="NAME"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="DESCRIPTION"/>
|
||||
</th>
|
||||
|
||||
<th>
|
||||
<spring:message code="STATUS"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="CREATOR"/>
|
||||
</th>
|
||||
<th>
|
||||
<spring:message code="LAST_EDITOR"/>
|
||||
</th>
|
||||
<th>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<c:forEach items="${wisemapsList}" var="mindmap">
|
||||
<tr>
|
||||
<td>
|
||||
<div style="text-align:center;"><input type="checkbox" name="chk" id="chk${mindmap.id}"
|
||||
onclick="addToSelectedMapList(this);"></div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="leftMenu">
|
||||
<img src="../images/icon_list.png" class="button" style="display:block;border:0;">
|
||||
|
||||
<div class="subMenu2">
|
||||
<a href="javascript:openMap('${mindmap.id}')" title="<spring:message code="OPEN_MSG"/>">
|
||||
<spring:message code="OPEN"/>
|
||||
</a>
|
||||
<c:if test="${mindmap.owner==requestScope.user}">
|
||||
<a href="renameMap.htm?mapId=${mindmap.id}" rel="moodalbox 400px 180px wizard"
|
||||
title="<spring:message code="RENAME_DETAILS"/>">
|
||||
<spring:message code="RENAME"/>
|
||||
</a>
|
||||
</c:if>
|
||||
<a href="history.htm?action=list&goToMindmapList&mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px wizard" title="<spring:message code="HISTORY_INFO"/>">
|
||||
<spring:message code="HISTORY"/>
|
||||
</a>
|
||||
|
||||
<div class="menuButton menuLink subMenu2Sep"
|
||||
onclick="new Windoo.Confirm('<spring:message code="DELETE_CONFIRMATION"/>',
|
||||
{
|
||||
window: {'theme':Windoo.Themes.wise,
|
||||
title:'<spring:message code="DELETE_MAP"/>'
|
||||
},
|
||||
'onConfirm':function(){
|
||||
var form = new Element('form').setProperties({action: '<c:out value="${deleteMapUrl}" escapeXml="true"/>&mapId=${mindmap.id}', method:'post'}).injectInside(document.body);
|
||||
form.submit();
|
||||
}
|
||||
});">
|
||||
<spring:message code="DELETE"/>
|
||||
</div>
|
||||
<a href="tags.htm?mapId=${mindmap.id}" rel="moodalbox 400px 200px wizard"
|
||||
title="<spring:message code="TAGS_DETAILS"/>">
|
||||
<spring:message code="TAGS"/>
|
||||
</a>
|
||||
<c:if test="${mindmap.owner==requestScope.user}">
|
||||
<a href="<c:out value="${shareMap}" escapeXml="true"/>&mapId=${mindmap.id}"
|
||||
rel="moodalbox 780px 530px wizard"
|
||||
title="<spring:message code="SHARE_DETAILS"/>">
|
||||
<spring:message code="COLLABORATION"/>
|
||||
</a>
|
||||
<a class="subMenu2Sep" href="publish.htm?mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px wizard" title="<spring:message code="PUBLISH_MSG"/>">
|
||||
<spring:message code="PUBLISH"/>
|
||||
</a>
|
||||
</c:if>
|
||||
<%--<a href="export.htm?mapId=${mindmap.id}"
|
||||
rel="moodalbox 600px 400px" title="<spring:message code="EXPORT_DETAILS"/>">
|
||||
<spring:message code="EXPORT"/>
|
||||
</a>--%>
|
||||
<%--<a href="javascript:printMap(${mindmap.id});">
|
||||
<spring:message code="PRINT"/>
|
||||
</a>--%>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div>
|
||||
<div class="mapTitle">
|
||||
<a href="javascript:openMap('${mindmap.id}')">
|
||||
${mindmap.title}
|
||||
</a>
|
||||
</div>
|
||||
<div class="mapTags">
|
||||
${mindmap.tags}
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
${mindmap.description}
|
||||
</td>
|
||||
<td>
|
||||
<c:choose>
|
||||
<c:when test="${not mindmap.public}">
|
||||
<img src="../images/key.png"
|
||||
title="<spring:message code="PRIVATE"/>: <spring:message code="ONLY_VIEW_PRIVATE"/>"
|
||||
alt="<spring:message code="PRIVATE"/>"/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<img src="../images/world2.png"
|
||||
title="<spring:message code="PUBLIC"/>: <spring:message code="ALL_VIEW_PUBLIC"/>"
|
||||
alt="World"
|
||||
<spring:message code="PUBLIC"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</td>
|
||||
<td>${mindmap.creationUser}</td>
|
||||
<td>${mindmap.lastEditDate} by ${mindmap.lastEditor}</td>
|
||||
<td><a href="<c:out value="${mapDetail}" escapeXml="true"/>&mapId=${mindmap.id}">
|
||||
<spring:message code="DETAIL"/>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</c:forEach>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="ds1" class="submenu" style="display:none;">
|
||||
<a href="<c:out value="${deleteSelectedMapUrl}" escapeXml="true"/>&mindmapIds=" rel="moodalbox 300px 120px">Delete</a>
|
||||
<a href="#">Tag</a>
|
||||
<a href="#">Publish</a>
|
||||
</div>
|
||||
|
||||
<div id="ds2" class="submenu" style="position:absolute; display:none;">
|
||||
<a href="<c:out value="${shareMap}" escapeXml="true"/>&mapId=" rel="moodalbox 780px 530px"
|
||||
title="Share WiseMap">Share</a>
|
||||
<a href="publish.htm?mapId=" rel="moodalbox 600px 400px wizard" title="<spring:message code="PUBLISH_DETAILS"/>">
|
||||
<spring:message code="PUBLISH"/>
|
||||
</a>
|
||||
<a href="<c:out value="${deleteMapUrl}" escapeXml="true"/>&mapId=" rel="moodalbox 300px 120px"
|
||||
title="Delete Confirmation">
|
||||
Delete
|
||||
</a>
|
||||
<a href="export.htm?mapId=" rel="moodalbox 750px 400px" title="<spring:message code="EXPORT_DETAILS"/>">
|
||||
<spring:message code="EXPORT"/>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<c:url value="editor.htm" var="mindmapEditorUrl"/>
|
||||
<form name="openForm" action="${mindmapEditorUrl}" method="post">
|
||||
<input type="hidden" name="action" value="open"/>
|
||||
<input type="hidden" name="mapId" value=""/>
|
||||
</form>
|
||||
<form name="toolbarForm" method="post">
|
||||
<input type="hidden" name="mindmapIds"/>
|
||||
</form>
|
||||
<form method="post" id="printForm" name="printForm" action="<c:url value="export.htm"/>" target="new">
|
||||
<input type="hidden" name="action" value="print"/>
|
||||
<input type="hidden" name="mapId" value="${mindmap.id}"/>
|
||||
</form>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
function openMap(mapId) {
|
||||
document.openForm.mapId.value = mapId;
|
||||
document.openForm.submit();
|
||||
}
|
||||
function deleteOkButton(url) {
|
||||
var form = document.createElement('form');
|
||||
form.method = 'post';
|
||||
form.action = url;
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
|
||||
Window.onDomReady(initDropDowns);
|
||||
function initDropDowns() {
|
||||
$ES('li[rel="submenu"]', $(document.body)).each(function(el) {
|
||||
var items = $E('ul', el);
|
||||
el.addEvent('click', showMenu.bind(items));
|
||||
}, this);
|
||||
}
|
||||
|
||||
function showMenu(evt) {
|
||||
if ($(document).onclick) {
|
||||
$(document).fireEvent('click', 0);
|
||||
showMenu.delay(110, this, evt);
|
||||
}
|
||||
else {
|
||||
this.myEffect = $(this).effects({duration:100, transition: Fx.Transitions.linear});
|
||||
this.myEffect.start({'opacity':[0,1]});
|
||||
$(document).onclick = hide.bind(this);
|
||||
var event = new Event(evt);
|
||||
event.stop();
|
||||
}
|
||||
}
|
||||
|
||||
function hide() {
|
||||
this.myEffect.start({'opacity':[1,0]});
|
||||
$(document).onclick = '';
|
||||
}
|
||||
|
||||
function updateLinks(el) {
|
||||
$ES('a', el).each(function(link) {
|
||||
if (!link.ohref) {
|
||||
link.ohref = link.getProperty('ohref');
|
||||
}
|
||||
link.href = link.ohref + $('selectedMapIds').value;
|
||||
});
|
||||
}
|
||||
|
||||
function openWizard(href, title, rel) {
|
||||
href = href + $('selectedMapIds').value;
|
||||
// MOOdalBox.open(href, title, rel);
|
||||
}
|
||||
|
||||
function addToSelectedMapList(el) {
|
||||
var ids = $('selectedMapIds');
|
||||
var id = el.id.replace(/[^\d]/g, '');
|
||||
|
||||
var value = ids.getProperty("value");
|
||||
|
||||
if (value != "") {
|
||||
var allIds = $A(ids.value.split(','));
|
||||
var changed = false;
|
||||
if (allIds.contains(id) && !el.checked) {
|
||||
allIds.remove(id);
|
||||
changed = true;
|
||||
}
|
||||
else if (!allIds.contains(id) && el.checked) {
|
||||
allIds.extend([id]);
|
||||
changed = true;
|
||||
}
|
||||
if (changed) {
|
||||
var finalIds = "";
|
||||
$each(allIds, function(el) {
|
||||
if (!finalIds == "") {
|
||||
el = "," + el;
|
||||
}
|
||||
finalIds = finalIds + el;
|
||||
});
|
||||
value = finalIds;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (el.checked) {
|
||||
value = id;
|
||||
}
|
||||
}
|
||||
ids.setProperty("value", value);
|
||||
}
|
||||
|
||||
|
||||
function selectAllMaps(elem) {
|
||||
var value = elem.checked;
|
||||
var ids = "";
|
||||
$ES('input[type="checkbox"]', $('docTable')).each(function(el) {
|
||||
if (el.name.contains('chk')) {
|
||||
el.checked = value;
|
||||
var id = el.id.replace(/[^\d]/g, '');
|
||||
if (!ids == "") {
|
||||
id = "," + id;
|
||||
}
|
||||
ids = ids + id;
|
||||
}
|
||||
});
|
||||
if (!value) {
|
||||
$('selectedMapIds').setProperty('value', '');
|
||||
}
|
||||
else {
|
||||
$('selectedMapIds').setProperty('value', ids);
|
||||
}
|
||||
/*var allElems = document.getElementsByName("chk");
|
||||
for (var i = 0; i < allElems.length; i++)
|
||||
{
|
||||
allElems[i].checked = value;
|
||||
}*/
|
||||
}
|
||||
|
||||
function printMap(mapId) {
|
||||
document.printForm.mapId.value = mapId;
|
||||
document.printForm.submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
function removeCollaborator(collaboratorEmail) {
|
||||
document.removeCollaboratorForm.colaboratorId.value = collaboratorEmail;
|
||||
document.removeCollaboratorForm.submit();
|
||||
//submitDialog('removeCollaboratorForm');
|
||||
}
|
||||
function addFriendsEmails() {
|
||||
var newUsers = "";
|
||||
var ob = $('friendList');
|
||||
while (ob.selectedIndex != -1) {
|
||||
newUsers = newUsers + ", " + ob.options[ob.selectedIndex].value;
|
||||
ob.options[ob.selectedIndex].selected = false;
|
||||
}
|
||||
var dest = $('emailList');
|
||||
if (dest.value == "")
|
||||
newUsers = newUsers.substr(2, newUsers.length);
|
||||
dest.value = dest.value + newUsers;
|
||||
}
|
||||
function changeStatus(collaboratorEmail) {
|
||||
document.removeCollaboratorForm.userEmail.value = collaboratorEmail;
|
||||
submitDialog('removeCollaboratorForm');
|
||||
}
|
||||
|
||||
</script>
|
||||
<jsp:include page="footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -25,8 +25,8 @@
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../css/print.css"/>
|
||||
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-core-1.3.2-full-compress.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-core.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-more.js'></script>
|
||||
<script type='text/javascript' src='../js/core.js'></script>
|
||||
|
||||
|
||||
|
@ -1,44 +1,44 @@
|
||||
<!DOCTYPE HTML>
|
||||
<%@page pageEncoding="UTF-8" %>
|
||||
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<tiles:importAttribute name="title" scope="request"/>
|
||||
<tiles:importAttribute name="details" scope="request"/>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="SITE.TITLE"/>
|
||||
-
|
||||
<c:choose>
|
||||
<c:when test="${requestScope.viewTitle!=null}">
|
||||
${requestScope.viewTitle}
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<spring:message code="${requestScope.title}"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/wisehome.css"/>
|
||||
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
|
||||
<script type='text/javascript' src='../js/libraries/mootools/mootools-more-1.3.2.1-yui.js'></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<jsp:include page="header.jsp"/>
|
||||
|
||||
<div class="pageBody">
|
||||
|
||||
<div class="pageBodyContent">
|
||||
<tiles:insert name="body"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<jsp:include page="footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
<!DOCTYPE HTML>
|
||||
<%@page pageEncoding="UTF-8" %>
|
||||
<%@ taglib prefix="tiles" uri="http://struts.apache.org/tags-tiles" %>
|
||||
<%@ include file="/jsp/init.jsp" %>
|
||||
|
||||
<tiles:importAttribute name="title" scope="request"/>
|
||||
<tiles:importAttribute name="details" scope="request"/>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
<spring:message code="SITE.TITLE"/>
|
||||
-
|
||||
<c:choose>
|
||||
<c:when test="${requestScope.viewTitle!=null}">
|
||||
${requestScope.viewTitle}
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<spring:message code="${requestScope.title}"/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</title>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
|
||||
<link rel="stylesheet" type="text/css" href="../css/wisehome.css"/>
|
||||
<link rel="icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<link rel="shortcut icon" href="${pageContext.request.contextPath}/images/favicon.ico" type="image/x-icon"/>
|
||||
<script type='text/javascript'
|
||||
src='https://ajax.googleapis.com/ajax/libs/mootools/1.3.2/mootools-yui-compressed.js'></script>
|
||||
<script type='text/javascript' src='../js/mootools-more.js'></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<jsp:include page="header.jsp"/>
|
||||
|
||||
<div class="pageBody">
|
||||
|
||||
<div class="pageBodyContent">
|
||||
<tiles:insert name="body"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<jsp:include page="footer.jsp"/>
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user