Update to HSQLDB driver
Remove DWR Remove native SVG tables Add new REST services for persistence.
This commit is contained in:
@@ -24,11 +24,11 @@ import java.util.List;
|
||||
|
||||
public interface MindmapManager {
|
||||
|
||||
Colaborator getColaboratorBy(String email);
|
||||
Collaborator getCollaboratorBy(String email);
|
||||
|
||||
Colaborator getColaboratorBy(long id);
|
||||
Collaborator getCollaboratorBy(long id);
|
||||
|
||||
List<MindmapUser> getMindmapUserByColaborator(final long colaboratorId);
|
||||
List<MindmapUser> getMindmapUserByCollaborator(final long collaboratorId);
|
||||
|
||||
List<MindmapUser> getMindmapUserByRole(final UserRole userRole);
|
||||
|
||||
@@ -40,7 +40,7 @@ public interface MindmapManager {
|
||||
|
||||
MindMap getMindmapByTitle(final String name, final User user);
|
||||
|
||||
void addColaborator (Colaborator colaborator);
|
||||
void addCollaborator(Collaborator collaborator);
|
||||
|
||||
void addMindmap(User user, MindMap mindMap);
|
||||
|
||||
@@ -50,7 +50,7 @@ public interface MindmapManager {
|
||||
|
||||
void updateMindmap(MindMap mindMap, boolean saveHistory);
|
||||
|
||||
void removeColaborator(Colaborator colaborator);
|
||||
void removeCollaborator(Collaborator collaborator);
|
||||
|
||||
void removeMindmap(MindMap mindap);
|
||||
|
||||
|
@@ -33,16 +33,16 @@ public class MindmapManagerImpl
|
||||
extends HibernateDaoSupport
|
||||
implements MindmapManager {
|
||||
|
||||
public Colaborator getColaboratorBy(final String email) {
|
||||
final Colaborator colaborator;
|
||||
final List colaborators = getHibernateTemplate().find("from com.wisemapping.model.Colaborator colaborator where email=?", email);
|
||||
public Collaborator getCollaboratorBy(final String email) {
|
||||
final Collaborator collaborator;
|
||||
final List colaborators = getHibernateTemplate().find("from com.wisemapping.model.Collaborator collaborator where email=?", email);
|
||||
if (colaborators != null && !colaborators.isEmpty()) {
|
||||
assert colaborators.size() == 1 : "More than one user with the same username!";
|
||||
colaborator = (Colaborator) colaborators.get(0);
|
||||
collaborator = (Collaborator) colaborators.get(0);
|
||||
} else {
|
||||
colaborator = null;
|
||||
collaborator = null;
|
||||
}
|
||||
return colaborator;
|
||||
return collaborator;
|
||||
}
|
||||
|
||||
public List<MindMap> search(MindMapCriteria criteria) {
|
||||
@@ -104,11 +104,11 @@ public class MindmapManagerImpl
|
||||
return hibernateCriteria.list();
|
||||
}
|
||||
|
||||
public Colaborator getColaboratorBy(long id) {
|
||||
return (Colaborator) getHibernateTemplate().get(Colaborator.class, id);
|
||||
public Collaborator getCollaboratorBy(long id) {
|
||||
return (Collaborator) getHibernateTemplate().get(Collaborator.class, id);
|
||||
}
|
||||
|
||||
public List<MindmapUser> getMindmapUserByColaborator(final long colaboratorId) {
|
||||
public List<MindmapUser> getMindmapUserByCollaborator(final long colaboratorId) {
|
||||
return getHibernateTemplate().find("from com.wisemapping.model.MindmapUser mindmapUser where colaborator_id=?", colaboratorId);
|
||||
}
|
||||
|
||||
@@ -129,17 +129,17 @@ public class MindmapManagerImpl
|
||||
return result;
|
||||
}
|
||||
|
||||
public void addColaborator(Colaborator colaborator) {
|
||||
assert colaborator != null : "ADD MINDMAP COLABORATOR: Colaborator is required!";
|
||||
getHibernateTemplate().save(colaborator);
|
||||
public void addCollaborator(Collaborator collaborator) {
|
||||
assert collaborator != null : "ADD MINDMAP COLABORATOR: Collaborator is required!";
|
||||
getHibernateTemplate().save(collaborator);
|
||||
}
|
||||
|
||||
public void removeMindmapUser(MindmapUser mindmapUser) {
|
||||
getHibernateTemplate().delete(mindmapUser);
|
||||
}
|
||||
|
||||
public void removeColaborator(Colaborator colaborator) {
|
||||
getHibernateTemplate().delete(colaborator);
|
||||
public void removeCollaborator(Collaborator collaborator) {
|
||||
getHibernateTemplate().delete(collaborator);
|
||||
}
|
||||
|
||||
public List<MindMap> getAllMindmaps() {
|
||||
@@ -172,13 +172,11 @@ public class MindmapManagerImpl
|
||||
|
||||
public void saveMindmap(MindMap mindMap) {
|
||||
assert mindMap != null : "Save Mindmap: Mindmap is required!";
|
||||
getSession().saveOrUpdate(mindMap.getNativeBrowser());
|
||||
getSession().save(mindMap);
|
||||
}
|
||||
|
||||
public void updateMindmap(MindMap mindMap, boolean saveHistory) {
|
||||
assert mindMap != null : "Save Mindmap: Mindmap is required!";
|
||||
getHibernateTemplate().saveOrUpdate(mindMap.getNativeBrowser());
|
||||
getHibernateTemplate().saveOrUpdate(mindMap);
|
||||
if (saveHistory)
|
||||
{
|
||||
|
@@ -18,9 +18,9 @@
|
||||
|
||||
package com.wisemapping.dao;
|
||||
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.model.UserLogin;
|
||||
import com.wisemapping.model.Colaborator;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -44,7 +44,7 @@ public interface UserManager {
|
||||
|
||||
User getUserByActivationCode(long code);
|
||||
|
||||
public Colaborator getColaboratorBy(String email);
|
||||
public Collaborator getCollaboratorBy(String email);
|
||||
|
||||
public User createUser(User user, Colaborator col);
|
||||
public User createUser(User user, Collaborator col);
|
||||
}
|
||||
|
@@ -18,10 +18,11 @@
|
||||
|
||||
package com.wisemapping.dao;
|
||||
|
||||
import com.wisemapping.model.Colaborator;
|
||||
import com.wisemapping.model.Collaborator;
|
||||
import com.wisemapping.model.MindmapUser;
|
||||
import com.wisemapping.model.User;
|
||||
import com.wisemapping.model.UserLogin;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
|
||||
//import org.acegisecurity.providers.encoding.PasswordEncoder;
|
||||
|
||||
@@ -55,12 +56,12 @@ public class UserManagerImpl
|
||||
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);
|
||||
public Collaborator getCollaboratorBy(final String email) {
|
||||
final Collaborator cola;
|
||||
final List cols = getHibernateTemplate().find("from com.wisemapping.model.Collaborator 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);
|
||||
cola = (Collaborator) cols.get(0);
|
||||
} else {
|
||||
cola = null;
|
||||
}
|
||||
@@ -97,7 +98,7 @@ public class UserManagerImpl
|
||||
getHibernateTemplate().saveOrUpdate(user);
|
||||
}
|
||||
|
||||
public User createUser(User user, Colaborator col)
|
||||
public User createUser(@NotNull User user, @NotNull Collaborator col)
|
||||
{
|
||||
// user.setPassword(passwordEncoder.encodePassword(user.getPassword(),null));
|
||||
assert user != null : "Trying to store a null user";
|
||||
@@ -107,7 +108,7 @@ public class UserManagerImpl
|
||||
MindmapUser newMapUser = new MindmapUser();
|
||||
newMapUser.setRoleId(mindmapUser.getRole().ordinal());
|
||||
newMapUser.setMindMap(mindmapUser.getMindMap());
|
||||
newMapUser.setColaborator(user);
|
||||
newMapUser.setCollaborator(user);
|
||||
user.addMindmapUser(newMapUser);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user