From 6e99d9b32b51d7c9cce37deda0c951a2887d5055 Mon Sep 17 00:00:00 2001
From: Martin Staehr <software@mstaehr.net>
Date: Thu, 13 Jun 2019 22:36:14 +0200
Subject: [PATCH] closes #98: move start of optional portfolio task into
 reflexionProcess

---
 .../gf/config/GFApplicationBinder.java        |  8 ++++---
 ...ionService.java => IReflexionService.java} |  2 +-
 ...tionService.java => ReflexionService.java} |  4 ++--
 .../gf/process/DossierCreationProcess.java    |  6 ++---
 .../gf/process/ReflexionProcess.java          | 22 +++++++++++++++++++
 5 files changed, 32 insertions(+), 10 deletions(-)
 rename gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/{IReflectionService.java => IReflexionService.java} (89%)
 rename gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/{ReflectionService.java => ReflexionService.java} (92%)
 create mode 100644 gemeinsamforschen/src/main/java/unipotsdam/gf/process/ReflexionProcess.java

diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/config/GFApplicationBinder.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/config/GFApplicationBinder.java
index 90e6605d..e6ed0fd3 100644
--- a/gemeinsamforschen/src/main/java/unipotsdam/gf/config/GFApplicationBinder.java
+++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/config/GFApplicationBinder.java
@@ -11,7 +11,7 @@ import unipotsdam.gf.interfaces.IGroupFinding;
 import unipotsdam.gf.interfaces.IJournal;
 import unipotsdam.gf.interfaces.IPeerAssessment;
 import unipotsdam.gf.interfaces.IPhases;
-import unipotsdam.gf.interfaces.IReflectionService;
+import unipotsdam.gf.interfaces.IReflexionService;
 import unipotsdam.gf.modules.annotation.controller.AnnotationController;
 import unipotsdam.gf.modules.annotation.controller.FeedbackImpl;
 import unipotsdam.gf.modules.assessment.AssessmentDAO;
@@ -40,7 +40,7 @@ import unipotsdam.gf.modules.project.Management;
 import unipotsdam.gf.modules.project.ManagementImpl;
 import unipotsdam.gf.modules.project.ProjectConfigurationDAO;
 import unipotsdam.gf.modules.project.ProjectDAO;
-import unipotsdam.gf.modules.reflection.service.ReflectionService;
+import unipotsdam.gf.modules.reflection.service.ReflexionService;
 import unipotsdam.gf.modules.researchreport.DummyResearchReportManagement;
 import unipotsdam.gf.modules.researchreport.ResearchReportManagement;
 import unipotsdam.gf.modules.submission.controller.SubmissionController;
@@ -53,6 +53,7 @@ import unipotsdam.gf.process.GroupFormationProcess;
 import unipotsdam.gf.process.IExecutionProcess;
 import unipotsdam.gf.process.PeerAssessmentProcess;
 import unipotsdam.gf.process.ProjectCreationProcess;
+import unipotsdam.gf.process.ReflexionProcess;
 import unipotsdam.gf.process.SurveyProcess;
 import unipotsdam.gf.process.constraints.ConstraintsImpl;
 import unipotsdam.gf.process.phases.PhasesImpl;
