                                                                 'org.springframework.context.ApplicationContextAware',
                                                                 'org.springframework.context.ApplicationContext'
                                                               ]
-                                             RETURN n.name as UsedBy, COLLECT(DISTINCT m.name) AS BlacklistedSpringAPIs
+                                             RETURN n.name AS UsedBy, COLLECT(DISTINCT m.name) AS BlacklistedSpringAPIs
                                               ORDER BY n.name
                                             ")
         message                  (if (empty? res)
-                                   ""
+                                   nil
                                    (s/join "\n"
                                            (map #(str (get % "UsedBy")
                                                       " uses "
                                                       (s/join ", " (get % "BlacklistedSpringAPIs")))
                                                 res)))]
-    (build-bookmark-map "API06" message "The technology does not use the service locator pattern.")))
+    (build-bookmark-map "API06" (empty? res) message "The technology does not use the service locator pattern.")))
 
 (defn- com06-compiled-jvm-version
   []

    (s/replace query "{in-clause-values}" comma-delimited-string-quoted-in-values)))

(defn- build-bookmark-map
  ([criteria-id evidence] (build-bookmark-map criteria-id evidence ""))
  ([criteria-id evidence non-evidence]
   (if (and evidence (not (empty? (s/trim evidence))))
     { (str criteria-id "_Evidence")    evidence
       (str criteria-id "_Meets")       ""
       (str criteria-id "_NoRemedy")    "" }
     { (str criteria-id "_Evidence")    non-evidence
       (str criteria-id "_DoesNotMeet") ""
       (str criteria-id "_Remedy")      "" } )))

(defn- api01-public-alfresco-java-api
  []

                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                 (map #(str (get % "ClassName")
                                            " is compiled for JVM version "
                                            (get % "ClassVersion"))
                                      res)))]
    (build-bookmark-map "COM06" (empty? res) message "The code has been compiled for JVM 1.6 or greater.")))

(defn- com09-stb07-stb14-search-apis
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name IN [
                                           'org.alfresco.service.cmr.search.SearchService',
                                           'org.alfresco.service.cmr.search.ResultSet'
                                         ]
                        RETURN n.name AS UsedBy, COLLECT(DISTINCT m.name) AS SearchAPIs
                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                 (map #(str (get % "UsedBy")
                                            " uses "
                                            (s/join ", " (get % "SearchAPIs")))
                                      res)))]
    (merge
      (build-bookmark-map "COM09"
                          (empty? res)
                          (str message "\n#### Manual followup required to check which search \"language\" is in use. ####")
                          "The technology does not use the Search APIs.")
      (build-bookmark-map "STB07"
                          (empty? res)
                          (str message "\n#### Manual followup required to confirm ResultSets are closed. ####")
                          "The technology does not use the Search APIs.")
      (build-bookmark-map "STB14"
                          (empty? res)
                          (str message "\n#### Manual followup required to confirm usage isn't done during bootstrap. ####")
                          "The technology does not use the Search APIs."))))

(defn- sec02-minimise-manual-authentication
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name = 'org.alfresco.repo.security.authentication.AuthenticationUtil'
                        RETURN n.name AS UsedBy, m.name AS AuthenticationUtilAPI
                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                   (map #(str (get % "UsedBy")
                                              " uses "
                                              (get % "AuthenticationUtilAPI"))
                                        res)))]
    (build-bookmark-map "SEC02" (empty? res) message "The technology does not manually control the authenticated session.")))

(defn- sec04-process-exec-builder
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND m.name IN [
                                           'java.lang.Process',
                                           'java.lang.ProcessBuilder'
                                         ]
                        RETURN n.name AS UsedBy, COLLECT(DISTINCT m.name) AS ProcessAPIs
                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                 (map #(str (get % "UsedBy")
                                            " uses "
                                            (s/join ", " (get % "ProcessAPIs")))
                                      res)))]
    (build-bookmark-map "SEC04" (empty? res) message "The technology does not use Process.exec() or ProcessBuilder.")))

(defn- stb03-servlets-servlet-filters
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.package)
                           AND m.package IN [
                                              'javax.servlet',
                                              'javax.servlet.http'
                                            ]
                        RETURN n.name AS UsedBy, COLLECT(DISTINCT m.name) AS ServletAPIs
                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                 (map #(str (get % "UsedBy")
                                            " uses "
                                            (s/join ", " (get % "ServletAPIs")))
                                      res)))]
    (build-bookmark-map "STB03" (empty? res) message "The technology does not use servlets or servlet filters.")))

(defn- stb04-database-access
  []
  (let [res (cy/tquery "
                         START n=NODE(*)
                         MATCH (n)-->(m)
                         WHERE HAS(n.name)
                           AND HAS(m.name)
                           AND HAS(m.package)
                           AND m.package IN [
                                              'java.sql',
                                              'javax.sql',
                                              'org.springframework.jdbc',
                                              'com.ibatis',
                                              'org.hibernate'
                                            ]
                        RETURN n.name AS UsedBy, COLLECT(DISTINCT m.name) AS DatabaseAPIs
                         ORDER BY n.name
                       ")
        message        (if (empty? res)
                         nil
                         (s/join "\n"
                                 (map #(str (get % "UsedBy")
                                            " uses "
                                            (s/join ", " (get % "DatabaseAPIs")))
                                      res)))]
    (build-bookmark-map "STB04" (empty? res) message "The technology does not access the database directly.")))

(defn- stb06-stb18-manual-transactions
  []
