From d8cd7699efbb33821540c1e6a45da32ce2dd9943 Mon Sep 17 00:00:00 2001
From: uhensler <urs.hensler@frentix.com>
Date: Mon, 2 Sep 2019 09:52:57 +0200
Subject: [PATCH] OO-4186: Super interface os parent of course node providers

---
 .../assessment/handler/AssessmentHandler.java |  5 ++-
 .../learningpath/LearningPathNodeHandler.java |  5 ++-
 .../NodeDurationEvaluatorProvider.java        |  6 ++--
 .../NodeLinearStatusEvaluatorProvider.java    |  6 ++--
 .../NodeObligationEvaluatorProvider.java      |  6 ++--
 .../olat/course/nodes/CourseNodeProvider.java | 32 +++++++++++++++++++
 6 files changed, 45 insertions(+), 15 deletions(-)
 create mode 100644 src/main/java/org/olat/course/nodes/CourseNodeProvider.java

diff --git a/src/main/java/org/olat/course/assessment/handler/AssessmentHandler.java b/src/main/java/org/olat/course/assessment/handler/AssessmentHandler.java
index 056ba8e38d6..9ee0a826739 100644
--- a/src/main/java/org/olat/course/assessment/handler/AssessmentHandler.java
+++ b/src/main/java/org/olat/course/assessment/handler/AssessmentHandler.java
@@ -26,6 +26,7 @@ import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.course.assessment.ui.tool.AssessmentCourseNodeController;
 import org.olat.course.nodes.CourseNode;
+import org.olat.course.nodes.CourseNodeProvider;
 import org.olat.course.run.scoring.AssessmentEvaluation;
 import org.olat.course.run.scoring.ScoreCalculator;
 import org.olat.course.run.userview.UserCourseEnvironment;
