solving merge conflict

This commit is contained in:
Ezequiel Bergamaschi
2014-02-05 21:21:00 -03:00
committed by Ezequiel Bergamaschi
20 changed files with 427 additions and 143 deletions

View File

@@ -46,8 +46,6 @@ public interface MindmapService {
void removeCollaboration(@NotNull Mindmap mindmap, @NotNull Collaboration collaboration) throws CollaborationException;
void addTags(@NotNull Mindmap mindmap, String tags);
void removeMindmap(@NotNull final Mindmap mindmap, @NotNull final User user) throws WiseMappingException;
List<Mindmap> search(MindMapCriteria criteria);

View File

@@ -243,28 +243,6 @@ public class MindmapServiceImpl
return collaborator;
}
@Override
public void addTags(@NotNull Mindmap mindmap, String tags) {
mindmap.setTags(tags);
mindmapManager.updateMindmap(mindmap, false);
if (tags != null && tags.length() > 0) {
final String tag[] = tags.split(TAG_SEPARATOR);
final User user = mindmap.getCreator();
// Add new Tags to User
boolean updateUser = false;
for (String userTag : tag) {
if (!user.getTags().contains(userTag)) {
user.getTags().add(userTag);
updateUser = true;
}
}
if (updateUser) {
//update user
userService.updateUser(user);
}
}
}
@Override
public List<MindMapHistory> findMindmapHistory(int mindmapId) {

View File

@@ -38,7 +38,7 @@ public interface UserService {
public void resetPassword(@NotNull String email) throws InvalidUserEmailException, InvalidAuthSchemaException;
public void deleteUser(@NotNull User user);
public void removeUser(@NotNull User user);
public void auditLogin(@NotNull User user);

View File

@@ -21,7 +21,11 @@ package com.wisemapping.service;
import com.wisemapping.dao.UserManager;
import com.wisemapping.exceptions.WiseMappingException;
import com.wisemapping.mail.NotificationService;
import com.wisemapping.model.*;
import com.wisemapping.model.AccessAuditory;
import com.wisemapping.model.AuthenticationType;
import com.wisemapping.model.Collaborator;
import com.wisemapping.model.Mindmap;
import com.wisemapping.model.User;
import org.apache.velocity.app.VelocityEngine;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -29,8 +33,11 @@ import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.ui.velocity.VelocityEngineUtils;
import java.io.IOException;
import java.util.*;
import java.util.Calendar;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
import java.util.UUID;
public class UserServiceImpl
implements UserService {
@@ -95,8 +102,10 @@ public class UserServiceImpl
}
@Override
public void deleteUser(@NotNull User user) {
userManager.deleteUser(user);
public void removeUser(@NotNull User user) {
// Force object reload before removing....
final User userBy = userManager.getUserBy(user.getEmail());
userManager.removeUser(userBy);
}
@Override