diff --git a/services/src/main/java/org/exoplatform/task/integration/SpaceTaskDataInitializer.java b/services/src/main/java/org/exoplatform/task/integration/SpaceTaskDataInitializer.java
index 5c89c871b..6945dc6c0 100644
--- a/services/src/main/java/org/exoplatform/task/integration/SpaceTaskDataInitializer.java
+++ b/services/src/main/java/org/exoplatform/task/integration/SpaceTaskDataInitializer.java
@@ -14,11 +14,14 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, see.
**/
-
+
package org.exoplatform.task.integration;
-import org.exoplatform.services.log.ExoLogger;
-import org.exoplatform.services.log.Log;
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
import org.exoplatform.social.core.space.SpaceListenerPlugin;
import org.exoplatform.social.core.space.model.Space;
import org.exoplatform.social.core.space.spi.SpaceLifeCycleEvent;
@@ -28,101 +31,28 @@
import org.exoplatform.task.util.ProjectUtil;
import org.exoplatform.task.util.UserUtil;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
public class SpaceTaskDataInitializer extends SpaceListenerPlugin {
-
- private static final Log log = ExoLogger.getExoLogger(SpaceTaskDataInitializer.class);
-
- private ProjectService projectService;
- private StatusService statusServ;
+ private ProjectService projectService;
+
+ private StatusService statusServ;
public SpaceTaskDataInitializer(ProjectService pServ, StatusService statusServ) {
this.projectService = pServ;
this.statusServ = statusServ;
}
- @Override
- public void spaceAccessEdited(SpaceLifeCycleEvent event) {
- }
-
@Override
public void spaceCreated(SpaceLifeCycleEvent event) {
Space space = event.getSpace();
- String space_group_id = space.getGroupId();
-
- List memberships = UserUtil.getSpaceMemberships(space_group_id);
- Set managers = new HashSet(Arrays.asList(memberships.get(0)));
- Set participators = new HashSet(Arrays.asList(memberships.get(1)));
+
+ List memberships = UserUtil.getSpaceMemberships(space.getGroupId());
+ Set managers = new HashSet<>(Arrays.asList(memberships.get(0)));
+ Set participators = new HashSet<>(Arrays.asList(memberships.get(1)));
ProjectDto project = ProjectUtil.newProjectInstanceDto(space.getDisplayName(), "", managers, participators);
project = projectService.createProject(project);
statusServ.createInitialStatuses(project);
}
- @Override
- public void spaceRemoved(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void applicationActivated(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void applicationAdded(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void applicationDeactivated(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void applicationRemoved(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void grantedLead(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void joined(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void left(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void revokedLead(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void spaceRenamed(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void spaceDescriptionEdited(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void spaceAvatarEdited(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void addInvitedUser(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void addPendingUser(SpaceLifeCycleEvent event) {
- }
-
- @Override
- public void spaceBannerEdited(SpaceLifeCycleEvent event) {
-
- }
-
}
diff --git a/services/src/test/java/org/exoplatform/task/service/ProjectServiceTest.java b/services/src/test/java/org/exoplatform/task/service/ProjectServiceTest.java
index 51eb3e91d..a0fb323c8 100644
--- a/services/src/test/java/org/exoplatform/task/service/ProjectServiceTest.java
+++ b/services/src/test/java/org/exoplatform/task/service/ProjectServiceTest.java
@@ -16,19 +16,45 @@
*/
package org.exoplatform.task.service;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.ArgumentCaptor;
+import org.mockito.Captor;
+import org.mockito.Mock;
+import org.mockito.runners.MockitoJUnitRunner;
+
import org.exoplatform.commons.utils.ListAccess;
-import org.exoplatform.container.ExoContainer;
-import org.exoplatform.container.ExoContainerContext;
import org.exoplatform.container.PortalContainer;
import org.exoplatform.services.listener.ListenerService;
-import org.exoplatform.social.core.storage.impl.StorageUtils;
import org.exoplatform.task.TestDtoUtils;
import org.exoplatform.task.TestUtils;
-import org.exoplatform.task.dao.*;
+import org.exoplatform.task.dao.ProjectHandler;
+import org.exoplatform.task.dao.StatusHandler;
+import org.exoplatform.task.dao.TaskHandler;
+import org.exoplatform.task.dao.TaskQuery;
import org.exoplatform.task.dao.jpa.DAOHandlerJPAImpl;
import org.exoplatform.task.domain.Project;
import org.exoplatform.task.domain.Status;
-import org.exoplatform.task.domain.Task;
import org.exoplatform.task.dto.ProjectDto;
import org.exoplatform.task.dto.StatusDto;
import org.exoplatform.task.dto.TaskDto;
@@ -41,23 +67,6 @@
import org.exoplatform.task.storage.impl.ProjectStorageImpl;
import org.exoplatform.task.storage.impl.StatusStorageImpl;
import org.exoplatform.task.util.ProjectUtil;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.ArgumentCaptor;
-import org.mockito.Captor;
-import org.mockito.Mock;
-import org.mockito.runners.MockitoJUnitRunner;
-
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.any;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.*;
import org.exoplatform.task.util.StorageUtil;
@RunWith(MockitoJUnitRunner.class)
diff --git a/webapps/src/main/webapp/WEB-INF/conf/configuration.xml b/webapps/src/main/webapp/WEB-INF/conf/configuration.xml
index 7c2055e6f..60c861b90 100644
--- a/webapps/src/main/webapp/WEB-INF/conf/configuration.xml
+++ b/webapps/src/main/webapp/WEB-INF/conf/configuration.xml
@@ -23,7 +23,6 @@
war:/conf/task-addon/notification-configuration.xml
war:/conf/task-addon/dynamic-container-configuration.xml
war:/conf/task-addon/search-configuration.xml
- war:/conf/task-addon/spaces-templates-configuration.xml
war:/conf/task-addon/ckeditor-configuration.xml
war:/conf/task-addon/analytics-configuration.xml
diff --git a/webapps/src/main/webapp/WEB-INF/conf/task-addon/spaces-templates-configuration.xml b/webapps/src/main/webapp/WEB-INF/conf/task-addon/spaces-templates-configuration.xml
deleted file mode 100644
index ae6fa4e8f..000000000
--- a/webapps/src/main/webapp/WEB-INF/conf/task-addon/spaces-templates-configuration.xml
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
- org.exoplatform.social.core.space.spi.SpaceTemplateService
-
-
- Space Template Extension
- extendSpaceTemplatePlugin
- org.exoplatform.social.core.space.SpaceTemplateConfigPlugin
-
-
- template
- Space Template
-
-
-
-
-
-
-
- Space Template Extension
- extendSpaceTemplatePlugin
- org.exoplatform.social.core.space.SpaceTemplateConfigPlugin
-
-
- template
- Space Template
-
-
- project
-
-
-
-
-
-
- TasksManagement
-
-
- TasksManagement
-
-
- Tasks
-
-
- true
-
-
- 500
-
-
- tasks
-
-
- fas fa-tasks
-
-
-
-
-
-
-
-
-
-
-
-
-