@@ -44,9 +45,7 @@ import org.olat.repository.RepositoryEntry;
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
-public interface AssessmentHandler {
-	
-	public String acceptCourseNodeType();
+public interface AssessmentHandler extends CourseNodeProvider {
 	
 	public AssessmentConfig getAssessmentConfig(CourseNode courseNode);
 	
diff --git a/src/main/java/org/olat/course/learningpath/LearningPathNodeHandler.java b/src/main/java/org/olat/course/learningpath/LearningPathNodeHandler.java
index 11d3a5de32d..f17ec3a69f9 100644
--- a/src/main/java/org/olat/course/learningpath/LearningPathNodeHandler.java
+++ b/src/main/java/org/olat/course/learningpath/LearningPathNodeHandler.java
@@ -23,6 +23,7 @@ import org.olat.core.gui.UserRequest;
 import org.olat.core.gui.control.Controller;
 import org.olat.core.gui.control.WindowControl;
 import org.olat.course.nodes.CourseNode;
+import org.olat.course.nodes.CourseNodeProvider;
 
 /**
  * 
@@ -30,9 +31,7 @@ import org.olat.course.nodes.CourseNode;
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
-public interface LearningPathNodeHandler {
-	
-	public String acceptCourseNodeType();
+public interface LearningPathNodeHandler extends CourseNodeProvider {
 	
 	public boolean isSupported();
 	
diff --git a/src/main/java/org/olat/course/learningpath/evaluation/NodeDurationEvaluatorProvider.java b/src/main/java/org/olat/course/learningpath/evaluation/NodeDurationEvaluatorProvider.java
index 16a20f3350c..1d3a9f5c573 100644
--- a/src/main/java/org/olat/course/learningpath/evaluation/NodeDurationEvaluatorProvider.java
+++ b/src/main/java/org/olat/course/learningpath/evaluation/NodeDurationEvaluatorProvider.java
@@ -19,6 +19,8 @@
  */
 package org.olat.course.learningpath.evaluation;
 
+import org.olat.course.nodes.CourseNodeProvider;
+
 /**
  * Interface to provide an individual
  * {@link org.olat.course.learningpath.evaluation.DurationEvaluator} for a course
@@ -32,9 +34,7 @@ package org.olat.course.learningpath.evaluation;
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
-public interface NodeDurationEvaluatorProvider {
-	
-	public String acceptCourseNodeType();
+public interface NodeDurationEvaluatorProvider extends CourseNodeProvider {
 	
 	public DurationEvaluator getDurationEvaluator();
 
diff --git a/src/main/java/org/olat/course/learningpath/evaluation/NodeLinearStatusEvaluatorProvider.java b/src/main/java/org/olat/course/learningpath/evaluation/NodeLinearStatusEvaluatorProvider.java
index 50a3dd7df33..e563d72b95f 100644
--- a/src/main/java/org/olat/course/learningpath/evaluation/NodeLinearStatusEvaluatorProvider.java
+++ b/src/main/java/org/olat/course/learningpath/evaluation/NodeLinearStatusEvaluatorProvider.java
@@ -19,6 +19,8 @@
  */
 package org.olat.course.learningpath.evaluation;
 
+import org.olat.course.nodes.CourseNodeProvider;
+
 /**
  * Interface to provide an individual
  * {@link org.olat.course.learningpath.evaluation.StatusEvaluator} for a course
@@ -32,9 +34,7 @@ package org.olat.course.learningpath.evaluation;
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
-public interface NodeLinearStatusEvaluatorProvider {
-	
-	public String acceptCourseNodeType();
+public interface NodeLinearStatusEvaluatorProvider extends CourseNodeProvider {
 	
 	public StatusEvaluator getStatusEvaluator();
 
diff --git a/src/main/java/org/olat/course/learningpath/evaluation/NodeObligationEvaluatorProvider.java b/src/main/java/org/olat/course/learningpath/evaluation/NodeObligationEvaluatorProvider.java
index 7f75c859371..9fc7915c3b6 100644
--- a/src/main/java/org/olat/course/learningpath/evaluation/NodeObligationEvaluatorProvider.java
+++ b/src/main/java/org/olat/course/learningpath/evaluation/NodeObligationEvaluatorProvider.java
@@ -19,6 +19,8 @@
  */
 package org.olat.course.learningpath.evaluation;
 
+import org.olat.course.nodes.CourseNodeProvider;
+
 /**
  * * Interface to provide an individual
  * {@link org.olat.course.learningpath.evaluation.ObligationEvaluator} for a
@@ -32,9 +34,7 @@ package org.olat.course.learningpath.evaluation;
  * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
  *
  */
-public interface NodeObligationEvaluatorProvider {
-	
-	public String acceptCourseNodeType();
+public interface NodeObligationEvaluatorProvider extends CourseNodeProvider {
 	
 	public ObligationEvaluator getObligationEvaluator();
 }
diff --git a/src/main/java/org/olat/course/nodes/CourseNodeProvider.java b/src/main/java/org/olat/course/nodes/CourseNodeProvider.java
new file mode 100644
index 00000000000..52e1b73c3d0
--- /dev/null
+++ b/src/main/java/org/olat/course/nodes/CourseNodeProvider.java
@@ -0,0 +1,32 @@
+/**
+ * <a href="http://www.openolat.org">
+ * OpenOLAT - Online Learning and Training</a><br>
+ * <p>
+ * Licensed under the Apache License, Version 2.0 (the "License"); <br>
+ * you may not use this file except in compliance with the License.<br>
+ * You may obtain a copy of the License at the
+ * <a href="http://www.apache.org/licenses/LICENSE-2.0">Apache homepage</a>
+ * <p>
+ * Unless required by applicable law or agreed to in writing,<br>
+ * software distributed under the License is distributed on an "AS IS" BASIS, <br>
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. <br>
+ * See the License for the specific language governing permissions and <br>
+ * limitations under the License.
+ * <p>
+ * Initial code contributed and copyrighted by<br>
+ * frentix GmbH, http://www.frentix.com
+ * <p>
+ */
+package org.olat.course.nodes;
+
+/**
+ * 
+ * Initial date: 2 Sep 2019<br>
+ * @author uhensler, urs.hensler@frentix.com, http://www.frentix.com
+ *
+ */
+public interface CourseNodeProvider {
+
+	public String acceptCourseNodeType();
+
+}
\ No newline at end of file
-- 
GitLab