@@ -117,6 +118,7 @@ public class GFApplicationBinder extends AbstractBinder {
         bind(FileManagementService.class).to(FileManagementService.class);
         bind(FileManagementDAO.class).to(FileManagementDAO.class);
         bind(AssessmentDAO.class).to(AssessmentDAO.class);
+        bind(ReflexionProcess.class).to(ReflexionProcess.class);
 
         /*
          * TODO: @Martin comment in for your development
@@ -133,6 +135,6 @@ public class GFApplicationBinder extends AbstractBinder {
         bind(UnirestService.class).to(UnirestService.class);
         bind(ContributionFeedbackService.class).to(IContributionFeedback.class);
         bind(ContributionFeedbackDAO.class).to(ContributionFeedbackDAO.class);
-        bind(ReflectionService.class).to(IReflectionService.class);
+        bind(ReflexionService.class).to(IReflexionService.class);
     }
 }
diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflectionService.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflexionService.java
similarity index 89%
rename from gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflectionService.java
rename to gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflexionService.java
index 26918a20..ac1c007b 100644
--- a/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflectionService.java
+++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/interfaces/IReflexionService.java
@@ -4,7 +4,7 @@ import unipotsdam.gf.modules.group.Group;
 import unipotsdam.gf.modules.project.Project;
 import unipotsdam.gf.process.phases.Phase;
 
-public interface IReflectionService {
+public interface IReflexionService {
 
     void startOptionalPortfolioTask(Project project, Group group, Phase phase);
 
diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflectionService.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflexionService.java
similarity index 92%
rename from gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflectionService.java
rename to gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflexionService.java
index 8329a231..142c2562 100644
--- a/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflectionService.java
+++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/modules/reflection/service/ReflexionService.java
@@ -1,6 +1,6 @@
 package unipotsdam.gf.modules.reflection.service;
 
-import unipotsdam.gf.interfaces.IReflectionService;
+import unipotsdam.gf.interfaces.IReflexionService;
 import unipotsdam.gf.modules.group.Group;
 import unipotsdam.gf.modules.project.Project;
 import unipotsdam.gf.modules.user.User;
@@ -17,7 +17,7 @@ import javax.inject.Inject;
 
 @ManagedBean
 @Resource
-public class ReflectionService implements IReflectionService {
+public class ReflexionService implements IReflexionService {
 
     @Inject
     private TaskDAO taskDAO;
diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/process/DossierCreationProcess.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/process/DossierCreationProcess.java
index 489c564e..e4cf619d 100644
--- a/gemeinsamforschen/src/main/java/unipotsdam/gf/process/DossierCreationProcess.java
+++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/process/DossierCreationProcess.java
@@ -3,7 +3,6 @@ package unipotsdam.gf.process;
 import com.itextpdf.text.DocumentException;
 import org.glassfish.jersey.media.multipart.FormDataContentDisposition;
 import unipotsdam.gf.interfaces.Feedback;
-import unipotsdam.gf.interfaces.IReflectionService;
 import unipotsdam.gf.modules.assessment.controller.model.ContributionCategory;
 import unipotsdam.gf.modules.fileManagement.FileManagementService;
 import unipotsdam.gf.modules.fileManagement.FileRole;
@@ -56,7 +55,7 @@ public class DossierCreationProcess {
     private GroupDAO groupDAO;
 
     @Inject
-    private IReflectionService reflectionService;
+    private ReflexionProcess reflexionProcess;
 
 
     /**
@@ -89,8 +88,7 @@ public class DossierCreationProcess {
         taskDAO.persistTaskGroup(project, user, TaskName.ANNOTATE_DOSSIER, Phase.DossierFeedback);
 
         Group group = groupDAO.getMyGroup(user, project);
-        reflectionService.startOptionalPortfolioTask(project, group, Phase.DossierFeedback);
-
+        reflexionProcess.startOptionalEPortfolioEntryTask(project, group);
     }
 
     public FullSubmission updateSubmission(FullSubmissionPostRequest fullSubmissionPostRequest,
diff --git a/gemeinsamforschen/src/main/java/unipotsdam/gf/process/ReflexionProcess.java b/gemeinsamforschen/src/main/java/unipotsdam/gf/process/ReflexionProcess.java
new file mode 100644
index 00000000..fbe750c0
--- /dev/null
+++ b/gemeinsamforschen/src/main/java/unipotsdam/gf/process/ReflexionProcess.java
@@ -0,0 +1,22 @@
+package unipotsdam.gf.process;
+
+import unipotsdam.gf.interfaces.IReflexionService;
+import unipotsdam.gf.modules.group.Group;
+import unipotsdam.gf.modules.project.Project;
+import unipotsdam.gf.process.phases.Phase;
+
+import javax.annotation.ManagedBean;
+import javax.annotation.Resource;
+import javax.inject.Inject;
+
+@Resource
+@ManagedBean
+public class ReflexionProcess {
+
+    @Inject
+    private IReflexionService reflexionService;
+
+    public void startOptionalEPortfolioEntryTask(Project project, Group group) {
+        reflexionService.startOptionalPortfolioTask(project, group, Phase.DossierFeedback);
+    }
+}
-- 
GitLab