commit 7fa6bc86877de032b922b4ad9a5cbce91f1d7313
Author: Ondřej Váně <onry.vane@gmail.com>
Date:   Sun Jul 18 21:45:09 2021 +0200

    #3 Add link to catalogue to AP detail
    
    - added links to catalogue in AP detail
    - added constant with base catalogue URL
    - in each AP added string with file name to catalogue
    - getter in AntiPattern class will concate base catalogue URL with catalogue file name
    - catalogue file name should be declare in definition of AP

diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/Constants.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/Constants.java
new file mode 100644
index 0000000..1e0d21b
--- /dev/null
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/Constants.java
@@ -0,0 +1,5 @@
+package cz.zcu.fav.kiv.antipatterndetectionapp;
+
+public class Constants {
+    public static final String ANTI_PATTERN_CATALOGUE_URL = "https://github.com/ReliSA/Software-process-antipatterns-catalogue/blob/master/catalogue/";
+}
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
index 80fc66e..5e0f312 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/BusinessAsUsualDetectorImpl.java
@@ -23,7 +23,8 @@ public class BusinessAsUsualDetectorImpl implements AntiPatternDetector {
                 put("divisionOfIterationsWithRetrospective", new Configuration<Float>("divisionOfIterationsWithRetrospective",
                         "Division of iterations with retrospective",
                         "Minimum percentage of the total number of iterations with a retrospective (0,1)", 0.66666f));
-            }});
+            }},
+            "Business_As_Usual.md");
 
     private final String sqlFileName = "business_as_usual.sql";
 
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
index 33fe21a..8e26620 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/RoadToNowhereDetectorImpl.java
@@ -28,7 +28,8 @@ public class RoadToNowhereDetectorImpl implements AntiPatternDetector {
                 put("minNumberOfActivitiesWithProjectPlan", new Configuration<Integer>("minNumberOfActivitiesWithProjectPlan",
                         "Minimum number of activities with project plan",
                         "Number of activities", 1));
-            }});
+            }},
+            "Road_To_Nowhere.md");
 
     private final String sqlFileName = "road_to_nowhere.sql";
     // sql queries loaded from sql file
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
index 8db9fc4..260f792 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/detecting/detectors/SpecifyNothingDetectorImpl.java
@@ -30,7 +30,8 @@ public class SpecifyNothingDetectorImpl implements AntiPatternDetector {
                 put("minAvgLengthOfActivityDescription", new Configuration<Integer>("minAvgLengthOfActivityDescription",
                         "Minimum average length of activity description",
                         "Minimum average number of character of activity description", 150));
-            }});
+            }},
+            "Specify_Nothing.md");
 
     private final String sqlFileName = "specify_nothing.sql";
     // sql queries loaded from sql file
diff --git a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java
index f7e17f3..ce72745 100644
--- a/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java
+++ b/src/main/java/cz/zcu/fav/kiv/antipatterndetectionapp/model/AntiPattern.java
@@ -1,5 +1,7 @@
 package cz.zcu.fav.kiv.antipatterndetectionapp.model;
 
+import cz.zcu.fav.kiv.antipatterndetectionapp.Constants;
+
 import java.util.Map;
 
 public class AntiPattern {
@@ -9,6 +11,7 @@ public class AntiPattern {
     private String name;
     private String description;
     private Map<String, Configuration> configurations;
+    private String catalogueFileName;
 
     public AntiPattern(Long id, String printName, String name, String description) {
         this.id = id;
@@ -25,6 +28,15 @@ public class AntiPattern {
         this.configurations = configurations;
     }
 
+    public AntiPattern(Long id, String printName, String name, String description, Map<String, Configuration> configurations, String catalogueFileName) {
+        this.id = id;
+        this.printName = printName;
+        this.name = name;
+        this.description = description;
+        this.configurations = configurations;
+        this.catalogueFileName = catalogueFileName;
+    }
+
     public Long getId() {
         return id;
     }
@@ -69,6 +81,18 @@ public class AntiPattern {
         return "<a href='/anti-patterns/" + this.id.toString() + "'>Detail</a>";
     }
 
+    public String getCatalogueFileName() {
+        return catalogueFileName;
+    }
+
+    public void setCatalogueFileName(String catalogueFileName) {
+        this.catalogueFileName = catalogueFileName;
+    }
+
+    public String getFullCatalogueUrl() {
+        return Constants.ANTI_PATTERN_CATALOGUE_URL + this.catalogueFileName;
+    }
+
     @Override
     public String toString() {
         return "AntiPattern{" +
@@ -77,6 +101,7 @@ public class AntiPattern {
                 ", name='" + name + '\'' +
                 ", description='" + description + '\'' +
                 ", configurations=" + configurations +
+                ", catalogueFileName='" + catalogueFileName + '\'' +
                 '}';
     }
 }
diff --git a/src/main/webapp/WEB-INF/templates/anti-pattern.html b/src/main/webapp/WEB-INF/templates/anti-pattern.html
index c6a108e..bf5b688 100644
--- a/src/main/webapp/WEB-INF/templates/anti-pattern.html
+++ b/src/main/webapp/WEB-INF/templates/anti-pattern.html
@@ -22,30 +22,74 @@
 <!-- Navigation bar imported -->
 <div th:replace="fragments/navbar :: navBar"></div>
 <!-- ./Navigation bar imported -->
+
+<!-- Card for anti pattern details-->
 <div class="card">
     <h3 class="card-header">Anti Pattern</h3>
     <div class="card-body">
+
+        <!-- Anti pattern id -->
         <div class="form-group">
-            <label for="projectId">Anti Pattern Id:</label>
-            <input disabled type="text" class="form-control" id="projectId" th:value="${antiPattern.id}">
+            <label for="antiPatternId">Anti Pattern Id:</label>
+            <input disabled type="text" class="form-control" id="antiPatternId" th:value="${antiPattern.id}">
         </div>
+        <!-- ./Anti pattern id -->
+
+        <!-- Anti pattern name -->
         <div class="form-group">
-            <label for="projectId">Anti Pattern name:</label>
-            <input disabled type="text" class="form-control" id="projectName" th:value="${antiPattern.printName}">
+            <label for="antiPatternName">Anti Pattern name:</label>
+            <input disabled type="text" class="form-control" id="antiPatternName" th:value="${antiPattern.printName}">
         </div>
+        <!-- ./Anti pattern name -->
+
+        <!-- Anti pattern description -->
         <div class="form-group">
-            <label for="projectId">Anti Pattern description:</label>
-            <textarea disabled class="form-control" id="projectDescription" rows="5"
+            <label for="antiPatternDescription">Anti Pattern description:</label>
+            <textarea disabled class="form-control" id="antiPatternDescription" rows="5"
                       th:text="${antiPattern.description}"></textarea>
         </div>
+        <!-- ./Anti pattern description -->
+
+        <!-- Anti pattern catalogue url if is filled in AntiPattern model class -->
+        <div class="form-group">
+            <label for="antiPatternCatalogueUrl">Software process Anti Patterns catalogue:</label>
+            <br>
+
+            <!-- Anti pattern catalogue file name is filled -->
+            <a th:if="${antiPattern ne null and antiPattern.catalogueFileName ne null}"
+               id="antiPatternCatalogueUrl"
+               th:href="${antiPattern.getFullCatalogueUrl()}"
+               th:text="${antiPattern.printName}"
+               target="_blank">
+            </a>
+            <!-- ./Anti pattern catalogue file name is filled -->
+
+            <!-- Anti pattern catalogue file name is NOT filled -->
+            <del><a th:unless="${antiPattern ne null and antiPattern.catalogueFileName ne null}"
+               id="antiPatternCatalogueUrl"
+               th:text="${antiPattern.printName}"
+               target="_blank"
+               style="color: grey"
+            ></a></del>
+            <small th:unless="${antiPattern ne null and antiPattern.catalogueFileName ne null}"
+                   style="color: grey"> This anti pattern is not occur in catalogue </small>
+            <!-- ./Anti pattern catalogue file name is NOT filled -->
+        </div>
+        <!-- ./Anti pattern catalogue url if is filled in AntiPattern model class -->
+
+        <!-- Anti pattern configuration form -->
         <h5>Anti Pattern configurations</h5>
         <div th:each="config : ${antiPattern.configurations}" class="form-group">
             <label th:text="${config.value.printName} + ':'" th:for="${config.value.name}"></label>
-            <input disabled type="text" class="form-control" th:id="${config.value.name}" th:value="${config.value.value}">
-            <small th:text="${config.value.description}" th:value="${config.value.name}" class="form-text text-muted"></small>
+            <input disabled type="text" class="form-control" th:id="${config.value.name}"
+                   th:value="${config.value.value}">
+            <small th:text="${config.value.description}" th:value="${config.value.name}"
+                   class="form-text text-muted"></small>
         </div>
+        <!-- ./Anti pattern configuration form -->
     </div>
 </div>
+<!-- ./Card for anti pattern details-->
 
 </body>
 </html>
