From 1abe9e23c8267952025395124ebe4b386c55d858 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 28 Jan 2016 15:14:44 -0700
Subject: [PATCH 001/183] Remove (unused) ipc-contains-obj-shared-with hack
from sharing.
---
.../terrain/services/filesystem/sharing.clj | 22 -------------------
1 file changed, 22 deletions(-)
diff --git a/services/terrain/src/terrain/services/filesystem/sharing.clj b/services/terrain/src/terrain/services/filesystem/sharing.clj
index ffc1952dc..5ca5d48c3 100644
--- a/services/terrain/src/terrain/services/filesystem/sharing.clj
+++ b/services/terrain/src/terrain/services/filesystem/sharing.clj
@@ -15,20 +15,6 @@
[terrain.services.filesystem.icat :as icat]
[terrain.services.filesystem.validators :as validators]))
-(def shared-with-attr "ipc-contains-obj-shared-with")
-
-(defn- add-user-shared-with
- "Adds 'ipc-contains-obj-shared-with' AVU for a user to an object if it's not there."
- [cm fpath shared-with]
- (when (empty? (get-avus-by-collection cm fpath shared-with shared-with-attr))
- (set-metadata cm fpath shared-with shared-with shared-with-attr)))
-
-(defn- remove-user-shared-with
- "Removes 'ipc-contains-obj-shared-with' AVU for a user from an object if it's there."
- [cm fpath shared-with]
- (when-not (empty? (get-avus-by-collection cm fpath shared-with shared-with-attr))
- (delete-metadata cm fpath shared-with)))
-
(defn- shared?
([cm share-with fpath]
(:read (permissions cm share-with fpath)))
@@ -101,7 +87,6 @@
share-recs (group-by keyfn (share-paths cm user share-withs fpaths perm))
sharees (map :user (:succeeded share-recs))
home-dir (paths/user-home-dir user)]
- (dorun (map (partial add-user-shared-with cm (paths/user-home-dir user)) sharees))
{:user sharees
:path fpaths
:skipped (map #(dissoc % :skipped) (:skipped share-recs))
@@ -155,12 +140,6 @@
(shared? cm unshare-with fpath) (unshare-path cm user unshare-with fpath)
:else (skip-share unshare-with fpath :not-shared))))
-(defn- clean-up-unsharee-avus
- [cm fpath unshare-with]
- (when-not (shared? cm unshare-with fpath)
- (log/warn "Removing shared with AVU on" fpath "for" unshare-with)
- (remove-user-shared-with cm fpath unshare-with)))
-
(defn unshare
"Allows 'user' to unshare file 'fpath' with user 'unshare-with'."
[user unshare-withs fpaths]
@@ -181,7 +160,6 @@
unshare-recs (group-by keyfn (unshare-paths cm user unshare-withs fpaths))
unsharees (map :user (:succeeded unshare-recs))
home-dir (paths/user-home-dir user)]
- (dorun (map (partial clean-up-unsharee-avus cm home-dir) unsharees))
{:user unsharees
:path fpaths
:skipped (map #(dissoc % :skipped) (:skipped unshare-recs))})))
From 6e417ef88558e44e10f3ea00ab51315dd798b960 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 4 Feb 2016 12:56:23 -0700
Subject: [PATCH 002/183] Bump version to 2.5.
---
ansible/inventories/group_vars/all | 2 +-
lein-plugins/lein-iplant-cmdtar/project.clj | 2 +-
libs/authy/project.clj | 2 +-
libs/clj-cas/project.clj | 2 +-
libs/clj-icat-direct/project.clj | 2 +-
libs/clj-jargon/project.clj | 4 ++--
libs/common-cfg/project.clj | 2 +-
libs/common-cli/project.clj | 2 +-
libs/common-swagger-api/project.clj | 2 +-
libs/heuristomancer/project.clj | 4 ++--
libs/iplant-clojure-commons/project.clj | 4 ++--
libs/kameleon/project.clj | 2 +-
libs/mescal/project.clj | 8 ++++----
libs/service-logging/project.clj | 2 +-
services/Infosquito/project.clj | 8 ++++----
services/Infosquito/version | 2 +-
services/JEX/project.clj | 10 +++++-----
services/JEX/version | 2 +-
services/NotificationAgent/project.clj | 10 +++++-----
services/NotificationAgent/version | 2 +-
services/anon-files/project.clj | 10 +++++-----
services/anon-files/version | 2 +-
services/apps/project.clj | 18 +++++++++---------
services/apps/version | 2 +-
services/clockwork/project.clj | 12 ++++++------
services/clockwork/version | 2 +-
services/condor-log-monitor/version | 2 +-
services/data-info/project.clj | 20 ++++++++++----------
services/data-info/version | 2 +-
services/dewey/project.clj | 10 +++++-----
services/dewey/version | 2 +-
services/info-typer/project.clj | 12 ++++++------
services/info-typer/version | 2 +-
services/iplant-email/project.clj | 8 ++++----
services/iplant-email/version | 2 +-
services/iplant-groups/project.clj | 12 ++++++------
services/iplant-groups/version | 2 +-
services/jex-events/version | 2 +-
services/kifshare/project.clj | 10 +++++-----
services/kifshare/version | 2 +-
services/metadata/project.clj | 14 +++++++-------
services/metadata/version | 2 +-
services/monkey/project.clj | 8 ++++----
services/monkey/version | 2 +-
services/saved-searches/project.clj | 10 +++++-----
services/saved-searches/version | 2 +-
services/terrain/project.clj | 20 ++++++++++----------
services/terrain/version | 2 +-
services/tree-urls/project.clj | 10 +++++-----
services/tree-urls/version | 2 +-
services/user-preferences/project.clj | 10 +++++-----
services/user-preferences/version | 2 +-
services/user-sessions/project.clj | 10 +++++-----
services/user-sessions/version | 2 +-
tools/facepalm/project.clj | 8 ++++----
tools/facepalm/version | 2 +-
tools/filetool/project.clj | 8 ++++----
tools/filetool/version | 2 +-
tools/job-preserver/project.clj | 4 ++--
tools/sharkbait/project.clj | 6 +++---
tools/sharkbait/version | 2 +-
tools/template-mover/project.clj | 4 ++--
tools/template-mover/version | 2 +-
ui/gradle.properties | 2 +-
64 files changed, 172 insertions(+), 172 deletions(-)
diff --git a/ansible/inventories/group_vars/all b/ansible/inventories/group_vars/all
index e955277b2..3d77d5963 100644
--- a/ansible/inventories/group_vars/all
+++ b/ansible/inventories/group_vars/all
@@ -136,7 +136,7 @@ de:
# ssl_certificate_key: "/etc/ssl/example.com.key"
app_version_name: Phthalo
-app_version: 2.4.0
+app_version: 2.5.0
de_feedback_to_addr: ""
de_mail_from_addr: "{{ de_feedback_to_addr }}"
diff --git a/lein-plugins/lein-iplant-cmdtar/project.clj b/lein-plugins/lein-iplant-cmdtar/project.clj
index 2dcca17f8..96c89d1d8 100644
--- a/lein-plugins/lein-iplant-cmdtar/project.clj
+++ b/lein-plugins/lein-iplant-cmdtar/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/lein-iplant-cmdtar "5.2.4.0"
+(defproject org.iplantc/lein-iplant-cmdtar "5.2.5.0"
:eval-in-leiningen true
:description "Leiningen plugin for generating tarball command distributions."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
diff --git a/libs/authy/project.clj b/libs/authy/project.clj
index 87b2d7196..063f9e557 100644
--- a/libs/authy/project.clj
+++ b/libs/authy/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/authy "5.2.4.0"
+(defproject org.iplantc/authy "5.2.5.0"
:description "An OAuth 2.0 client clibrary written in Clojure."
:url "http://www.iplantcollaborative.org"
:license {:name "BSD Standard License"
diff --git a/libs/clj-cas/project.clj b/libs/clj-cas/project.clj
index 1c4cc22fb..5d99faccd 100644
--- a/libs/clj-cas/project.clj
+++ b/libs/clj-cas/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/clj-cas "5.2.4.0"
+(defproject org.iplantc/clj-cas "5.2.5.0"
:description "A CAS Client library written in Clojure."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
diff --git a/libs/clj-icat-direct/project.clj b/libs/clj-icat-direct/project.clj
index 375954f07..6c106911b 100644
--- a/libs/clj-icat-direct/project.clj
+++ b/libs/clj-icat-direct/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/clj-icat-direct "5.2.4.0"
+(defproject org.iplantc/clj-icat-direct "5.2.5.0"
:description "A Clojure library for accessing the iRODS ICAT database directly."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD Standard License"
diff --git a/libs/clj-jargon/project.clj b/libs/clj-jargon/project.clj
index 1ae4ec637..601a4f497 100644
--- a/libs/clj-jargon/project.clj
+++ b/libs/clj-jargon/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/clj-jargon "5.2.4.0"
+(defproject org.iplantc/clj-jargon "5.2.5.0"
:description "Clojure API on top of iRODS's jargon-core."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -17,7 +17,7 @@
:exclusions [[org.slf4j/slf4j-api]
[org.slf4j/slf4j-log4j12]]]
[slingshot "0.12.2"]
- [org.iplantc/clojure-commons "5.2.4.0"]]
+ [org.iplantc/clojure-commons "5.2.5.0"]]
:repositories [["dice.repository"
{:url "https://raw.github.com/DICE-UNC/DICE-Maven/master/releases"}]
["renci-snapshot.repository"
diff --git a/libs/common-cfg/project.clj b/libs/common-cfg/project.clj
index 3e075f5f4..28d8c2f7f 100644
--- a/libs/common-cfg/project.clj
+++ b/libs/common-cfg/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/common-cfg "5.2.4.0"
+(defproject org.iplantc/common-cfg "5.2.5.0"
:description "DE services code for managing configurations."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
diff --git a/libs/common-cli/project.clj b/libs/common-cli/project.clj
index ec2b2f58e..d26fcb512 100644
--- a/libs/common-cli/project.clj
+++ b/libs/common-cli/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/common-cli "5.2.4.0"
+(defproject org.iplantc/common-cli "5.2.5.0"
:description "Common CLI functions for the DE backend services and tools"
:url "http://github.com/iPlantCollaborativeOpenSource/DiscoveryEnvironmentBackend/"
:license {:name "BSD"}
diff --git a/libs/common-swagger-api/project.clj b/libs/common-swagger-api/project.clj
index 8c5a9b6b2..3570641bb 100644
--- a/libs/common-swagger-api/project.clj
+++ b/libs/common-swagger-api/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/common-swagger-api "5.2.4.0"
+(defproject org.iplantc/common-swagger-api "5.2.5.0"
:description "Common library for Swagger documented RESTful APIs"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
diff --git a/libs/heuristomancer/project.clj b/libs/heuristomancer/project.clj
index f2b0601e2..f01ad0394 100644
--- a/libs/heuristomancer/project.clj
+++ b/libs/heuristomancer/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/heuristomancer "5.2.4.0"
+(defproject org.iplantc/heuristomancer "5.2.5.0"
:description "Clojure library for attempting to guess file types."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD Standard License"
@@ -8,7 +8,7 @@
[org.clojure/tools.cli "0.3.2"]
[org.clojure/tools.logging "0.3.1"]
[instaparse "1.4.1"]]
- :plugins [[org.iplantc/lein-iplant-cmdtar "5.2.4.0"]
+ :plugins [[org.iplantc/lein-iplant-cmdtar "5.2.5.0"]
[test2junit "1.1.3"]]
:aot [heuristomancer.core]
:main heuristomancer.core)
diff --git a/libs/iplant-clojure-commons/project.clj b/libs/iplant-clojure-commons/project.clj
index 65146fa02..05054d71f 100755
--- a/libs/iplant-clojure-commons/project.clj
+++ b/libs/iplant-clojure-commons/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/clojure-commons "5.2.4.0"
+(defproject org.iplantc/clojure-commons "5.2.5.0"
:description "Common Utilities for Clojure Projects"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -20,5 +20,5 @@
[ring "1.4.0"]
[slingshot "0.12.2"]
[trptcolin/versioneer "0.2.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/service-logging "5.2.5.0"]]
:profiles {:test {:resource-paths ["resources" "test-resources"]}})
diff --git a/libs/kameleon/project.clj b/libs/kameleon/project.clj
index 9a063ece0..bc633cc48 100644
--- a/libs/kameleon/project.clj
+++ b/libs/kameleon/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/kameleon "5.2.4.0"
+(defproject org.iplantc/kameleon "5.2.5.0"
:description "Library for interacting with backend relational databases."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
diff --git a/libs/mescal/project.clj b/libs/mescal/project.clj
index 1e991bc5b..fc422af5f 100644
--- a/libs/mescal/project.clj
+++ b/libs/mescal/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/mescal "5.2.4.0"
+(defproject org.iplantc/mescal "5.2.5.0"
:description "A Clojure client library for the Agave API."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD Standard License"
@@ -9,7 +9,7 @@
[clj-time "0.7.0"]
[com.cemerick/url "0.1.1"]
[medley "0.5.3"]
- [org.iplantc/authy "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/authy "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[slingshot "0.10.3"]])
diff --git a/libs/service-logging/project.clj b/libs/service-logging/project.clj
index e822851fe..c48b63aeb 100644
--- a/libs/service-logging/project.clj
+++ b/libs/service-logging/project.clj
@@ -1,4 +1,4 @@
-(defproject org.iplantc/service-logging "5.2.4.0"
+(defproject org.iplantc/service-logging "5.2.5.0"
:description "Common Logging Utilities for Clojure Projects"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
diff --git a/services/Infosquito/project.clj b/services/Infosquito/project.clj
index ea43a0f1f..2c8acfeff 100644
--- a/services/Infosquito/project.clj
+++ b/services/Infosquito/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/infosquito "5.2.4.0"
+(defproject org.iplantc/infosquito "5.2.5.0"
:description "An ICAT database crawler used to index the contents of iRODS."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -29,7 +29,7 @@
[com.novemberain/langohr "2.11.0"]
[slingshot "0.10.3"]
[me.raynes/fs "1.4.6"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]]
:profiles {:dev {:resource-paths ["dev-resources"]}})
diff --git a/services/Infosquito/version b/services/Infosquito/version
index 675c9b112..da030363c 100644
--- a/services/Infosquito/version
+++ b/services/Infosquito/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/JEX/project.clj b/services/JEX/project.clj
index 42d226a67..da048a259 100644
--- a/services/JEX/project.clj
+++ b/services/JEX/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/jex "5.2.4.0"
+(defproject org.iplantc/jex "5.2.5.0"
:description "A backend job execution service that submits jobs to Condor."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -24,11 +24,11 @@
[com.fasterxml.jackson.core/jackson-core]]]
[com.cemerick/url "0.1.1"]
[compojure "1.3.2"]
- [org.iplantc/clojure-commons "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
[slingshot "0.12.2"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[me.raynes/fs "1.4.6"]]
:plugins [[lein-midje "3.1.1"]]
:profiles {:dev {:dependencies [[midje "1.6.3"]]}}
diff --git a/services/JEX/version b/services/JEX/version
index 675c9b112..da030363c 100644
--- a/services/JEX/version
+++ b/services/JEX/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/NotificationAgent/project.clj b/services/NotificationAgent/project.clj
index ff12b953c..2e0032344 100644
--- a/services/NotificationAgent/project.clj
+++ b/services/NotificationAgent/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/notificationagent "5.2.4.0"
+(defproject org.iplantc/notificationagent "5.2.5.0"
:description "A web service for storing and forwarding notifications."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -22,10 +22,10 @@
[com.fasterxml.jackson.core/jackson-databind]
[com.fasterxml.jackson.core/jackson-core]]]
[compojure "1.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[me.raynes/fs "1.4.6"]
[clj-http "2.0.0"]
[clj-time "0.11.0"]
diff --git a/services/NotificationAgent/version b/services/NotificationAgent/version
index 675c9b112..da030363c 100644
--- a/services/NotificationAgent/version
+++ b/services/NotificationAgent/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/anon-files/project.clj b/services/anon-files/project.clj
index 3a6940e5b..8bd912e01 100644
--- a/services/anon-files/project.clj
+++ b/services/anon-files/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/anon-files "5.2.4.0"
+(defproject org.iplantc/anon-files "5.2.5.0"
:description "Serves up files and directories that are shared with the anonymous user in iRODS."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
@@ -16,12 +16,12 @@
:main ^:skip-aot anon-files.core
:profiles {:uberjar {:aot :all}}
:dependencies [[org.clojure/clojure "1.6.0"]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/service-logging "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
[medley "0.6.0"]
[compojure "1.3.4"]
[ring "1.4.0"]]
diff --git a/services/anon-files/version b/services/anon-files/version
index 675c9b112..da030363c 100644
--- a/services/anon-files/version
+++ b/services/anon-files/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/apps/project.clj b/services/apps/project.clj
index 6695a120d..e75a3cecd 100644
--- a/services/apps/project.clj
+++ b/services/apps/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/apps "5.2.4.0"
+(defproject org.iplantc/apps "5.2.5.0"
:description "Framework for hosting DiscoveryEnvironment metadata services."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -20,14 +20,14 @@
[com.google.guava/guava "18.0"]
[medley "0.7.0"]
[metosin/compojure-api "0.24.2"]
- [org.iplantc/authy "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/mescal "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/common-swagger-api "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/authy "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/mescal "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/common-swagger-api "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[me.raynes/fs "1.4.6"]
[mvxcvi/clj-pgp "0.8.0"]]
:plugins [[lein-ring "0.9.6"]
diff --git a/services/apps/version b/services/apps/version
index 675c9b112..da030363c 100644
--- a/services/apps/version
+++ b/services/apps/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/clockwork/project.clj b/services/clockwork/project.clj
index 30f5984ea..dffb8364a 100644
--- a/services/clockwork/project.clj
+++ b/services/clockwork/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/clockwork "5.2.4.0"
+(defproject org.iplantc/clockwork "5.2.5.0"
:description "Scheduled jobs for the iPlant Discovery Environment"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -30,13 +30,13 @@
[com.mchange/c3p0 "0.9.5.1"]
[korma "0.3.0-RC5"
:exclusions [c3p0]]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[me.raynes/fs "1.4.6"]
[slingshot "0.10.3"]]
:profiles {:dev {:resource-paths ["resources/test"]}
diff --git a/services/clockwork/version b/services/clockwork/version
index 675c9b112..da030363c 100644
--- a/services/clockwork/version
+++ b/services/clockwork/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/condor-log-monitor/version b/services/condor-log-monitor/version
index 675c9b112..da030363c 100644
--- a/services/condor-log-monitor/version
+++ b/services/condor-log-monitor/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/data-info/project.clj b/services/data-info/project.clj
index 62ce6e8dd..2d44de604 100644
--- a/services/data-info/project.clj
+++ b/services/data-info/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/data-info "5.2.4.0"
+(defproject org.iplantc/data-info "5.2.5.0"
:description "provides the data information HTTP API"
:manifest {"Git-Ref" ~(git-ref)}
:uberjar-name "data-info-standalone.jar"
@@ -28,19 +28,19 @@
[org.apache.tika/tika-core "1.11"]
[net.sf.opencsv/opencsv "2.3"]
[slingshot "0.12.2"]
- [org.iplantc/clj-icat-direct "5.2.4.0"
+ [org.iplantc/clj-icat-direct "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/common-swagger-api "5.2.4.0"]
- [org.iplantc/heuristomancer "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/common-swagger-api "5.2.5.0"]
+ [org.iplantc/heuristomancer "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]]
:plugins [[lein-ring "0.9.6"]
[swank-clojure "1.4.2"]]
:profiles {:dev {:resource-paths ["conf/test"]}
diff --git a/services/data-info/version b/services/data-info/version
index 675c9b112..da030363c 100644
--- a/services/data-info/version
+++ b/services/data-info/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/dewey/project.clj b/services/dewey/project.clj
index ee0a6b160..ed2d1d6cc 100644
--- a/services/dewey/project.clj
+++ b/services/dewey/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/dewey "5.2.4.0"
+(defproject org.iplantc/dewey "5.2.5.0"
:description "This is a RabbitMQ client responsible for keeping an elasticsearch index
synchronized with an iRODS repository using messages produced by iRODS."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
@@ -30,12 +30,12 @@
[compojure "1.1.8"]
[ring "1.4.0"]
[slingshot "0.10.3"]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[me.raynes/fs "1.4.6"]]
:resource-paths []
:profiles {:dev {:dependencies [[midje "1.6.3"]]
diff --git a/services/dewey/version b/services/dewey/version
index 675c9b112..da030363c 100644
--- a/services/dewey/version
+++ b/services/dewey/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/info-typer/project.clj b/services/info-typer/project.clj
index b13f8b198..afe3f1f96 100644
--- a/services/info-typer/project.clj
+++ b/services/info-typer/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/info-typer "5.2.4.0"
+(defproject org.iplantc/info-typer "5.2.5.0"
:description "An AMQP based info type detection service for iRODS"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -17,13 +17,13 @@
:dependencies [[org.clojure/clojure "1.7.0"]
[com.novemberain/langohr "3.1.0"]
[me.raynes/fs "1.4.6"]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/clojure-commons "5.2.4.0" :exclusions [commons-logging]]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/heuristomancer "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/clojure-commons "5.2.5.0" :exclusions [commons-logging]]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/heuristomancer "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]]
:main ^:skip-aot info-typer.core
:profiles {:dev {:resource-paths ["conf/test"]}
:uberjar {:aot :all}}
diff --git a/services/info-typer/version b/services/info-typer/version
index 675c9b112..da030363c 100644
--- a/services/info-typer/version
+++ b/services/info-typer/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/iplant-email/project.clj b/services/iplant-email/project.clj
index bd125dfbc..6d9c52faf 100644
--- a/services/iplant-email/project.clj
+++ b/services/iplant-email/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/iplant-email "5.2.4.0"
+(defproject org.iplantc/iplant-email "5.2.5.0"
:description "iPlant Email Service"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -15,8 +15,8 @@
:manifest {"Git-Ref" ~(git-ref)}
:uberjar-name "iplant-email-standalone.jar"
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[cheshire "5.5.0"
:exclusions [[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor]
[com.fasterxml.jackson.dataformat/jackson-dataformat-smile]
@@ -26,7 +26,7 @@
[javax.mail/mail "1.4"]
[org.bituf/clj-stringtemplate "0.2"]
[compojure "1.0.1"]
- [org.iplantc/common-cli "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
[me.raynes/fs "1.4.6"]]
:aot [iplant-email.core]
:main iplant-email.core)
diff --git a/services/iplant-email/version b/services/iplant-email/version
index 675c9b112..da030363c 100644
--- a/services/iplant-email/version
+++ b/services/iplant-email/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/iplant-groups/project.clj b/services/iplant-groups/project.clj
index 166025aad..be5e29096 100644
--- a/services/iplant-groups/project.clj
+++ b/services/iplant-groups/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/iplant-groups "5.2.4.0"
+(defproject org.iplantc/iplant-groups "5.2.5.0"
:description "A REST front-end for Grouper."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -22,11 +22,11 @@
[medley "0.7.0"]
[metosin/compojure-api "0.24.2"]
[me.raynes/fs "1.4.6"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-swagger-api "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-swagger-api "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[ring/ring-core "1.4.0"]
[ring/ring-jetty-adapter "1.4.0"]]
:plugins [[lein-ring "0.9.6"]]
diff --git a/services/iplant-groups/version b/services/iplant-groups/version
index 675c9b112..da030363c 100644
--- a/services/iplant-groups/version
+++ b/services/iplant-groups/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/jex-events/version b/services/jex-events/version
index 675c9b112..da030363c 100644
--- a/services/jex-events/version
+++ b/services/jex-events/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/kifshare/project.clj b/services/kifshare/project.clj
index 88684e5c2..11b7f7de8 100644
--- a/services/kifshare/project.clj
+++ b/services/kifshare/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/kifshare "5.2.4.0"
+(defproject org.iplantc/kifshare "5.2.5.0"
:description "CyVerse Quickshare for iRODS"
:url "https://github.com/cyverse/DE"
@@ -20,12 +20,12 @@
:dependencies [[org.clojure/clojure "1.6.0"]
[org.clojure/tools.logging "0.3.1"]
[medley "0.5.5"]
- [org.iplantc/clj-jargon "5.2.4.0"
+ [org.iplantc/clj-jargon "5.2.5.0"
:exclusions [[org.slf4j/slf4j-log4j12]
[log4j]]]
- [org.iplantc/service-logging "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
[me.raynes/fs "1.4.6"]
[cheshire "5.5.0"
:exclusions [[com.fasterxml.jackson.dataformat/jackson-dataformat-cbor]
diff --git a/services/kifshare/version b/services/kifshare/version
index 675c9b112..da030363c 100644
--- a/services/kifshare/version
+++ b/services/kifshare/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/metadata/project.clj b/services/metadata/project.clj
index fa5180d7d..e35d375b9 100644
--- a/services/metadata/project.clj
+++ b/services/metadata/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/metadata "5.2.4.0"
+(defproject org.iplantc/metadata "5.2.5.0"
:description "The REST API for the Discovery Environment Metadata services."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD Standard License"
@@ -15,12 +15,12 @@
:manifest {"Git-Ref" ~(git-ref)}
:dependencies [[org.clojure/clojure "1.7.0"]
[metosin/compojure-api "0.24.2"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-swagger-api "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-swagger-api "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[slingshot "0.12.2"]]
:main metadata.core
:ring {:handler metadata.core/dev-handler
diff --git a/services/metadata/version b/services/metadata/version
index 675c9b112..da030363c 100644
--- a/services/metadata/version
+++ b/services/metadata/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/monkey/project.clj b/services/monkey/project.clj
index f430fd9a2..9303a25be 100644
--- a/services/monkey/project.clj
+++ b/services/monkey/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/monkey "5.2.4.0"
+(defproject org.iplantc/monkey "5.2.5.0"
:description "A metadata database crawler. It synchronizes the tag documents in the search data
index with the tag information inthe metadata database. 🐒"
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
@@ -24,7 +24,7 @@
[com.novemberain/langohr "2.11.0"]
[me.raynes/fs "1.4.6"]
[slingshot "0.10.3"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]]
:profiles {:dev {:resource-paths ["conf/test"]}})
diff --git a/services/monkey/version b/services/monkey/version
index 675c9b112..da030363c 100644
--- a/services/monkey/version
+++ b/services/monkey/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/saved-searches/project.clj b/services/saved-searches/project.clj
index 2c94659a4..08db77e77 100644
--- a/services/saved-searches/project.clj
+++ b/services/saved-searches/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/saved-searches "5.2.4.0"
+(defproject org.iplantc/saved-searches "5.2.5.0"
:description "DE API for managing saved searches."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
@@ -16,10 +16,10 @@
:main saved-searches.core
:uberjar-name "saved-searches-standalone.jar"
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[io.aviso/pretty "0.1.17"]
[me.raynes/fs "1.4.6"]
[cheshire "5.5.0"
diff --git a/services/saved-searches/version b/services/saved-searches/version
index 675c9b112..da030363c 100644
--- a/services/saved-searches/version
+++ b/services/saved-searches/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/terrain/project.clj b/services/terrain/project.clj
index fd06f39a9..5d20fb22f 100644
--- a/services/terrain/project.clj
+++ b/services/terrain/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/terrain "5.2.4.0-SNAPSHOT"
+(defproject org.iplantc/terrain "5.2.5.0-SNAPSHOT"
:description "Framework for hosting DiscoveryEnvironment metadata services."
:url "https://github.com/cyverse/DE"
:license {:name "BSD Standard License"
@@ -33,15 +33,15 @@
[org.nexml.model/nexml "1.5-SNAPSHOT"] ; provides org.nexml.model
[org/forester "1.005" ]
[slingshot "0.12.2"]
- [org.iplantc/clj-cas "5.2.4.0"]
- [org.iplantc/clj-icat-direct "5.2.4.0"]
- [org.iplantc/clj-jargon "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/heuristomancer "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]]
+ [org.iplantc/clj-cas "5.2.5.0"]
+ [org.iplantc/clj-icat-direct "5.2.5.0"]
+ [org.iplantc/clj-jargon "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/heuristomancer "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]]
:plugins [[lein-ring "0.9.2" :exclusions [org.clojure/clojure]]
[swank-clojure "1.4.2" :exclusions [org.clojure/clojure]]]
:profiles {:dev {:resource-paths ["conf/test"]}
diff --git a/services/terrain/version b/services/terrain/version
index 81895948f..f39bd79e2 100644
--- a/services/terrain/version
+++ b/services/terrain/version
@@ -1 +1 @@
-5.2.4.0-SNAPSHOT
+5.2.5.0-SNAPSHOT
diff --git a/services/tree-urls/project.clj b/services/tree-urls/project.clj
index 528a44a9a..70ce5e176 100644
--- a/services/tree-urls/project.clj
+++ b/services/tree-urls/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/tree-urls "5.2.4.0"
+(defproject org.iplantc/tree-urls "5.2.5.0"
:description "DE API for managing tree urls."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
@@ -16,10 +16,10 @@
:main tree-urls.core
:uberjar-name "tree-urls-standalone.jar"
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[io.aviso/pretty "0.1.17"]
[me.raynes/fs "1.4.6"]
[cheshire "5.5.0"
diff --git a/services/tree-urls/version b/services/tree-urls/version
index 675c9b112..da030363c 100644
--- a/services/tree-urls/version
+++ b/services/tree-urls/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/user-preferences/project.clj b/services/user-preferences/project.clj
index 192950e9c..7c1eda7e7 100644
--- a/services/user-preferences/project.clj
+++ b/services/user-preferences/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/user-preferences "5.2.4.0"
+(defproject org.iplantc/user-preferences "5.2.5.0"
:description "DE API for managing user preferences."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
@@ -16,10 +16,10 @@
:main user-preferences.core
:uberjar-name "user-preferences-standalone.jar"
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
[io.aviso/pretty "0.1.17"]
[me.raynes/fs "1.4.6"]
[cheshire "5.5.0"
diff --git a/services/user-preferences/version b/services/user-preferences/version
index 675c9b112..da030363c 100644
--- a/services/user-preferences/version
+++ b/services/user-preferences/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/services/user-sessions/project.clj b/services/user-sessions/project.clj
index ae906520e..53be52b67 100644
--- a/services/user-sessions/project.clj
+++ b/services/user-sessions/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/user-sessions "5.2.4.0"
+(defproject org.iplantc/user-sessions "5.2.5.0"
:description "DE API for managing user sessions."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"}
@@ -16,10 +16,10 @@
:aot [user-sessions.core]
:main user-sessions.core
:dependencies [[org.clojure/clojure "1.5.1"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/common-cfg "5.2.4.0"]
- [org.iplantc/service-logging "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/common-cfg "5.2.5.0"]
+ [org.iplantc/service-logging "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
[io.aviso/pretty "0.1.17"]
[me.raynes/fs "1.4.6"]
[cheshire "5.5.0"
diff --git a/services/user-sessions/version b/services/user-sessions/version
index 675c9b112..da030363c 100644
--- a/services/user-sessions/version
+++ b/services/user-sessions/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/tools/facepalm/project.clj b/tools/facepalm/project.clj
index dba13951d..8b37a0726 100644
--- a/tools/facepalm/project.clj
+++ b/tools/facepalm/project.clj
@@ -11,7 +11,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/facepalm "5.2.4.0"
+(defproject org.iplantc/facepalm "5.2.5.0"
:description "Command-line utility for DE database managment."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -28,9 +28,9 @@
[korma "0.4.0"
:exclusions [c3p0]]
[me.raynes/fs "1.4.6"]
- [org.iplantc/clj-jargon "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
+ [org.iplantc/clj-jargon "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
[postgresql "9.1-901-1.jdbc4"]
[slingshot "0.10.3"]
[clj-http "2.0.0"]]
diff --git a/tools/facepalm/version b/tools/facepalm/version
index 675c9b112..da030363c 100644
--- a/tools/facepalm/version
+++ b/tools/facepalm/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/tools/filetool/project.clj b/tools/filetool/project.clj
index 8194f2e43..0b30e178f 100644
--- a/tools/filetool/project.clj
+++ b/tools/filetool/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/porklock "5.2.4.0"
+(defproject org.iplantc/porklock "5.2.5.0"
:description "A command-line tool for interacting with iRODS."
:url "https://github.com/iPlantCollaborativeOpenSource/DE"
:license {:name "BSD"
@@ -21,6 +21,6 @@
[org.clojure/tools.logging "0.3.1"]
[commons-io/commons-io "2.4"]
[slingshot "0.12.2"]
- [org.iplantc/clj-jargon "5.2.4.0"]
- [org.iplantc/clojure-commons "5.2.4.0"]
- [org.iplantc/common-cli "5.2.4.0"]])
+ [org.iplantc/clj-jargon "5.2.5.0"]
+ [org.iplantc/clojure-commons "5.2.5.0"]
+ [org.iplantc/common-cli "5.2.5.0"]])
diff --git a/tools/filetool/version b/tools/filetool/version
index 675c9b112..da030363c 100644
--- a/tools/filetool/version
+++ b/tools/filetool/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/tools/job-preserver/project.clj b/tools/job-preserver/project.clj
index cd0841004..6f85991cd 100644
--- a/tools/job-preserver/project.clj
+++ b/tools/job-preserver/project.clj
@@ -1,4 +1,4 @@
-(defproject job-preserver "5.2.4.0"
+(defproject job-preserver "5.2.5.0"
:description "Migration to move job data that was skipped in previous migrations."
:url "https://github.com/iPlantCollaborativeOpenSource/DiscoveryEnvironmentBackend"
:license {:name "BSD Standard License"
@@ -10,7 +10,7 @@
[org.clojure/clojure "1.6.0"]
[org.clojure/tools.cli "0.3.1"]
[org.clojure/tools.logging "0.3.1"]
- [org.iplantc/kameleon "5.2.4.0"]]
+ [org.iplantc/kameleon "5.2.5.0"]]
:uberjar-name "job-preserver.jar"
:aot [job-preserver.core]
:main job-preserver.core)
diff --git a/tools/sharkbait/project.clj b/tools/sharkbait/project.clj
index ed18275e8..78c6a391e 100644
--- a/tools/sharkbait/project.clj
+++ b/tools/sharkbait/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject org.iplantc/sharkbait "5.2.4.0"
+(defproject org.iplantc/sharkbait "5.2.5.0"
:description "Utility for initializing Grouper."
:url "https://github.com/iPlantCollaborativeOpenSource/DE/"
:license {:name "BSD"
@@ -22,8 +22,8 @@
[org.clojure/tools.logging "0.3.1"]
[org.hibernate/hibernate-core "3.6.10.Final"]
[org.hibernate/hibernate-ehcache "3.6.10.Final"]
- [org.iplantc/common-cli "5.2.4.0"]
- [org.iplantc/kameleon "5.2.4.0"]
+ [org.iplantc/common-cli "5.2.5.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
[postgresql "9.3-1102.jdbc41"]]
:main sharkbait.core
:profiles {:uberjar {:aot :all}})
diff --git a/tools/sharkbait/version b/tools/sharkbait/version
index 675c9b112..da030363c 100644
--- a/tools/sharkbait/version
+++ b/tools/sharkbait/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/tools/template-mover/project.clj b/tools/template-mover/project.clj
index cc2caa955..3afa9ea99 100644
--- a/tools/template-mover/project.clj
+++ b/tools/template-mover/project.clj
@@ -7,7 +7,7 @@
(string/trim (:out (sh "git" "rev-parse" "HEAD")))
""))
-(defproject template-mover "5.2.4.0"
+(defproject template-mover "5.2.5.0"
:description "Utility to copy metadata templates to their new database."
:url "https://github.com/iPlantCollaborativeOpenSource/DiscoveryEnvironmentBackend"
:license {:name "BSD Standard License"
@@ -19,7 +19,7 @@
[org.clojure/java.jdbc "0.3.7"]
[org.clojure/tools.cli "0.3.1"]
[org.clojure/tools.logging "0.3.1"]
- [org.iplantc/kameleon "5.2.4.0"]
+ [org.iplantc/kameleon "5.2.5.0"]
[postgresql "9.1-901-1.jdbc4"]]
:aot :all
:main template-mover.core)
diff --git a/tools/template-mover/version b/tools/template-mover/version
index 675c9b112..da030363c 100644
--- a/tools/template-mover/version
+++ b/tools/template-mover/version
@@ -1 +1 @@
-5.2.4.0
+5.2.5.0
diff --git a/ui/gradle.properties b/ui/gradle.properties
index 1436070c2..4a109b493 100644
--- a/ui/gradle.properties
+++ b/ui/gradle.properties
@@ -1,4 +1,4 @@
-version=2.4.0
+version=2.5.0
BUILD_TAG=
BUILD_ID=
From cd76375bab7a64192033535ee9b207c6b5248211 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 4 Feb 2016 15:16:15 -0700
Subject: [PATCH 003/183] CORE-5291: After delete, return path in trash
This modifies only the data-info endpoints, but since terrain serves as a pure
passthrough for these endpoints, it will also be reflected in the terrain
endpoints.
---
.../src/data_info/routes/domain/trash.clj | 18 ++++++++++++++++++
.../data-info/src/data_info/routes/trash.clj | 6 +++---
.../data-info/src/data_info/services/trash.clj | 13 +++++++++----
3 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/services/data-info/src/data_info/routes/domain/trash.clj b/services/data-info/src/data_info/routes/domain/trash.clj
index 7a359427d..383ec417c 100644
--- a/services/data-info/src/data_info/routes/domain/trash.clj
+++ b/services/data-info/src/data_info/routes/domain/trash.clj
@@ -27,3 +27,21 @@
(s/defschema RestorationPaths
{:restored
(describe RestorationPathsMap "A map of paths from the request to their restoration info")})
+
+(s/defschema TrashPathsMap
+ {(describe s/Keyword "The iRODS data item's original path.")
+ (describe String "The data item's path in the trash")})
+
+(s/defschema TrashPaths
+ (assoc Paths
+ :trash-paths (describe TrashPathsMap "A map of paths from the request to their location in the trash, if any.")))
+
+;; Used only for documentation in Swagger UI
+(s/defschema TrashPathsDocMap
+ {:/path/from/request/to/a/file/or/folder
+ (describe String "The data item's path in the trash")})
+
+;; Used only for documentation in Swagger UI
+(s/defschema TrashPathsDoc
+ (assoc TrashPaths
+ :trash-paths (describe TrashPathsDocMap "A map of paths from the request to their location in the trash, if any.")))
diff --git a/services/data-info/src/data_info/routes/trash.clj b/services/data-info/src/data_info/routes/trash.clj
index 841b51c2f..d695a1793 100644
--- a/services/data-info/src/data_info/routes/trash.clj
+++ b/services/data-info/src/data_info/routes/trash.clj
@@ -20,7 +20,7 @@
:tags ["bulk"]
:query [params StandardUserQueryParams]
:body [body (describe Paths "The paths to move to the trash")]
- :return Paths
+ :return (s/doc-only TrashPaths TrashPathsDoc)
:summary "Delete Data Items"
:description (str
"Delete the data items with the listed paths."
@@ -46,7 +46,7 @@
(DELETE* "/" [:as {uri :uri}]
:query [params StandardUserQueryParams]
- :return Paths
+ :return TrashPaths
:summary "Delete Data Item"
:description (str
"Deletes the data item with the provided UUID."
@@ -56,7 +56,7 @@
(DELETE* "/children" [:as {uri :uri}]
:query [params StandardUserQueryParams]
- :return Paths
+ :return TrashPaths
:summary "Delete Data Item Contents"
:description (str
"Deletes the contents of the folder with the provided UUID."
diff --git a/services/data-info/src/data_info/services/trash.clj b/services/data-info/src/data_info/services/trash.clj
index d388f0bf2..ed00931a4 100644
--- a/services/data-info/src/data_info/services/trash.clj
+++ b/services/data-info/src/data_info/services/trash.clj
@@ -35,7 +35,8 @@
[cm p user]
(let [trash-path (randomized-trash-path user p)]
(move cm p trash-path :user user :admin-users (cfg/irods-admins))
- (set-metadata cm trash-path "ipc-trash-origin" p paths/IPCSYSTEM)))
+ (set-metadata cm trash-path "ipc-trash-origin" p paths/IPCSYSTEM)
+ trash-path))
(defn- home-matcher
[user path]
@@ -51,7 +52,8 @@
(defn- delete-paths
[user paths]
(with-jargon (cfg/jargon-cfg) [cm]
- (let [paths (mapv ft/rm-last-slash paths)]
+ (let [paths (mapv ft/rm-last-slash paths)
+ trash-paths (atom (hash-map))]
(validators/user-exists cm user)
(validators/all-paths-exist cm paths)
(validators/user-owns-paths cm user paths)
@@ -69,10 +71,13 @@
;;; If the file isn't already in the user's trash, move it there
;;; otherwise, do a hard delete.
(if-not (.startsWith p (paths/user-trash-path user))
- (move-to-trash cm p user)
+ (do (let [trash-path (move-to-trash cm p user)]
+ (reset! trash-paths
+ (assoc @trash-paths p trash-path))))
(delete cm p true))) ;;; Force a delete to bypass proxy user's trash.
- {:paths paths})))
+ {:paths paths
+ :trash-paths @trash-paths})))
(defn- delete-uuid
"Delete by UUID: given a user and a data item UUID, delete that data item, returning a list of filenames deleted."
From 389470ecce35aa496804416054235a16f689cbc0 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 4 Feb 2016 16:53:21 -0700
Subject: [PATCH 004/183] Remove unused net.sf.json-lib/json-lib dependency
from data-info.
---
services/data-info/project.clj | 1 -
1 file changed, 1 deletion(-)
diff --git a/services/data-info/project.clj b/services/data-info/project.clj
index 2d44de604..35a7b4ce1 100644
--- a/services/data-info/project.clj
+++ b/services/data-info/project.clj
@@ -24,7 +24,6 @@
[dire "0.5.3"]
[me.raynes/fs "1.4.6"]
[metosin/compojure-api "0.24.2"]
- [net.sf.json-lib/json-lib "2.4" :classifier "jdk15"]
[org.apache.tika/tika-core "1.11"]
[net.sf.opencsv/opencsv "2.3"]
[slingshot "0.12.2"]
From e9ccd94f0e1ca601099bdc9bac3679f5d29df576 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 28 Jan 2016 16:27:36 -0700
Subject: [PATCH 005/183] CORE-6215: add anon-files sharing to data-info.
---
services/data-info/src/data_info/routes.clj | 2 +
.../src/data_info/routes/domain/sharing.clj | 25 ++++
.../src/data_info/routes/sharing.clj | 19 +++
.../src/data_info/services/sharing.clj | 121 ++++++++++++++++++
4 files changed, 167 insertions(+)
create mode 100644 services/data-info/src/data_info/routes/domain/sharing.clj
create mode 100644 services/data-info/src/data_info/routes/sharing.clj
create mode 100644 services/data-info/src/data_info/services/sharing.clj
diff --git a/services/data-info/src/data_info/routes.clj b/services/data-info/src/data_info/routes.clj
index 1d2bb2b21..d8037d238 100644
--- a/services/data-info/src/data_info/routes.clj
+++ b/services/data-info/src/data_info/routes.clj
@@ -14,6 +14,7 @@
[data-info.routes.users :as users-routes]
[data-info.routes.navigation :as navigation-routes]
[data-info.routes.rename :as rename-routes]
+ [data-info.routes.sharing :as sharing-routes]
[data-info.routes.status :as status-routes]
[data-info.routes.stats :as stat-routes]
[data-info.routes.trash :as trash-routes]
@@ -53,5 +54,6 @@
users-routes/permissions-gatherer
navigation-routes/navigation
stat-routes/stat-gatherer
+ sharing-routes/sharing-routes
trash-routes/trash
(route/not-found (svc/unrecognized-path-response))))
diff --git a/services/data-info/src/data_info/routes/domain/sharing.clj b/services/data-info/src/data_info/routes/domain/sharing.clj
new file mode 100644
index 000000000..261503e4c
--- /dev/null
+++ b/services/data-info/src/data_info/routes/domain/sharing.clj
@@ -0,0 +1,25 @@
+(ns data-info.routes.domain.sharing
+ (:use [common-swagger-api.schema :only [describe
+ NonBlankString]])
+ (:require [schema.core :as s]))
+
+(s/defschema AnonFileUrls
+ {(describe s/Keyword "the iRODS data item's path")
+ (describe NonBlankString "the URL for the file to request in anon-files.")})
+
+(s/defschema AnonShareInfo
+ {:user
+ (describe NonBlankString "The user performing the request.")
+
+ :paths
+ (describe AnonFileUrls "The anon-files URLs for the paths provided with the request.")})
+
+;; Used only for display as documentation in Swagger UI
+(s/defschema AnonFilePathsMap
+ {:/path/from/request/to/a/file
+ (describe NonBlankString "the URL for the file to request in anon-files.")})
+
+;; Used only for display as documentation in Swagger UI
+(s/defschema AnonShareResponse
+ (assoc AnonShareInfo
+ :paths (describe AnonFilePathsMap "The anon-files URLs for the paths provided with the request.")))
diff --git a/services/data-info/src/data_info/routes/sharing.clj b/services/data-info/src/data_info/routes/sharing.clj
new file mode 100644
index 000000000..6cebd1335
--- /dev/null
+++ b/services/data-info/src/data_info/routes/sharing.clj
@@ -0,0 +1,19 @@
+(ns data-info.routes.sharing
+ (:use [common-swagger-api.schema]
+ [data-info.routes.domain.common]
+ [data-info.routes.domain.sharing])
+ (:require [data-info.services.sharing :as sharing]
+ [data-info.util.service :as svc]
+ [data-info.util.schema :as s]))
+
+(defroutes* sharing-routes
+ (POST* "/anonymizer" [:as {uri :uri}]
+ :tags ["bulk"]
+ :query [params StandardUserQueryParams]
+ :body [body (describe Paths "The paths to make readable by the anonymous user.")]
+ :return (s/doc-only AnonShareInfo AnonShareResponse)
+ :summary "Make Data Items Anonymously Readable"
+ :description (str
+"Given a list of files in the body, makes the files readable by the anonymous user."
+(get-error-code-block "ERR_NOT_A_FILE, ERR_DOES_NOT_EXIST, ERR_NOT_OWNER, ERR_TOO_MANY_PATHS, ERR_NOT_A_USER"))
+ (svc/trap uri sharing/do-anon-files params body)))
diff --git a/services/data-info/src/data_info/services/sharing.clj b/services/data-info/src/data_info/services/sharing.clj
new file mode 100644
index 000000000..893e38723
--- /dev/null
+++ b/services/data-info/src/data_info/services/sharing.clj
@@ -0,0 +1,121 @@
+(ns data-info.services.sharing
+ (:use [clj-jargon.init :only [with-jargon]]
+ [clj-jargon.item-info :only [trash-base-dir is-dir?]]
+ [clj-jargon.permissions]
+ [slingshot.slingshot :only [try+ throw+]])
+ (:require [clojure.tools.logging :as log]
+ [clojure.string :as string]
+ [clojure-commons.file-utils :as ft]
+ [cemerick.url :as url]
+ [dire.core :refer [with-pre-hook! with-post-hook!]]
+ [data-info.util.logging :as dul]
+ [data-info.util.paths :as paths]
+ [data-info.util.config :as cfg]
+ [data-info.util.validators :as validators]))
+
+(defn- shared?
+ ([cm share-with fpath]
+ (:read (permissions cm share-with fpath)))
+ ([cm share-with fpath desired-perm]
+ (let [curr-perm (permission-for cm share-with fpath)]
+ (= curr-perm desired-perm))))
+
+(defn- skip-share
+ [user path reason]
+ (log/warn "Skipping share of" path "with" user "because:" reason)
+ {:user user
+ :path path
+ :reason reason
+ :skipped true})
+
+(defn- share-path-home
+ "Returns the home directory that a shared file is under."
+ [share-path]
+ (string/join "/" (take 4 (string/split share-path #"\/"))))
+
+(defn- share-path
+ "Shares a path with a user. This consists of the following steps:
+
+ 1. The parent directories up to the sharer's home directory need to be marked as readable
+ by the sharee. Othwerwise, any files that are shared will be orphaned in the UI.
+
+ 2. If the shared item is a directory then the inherit bit needs to be set so that files
+ that are uploaded into the directory will also be shared.
+
+ 3. The permissions are set on the item being shared. This is done recursively in case the
+ item being shared is a directory."
+ [cm user share-with perm fpath]
+ (let [hdir (share-path-home fpath)
+ trash-dir (trash-base-dir (:zone cm) user)
+ base-dirs #{hdir trash-dir}]
+ (log/warn fpath "is being shared with" share-with "by" user)
+ (process-parent-dirs (partial set-readable cm share-with true) #(not (base-dirs %)) fpath)
+
+ (when (is-dir? cm fpath)
+ (log/warn fpath "is a directory, setting the inherit bit.")
+ (set-inherits cm fpath))
+
+ (when-not (is-readable? cm share-with hdir)
+ (log/warn share-with "is being given read permissions on" hdir "by" user)
+ (set-permission cm share-with hdir :read false))
+
+ (log/warn share-with "is being given recursive permissions (" perm ") on" fpath)
+ (set-permission cm share-with fpath (keyword perm) true)
+
+ {:user share-with :path fpath}))
+
+(defn- share-paths
+ [cm user share-withs fpaths perm]
+ (for [share-with share-withs
+ fpath fpaths]
+ (cond (= user share-with) (skip-share share-with fpath :share-with-self)
+ (paths/in-trash? user fpath) (skip-share share-with fpath :share-from-trash)
+ (shared? cm share-with fpath perm) (skip-share share-with fpath :already-shared)
+ :else (share-path cm user share-with perm fpath))))
+
+(defn- share
+ [cm user share-withs fpaths perm]
+ (validators/user-exists cm user)
+ (validators/all-users-exist cm share-withs)
+ (validators/all-paths-exist cm fpaths)
+ (validators/user-owns-paths cm user fpaths)
+
+ (let [keyfn #(if (:skipped %) :skipped :succeeded)
+ share-recs (group-by keyfn (share-paths cm user share-withs fpaths perm))
+ sharees (map :user (:succeeded share-recs))
+ home-dir (paths/user-home-dir user)]
+ {:user sharees
+ :path fpaths
+ :skipped (map #(dissoc % :skipped) (:skipped share-recs))
+ :permission perm}))
+
+(defn- anon-file-url
+ [p]
+ (let [aurl (url/url (cfg/anon-files-base))]
+ (str (-> aurl (assoc :path (ft/path-join (:path aurl) (string/replace p #"^\/" "")))))))
+
+(defn- anon-files-urls
+ [paths]
+ (into {} (map #(vector %1 (anon-file-url %1)) paths)))
+
+(defn- anon-files
+ [user paths]
+ (with-jargon (cfg/jargon-cfg) [cm]
+ (validators/user-exists cm user)
+ (validators/all-paths-exist cm paths)
+ (validators/paths-are-files cm paths)
+ (validators/user-owns-paths cm user paths)
+ (log/warn "Giving read access to" (cfg/anon-user) "on:" (string/join " " paths))
+ (share cm user [(cfg/anon-user)] paths :read)
+ {:user user :paths (anon-files-urls paths)}))
+
+(defn do-anon-files
+ [{:keys [user]} {:keys [paths]}]
+ (anon-files user (mapv ft/rm-last-slash paths)))
+
+(with-pre-hook! #'do-anon-files
+ (fn [params body]
+ (dul/log-call "do-anon-files" params body)
+ (validators/validate-num-paths (:paths body))))
+
+(with-post-hook! #'do-anon-files (dul/log-func "do-anon-files"))
From acfef5dce706e24f5adff585016af967216a187a Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Thu, 4 Feb 2016 12:46:40 -0700
Subject: [PATCH 006/183] CORE-6215: migrate anon-files to call data-info
endpoint.
---
.../terrain/src/terrain/clients/data_info.clj | 5 ++++
.../src/terrain/clients/data_info/raw.clj | 8 ++++++
.../terrain/src/terrain/routes/filesystem.clj | 2 +-
.../terrain/services/filesystem/sharing.clj | 27 -------------------
4 files changed, 14 insertions(+), 28 deletions(-)
diff --git a/services/terrain/src/terrain/clients/data_info.clj b/services/terrain/src/terrain/clients/data_info.clj
index e03b55082..b83d7182d 100644
--- a/services/terrain/src/terrain/clients/data_info.clj
+++ b/services/terrain/src/terrain/clients/data_info.clj
@@ -228,6 +228,11 @@
(let [path-uuid (uuid-for-path (:user params) (:path body))]
(raw/set-file-type (:user params) path-uuid (:type body))))
+(defn share-with-anonymous
+ "Uses the data-info anonymizer endpoint to share paths with the anonymous user."
+ [params body]
+ (raw/share-with-anonymous (:user params) (:paths body)))
+
(defn gen-output-dir
"Either obtains or creates a default output directory using a specified base name."
[base]
diff --git a/services/terrain/src/terrain/clients/data_info/raw.clj b/services/terrain/src/terrain/clients/data_info/raw.clj
index 262164d30..072a40007 100644
--- a/services/terrain/src/terrain/clients/data_info/raw.clj
+++ b/services/terrain/src/terrain/clients/data_info/raw.clj
@@ -221,6 +221,14 @@
(request :post ["data" path-uuid "metadata" "save"]
(mk-req-map user (json/encode {:dest dest :recursive recursive}))))
+;; SHARING
+
+(defn share-with-anonymous
+ "Share a list of paths with the anonymous user."
+ [user paths]
+ (request :post ["anonymizer"]
+ (mk-req-map user (json/encode {:paths paths}))))
+
;; MISC
(defn collect-permissions
diff --git a/services/terrain/src/terrain/routes/filesystem.clj b/services/terrain/src/terrain/routes/filesystem.clj
index 8c9800c9b..9c81eec03 100644
--- a/services/terrain/src/terrain/routes/filesystem.clj
+++ b/services/terrain/src/terrain/routes/filesystem.clj
@@ -90,7 +90,7 @@
(controller req data/read-tabular-chunk :params :body))
(POST "/filesystem/anon-files" [:as req]
- (controller req sharing/do-anon-files :params :body))))
+ (controller req data/share-with-anonymous :params :body))))
(defn secured-filesystem-metadata-routes
"The routes for file metadata endpoints."
diff --git a/services/terrain/src/terrain/services/filesystem/sharing.clj b/services/terrain/src/terrain/services/filesystem/sharing.clj
index 5ca5d48c3..0dec5b252 100644
--- a/services/terrain/src/terrain/services/filesystem/sharing.clj
+++ b/services/terrain/src/terrain/services/filesystem/sharing.clj
@@ -172,30 +172,3 @@
[p]
(let [aurl (url/url (cfg/anon-files-base))]
(str (-> aurl (assoc :path (ft/path-join (:path aurl) (string/replace p #"^\/" "")))))))
-
-(defn anon-files-urls
- [paths]
- (into {} (map #(vector %1 (anon-file-url %1)) paths)))
-
-(defn anon-files
- [user paths]
- (with-jargon (icat/jargon-cfg) [cm]
- (validators/user-exists cm user)
- (validators/all-paths-exist cm paths)
- (validators/paths-are-files cm paths)
- (validators/user-owns-paths cm user paths)
- (log/warn "Giving read access to" (cfg/fs-anon-user) "on:" (string/join " " paths))
- (share user [(cfg/fs-anon-user)] paths :read)
- {:user user :paths (anon-files-urls paths)}))
-
-(defn fix-broken-paths
- [paths]
- (mapv #(string/replace % #"\/$" "") paths))
-
-(defn do-anon-files
- [params body]
- (paths/log-call "do-anon-files" params body)
- (validate-map params {:user string?})
- (validate-map body {:paths sequential?})
- (validators/validate-num-paths (:paths body))
- (anon-files (:user params) (fix-broken-paths (:paths body))))
From dd006ef85d27832bc93820f923880aa02982141d Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Fri, 5 Feb 2016 13:58:46 -0700
Subject: [PATCH 007/183] Use swap! rather than reset! for atom updates in
data-info.services.trash.
---
services/data-info/src/data_info/services/trash.clj | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/services/data-info/src/data_info/services/trash.clj b/services/data-info/src/data_info/services/trash.clj
index ed00931a4..1b5b81d24 100644
--- a/services/data-info/src/data_info/services/trash.clj
+++ b/services/data-info/src/data_info/services/trash.clj
@@ -72,8 +72,7 @@
;;; otherwise, do a hard delete.
(if-not (.startsWith p (paths/user-trash-path user))
(do (let [trash-path (move-to-trash cm p user)]
- (reset! trash-paths
- (assoc @trash-paths p trash-path))))
+ (swap! trash-paths assoc p trash-path)))
(delete cm p true))) ;;; Force a delete to bypass proxy user's trash.
{:paths paths
@@ -206,9 +205,8 @@
(move cm path fully-restored :user user :admin-users (cfg/irods-admins))
(log/warn "Done moving " path " to " fully-restored)
- (reset! retval
- (assoc @retval path {:restored-path fully-restored
- :partial-restore restored-to-homedir}))))
+ (swap! retval assoc path {:restored-path fully-restored
+ :partial-restore restored-to-homedir})))
{:restored @retval}))
{:restored {}}))))
From 91572bc1389114d477f9a72d2b934ff119585c09 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Mon, 8 Feb 2016 12:55:44 -0700
Subject: [PATCH 008/183] Revert force of lein 2.5.3 given 2.6.1 release.
This reverts commit e645cada4488290f7bc69d594845908a3937fe99.
---
docker/de-backend-buildenv/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docker/de-backend-buildenv/Dockerfile b/docker/de-backend-buildenv/Dockerfile
index 3c9572e43..b3dc88c67 100644
--- a/docker/de-backend-buildenv/Dockerfile
+++ b/docker/de-backend-buildenv/Dockerfile
@@ -44,7 +44,7 @@ ENV LEIN_ROOT 1
ENV PATH /bin:/usr/bin:/usr/local/bin:/sbin/:/usr/sbin:/opt/go/bin:/opt/gopath/bin:/opt/maven/bin:/opt/nodejs/bin
RUN go get github.com/tools/godep
RUN go get github.com/constabulary/gb/...
-ADD https://raw.githubusercontent.com/technomancy/leiningen/2.5.3/bin/lein /usr/bin/lein
+ADD https://raw.githubusercontent.com/technomancy/leiningen/stable/bin/lein /usr/bin/lein
ADD build_profiles.clj /root/.lein/profiles.clj
RUN chmod a+x /usr/bin/lein
From 9373eaf9b008bd1725dd95f0a33e9af810a2ca95 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Tue, 9 Feb 2016 12:33:30 -0700
Subject: [PATCH 009/183] Switch the base of jex-events' docker image to use
jeanblanchard/alpine-glibc.
---
services/jex-events/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/jex-events/Dockerfile b/services/jex-events/Dockerfile
index 26783a560..b5e9bbf9f 100644
--- a/services/jex-events/Dockerfile
+++ b/services/jex-events/Dockerfile
@@ -1,4 +1,4 @@
-FROM ubuntu:14.04
+FROM jeanblanchard/alpine-glibc
ADD bin/jex-events /bin/
From 5f4376dd35554805489c914c280ece9af7d8cb7b Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 8 Feb 2016 12:39:02 -0700
Subject: [PATCH 010/183] CORE-7479 Change DE window header text to bold for
readability
---
.../theme/base/client/desktop/window/IplantWindowStyles.css | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/window/IplantWindowStyles.css b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/window/IplantWindowStyles.css
index d4203ed9e..62551ab84 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/window/IplantWindowStyles.css
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/window/IplantWindowStyles.css
@@ -1,6 +1,6 @@
@font-face {
- font-family: TextaRegular;
- src: url(../Texta_Font/Texta-Regular.otf);
+ font-family: TextaBold;
+ src: url(../Texta_Font/Texta-Bold.otf);
}
@sprite .restoreBtn {
@@ -67,7 +67,7 @@
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
- font-family: TextaRegular, Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro",
+ font-family: TextaBold, Univers, Calibri, "Gill Sans", "Gill Sans MT", "Myriad Pro",
Myriad, "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L",
Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial,
sans-serif !important;
From 9ce2e7c10dde57c643838ba29f0fed1c20890246 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 11:33:44 -0700
Subject: [PATCH 011/183] CORE-3484: added uniqueness constraints on the name
and path columns of the genome_reference table
---
.../src/main/constraints/46_genome_ref.sql | 15 +++++++++++++++
.../conversions/v2.5.0/c250_2016021001.clj | 19 +++++++++++++++++++
.../src/main/data/99_version.sql | 1 +
libs/kameleon/project.clj | 2 +-
4 files changed, 36 insertions(+), 1 deletion(-)
create mode 100644 databases/de-database-schema/src/main/constraints/46_genome_ref.sql
create mode 100644 databases/de-database-schema/src/main/conversions/v2.5.0/c250_2016021001.clj
diff --git a/databases/de-database-schema/src/main/constraints/46_genome_ref.sql b/databases/de-database-schema/src/main/constraints/46_genome_ref.sql
new file mode 100644
index 000000000..857694117
--- /dev/null
+++ b/databases/de-database-schema/src/main/constraints/46_genome_ref.sql
@@ -0,0 +1,15 @@
+SET search_path = public, pg_catalog;
+
+--
+-- Uniqueness constraint on reference genome name.
+--
+ALTER TABLE ONLY genome_reference
+ADD CONSTRAINT genome_ref_mame_unique
+UNIQUE (name);
+
+--
+-- Uniqueness constraint on reference genome path.
+--
+ALTER TABLE ONLY genome_reference
+ADD CONSTRAINT genome_ref_path_unique
+UNIQUE (path);
diff --git a/databases/de-database-schema/src/main/conversions/v2.5.0/c250_2016021001.clj b/databases/de-database-schema/src/main/conversions/v2.5.0/c250_2016021001.clj
new file mode 100644
index 000000000..b4507a936
--- /dev/null
+++ b/databases/de-database-schema/src/main/conversions/v2.5.0/c250_2016021001.clj
@@ -0,0 +1,19 @@
+(ns facepalm.c250-2016021001
+ (:use [korma.core]
+ [kameleon.sql-reader :only [load-sql-file]]))
+
+(def ^:private version
+ "The destination database version."
+ "2.5.0:20160210.01")
+
+(defn- add-reference-genome-uniqueness-constraints
+ "Adds uniqueness constraints to the name and path columns of the genome_reference table."
+ []
+ (println "\t* Adding uniqueness constraints to the genome_reference table")
+ (load-sql-file "constraints/46_genome_ref.sql"))
+
+(defn convert
+ "Performs the conversion for this database version"
+ []
+ (println "Performing the conversion for" version)
+ (add-reference-genome-uniqueness-constraints))
diff --git a/databases/de-database-schema/src/main/data/99_version.sql b/databases/de-database-schema/src/main/data/99_version.sql
index d1cb9ecf3..87e0614c8 100644
--- a/databases/de-database-schema/src/main/data/99_version.sql
+++ b/databases/de-database-schema/src/main/data/99_version.sql
@@ -70,3 +70,4 @@ INSERT INTO version (version) VALUES ('2.1.0:20150901.01');
INSERT INTO version (version) VALUES ('2.2.0:20151005.01');
INSERT INTO version (version) VALUES ('2.3.0:20151110.01');
INSERT INTO version (version) VALUES ('2.4.0:20160106.01');
+INSERT INTO version (version) VALUES ('2.5.0:20160210.01');
diff --git a/libs/kameleon/project.clj b/libs/kameleon/project.clj
index bc633cc48..ab69c820f 100644
--- a/libs/kameleon/project.clj
+++ b/libs/kameleon/project.clj
@@ -14,4 +14,4 @@
[slingshot "0.12.2"]]
:plugins [[lein-marginalia "0.7.1"]
[test2junit "1.1.3"]]
- :manifest {"db-version" "2.4.0:20160106.01"})
+ :manifest {"db-version" "2.5.0:20160210.01"})
From 6c27115bbc395d58d1b1a6a21fde7d66eab0e743 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 13:40:30 -0700
Subject: [PATCH 012/183] CORE-3485: added a check for duplidate reference
genome paths
---
.../src/clojure_commons/exception_util.clj | 5 +++
.../src/apps/metadata/reference_genomes.clj | 36 +++++++++++++------
2 files changed, 31 insertions(+), 10 deletions(-)
diff --git a/libs/iplant-clojure-commons/src/clojure_commons/exception_util.clj b/libs/iplant-clojure-commons/src/clojure_commons/exception_util.clj
index 9fc7265f7..e55bc4953 100644
--- a/libs/iplant-clojure-commons/src/clojure_commons/exception_util.clj
+++ b/libs/iplant-clojure-commons/src/clojure_commons/exception_util.clj
@@ -11,3 +11,8 @@
"Throws an error indicating that the request is forbidden."
[reason & {:as ex-info}]
(throw+ (assoc ex-info :type ::cx/forbidden :error reason)))
+
+(defn exists
+ "Throws an error indicating that there was an attempt to create something that already exists."
+ [reason & {:as ex-info}]
+ (throw+ (assoc ex-info :type ::cx/exists :error reason)))
diff --git a/services/apps/src/apps/metadata/reference_genomes.clj b/services/apps/src/apps/metadata/reference_genomes.clj
index 1aa3ec7d7..317fa04cf 100644
--- a/services/apps/src/apps/metadata/reference_genomes.clj
+++ b/services/apps/src/apps/metadata/reference_genomes.clj
@@ -10,6 +10,7 @@
[apps.util.conversions :only [date->timestamp]]
[slingshot.slingshot :only [throw+]])
(:require [clojure.tools.logging :as log]
+ [clojure-commons.exception-util :as cxu]
[korma.core :as sql]))
(defn- reference-genome-base-query
@@ -22,6 +23,13 @@
(join created_by)
(join last_modified_by)))
+(defn- get-reference-genomes-where
+ "A convenience function to look up reference genomes that satisfy a simple set of conditions."
+ [conditions]
+ (-> (reference-genome-base-query)
+ (where conditions)
+ select))
+
(defn get-reference-genomes
"Lists all of the reference genomes in the database."
[{:keys [deleted created_by]}]
@@ -83,18 +91,26 @@
(sql/update genome_reference (set-fields update-values) (where {:id reference-genome-id}))
(get-reference-genome reference-genome-id)))
+(defn- validate-reference-genome-path
+ "Verifies that a reference genome with the same path doesn't already exist."
+ [path]
+ (if (seq (get-reference-genomes-where {:path path}))
+ (cxu/exists "A reference genome with the given path already exists." :path path)))
+
(defn add-reference-genome
"Adds a reference genome with the given name and path."
- [reference-genome]
- (let [user-id (get-user-id (:username current-user))
- insert-values (-> reference-genome
- (select-keys [:name :path])
- (assoc :created_by user-id
- :last_modified_by user-id
- :created_on (sqlfn now)
- :last_modified_on (sqlfn now)))
- reference-genome-id (:id (insert genome_reference (values insert-values)))]
- (get-reference-genome reference-genome-id)))
+ [{:keys [name path] :as reference-genome}]
+ (let [user-id (get-user-id (:username current-user))]
+ (validate-reference-genome-path path)
+ (-> (insert genome_reference
+ (values {:name name
+ :path path
+ :created_by user-id
+ :last_modified_by user-id
+ :created_on (sqlfn now)
+ :last_modified_on (sqlfn now)}))
+ :id
+ get-reference-genome)))
(def ^:private valid-insert-fields
[:id :name :path :deleted :created_by :created_on :last_modified_by :last_modified_on])
From cbbe35b4354674a73b11a29fa719792be491cf93 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 14:30:08 -0700
Subject: [PATCH 013/183] CORE-3484: added a duplicate name check to the POST
/admin/reference-genomes endpoint
---
services/apps/src/apps/metadata/reference_genomes.clj | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/services/apps/src/apps/metadata/reference_genomes.clj b/services/apps/src/apps/metadata/reference_genomes.clj
index 317fa04cf..3fd799d21 100644
--- a/services/apps/src/apps/metadata/reference_genomes.clj
+++ b/services/apps/src/apps/metadata/reference_genomes.clj
@@ -97,11 +97,18 @@
(if (seq (get-reference-genomes-where {:path path}))
(cxu/exists "A reference genome with the given path already exists." :path path)))
+(defn- validate-reference-genome-name
+ "Verifies that a reference genome with the same name doesn't already exist."
+ [name]
+ (if (seq (get-reference-genomes-where {:name name}))
+ (cxu/exists "A reference genome with the given name already exists." :name name)))
+
(defn add-reference-genome
"Adds a reference genome with the given name and path."
[{:keys [name path] :as reference-genome}]
(let [user-id (get-user-id (:username current-user))]
(validate-reference-genome-path path)
+ (validate-reference-genome-name name)
(-> (insert genome_reference
(values {:name name
:path path
From 241f8d6fb1ffdca66e301ed6a1f445b1b9b1c431 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 15:24:20 -0700
Subject: [PATCH 014/183] CORE-3484: fixed a typo in a database constraint name
---
.../de-database-schema/src/main/constraints/46_genome_ref.sql | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/databases/de-database-schema/src/main/constraints/46_genome_ref.sql b/databases/de-database-schema/src/main/constraints/46_genome_ref.sql
index 857694117..9936d9050 100644
--- a/databases/de-database-schema/src/main/constraints/46_genome_ref.sql
+++ b/databases/de-database-schema/src/main/constraints/46_genome_ref.sql
@@ -4,7 +4,7 @@ SET search_path = public, pg_catalog;
-- Uniqueness constraint on reference genome name.
--
ALTER TABLE ONLY genome_reference
-ADD CONSTRAINT genome_ref_mame_unique
+ADD CONSTRAINT genome_ref_name_unique
UNIQUE (name);
--
From f5c0a22b12f2ad6267ee6bca6050e7876b26ac1b Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 16:49:24 -0700
Subject: [PATCH 015/183] CORE-3484, CORE-3485: add reference genome path and
name validation to PATCH /admin/reference-genomes/:reference-genome-id as
well
---
.../src/apps/metadata/reference_genomes.clj | 46 +++++++++++--------
1 file changed, 27 insertions(+), 19 deletions(-)
diff --git a/services/apps/src/apps/metadata/reference_genomes.clj b/services/apps/src/apps/metadata/reference_genomes.clj
index 3fd799d21..8b911c0cf 100644
--- a/services/apps/src/apps/metadata/reference_genomes.clj
+++ b/services/apps/src/apps/metadata/reference_genomes.clj
@@ -68,6 +68,24 @@
(assert-not-nil [:reference-genome-id reference-genome-id]
(first (get-reference-genomes-by-id reference-genome-id))))
+(defn- validate-reference-genome-path
+ "Verifies that a reference genome with the same path doesn't already exist."
+ ([path id]
+ (if (seq (get-reference-genomes-where {:path path :id [not= id]}))
+ (cxu/exists "Another reference genome with the given path already exists." :path path)))
+ ([path]
+ (if (seq (get-reference-genomes-where {:path path}))
+ (cxu/exists "A reference genome with the given path already exists." :path path))))
+
+(defn- validate-reference-genome-name
+ "Verifies that a reference genome with the same name doesn't already exist."
+ ([name id]
+ (if (seq (get-reference-genomes-where {:name name :id [not= id]}))
+ (cxu/exists "Another reference genome with the given name already exists." :name name)))
+ ([name]
+ (if (seq (get-reference-genomes-where {:name name}))
+ (cxu/exists "A reference genome with the given name already exists." :name name))))
+
(defn get-reference-genome
"Gets a reference genome by its ID."
[reference-genome-id]
@@ -82,26 +100,16 @@
(defn update-reference-genome
"Updates the name, path, and deleted flag of a reference genome."
- [{reference-genome-id :id :as reference-genome}]
+ [{reference-genome-id :id :keys [name path] :as reference-genome}]
(get-valid-reference-genome reference-genome-id)
- (let [update-values (-> reference-genome
- (select-keys [:name :path :deleted])
- (assoc :last_modified_by (get-user-id (:username current-user))
- :last_modified_on (sqlfn now)))]
- (sql/update genome_reference (set-fields update-values) (where {:id reference-genome-id}))
- (get-reference-genome reference-genome-id)))
-
-(defn- validate-reference-genome-path
- "Verifies that a reference genome with the same path doesn't already exist."
- [path]
- (if (seq (get-reference-genomes-where {:path path}))
- (cxu/exists "A reference genome with the given path already exists." :path path)))
-
-(defn- validate-reference-genome-name
- "Verifies that a reference genome with the same name doesn't already exist."
- [name]
- (if (seq (get-reference-genomes-where {:name name}))
- (cxu/exists "A reference genome with the given name already exists." :name name)))
+ (validate-reference-genome-path path reference-genome-id)
+ (validate-reference-genome-name name reference-genome-id)
+ (sql/update genome_reference
+ (set-fields (assoc (select-keys reference-genome [:name :path :deleted])
+ :last_modified_by (get-user-id (:username current-user))
+ :last_modified_on (sqlfn now)))
+ (where {:id reference-genome-id}))
+ (get-reference-genome reference-genome-id))
(defn add-reference-genome
"Adds a reference genome with the given name and path."
From 1dd093ca28b3d1a3feed67c0f1c2eb2610d7f0db Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 10 Feb 2016 17:43:20 -0700
Subject: [PATCH 016/183] CORE-7386: remove support for the `public` query
parmeter from GET /admin/apps/categories
---
services/apps/src/apps/routes/admin.clj | 2 +-
services/apps/src/apps/service/apps/de/listings.clj | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/services/apps/src/apps/routes/admin.clj b/services/apps/src/apps/routes/admin.clj
index 183685ec6..5604fa18d 100644
--- a/services/apps/src/apps/routes/admin.clj
+++ b/services/apps/src/apps/routes/admin.clj
@@ -108,7 +108,7 @@
(defroutes* admin-categories
(GET* "/" []
- :query [params CategoryListingParams]
+ :query [params SecuredQueryParams]
:return AppCategoryListing
:summary "List App Categories"
:description "This service is used by DE admins to obtain a list of public app categories along
diff --git a/services/apps/src/apps/service/apps/de/listings.clj b/services/apps/src/apps/service/apps/de/listings.clj
index 788567595..64fda7e4a 100644
--- a/services/apps/src/apps/service/apps/de/listings.clj
+++ b/services/apps/src/apps/service/apps/de/listings.clj
@@ -154,7 +154,7 @@
"Retrieves the list of app groups that are accessible to administrators. This includes all public
app groups along with the trash group."
[user params]
- (let [params (assoc params :admin true)]
+ (let [params (assoc params :admin true :public true)]
(conj (vec (get-app-groups user params))
(format-trash-category nil nil params))))
From 3538e80e4beb9ca6b73e57b78c769aae762d2223 Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Thu, 11 Feb 2016 11:56:12 -0700
Subject: [PATCH 017/183] CORE-7511 Add more user info to PermID Request
details.
Updated the responses of Permanent ID Request endpoints that return a
request's details to include more user info in the 'requested_by' field,
such as email and first/last name.
Since the requesting user's email is now available when notifications
are sent to that user, notification emails can now be enabled.
Added the new ID to the "Completion" notification update in the
"comments" field, which is now included as the body of the "Completion"
notification email.
---
.../services/permanent_id_requests.clj | 53 ++++++++++++++-----
1 file changed, 39 insertions(+), 14 deletions(-)
diff --git a/services/terrain/src/terrain/services/permanent_id_requests.clj b/services/terrain/src/terrain/services/permanent_id_requests.clj
index 7b5c9eb06..bfbbfa8a8 100644
--- a/services/terrain/src/terrain/services/permanent_id_requests.clj
+++ b/services/terrain/src/terrain/services/permanent_id_requests.clj
@@ -10,6 +10,7 @@
[terrain.clients.data-info :as data-info]
[terrain.clients.data-info.raw :as data-info-client]
[terrain.clients.ezid :as ezid]
+ [terrain.clients.iplant-groups :as groups]
[terrain.clients.metadata.raw :as metadata]
[terrain.clients.notifications :as notifications]
[terrain.util.config :as config]
@@ -176,24 +177,29 @@
(metadata/add-metadata-template-avus id data-type template-id publish-avus)))
(defn- send-notification
- [user subject request-id]
+ [user email subject contents request-id]
(log/debug "sending permanent_id_request notification to" user ":" subject)
(try
(notifications/send-notification
{:type "permanent_id_request"
:user user
:subject subject
- :payload {:uuid request-id}})
+ :email true
+ :email_template "blank"
+ :payload {:email_address email
+ :contents contents
+ :uuid request-id}})
(catch Exception e
(log/error e
"Could not send permanent_id_request (" request-id ") notification to" user ":" subject))))
(defn- send-update-notification
- [{:keys [id type folder history requested_by] :or {folder {:path "unknown"}}}]
- (send-notification
- requested_by
- (str type " Request for " (ft/basename (:path folder)) " Status Changed to " (:status (last history)))
- id))
+ [{{:keys [username email]} :requested_by
+ :keys [id type folder history]
+ :or {folder {:path "unknown"}}}]
+ (let [{:keys [status comments]} (last history)
+ subject (str type " Request for " (ft/basename (:path folder)) " Status Changed to " status)]
+ (send-notification username email subject comments id)))
(defn- request-type->shoulder
[type]
@@ -263,6 +269,19 @@
(dissoc :target_id :target_type :original_path)
(assoc :folder (data-info/stat-by-uuid user (uuidify target_id)))))
+(defn- format-requested-by
+ [user {:keys [requested_by target_id] :as permanent-id-request}]
+ (let [user-info (groups/lookup-subject user requested_by)]
+ (if user-info
+ (assoc permanent-id-request :requested_by (groups/format-like-trellis user-info))
+ permanent-id-request)))
+
+(defn- format-permanent-id-request-details
+ [user permanent-id-request]
+ (->> permanent-id-request
+ (format-perm-id-req-response user)
+ (format-requested-by user)))
+
(defn- format-perm-id-req-list
[requests]
(map
@@ -273,7 +292,7 @@
[params]
(-> (metadata/list-permanent-id-requests params)
parse-service-json
- (update-in [:requests] format-perm-id-req-list)))
+ (update :requests format-perm-id-req-list)))
(defn create-permanent-id-request
[params body]
@@ -285,10 +304,15 @@
target-type (validate-request-target-type folder)
{request-id :id :as response} (submit-permanent-id-request type folder-id target-type path)
staged-path (stage-data-item user folder)]
- (send-notification user (str type " Request Submitted for " (ft/basename path)) request-id)
+ (send-notification
+ user
+ (:email current-user)
+ (str type " Request Submitted for " (ft/basename path))
+ nil
+ request-id)
(email/send-permanent-id-request-new type staged-path current-user)
(email/send-permanent-id-request-submitted type staged-path current-user)
- (format-perm-id-req-response user response)))
+ (format-permanent-id-request-details user response)))
(defn list-permanent-id-request-status-codes
[params]
@@ -302,25 +326,25 @@
[request-id params]
(->> (metadata/get-permanent-id-request request-id)
parse-service-json
- (format-perm-id-req-response (:shortUsername current-user))))
+ (format-permanent-id-request-details (:shortUsername current-user))))
(defn admin-list-permanent-id-requests
[params]
(-> (metadata/admin-list-permanent-id-requests params)
parse-service-json
- (update-in [:requests] format-perm-id-req-list)))
+ (update :requests format-perm-id-req-list)))
(defn admin-get-permanent-id-request
[request-id params]
(->> (metadata/admin-get-permanent-id-request request-id)
parse-service-json
- (format-perm-id-req-response (:shortUsername current-user))))
+ (format-permanent-id-request-details (:shortUsername current-user))))
(defn update-permanent-id-request
[request-id params body]
(let [response (->> (metadata/update-permanent-id-request request-id body)
parse-service-json
- (format-perm-id-req-response (:shortUsername current-user)))]
+ (format-permanent-id-request-details (:shortUsername current-user)))]
(send-update-notification response)
response))
@@ -355,4 +379,5 @@
(let [identifier (complete-permanent-id-request (:shortUsername current-user)
(admin-get-permanent-id-request request-id nil))]
(update-permanent-id-request request-id nil (json/encode {:status status-code-completion
+ :comments identifier
:permanent_id identifier}))))
From 357e7988ccf3a6fabc7030c74c798c3783413d37 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Thu, 11 Feb 2016 11:57:54 -0700
Subject: [PATCH 018/183] CORE-6943 modify Email notifications options wordings
to include URL import notification emails.
---
.../client/desktop/DesktopContextualHelpMessages.properties | 2 +-
.../de/theme/base/client/desktop/DesktopMessages.properties | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
index 9452d599a..0f060308e 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
@@ -1,7 +1,7 @@
iconHomepageDataTip = Store, manage, and share your data here.
iconHomepageAnalysesTip = Find the status, parameters, and results of your executed apps.
iconHomepageAppsTip = Discover, create, and use scientific apps for your data.
-notifyEmailHelp = This option will send you an email when your analysis is complete or has failed. It will be sent to the email address you used to register for your CyVerse account.
This option is helpful if you would like to track the status of your analysis while outside of the Discovery Environment.
+notifyEmailHelp = This option will send you an email when your analysis or URL import is complete or has failed. It will be sent to the email address you used to register for your CyVerse account.
This option is helpful if you would like to track the status of your analysis while outside of the Discovery Environment.
rememberFileSelectorPathHelp = This option allows the Data Manager to automatically navigate the file tree to the file location that was used the last time you ran an app.
This option is helpful if you have an extensive file tree or often use the same input file location.
saveSessionHelp = Enabling the Save session option will restore your Discovery Environment desktop to exactly how you left it when you last logged out.
defaultOutputFolderHelp = This will be the default location where all outputs from your analyses can be found.
You can keep the default path or click Browse to select a new location.
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
index 29473119a..4e0be1843 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
@@ -4,7 +4,7 @@ about = About
forums = Forums
duplicateShortCutKey = The following keyboard shortcut is already in use: {0}. Please choose another shortcut.
preferences = Preferences
-notifyEmail = Notify me by email when my analysis status changes.
+notifyEmail = Notify me by email when my analysis
or URL import status changes.
rememberFileSectorPath = Remember last file path for Apps.
restoreDefaults = Restore Defaults
saveSession = Save Session
From b15291931a506d772cc3608cb4286483021f395b Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Thu, 11 Feb 2016 13:35:04 -0700
Subject: [PATCH 019/183] CORE-7511 Minor refactor.
Includes removing unused 'params' arguments from some
terrain.services.permanent-id-requests functions.
---
.../terrain/routes/permanent_id_requests.clj | 28 ++++++++---------
.../services/permanent_id_requests.clj | 31 +++++++++----------
2 files changed, 29 insertions(+), 30 deletions(-)
diff --git a/services/terrain/src/terrain/routes/permanent_id_requests.clj b/services/terrain/src/terrain/routes/permanent_id_requests.clj
index daf7ba119..0a3e18c58 100644
--- a/services/terrain/src/terrain/routes/permanent_id_requests.clj
+++ b/services/terrain/src/terrain/routes/permanent_id_requests.clj
@@ -14,17 +14,17 @@
(GET "/permanent-id-requests" [:as {params :params}]
(service/success-response (list-permanent-id-requests params)))
- (POST "/permanent-id-requests" [:as {:keys [params body]}]
- (service/success-response (create-permanent-id-request params body)))
+ (POST "/permanent-id-requests" [:as {:keys [body]}]
+ (service/success-response (create-permanent-id-request body)))
- (GET "/permanent-id-requests/status-codes" [:as {params :params}]
- (service/success-response (list-permanent-id-request-status-codes params)))
+ (GET "/permanent-id-requests/status-codes" []
+ (service/success-response (list-permanent-id-request-status-codes)))
- (GET "/permanent-id-requests/types" [:as {params :params}]
- (service/success-response (list-permanent-id-request-types params)))
+ (GET "/permanent-id-requests/types" []
+ (service/success-response (list-permanent-id-request-types)))
- (GET "/permanent-id-requests/:request-id" [request-id :as {params :params}]
- (service/success-response (get-permanent-id-request request-id params)))))
+ (GET "/permanent-id-requests/:request-id" [request-id]
+ (service/success-response (get-permanent-id-request request-id)))))
(defn admin-permanent-id-request-routes
"The admin routes for Permanent ID Request endpoints."
@@ -36,11 +36,11 @@
(GET "/permanent-id-requests" [:as {params :params}]
(service/success-response (admin-list-permanent-id-requests params)))
- (GET "/permanent-id-requests/:request-id" [request-id :as {params :params}]
- (service/success-response (admin-get-permanent-id-request request-id params)))
+ (GET "/permanent-id-requests/:request-id" [request-id]
+ (service/success-response (admin-get-permanent-id-request request-id)))
- (POST "/permanent-id-requests/:request-id/ezid" [request-id :as {:keys [params body]}]
- (service/success-response (create-permanent-id request-id params body)))
+ (POST "/permanent-id-requests/:request-id/ezid" [request-id :as {:keys [body]}]
+ (service/success-response (create-permanent-id request-id body)))
- (POST "/permanent-id-requests/:request-id/status" [request-id :as {:keys [params body]}]
- (service/success-response (update-permanent-id-request request-id params body)))))
+ (POST "/permanent-id-requests/:request-id/status" [request-id :as {:keys [body]}]
+ (service/success-response (update-permanent-id-request request-id body)))))
diff --git a/services/terrain/src/terrain/services/permanent_id_requests.clj b/services/terrain/src/terrain/services/permanent_id_requests.clj
index bfbbfa8a8..1a5db21aa 100644
--- a/services/terrain/src/terrain/services/permanent_id_requests.clj
+++ b/services/terrain/src/terrain/services/permanent_id_requests.clj
@@ -271,10 +271,9 @@
(defn- format-requested-by
[user {:keys [requested_by target_id] :as permanent-id-request}]
- (let [user-info (groups/lookup-subject user requested_by)]
- (if user-info
- (assoc permanent-id-request :requested_by (groups/format-like-trellis user-info))
- permanent-id-request)))
+ (if-let [user-info (groups/lookup-subject user requested_by)]
+ (assoc permanent-id-request :requested_by (groups/format-like-trellis user-info))
+ permanent-id-request))
(defn- format-permanent-id-request-details
[user permanent-id-request]
@@ -295,7 +294,7 @@
(update :requests format-perm-id-req-list)))
(defn create-permanent-id-request
- [params body]
+ [body]
(create-staging-dir)
(let [{type :type folder-id :folder} (service/decode-json body)
folder-id (uuidify folder-id)
@@ -315,15 +314,15 @@
(format-permanent-id-request-details user response)))
(defn list-permanent-id-request-status-codes
- [params]
+ []
(metadata/list-permanent-id-request-status-codes))
(defn list-permanent-id-request-types
- [params]
+ []
(metadata/list-permanent-id-request-types))
(defn get-permanent-id-request
- [request-id params]
+ [request-id]
(->> (metadata/get-permanent-id-request request-id)
parse-service-json
(format-permanent-id-request-details (:shortUsername current-user))))
@@ -335,13 +334,13 @@
(update :requests format-perm-id-req-list)))
(defn admin-get-permanent-id-request
- [request-id params]
+ [request-id]
(->> (metadata/admin-get-permanent-id-request request-id)
parse-service-json
(format-permanent-id-request-details (:shortUsername current-user))))
(defn update-permanent-id-request
- [request-id params body]
+ [request-id body]
(let [response (->> (metadata/update-permanent-id-request request-id body)
parse-service-json
(format-permanent-id-request-details (:shortUsername current-user)))]
@@ -370,14 +369,14 @@
identifier)
(catch Object e
(log/error e)
- (update-permanent-id-request request-id nil (json/encode {:status status-code-failed}))
+ (update-permanent-id-request request-id (json/encode {:status status-code-failed}))
(throw+ e))))
(defn create-permanent-id
- [request-id params body]
+ [request-id body]
(create-publish-dir)
(let [identifier (complete-permanent-id-request (:shortUsername current-user)
- (admin-get-permanent-id-request request-id nil))]
- (update-permanent-id-request request-id nil (json/encode {:status status-code-completion
- :comments identifier
- :permanent_id identifier}))))
+ (admin-get-permanent-id-request request-id))]
+ (update-permanent-id-request request-id (json/encode {:status status-code-completion
+ :comments identifier
+ :permanent_id identifier}))))
From fa7d575511757239ba4340c05c15f423910bb1e1 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Thu, 11 Feb 2016 14:48:54 -0700
Subject: [PATCH 020/183] CORE-6943 UI for enabling/disabling URL import email
notifications.
---
.../presenter/AppLaunchPresenterImpl.java | 2 +-
.../de/client/models/UserSettings.java | 43 +++++++++++++------
.../views/widgets/PreferencesDialog.java | 18 +++++---
.../views/widgets/PreferencesView.ui.xml | 15 +++++--
.../iplantc/de/desktop/shared/DeModule.java | 3 +-
.../DesktopContextualHelpMessages.java | 3 ++
.../DesktopContextualHelpMessages.properties | 3 +-
.../base/client/desktop/DesktopMessages.java | 7 ++-
.../client/desktop/DesktopMessages.properties | 3 +-
.../PreferencesViewDefaultAppearance.java | 14 +++++-
10 files changed, 81 insertions(+), 30 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/apps/widgets/client/presenter/AppLaunchPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/apps/widgets/client/presenter/AppLaunchPresenterImpl.java
index 8bab79225..d99081d0d 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/apps/widgets/client/presenter/AppLaunchPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/apps/widgets/client/presenter/AppLaunchPresenterImpl.java
@@ -77,7 +77,7 @@ public void go(final HasOneWidget container) {
final AppTemplateAutoBeanFactory factory = GWT.create(AppTemplateAutoBeanFactory.class);
final JobExecution je = factory.jobExecution().as();
je.setAppTemplateId(appTemplate.getId());
- je.setEmailNotificationEnabled(userSettings.isEnableEmailNotification());
+ je.setEmailNotificationEnabled(userSettings.isEnableAnalysisEmailNotification());
// JDS Replace all Cmd Line restricted chars with underscores
String regex = Format.substitute("[{0}]",
RegExp.escapeCharacterClassSet(valConstants.restrictedCmdLineChars()
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
index 7d78759b7..67f67254f 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
@@ -22,7 +22,8 @@
public class UserSettings {
private final KeyBoardShortcutConstants SHORTCUTS = GWT.create(KeyBoardShortcutConstants.class);
- private boolean enableEmailNotification;
+ private boolean enableAnalysisEmailNotification;
+ private boolean enableImportEmailNotification;
private String defaultFileSelectorPath;
private boolean rememberLastPath;
private boolean saveSession;
@@ -36,7 +37,8 @@ public class UserSettings {
private String lastPath;
- public static final String EMAIL_NOTIFCATOIN = "enableEmailNotification";
+ public static final String EMAIL_ANALYSIS_NOTIFCATOIN = "enableAnalysisEmailNotification";
+ public static final String EMAIL_IMPORT_NOTIFICATION = "enableImportEmailNotification";
public static final String DEFAULT_FILE_SELECTOR_PATH = "defaultFileSelectorPath";
public static final String REMEMBER_LAST_PATH = "rememberLastPath";
public static final String SAVE_SESSION = "saveSession";
@@ -57,7 +59,7 @@ public UserSettings(final Splittable userSettingsSplit){
}
private UserSettings() {
- this.enableEmailNotification = false;
+ this.enableAnalysisEmailNotification = false;
this.rememberLastPath = false;
this.saveSession = true;
}
@@ -83,11 +85,17 @@ public void setValues(Splittable split) {
return;
}
- if (split.get(EMAIL_NOTIFCATOIN) != null) {
- setEnableEmailNotification(split.get(EMAIL_NOTIFCATOIN).asBoolean());
+ if (split.get(EMAIL_ANALYSIS_NOTIFCATOIN) != null) {
+ setEnableAnalysisEmailNotification(split.get(EMAIL_ANALYSIS_NOTIFCATOIN).asBoolean());
} else {
- setEnableEmailNotification(true);
+ setEnableAnalysisEmailNotification(true);
}
+ if (split.get(EMAIL_IMPORT_NOTIFICATION) != null) {
+ setEnableAnalysisEmailNotification(split.get(EMAIL_IMPORT_NOTIFICATION).asBoolean());
+ } else {
+ setEnableAnalysisEmailNotification(true);
+ }
+
if (split.get(DEFAULT_FILE_SELECTOR_PATH) != null) {
setDefaultFileSelectorPath(split.get(DEFAULT_FILE_SELECTOR_PATH).asString());
}
@@ -197,17 +205,17 @@ public String getNotifyShortCut() {
return notifyShortCut;
}
/**
- * @param enableEmailNotification the enableEmailNotification to set
+ * @param enableAnalysisEmailNotification the enableAnalysisEmailNotification to set
*/
- public void setEnableEmailNotification(boolean enableEmailNotification) {
- this.enableEmailNotification = enableEmailNotification;
+ public void setEnableAnalysisEmailNotification(boolean enableAnalysisEmailNotification) {
+ this.enableAnalysisEmailNotification = enableAnalysisEmailNotification;
}
/**
- * @return the enableEmailNotification
+ * @return the enableAnalysisEmailNotification
*/
- public boolean isEnableEmailNotification() {
- return enableEmailNotification;
+ public boolean isEnableAnalysisEmailNotification() {
+ return enableAnalysisEmailNotification;
}
/**
@@ -231,7 +239,8 @@ public String getDefaultFileSelectorPath() {
*/
public Splittable asSplittable() {
Splittable ret = StringQuoter.createSplittable();
- StringQuoter.create(isEnableEmailNotification()).assign(ret, EMAIL_NOTIFCATOIN);
+ StringQuoter.create(isEnableAnalysisEmailNotification()).assign(ret, EMAIL_ANALYSIS_NOTIFCATOIN);
+ StringQuoter.create(isEnableImportEmailNotification()).assign(ret, EMAIL_IMPORT_NOTIFICATION);
StringQuoter.create(getDefaultFileSelectorPath()).assign(ret, DEFAULT_FILE_SELECTOR_PATH);
StringQuoter.create(isRememberLastPath()).assign(ret, REMEMBER_LAST_PATH);
StringQuoter.create(isSaveSession()).assign(ret, SAVE_SESSION);
@@ -340,4 +349,12 @@ public String getLastPath() {
public void setLastPath(String lastPath) {
this.lastPath = lastPath;
}
+
+ public boolean isEnableImportEmailNotification() {
+ return enableImportEmailNotification;
+ }
+
+ public void setEnableImportEmailNotification(boolean enableImportEmailNotification) {
+ this.enableImportEmailNotification = enableImportEmailNotification;
+ }
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesDialog.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesDialog.java
index 639964186..8c2ff53ca 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesDialog.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesDialog.java
@@ -56,7 +56,9 @@ public interface PreferencesViewAppearance {
String preferences();
- String notifyEmail();
+ String notifyAnalysisEmail();
+
+ String notifyImportEmail();
String completeRequiredFieldsError();
@@ -87,6 +89,8 @@ public interface PreferencesViewAppearance {
String closeActiveWindow();
String saveSessionHelp();
+
+ String notifyEmail();
}
public interface HtmlLayoutContainerTemplate extends XTemplates {
@@ -106,7 +110,8 @@ interface EditorDriver extends SimpleBeanEditorDriver event) {
defaultsBtn.addSelectHandler(new SelectEvent.SelectHandler() {
@Override
public void onSelect(SelectEvent event) {
- enableEmailNotification.setValue(true);
+ enableAnalysisEmailNotification.setValue(true);
+ enableImportEmailNotification.setValue(true);
rememberLastPath.setValue(true);
saveSession.setValue(true);
appsShortCut.setValue(KB_CONSTANTS.appsKeyShortCut());
@@ -231,7 +237,8 @@ protected void onButtonPressed(TextButton button) {
} else if (button == defaultsBtn) {
- enableEmailNotification.setValue(true);
+ enableAnalysisEmailNotification.setValue(true);
+ enableImportEmailNotification.setValue(true);
rememberLastPath.setValue(true);
saveSession.setValue(true);
appsShortCut.setValue(KB_CONSTANTS.appsKeyShortCut());
@@ -256,7 +263,8 @@ protected void onEnsureDebugId(String baseID) {
getButton(PredefinedButton.CANCEL).ensureDebugId(baseID + DeModule.PreferenceIds.CANCEL);
defaultsBtn.ensureDebugId(baseID + DeModule.PreferenceIds.DEFAULTS_BTN);
- enableEmailNotification.ensureDebugId(baseID + DeModule.PreferenceIds.EMAIL_NOTIFICATION);
+ enableAnalysisEmailNotification.ensureDebugId(baseID + DeModule.PreferenceIds.EMAIL_ANALYSIS_NOTIFICATION);
+ enableImportEmailNotification.ensureDebugId(baseID + DeModule.PreferenceIds.EMAIL_IMPORT_NOTIFICATION);
rememberLastPath.ensureDebugId(baseID + DeModule.PreferenceIds.REMEMBER_LAST_PATH);
saveSession.ensureDebugId(baseID + DeModule.PreferenceIds.SAVE_SESSION);
defaultOutputFolder.ensureDebugId(baseID + DeModule.PreferenceIds.DEFAULT_OUTPUT_FOLDER);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesView.ui.xml b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesView.ui.xml
index b3e34a8aa..f56b50d3c 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesView.ui.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/PreferencesView.ui.xml
@@ -31,7 +31,7 @@
-
+
-
+
+
+
+
+
+
This option will send you an email when your analysis or URL import is complete or has failed. It will be sent to the email address you used to register for your CyVerse account.
This option is helpful if you would like to track the status of your analysis while outside of the Discovery Environment.
+notifyEmailHelp = This option will send you an email when your analysis or URL import is complete or has failed. It will be sent to the email address you used to register for your CyVerse account.
This option is helpful if you would like to track the status of your analysis or URL import while outside of the Discovery Environment.
rememberFileSelectorPathHelp = This option allows the Data Manager to automatically navigate the file tree to the file location that was used the last time you ran an app.
This option is helpful if you have an extensive file tree or often use the same input file location.
saveSessionHelp = Enabling the Save session option will restore your Discovery Environment desktop to exactly how you left it when you last logged out.
defaultOutputFolderHelp = This will be the default location where all outputs from your analyses can be found.
You can keep the default path or click Browse to select a new location.
+notifyEmail = Email me when analysis / URL import status changes.
\ No newline at end of file
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.java
index d5a243bc0..0fa7eb4ab 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.java
@@ -51,8 +51,11 @@ public interface DesktopMessages extends Messages {
@Key("newNotificationsAlert")
String newNotificationsAlert();
- @Key("notifyEmail")
- String notifyEmail();
+ @Key("notifyAnalysisEmail")
+ String notifyAnalysisEmail();
+
+ @Key("notifyImportEmail")
+ String notifyImportEmail();
@Key("oneCharMax")
String oneCharMax();
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
index 4e0be1843..2a9c852d5 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopMessages.properties
@@ -4,7 +4,8 @@ about = About
forums = Forums
duplicateShortCutKey = The following keyboard shortcut is already in use: {0}. Please choose another shortcut.
preferences = Preferences
-notifyEmail = Notify me by email when my analysis
or URL import status changes.
+notifyAnalysisEmail = Email me when my analysis status changes.
+notifyImportEmail = Email me when my URL import status changes.
rememberFileSectorPath = Remember last file path for Apps.
restoreDefaults = Restore Defaults
saveSession = Save Session
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/PreferencesViewDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/PreferencesViewDefaultAppearance.java
index 7606daec6..1814d60ae 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/PreferencesViewDefaultAppearance.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/PreferencesViewDefaultAppearance.java
@@ -53,8 +53,13 @@ public String preferences() {
}
@Override
- public String notifyEmail() {
- return desktopMessages.notifyEmail();
+ public String notifyAnalysisEmail() {
+ return desktopMessages.notifyAnalysisEmail();
+ }
+
+ @Override
+ public String notifyImportEmail() {
+ return desktopMessages.notifyImportEmail();
}
@Override
@@ -131,4 +136,9 @@ public String closeActiveWindow() {
public String saveSessionHelp() {
return help.saveSessionHelp();
}
+
+ @Override
+ public String notifyEmail() {
+ return help.notifyEmail();
+ }
}
From 787b09f3a77f99552ee210962fd3ee03d309e348 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Thu, 11 Feb 2016 15:28:03 -0700
Subject: [PATCH 021/183] CORE-6943 fix to call the right setter method for
enable email notification option for Import URL status.
---
.../main/java/org/iplantc/de/client/models/UserSettings.java | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
index 67f67254f..6aecdea0b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/models/UserSettings.java
@@ -91,9 +91,9 @@ public void setValues(Splittable split) {
setEnableAnalysisEmailNotification(true);
}
if (split.get(EMAIL_IMPORT_NOTIFICATION) != null) {
- setEnableAnalysisEmailNotification(split.get(EMAIL_IMPORT_NOTIFICATION).asBoolean());
+ setEnableImportEmailNotification(split.get(EMAIL_IMPORT_NOTIFICATION).asBoolean());
} else {
- setEnableAnalysisEmailNotification(true);
+ setEnableImportEmailNotification(true);
}
if (split.get(DEFAULT_FILE_SELECTOR_PATH) != null) {
From c165c6df11af00f83df41d18a9b5a798acd9c167 Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Thu, 11 Feb 2016 18:04:09 -0700
Subject: [PATCH 022/183] CORE-6943 Update urlupload endpoint to lookup notify
pref.
---
.../terrain/src/terrain/clients/user_prefs.clj | 15 +++++++++++++--
.../terrain/services/metadata/internal_jobs.clj | 12 ++++++++++--
2 files changed, 23 insertions(+), 4 deletions(-)
diff --git a/services/terrain/src/terrain/clients/user_prefs.clj b/services/terrain/src/terrain/clients/user_prefs.clj
index 25164dc36..04f288bd2 100644
--- a/services/terrain/src/terrain/clients/user_prefs.clj
+++ b/services/terrain/src/terrain/clients/user_prefs.clj
@@ -1,10 +1,11 @@
(ns terrain.clients.user-prefs
(:use [terrain.util.config]
[clojure-commons.error-codes]
- [slingshot.slingshot :only [throw+]])
+ [slingshot.slingshot :only [try+ throw+]])
(:require [clj-http.client :as http]
[cemerick.url :refer [url]]
- [cheshire.core :as json]))
+ [cheshire.core :as json]
+ [clojure.tools.logging :as log]))
(defn- user-prefs-url
[user]
@@ -29,6 +30,16 @@
:else
(json/parse-string (:body resp) true))))
+(defn get-prefs-safe
+ "Same as get-prefs, but does not throw exceptions.
+ Instead, caught exceptions are logged and nil is returned."
+ [username]
+ (try+
+ (get-prefs username)
+ (catch Object e
+ (log/error e)
+ nil)))
+
(defn set-prefs
[username prefs-map]
(let [json-prefs (json/encode prefs-map)
diff --git a/services/terrain/src/terrain/services/metadata/internal_jobs.clj b/services/terrain/src/terrain/services/metadata/internal_jobs.clj
index 7572b2d54..4ebaf0353 100644
--- a/services/terrain/src/terrain/services/metadata/internal_jobs.clj
+++ b/services/terrain/src/terrain/services/metadata/internal_jobs.clj
@@ -1,9 +1,17 @@
(ns terrain.services.metadata.internal-jobs
- (:use [slingshot.slingshot :only [throw+]])
+ (:use [slingshot.slingshot :only [throw+]]
+ [terrain.auth.user-attributes :only [current-user]])
(:require [clojure-commons.error-codes :as ce]
[terrain.clients.apps :as apps]
+ [terrain.clients.user-prefs :as prefs]
[terrain.util.config :as config]))
+(defn- get-url-import-notify-pref
+ "Looks up the current user's enableImportEmailNotification preference.
+ Returns true by default if the preference is not set or could not be retrieved."
+ []
+ (:enableImportEmailNotification (prefs/get-prefs-safe (:username current-user)) true))
+
(defn- load-param-map
[app-id]
(->> (apps/get-app app-id)
@@ -48,7 +56,7 @@
:debug false
:create_output_subdir false
:output_dir dest-path
- :notify true
+ :notify (get-url-import-notify-pref)
:skip-parent-meta true
:file-metadata [(avu "ipc-url-import" address "Import URL")]
:archive_logs false})
From 4ffcc9f95c3407f3847d81ca6658d3b8f7cb95b3 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Fri, 12 Feb 2016 10:20:15 -0700
Subject: [PATCH 023/183] CORE-6943 add new line at EOF
---
.../client/desktop/DesktopContextualHelpMessages.properties | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
index ad851589c..b88987668 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/desktop/DesktopContextualHelpMessages.properties
@@ -5,4 +5,4 @@ notifyEmailHelp = This option will send you an email when your analysis or UR
rememberFileSelectorPathHelp =
This option allows the Data Manager to automatically navigate the file tree to the file location that was used the last time you ran an app.
This option is helpful if you have an extensive file tree or often use the same input file location.
saveSessionHelp = Enabling the Save session option will restore your Discovery Environment desktop to exactly how you left it when you last logged out.
defaultOutputFolderHelp = This will be the default location where all outputs from your analyses can be found.
You can keep the default path or click Browse to select a new location.
-notifyEmail = Email me when analysis / URL import status changes.
\ No newline at end of file
+notifyEmail = Email me when analysis / URL import status changes.
From d31fa8a9427a6a755b66ac6dee6ed8e768193e46 Mon Sep 17 00:00:00 2001
From: John Wregglesworth
Date: Tue, 16 Feb 2016 10:23:24 -0700
Subject: [PATCH 024/183] Added ignore_errors: yes to
util-cfg-docker-rm-configs
---
ansible/roles/util-cfg-docker-rm-configs/tasks/main.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/ansible/roles/util-cfg-docker-rm-configs/tasks/main.yml b/ansible/roles/util-cfg-docker-rm-configs/tasks/main.yml
index cbd1d17bd..4c57d7fbb 100644
--- a/ansible/roles/util-cfg-docker-rm-configs/tasks/main.yml
+++ b/ansible/roles/util-cfg-docker-rm-configs/tasks/main.yml
@@ -13,5 +13,6 @@
shell: "docker-compose -f {{docker.compose_path}} rm -f -v config_{{service_name}}"
register: docker_pull_v
changed_when: docker_pull_v.stdout.find('Image is up to date') == -1
+ ignore_errors: yes
tags:
- docker_rm
From 275d8e6710b524089be758c032d5154ac932ce4c Mon Sep 17 00:00:00 2001
From: John Wregglesworth
Date: Tue, 16 Feb 2016 10:31:42 -0700
Subject: [PATCH 025/183] Added 'ignore_errors: yes' to util-cfg-docker-rm
---
ansible/roles/util-cfg-docker-rm/tasks/main.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/ansible/roles/util-cfg-docker-rm/tasks/main.yml b/ansible/roles/util-cfg-docker-rm/tasks/main.yml
index 22c0b91f3..655b743c0 100644
--- a/ansible/roles/util-cfg-docker-rm/tasks/main.yml
+++ b/ansible/roles/util-cfg-docker-rm/tasks/main.yml
@@ -13,5 +13,6 @@
shell: "docker-compose -f {{docker.compose_path}} rm -f -v {{service_name}}"
register: docker_pull_v
changed_when: docker_pull_v.stdout.find('Image is up to date') == -1
+ ignore_errors: yes
tags:
- docker_rm
From 21db501efdcb91030903284193dbcc61ed263c20 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Wed, 17 Feb 2016 15:03:56 -0700
Subject: [PATCH 026/183] Reinstate infosquito batch size of 1000 on @tedgin's
recommendation that this was the original intention.
---
.../roles/util-cfg-service/templates/infosquito.properties.j2 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ansible/roles/util-cfg-service/templates/infosquito.properties.j2 b/ansible/roles/util-cfg-service/templates/infosquito.properties.j2
index c52dea9fe..a0eb119fc 100644
--- a/ansible/roles/util-cfg-service/templates/infosquito.properties.j2
+++ b/ansible/roles/util-cfg-service/templates/infosquito.properties.j2
@@ -12,7 +12,7 @@ infosquito.icat.db = {{ icat.db }}
# Indexing Options
infosquito.base-collection = /{{ irods.zone }}
-infosquito.index-batch-size = 100
+infosquito.index-batch-size = 1000
# AMQP Settings
infosquito.amqp.host = {{ amqp_broker.host }}
From 4dd815b47d088597992f37623aa404d15efeed97 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 11 Feb 2016 12:46:54 -0700
Subject: [PATCH 027/183] CORE-4345 Notification DeleteAll btn deletes all only
in current filter
---
.../iplantc/de/client/services/MessageServiceFacade.java | 4 ++--
.../de/client/services/impl/MessageServiceFacadeImpl.java | 7 ++++++-
.../client/presenter/NotificationPresenterImpl.java | 2 +-
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
index 97c73a543..29f3661bb 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
@@ -53,10 +53,10 @@ public interface MessageServiceFacade {
*/
void getMessageCounts(AsyncCallback callback);
- void deleteAll(AsyncCallback callback);
+ void deleteAll(String filter, AsyncCallback callback);
void markAllNotificationsSeen(AsyncCallback callback);
void getPermanentIdRequestStatusHistory(String id, AsyncCallback callback);
-}
\ No newline at end of file
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
index 2623080e0..3ec1fb6d8 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
@@ -8,6 +8,7 @@
import org.iplantc.de.client.models.notifications.Counts;
import org.iplantc.de.client.models.notifications.Notification;
import org.iplantc.de.client.models.notifications.NotificationAutoBeanFactory;
+import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.services.MessageServiceFacade;
import org.iplantc.de.client.services.PermIdRequestUserServiceFacade;
import org.iplantc.de.client.services.callbacks.NotificationCallback;
@@ -141,9 +142,13 @@ public void getMessageCounts(final AsyncCallback callback) {
}
@Override
- public void deleteAll(AsyncCallback callback) {
+ public void deleteAll(String filter, AsyncCallback callback) {
String address = deProperties.getMuleServiceBaseUrl() + "notifications/delete-all"; //$NON-NLS-1$
+ if (!filter.toLowerCase().equals(NotificationCategory.ALL.toString().toLowerCase())){
+ address += "?filter=" + URL.encodeQueryString(filter.toLowerCase());
+ }
+
ServiceCallWrapper wrapper = new ServiceCallWrapper(DELETE, address);
deServiceFacade.getServiceData(wrapper, callback);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index 47a10cd17..c96fa4fb3 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -202,7 +202,7 @@ public void go(HasOneWidget container) {
@Override
public void onDeleteAllClicked() {
view.mask();
- messageServiceFacade.deleteAll(new AsyncCallback() {
+ messageServiceFacade.deleteAll(currentCategory.toString(), new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
From a0766c0ec40b47415670dbc4e6f07c15f056d55e Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 4 Feb 2016 16:56:59 -0700
Subject: [PATCH 028/183] CORE-4832 Hide Notification menu when opening
Notification window
---
.../main/java/org/iplantc/de/desktop/client/DesktopView.java | 2 ++
.../de/desktop/client/presenter/DesktopPresenterImpl.java | 4 +++-
.../org/iplantc/de/desktop/client/views/DesktopViewImpl.java | 4 ++++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/DesktopView.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/DesktopView.java
index 52b901ee5..4f4037255 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/DesktopView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/DesktopView.java
@@ -248,4 +248,6 @@ interface UnseenNotificationsPresenter {
void setUnseenNotificationCount(int count);
void setUnseenSystemMessageCount(int count);
+
+ void hideNotificationMenu();
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImpl.java
index cf6551c5a..fd69690c7 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImpl.java
@@ -214,12 +214,14 @@ public void onSuccess(Void result) {
@Override
public void doSeeAllNotifications() {
- show(ConfigFactory.notifyWindowConfig(NotificationCategory.ALL));
+ show(ConfigFactory.notifyWindowConfig(NotificationCategory.ALL));
+ view.hideNotificationMenu();
}
@Override
public void doSeeNewNotifications() {
show(ConfigFactory.notifyWindowConfig(NotificationCategory.NEW));
+ view.hideNotificationMenu();
}
public void doViewGenomes(final File file) {
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/DesktopViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/DesktopViewImpl.java
index 0322f3fd8..1472313c3 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/DesktopViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/DesktopViewImpl.java
@@ -105,6 +105,10 @@ void onNotificationMenuClicked(ShowContextMenuEvent event){
}
}
+ public void hideNotificationMenu() {
+ ((DesktopIconButton)notificationsBtn).hideMenu();
+ }
+
@Override
public void onRegister(RegisterEvent event) {
final Widget eventItem = event.getItem();
From e85db385c37990aec006cec78ab167d2565ca03a Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 11 Feb 2016 13:20:54 -0700
Subject: [PATCH 029/183] CORE-4345 Add tests for Notifications
---
.../presenter/NotificationPresenterImpl.java | 8 +-
.../presenter/DesktopPresenterImplTest.java | 15 +-
.../DesktopNotifications_DesktopViewTest.java | 38 +++--
.../NotificationPresenterImplTest.java | 135 ++++++++++++++++++
4 files changed, 183 insertions(+), 13 deletions(-)
create mode 100644 ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index c96fa4fb3..2e7620d58 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -115,12 +115,12 @@ public void onSuccess(String result1) {
private final IplantErrorStrings errorStrings;
- private final EventBus eventBus;
- private final MessageServiceFacade messageServiceFacade;
- private final NotificationToolbarView toolbar;
+ EventBus eventBus;
+ MessageServiceFacade messageServiceFacade;
+ NotificationToolbarView toolbar;
private final NotificationView view;
private PagingLoadResult callbackResult;
- private NotificationCategory currentCategory;
+ NotificationCategory currentCategory;
private final JsonUtil jsonUtil;
public NotificationPresenterImpl(final NotificationView view) {
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImplTest.java b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImplTest.java
index b712ec1e6..a2a4e8b91 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImplTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/presenter/DesktopPresenterImplTest.java
@@ -5,10 +5,12 @@
import org.iplantc.de.client.events.EventBus;
import org.iplantc.de.client.models.WindowType;
import org.iplantc.de.commons.client.requests.KeepaliveTimer;
+import org.iplantc.de.commons.client.views.window.configs.ConfigFactory;
import org.iplantc.de.systemMessages.client.view.NewMessageView;
import com.google.gwt.dom.client.Element;
import com.google.gwtmockito.GxtMockitoTestRunner;
+import com.google.gwtmockito.WithClassesToStub;
import com.sencha.gxt.widget.core.client.WindowManager;
@@ -22,6 +24,7 @@
import org.mockito.Mock;
@RunWith(GxtMockitoTestRunner.class)
+@WithClassesToStub(ConfigFactory.class)
public class DesktopPresenterImplTest {
@Mock DesktopWindowManager desktopWindowManagerMock;
@@ -84,4 +87,14 @@ public class DesktopPresenterImplTest {
verifyNoMoreInteractions(desktopWindowManagerMock);
}
-}
\ No newline at end of file
+ @Test public void testDoSeeAllNotifications() {
+ uut.doSeeAllNotifications();
+ verify(viewMock).hideNotificationMenu();
+ }
+
+ @Test public void testDoSeeNewNotifications() {
+ uut.doSeeNewNotifications();
+ verify(viewMock).hideNotificationMenu();
+ }
+
+}
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
index 098c4d889..30a5c871d 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
@@ -1,35 +1,53 @@
package org.iplantc.de.desktop.client.views;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.anyBoolean;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoMoreInteractions;
+
import org.iplantc.de.desktop.client.DesktopView;
+import org.iplantc.de.desktop.client.views.widgets.DesktopIconButton;
import org.iplantc.de.resources.client.messages.IplantNewUserTourStrings;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwtmockito.GxtMockitoTestRunner;
+import com.google.gwtmockito.WithClassesToStub;
import com.sencha.gxt.widget.core.client.WindowManager;
import com.sencha.gxt.widget.core.client.event.RegisterEvent;
import com.sencha.gxt.widget.core.client.event.ShowContextMenuEvent;
import com.sencha.gxt.widget.core.client.event.UnregisterEvent;
-import static org.mockito.Matchers.eq;
-import static org.mockito.Mockito.*;
+import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
@RunWith(GxtMockitoTestRunner.class)
+@WithClassesToStub(DesktopIconButton.class)
public class DesktopNotifications_DesktopViewTest {
@Mock RegisterEvent registerEventMock;
@Mock IplantNewUserTourStrings tourStringsMock;
@Mock UnregisterEvent unregisterEventMock;
@Mock WindowManager windowManagerMock;
+ @Mock DesktopView.Presenter mockPresenter;
+ @Mock DesktopIconButton notificationsBtnMock;
- @Test public void notificationsMarkedSeenWhenNotificationBtnSelectedWithLessThan10Unseen() {
- DesktopViewImpl uut = new DesktopViewImpl(tourStringsMock, windowManagerMock);
+ private DesktopViewImpl uut;
+
+ @Before
+ public void setUp() {
+ uut = new DesktopViewImpl(tourStringsMock, windowManagerMock);
+ uut.notificationsBtn = notificationsBtnMock;
verifyViewInit(uut);
- final DesktopView.Presenter mockPresenter = mock(DesktopView.Presenter.class);
uut.setPresenter(mockPresenter);
+ }
+
+ @Test public void notificationsMarkedSeenWhenNotificationBtnSelectedWithLessThan10Unseen() {
+
uut.unseenNotificationCount = 9;
uut.onNotificationMenuClicked(mock(ShowContextMenuEvent.class));
@@ -38,9 +56,7 @@ public class DesktopNotifications_DesktopViewTest {
}
@Test public void notificationsNotMarkedSeenWhenNotificationBtnSelectedWithGreaterThan10Unseen() {
- DesktopViewImpl uut = new DesktopViewImpl(tourStringsMock, windowManagerMock);
- verifyViewInit(uut);
- final DesktopView.Presenter mockPresenter = mock(DesktopView.Presenter.class);
+
uut.setPresenter(mockPresenter);
uut.unseenNotificationCount = 11;
@@ -49,6 +65,12 @@ public class DesktopNotifications_DesktopViewTest {
verifyNoMoreInteractions(mockPresenter);
}
+ @Test public void notificationMenuHidesOnSeeAllNotifications() {
+ uut.hideNotificationMenu();
+ verify(notificationsBtnMock).hideMenu();
+ verifyNoMoreInteractions(notificationsBtnMock, mockPresenter);
+ }
+
private void verifyViewInit(DesktopViewImpl uut) {
verify(windowManagerMock).addRegisterHandler(eq(uut));
verify(windowManagerMock).addUnregisterHandler(eq(uut));
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
new file mode 100644
index 000000000..8c94e2382
--- /dev/null
+++ b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
@@ -0,0 +1,135 @@
+package org.iplantc.de.notifications.client.presenter;
+
+import static org.mockito.Mockito.eq;
+import static org.mockito.Mockito.isA;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.iplantc.de.client.events.EventBus;
+import org.iplantc.de.client.models.notifications.NotificationCategory;
+import org.iplantc.de.client.models.notifications.NotificationMessage;
+import org.iplantc.de.client.services.MessageServiceFacade;
+import org.iplantc.de.notifications.client.events.DeleteNotificationsUpdateEvent;
+import org.iplantc.de.notifications.client.views.NotificationToolbarView;
+import org.iplantc.de.notifications.client.views.NotificationView;
+
+import com.google.gwt.json.client.JSONObject;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwtmockito.GxtMockitoTestRunner;
+
+import com.sencha.gxt.data.shared.ListStore;
+import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfig;
+
+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 java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author aramsey
+ */
+@RunWith(GxtMockitoTestRunner.class)
+public class NotificationPresenterImplTest {
+
+ @Mock NotificationView viewMock;
+ @Mock MessageServiceFacade messageServiceFacadeMock;
+ @Mock NotificationToolbarView toolbarViewMock;
+ @Mock EventBus eventBusMock;
+ @Mock NotificationCategory currentCategoryMock;
+ @Mock ListStore listStoreMock;
+ @Mock List listMock;
+ @Mock NotificationMessage notificationMessageMock;
+ @Mock Iterator iteratorMock;
+
+ @Captor ArgumentCaptor> asyncCallbackStringCaptor;
+
+ private NotificationPresenterImpl uut;
+
+ @Before
+ public void setUp() {
+ when(currentCategoryMock.toString()).thenReturn("sample");
+ when(viewMock.getCurrentLoadConfig()).thenReturn(mock(FilterPagingLoadConfig.class));
+ when(notificationMessageMock.getId()).thenReturn("id");
+
+ uut = new NotificationPresenterImpl(viewMock);
+
+ uut.currentCategory = currentCategoryMock;
+ uut.messageServiceFacade = messageServiceFacadeMock;
+ uut.toolbar = toolbarViewMock;
+ uut.eventBus = eventBusMock;
+ }
+
+ @Test
+ public void testOnNotificationGridRefresh_emptyListStore() {
+ when(listStoreMock.size()).thenReturn(0);
+ when(viewMock.getListStore()).thenReturn(listStoreMock);
+
+ uut.onGridRefresh();
+ verify(toolbarViewMock).setDeleteAllButtonEnabled(eq(false));
+ }
+
+ @Test
+ public void testOnNotificationGridRefresh_nonEmptyListStore() {
+ when(listStoreMock.size()).thenReturn(5);
+ when(viewMock.getListStore()).thenReturn(listStoreMock);
+
+ uut.onGridRefresh();
+ verify(toolbarViewMock).setDeleteAllButtonEnabled(eq(true));
+ }
+
+ @Test
+ public void testOnNotificationSelection_emptyListStore() {
+ when(listMock.size()).thenReturn(0);
+
+ uut.onNotificationSelection(listMock);
+ verify(toolbarViewMock).setDeleteButtonEnabled(eq(false));
+ }
+
+ @Test
+ public void testOnNotificationSelection_nonEmptyListStore() {
+ when(listMock.size()).thenReturn(5);
+
+ uut.onNotificationSelection(listMock);
+ verify(toolbarViewMock).setDeleteButtonEnabled(eq(true));
+ }
+
+
+ @Test
+ public void testOnNotificationToolbarDeleteAllClicked() {
+ uut.onDeleteAllClicked();
+
+ verify(viewMock).mask();
+ verify(messageServiceFacadeMock).deleteAll(eq(currentCategoryMock.toString()), asyncCallbackStringCaptor.capture());
+ AsyncCallback asyncCallback = asyncCallbackStringCaptor.getValue();
+
+ asyncCallback.onSuccess("result");
+ verify(viewMock).unmask();
+ verify(viewMock).loadNotifications(eq(viewMock.getCurrentLoadConfig()));
+ verify(eventBusMock).fireEvent(isA(DeleteNotificationsUpdateEvent.class));
+
+ }
+
+ @Test
+ public void testOnNotificationToolbarDeleteClicked() {
+ when(listMock.isEmpty()).thenReturn(false);
+ when(listMock.size()).thenReturn(1);
+ when(iteratorMock.hasNext()).thenReturn(true, false);
+ when(iteratorMock.next()).thenReturn(notificationMessageMock);
+ when(listMock.iterator()).thenReturn(iteratorMock);
+ when(viewMock.getSelectedItems()).thenReturn(listMock);
+
+ uut.onDeleteClicked();
+
+ verify(messageServiceFacadeMock).deleteMessages(isA(JSONObject.class), asyncCallbackStringCaptor.capture());
+
+ asyncCallbackStringCaptor.getValue().onSuccess("result");
+ verify(eventBusMock).fireEvent(isA(DeleteNotificationsUpdateEvent.class));
+
+ }
+}
From 60c54c846f061518e5fe8d30c5e2380d5712744e Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 11 Feb 2016 14:34:00 -0700
Subject: [PATCH 030/183] CORE-4345 Remove duplicated line in DesktopViewTest
---
.../client/views/DesktopNotifications_DesktopViewTest.java | 1 -
1 file changed, 1 deletion(-)
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
index 30a5c871d..329ed71aa 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/desktop/client/views/DesktopNotifications_DesktopViewTest.java
@@ -57,7 +57,6 @@ public void setUp() {
@Test public void notificationsNotMarkedSeenWhenNotificationBtnSelectedWithGreaterThan10Unseen() {
- uut.setPresenter(mockPresenter);
uut.unseenNotificationCount = 11;
uut.onNotificationMenuClicked(mock(ShowContextMenuEvent.class));
From 1bbddb54a8d4a95fec4f2f8b6ae6377aeb2b0a90 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 15 Feb 2016 17:11:50 -0700
Subject: [PATCH 031/183] CORE-4345 Update notification/delete-all endpoint to
accept filter
---
.../NotificationAgent/src/notification_agent/delete.clj | 8 +++++---
.../NotificationAgent/src/notification_agent/query.clj | 2 +-
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/services/NotificationAgent/src/notification_agent/delete.clj b/services/NotificationAgent/src/notification_agent/delete.clj
index 0fad25b13..f4f7a11c8 100644
--- a/services/NotificationAgent/src/notification_agent/delete.clj
+++ b/services/NotificationAgent/src/notification_agent/delete.clj
@@ -2,7 +2,8 @@
(:use [notification-agent.common]
[slingshot.slingshot :only [throw+]])
(:require [clojure.tools.logging :as log]
- [notification-agent.db :as db]))
+ [notification-agent.db :as db]
+ [notification-agent.query :as query]))
(defn delete-messages
"Handles a message deletion request. The request body should consist of
@@ -23,9 +24,10 @@
"Handles a request to delete all messages for a specific user that match"
[params]
(log/debug "handling a notification delete-all request")
- (let [user (validate-user (:user params))]
+ (let [user (validate-user (:user params))
+ query {:filter (query/get-filter params)}]
(log/debug "deleting notifications for" user)
- (db/delete-matching-notifications user params)
+ (db/delete-matching-notifications user query)
{:count (str (db/count-matching-messages user {:seen false}))}))
(defn delete-system-messages
diff --git a/services/NotificationAgent/src/notification_agent/query.clj b/services/NotificationAgent/src/notification_agent/query.clj
index c0ed2ed18..073e9212c 100644
--- a/services/NotificationAgent/src/notification_agent/query.clj
+++ b/services/NotificationAgent/src/notification_agent/query.clj
@@ -83,7 +83,7 @@
filt (mangle-filter (:filter query-params))]
(if (= filt "new") false seen)))
-(defn- get-filter
+(defn get-filter
"Gets the filter from the query parameters."
[query-params]
(let [filt (mangle-filter (:filter query-params))]
From 50395f0f11f1c815d3cd8dd1c641b849a24e3228 Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Thu, 18 Feb 2016 13:40:57 -0700
Subject: [PATCH 032/183] Replace `app_version` with `de_version`.
---
ansible/inventories/group_vars/all | 4 ++--
ansible/roles/util-cfg-service/templates/ui/de.properties.j2 | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ansible/inventories/group_vars/all b/ansible/inventories/group_vars/all
index 27bb91baa..b215fcea2 100644
--- a/ansible/inventories/group_vars/all
+++ b/ansible/inventories/group_vars/all
@@ -127,8 +127,8 @@ de:
# ssl_certificate: "/etc/ssl/example.com.crt"
# ssl_certificate_key: "/etc/ssl/example.com.key"
-app_version_name: Phthalo
-app_version: 2.5.0
+de_version_name: Phthalo
+de_version: 2.5.0
de_feedback_to_addr: ""
de_mail_from_addr: "{{ de_feedback_to_addr }}"
diff --git a/ansible/roles/util-cfg-service/templates/ui/de.properties.j2 b/ansible/roles/util-cfg-service/templates/ui/de.properties.j2
index b926ad98a..1580d5835 100644
--- a/ansible/roles/util-cfg-service/templates/ui/de.properties.j2
+++ b/ansible/roles/util-cfg-service/templates/ui/de.properties.j2
@@ -8,8 +8,8 @@
# This values are used since reading the MANIFEST.MF file from a deployed WAR
# is a tricky environment.
###############################################################################
-org.iplantc.discoveryenvironment.about.defaultBuildNumber = {{ app_version_name }}
-org.iplantc.discoveryenvironment.about.releaseVersion = {{ app_version }}
+org.iplantc.discoveryenvironment.about.defaultBuildNumber = {{ de_version_name }}
+org.iplantc.discoveryenvironment.about.releaseVersion = {{ de_version }}
###############################################################################
# CAS Authentication Settings
From da0dae593fff6279912a4c0fa4b210d1c2114ada Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 18 Feb 2016 14:31:42 -0700
Subject: [PATCH 033/183] CORE-4345 Pass NotificationCategory instead of string
to Msg service
---
.../iplantc/de/client/services/MessageServiceFacade.java | 3 ++-
.../de/client/services/impl/MessageServiceFacadeImpl.java | 6 +++---
.../client/presenter/NotificationPresenterImpl.java | 2 +-
.../client/presenter/NotificationPresenterImplTest.java | 2 +-
4 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
index 29f3661bb..3ed978249 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/MessageServiceFacade.java
@@ -3,6 +3,7 @@
import org.iplantc.de.client.models.HasId;
import org.iplantc.de.client.models.notifications.Counts;
import org.iplantc.de.client.models.notifications.Notification;
+import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.services.callbacks.NotificationCallback;
import com.google.gwt.json.client.JSONObject;
@@ -53,7 +54,7 @@ public interface MessageServiceFacade {
*/
void getMessageCounts(AsyncCallback callback);
- void deleteAll(String filter, AsyncCallback callback);
+ void deleteAll(NotificationCategory category, AsyncCallback callback);
void markAllNotificationsSeen(AsyncCallback callback);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
index 3ec1fb6d8..b0eece166 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
@@ -142,11 +142,11 @@ public void getMessageCounts(final AsyncCallback callback) {
}
@Override
- public void deleteAll(String filter, AsyncCallback callback) {
+ public void deleteAll(NotificationCategory category, AsyncCallback callback) {
String address = deProperties.getMuleServiceBaseUrl() + "notifications/delete-all"; //$NON-NLS-1$
- if (!filter.toLowerCase().equals(NotificationCategory.ALL.toString().toLowerCase())){
- address += "?filter=" + URL.encodeQueryString(filter.toLowerCase());
+ if (!category.equals(NotificationCategory.ALL)) {
+ address += "?filter=" + URL.encodeQueryString(category.name().toLowerCase());
}
ServiceCallWrapper wrapper = new ServiceCallWrapper(DELETE, address);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index 2e7620d58..d6ca2b8de 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -202,7 +202,7 @@ public void go(HasOneWidget container) {
@Override
public void onDeleteAllClicked() {
view.mask();
- messageServiceFacade.deleteAll(currentCategory.toString(), new AsyncCallback() {
+ messageServiceFacade.deleteAll(currentCategory, new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
index 8c94e2382..9afc5ee34 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
@@ -105,7 +105,7 @@ public void testOnNotificationToolbarDeleteAllClicked() {
uut.onDeleteAllClicked();
verify(viewMock).mask();
- verify(messageServiceFacadeMock).deleteAll(eq(currentCategoryMock.toString()), asyncCallbackStringCaptor.capture());
+ verify(messageServiceFacadeMock).deleteAll(eq(currentCategoryMock), asyncCallbackStringCaptor.capture());
AsyncCallback asyncCallback = asyncCallbackStringCaptor.getValue();
asyncCallback.onSuccess("result");
From 6b5502f29b0db534e49123d2a43ad6a379b0208f Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 18 Feb 2016 16:17:04 -0700
Subject: [PATCH 034/183] CORE-4345 Protect against NPE in Msg service
---
.../de/client/services/impl/MessageServiceFacadeImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
index b0eece166..5c08ca990 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
@@ -145,7 +145,7 @@ public void getMessageCounts(final AsyncCallback callback) {
public void deleteAll(NotificationCategory category, AsyncCallback callback) {
String address = deProperties.getMuleServiceBaseUrl() + "notifications/delete-all"; //$NON-NLS-1$
- if (!category.equals(NotificationCategory.ALL)) {
+ if (NotificationCategory.ALL != category) {
address += "?filter=" + URL.encodeQueryString(category.name().toLowerCase());
}
From 93eaedbad9e79b317cad9caadf8fdbf985f841fa Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Fri, 19 Feb 2016 13:22:38 -0700
Subject: [PATCH 035/183] CORE-7518 Optimize count-all-items-under-folder ICAT
query.
The JOIN on the "parent" and "r_coll_main" tables would cause this query
to run for over 2 hours for our iRODS admin proxy user, which has
permissions for all folders in the data store.
---
.../clj-icat-direct/src/clj_icat_direct/queries.clj | 13 ++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index ea2a5ba40..48fb97643 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -533,17 +533,16 @@
FROM r_data_main
WHERE coll_id = ANY(ARRAY( SELECT coll_id FROM parent )))
- SELECT count(*) AS total
- FROM ( SELECT DISTINCT d.data_id FROM r_objt_access a
+ SELECT ((SELECT count(DISTINCT d.data_id) FROM r_objt_access a
JOIN data_objs d ON a.object_id = d.data_id
WHERE a.user_id IN ( SELECT group_user_id FROM user_groups )
- AND a.object_id IN ( SELECT data_id from data_objs )
- UNION
- SELECT DISTINCT c.coll_id FROM r_coll_main c
+ AND a.object_id IN ( SELECT data_id from data_objs ))
+ +
+ (SELECT count(DISTINCT c.coll_id) FROM r_coll_main c
JOIN r_objt_access a ON c.coll_id = a.object_id
- JOIN parent p ON c.parent_coll_name = p.coll_name
WHERE a.user_id IN ( SELECT group_user_id FROM user_groups )
- AND c.coll_type != 'linkPoint' ) AS contents"
+ AND c.parent_coll_name = ANY(ARRAY( SELECT coll_name FROM parent ))
+ AND c.coll_type != 'linkPoint')) AS total"
:list-folders-in-folder
"WITH user_groups AS ( SELECT g.* FROM r_user_main u
From a53169ab99eaeb56ab801abab673a2bd99b431c8 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Wed, 17 Feb 2016 15:55:48 -0700
Subject: [PATCH 036/183] Improve count- and list- in folder queries
* In CTEs, select only columns which are used in later requests
* Remove unnecessary UNION, prefer simple SELECT DISTINCT with an OR
condition
* Remove unnecessary 'parent' CTEs
---
.../src/clj_icat_direct/queries.clj | 36 ++++++++-----------
1 file changed, 14 insertions(+), 22 deletions(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index 48fb97643..0d42b1f59 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -517,21 +517,19 @@
(def queries
{:count-all-items-under-folder
- "WITH user_groups AS ( SELECT g.*
+ "WITH user_groups AS ( SELECT g.group_user_id
FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
AND u.zone_name = ? ),
- parent AS ( SELECT * from r_coll_main
+ parent AS ( SELECT DISTINCT coll_id, coll_name from r_coll_main
WHERE coll_name = ?
- UNION
- SELECT * from r_coll_main
- WHERE coll_name LIKE ? || '/%' ),
+ OR coll_name LIKE ? || '/%' ),
- data_objs AS ( SELECT *
+ data_objs AS ( SELECT data_id
FROM r_data_main
- WHERE coll_id = ANY(ARRAY( SELECT coll_id FROM parent )))
+ WHERE coll_id = ANY(ARRAY( SELECT coll_id FROM parent )) )
SELECT ((SELECT count(DISTINCT d.data_id) FROM r_objt_access a
JOIN data_objs d ON a.object_id = d.data_id
@@ -545,14 +543,11 @@
AND c.coll_type != 'linkPoint')) AS total"
:list-folders-in-folder
- "WITH user_groups AS ( SELECT g.* FROM r_user_main u
+ "WITH user_groups AS ( SELECT g.group_user_id FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
AND u.zone_name = ? ),
- parent AS ( SELECT * from r_coll_main
- WHERE coll_name = ? )
-
SELECT DISTINCT
c.parent_coll_name as dir_name,
c.coll_name as full_path,
@@ -565,28 +560,28 @@
MAX(a.access_type_id) as access_type_id
FROM r_coll_main c
JOIN r_objt_access a ON c.coll_id = a.object_id
- JOIN parent p ON c.parent_coll_name = p.coll_name
JOIN r_objt_metamap mm ON mm.object_id = c.coll_id
JOIN r_meta_main m ON m.meta_id = mm.meta_id
WHERE a.user_id IN ( SELECT group_user_id FROM user_groups )
AND c.coll_type != 'linkPoint'
+ AND c.parent_coll_name = ?
AND m.meta_attr_name = 'ipc_UUID'
GROUP BY dir_name, full_path, base_name, c.create_ts, c.modify_ts, type, data_size, uuid
ORDER BY base_name ASC"
:count-files-in-folder
- "WITH user_groups AS ( SELECT g.*
+ "WITH user_groups AS ( SELECT g.group_user_id
FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
AND u.zone_name = ? ),
- parent AS ( SELECT * from r_coll_main
+ parent AS ( SELECT coll_id from r_coll_main
WHERE coll_name = ? ),
- data_objs AS ( SELECT *
+ data_objs AS ( SELECT data_id
FROM r_data_main
- WHERE coll_id = ANY(ARRAY( SELECT coll_id FROM parent )))
+ WHERE coll_id IN ( SELECT coll_id FROM parent ))
SELECT count(DISTINCT d.data_id) FROM r_objt_access a
JOIN data_objs d ON a.object_id = d.data_id
@@ -594,20 +589,17 @@
AND a.object_id IN ( SELECT data_id from data_objs )"
:count-folders-in-folder
- "WITH user_groups AS ( SELECT g.*
+ "WITH user_groups AS ( SELECT g.group_user_id
FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
AND u.zone_name = ? ),
- parent AS ( SELECT * from r_coll_main
- WHERE coll_name = ? )
-
SELECT count(DISTINCT c.coll_id) FROM r_coll_main c
JOIN r_objt_access a ON c.coll_id = a.object_id
- JOIN parent p ON c.parent_coll_name = p.coll_name
WHERE a.user_id IN ( SELECT group_user_id FROM user_groups )
- AND c.coll_type != 'linkPoint'"
+ AND c.coll_type != 'linkPoint'
+ AND c.parent_coll_name = ?"
:file-permissions
"SELECT DISTINCT o.access_type_id, u.user_name
From 625102cdb6fd543dd976585d1b6cfd6dce79b7ad Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Wed, 17 Feb 2016 17:12:40 -0700
Subject: [PATCH 037/183] Select only needed columns in file_types CTE.
---
libs/clj-icat-direct/src/clj_icat_direct/queries.clj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index 0d42b1f59..a6bf1ee88 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -712,7 +712,7 @@
AND o.object_id IN (SELECT object_id
FROM r_objt_access
WHERE user_id in (SELECT group_user_id FROM groups))),
- file_types AS (SELECT *
+ file_types AS (SELECT om.object_id, mm.meta_attr_value
FROM r_objt_metamap AS om
JOIN r_meta_main AS mm ON mm.meta_id = om.meta_id
WHERE om.object_id = ANY(ARRAY(SELECT object_id FROM uuids))
From 32a3551ae175ac5d171e09c5fdb287b5741370e8 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Mon, 22 Feb 2016 12:21:24 -0700
Subject: [PATCH 038/183] CORE-7512 display requester email and request status
history under Update request Dialog in Belphegor.
---
.../PermanentIdRequestPresenter.java | 62 ++++++++++++++++---
.../PermanentIdRequestAdminServiceFacade.java | 2 +
...manentIdRequestAdminServiceFacadeImpl.java | 7 +++
.../views/PermanentIdRequestView.java | 15 +++--
.../views/PermanentIdRequestViewImpl.java | 18 +-----
.../views/PermanentIdRequestViewImpl.ui.xml | 1 +
.../views/UpdatePermanentIdRequest.ui.xml | 16 +++--
.../views/UpdatePermanentIdRequestDialog.java | 42 +++++++------
.../identifiers/PermanentIdRequesDetails.java | 30 +++++++++
.../PermanentIdRequestAutoBeanFactory.java | 2 +
.../PermanentIdRequestStatusHistory.java | 25 --------
...ntIdRequestPresenterDefaultAppearance.java | 11 ++++
...rmanentIdRequestViewDefaultAppearance.java | 10 ---
.../toolbar/ToolbarDisplayMessages.properties | 2 +-
.../PermanentIdRequestPresenterTest.java | 4 +-
15 files changed, 157 insertions(+), 90 deletions(-)
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java
delete mode 100644 ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestStatusHistory.java
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
index 4503e6f95..96c0392e9 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
@@ -4,6 +4,8 @@
import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView;
import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.PermanentIdRequestPresenterAppearance;
import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.Presenter;
+import org.iplantc.de.admin.desktop.client.permIdRequest.views.UpdatePermanentIdRequestDialog;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequesDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequest;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestList;
@@ -21,6 +23,8 @@
import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanCodex;
+import com.sencha.gxt.widget.core.client.event.SelectEvent;
+
/**
*
*
@@ -87,9 +91,8 @@ public void onFailure(Throwable caught) {
@Override
public void onSuccess(String result) {
view.unmask();
- final AutoBean decode = AutoBeanCodex.decode(factory,
- PermanentIdRequestList.class,
- result);
+ final AutoBean decode =
+ AutoBeanCodex.decode(factory, PermanentIdRequestList.class, result);
view.loadRequests(decode.as().getRequests());
}
@@ -103,7 +106,7 @@ public void loadPermIdRequests() {
}
@Override
- public void updateRequest(final PermanentIdRequestUpdate update) {
+ public void doUpdateRequest(final PermanentIdRequestUpdate update) {
if (selectedRequest != null && update != null) {
view.mask(I18N.DISPLAY.loadingMask());
prsvc.updatePermanentIdRequestStatus(selectedRequest.getId(),
@@ -114,7 +117,8 @@ public void updateRequest(final PermanentIdRequestUpdate update) {
public void onFailure(Throwable caught) {
view.unmask();
IplantAnnouncer.getInstance()
- .schedule(new ErrorAnnouncementConfig(appearance.statusUpdateFailure()));
+ .schedule(new ErrorAnnouncementConfig(
+ appearance.statusUpdateFailure()));
}
@@ -122,7 +126,8 @@ public void onFailure(Throwable caught) {
public void onSuccess(String result) {
view.unmask();
IplantAnnouncer.getInstance()
- .schedule(new SuccessAnnouncementConfig(appearance.statusUpdateSuccess()));
+ .schedule(new SuccessAnnouncementConfig(
+ appearance.statusUpdateSuccess()));
selectedRequest.setStatus(update.getStatus());
view.update(selectedRequest);
}
@@ -130,6 +135,41 @@ public void onSuccess(String result) {
}
}
+ @Override
+ public void onUpdateRequest() {
+ getRequestDetails(new AsyncCallback() {
+ @Override
+ public void onFailure(Throwable caught) {
+ view.unmask();
+ IplantErrorDialog ied = new IplantErrorDialog(I18N.DISPLAY.error(), caught.getMessage());
+ ied.show();
+ }
+
+ @Override
+ public void onSuccess(String result) {
+ view.unmask();
+ final AutoBean decode =
+ AutoBeanCodex.decode(factory, PermanentIdRequesDetails.class, result);
+ final UpdatePermanentIdRequestDialog dialog = new UpdatePermanentIdRequestDialog(
+ selectedRequest.getStatus(),
+ decode.as(),
+ factory);
+ dialog.setHeadingText(appearance.updateStatus());
+ dialog.getOkButton().setText(appearance.update());
+ dialog.getOkButton().addSelectHandler(new SelectEvent.SelectHandler() {
+
+ @Override
+ public void onSelect(SelectEvent event) {
+ final PermanentIdRequestUpdate update = dialog.getPermanentIdRequestUpdate();
+ doUpdateRequest(update);
+ }
+ });
+
+ dialog.show();
+ }
+ });
+ }
+
@Override
public void createPermanentId() {
if (selectedRequest != null) {
@@ -152,7 +192,7 @@ public void onSuccess(String result) {
IplantAnnouncer.getInstance()
.schedule(new SuccessAnnouncementConfig(appearance.createPermIdSucess()));
- //refresh page
+ //refresh page
loadPermIdRequests();
}
@@ -160,4 +200,12 @@ public void onSuccess(String result) {
}
}
+ @Override
+ public void getRequestDetails(AsyncCallback callback) {
+ if (selectedRequest != null) {
+ view.mask(I18N.DISPLAY.loadingMask());
+ prsvc.getRequestDetails(selectedRequest.getId(), callback);
+ }
+
+ }
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
index 90d46e402..05c84bb03 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
@@ -23,4 +23,6 @@ void updatePermanentIdRequestStatus(String requestId,
void createPermanentId(String id, AsyncCallback asyncCallback);
+ void getRequestDetails(String id, AsyncCallback asyncCallback);
+
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
index ccbbaa378..e4491f04b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
@@ -47,4 +47,11 @@ public void createPermanentId(String requestId, AsyncCallback asyncCallb
}
+ @Override
+ public void getRequestDetails(String id, AsyncCallback asyncCallback) {
+ String address = PERMID_ADMIN_REQUEST + "/" + id;
+ final ServiceCallWrapper wrapper = new ServiceCallWrapper(Type.GET, address);
+ deService.getServiceData(wrapper, asyncCallback);
+ }
+
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
index b2939f448..c36ea7823 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
@@ -7,6 +7,7 @@
import org.iplantc.de.client.services.DiskResourceServiceFacade;
import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasOneWidget;
import com.google.gwt.user.client.ui.IsWidget;
@@ -70,10 +71,6 @@ public interface PermanentIdRequestViewAppearance {
String commentsLbl();
- String updateStatus();
-
- String update();
-
String request();
}
@@ -89,9 +86,13 @@ public interface Presenter {
void setSelectedRequest(PermanentIdRequest request);
- void updateRequest(PermanentIdRequestUpdate update);
+ void doUpdateRequest(PermanentIdRequestUpdate update);
+
+ void onUpdateRequest();
void createPermanentId();
+
+ void getRequestDetails(AsyncCallback callback);
}
public interface PermanentIdRequestPresenterAppearance {
@@ -106,6 +107,10 @@ public interface PermanentIdRequestPresenterAppearance {
String statusUpdateFailure();
String statusUpdateSuccess();
+
+ String updateStatus();
+
+ String update();
}
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.java
index b1154767b..9e637262b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.java
@@ -97,23 +97,7 @@ public void onSelectionChanged(SelectionChangedEvent event)
@UiHandler("updateBtn")
void onUpdateBtnClicked(SelectEvent event) {
- final UpdatePermanentIdRequestDialog dialog = new UpdatePermanentIdRequestDialog(grid.getSelectionModel()
- .getSelectedItem(),
- presenter,
- factory);
-
- dialog.setHeadingText(appearance.updateStatus());
- dialog.getOkButton().setText(appearance.update());
- dialog.getOkButton().addSelectHandler(new SelectHandler() {
-
- @Override
- public void onSelect(SelectEvent event) {
- final PermanentIdRequestUpdate update = dialog.getPermanentIdRequestUpdate();
- presenter.updateRequest(update);
- }
- });
-
- dialog.show();
+ presenter.onUpdateRequest();
}
@UiHandler("metadataBtn")
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.ui.xml b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.ui.xml
index b9d1da324..abf48a4d0 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.ui.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestViewImpl.ui.xml
@@ -45,6 +45,7 @@
text="Create Permanent Identifier" icon="{appearance.updateIcon}"
enabled="false" />
+
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
index dc30bbcc4..3e96f429c 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
@@ -2,7 +2,8 @@
+ xmlns:form="urn:import:com.sencha.gxt.widget.core.client.form"
+ xmlns:widget="urn:import:org.iplantc.de.commons.client.widgets">
-
+
@@ -18,10 +19,17 @@
+
+
+
+
+
+
+
-
+
@@ -35,7 +43,7 @@
-
+
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
index 8e153c1dd..8268bd8e7 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
@@ -1,13 +1,16 @@
package org.iplantc.de.admin.desktop.client.permIdRequest.views;
-import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.PermanentIdRequestViewAppearance;
-import org.iplantc.de.client.models.identifiers.PermanentIdRequest;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequesDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestStatus;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
import org.iplantc.de.commons.client.views.dialogs.IPlantDialog;
+import org.iplantc.de.commons.client.widgets.IPlantAnchor;
+import org.iplantc.de.notifications.client.views.dialogs.RequestHistoryDialog;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.uibinder.client.UiField;
@@ -17,8 +20,6 @@
import com.sencha.gxt.cell.core.client.form.ComboBoxCell.TriggerAction;
import com.sencha.gxt.data.shared.LabelProvider;
-import com.sencha.gxt.widget.core.client.event.SelectEvent;
-import com.sencha.gxt.widget.core.client.event.SelectEvent.SelectHandler;
import com.sencha.gxt.widget.core.client.form.SimpleComboBox;
import com.sencha.gxt.widget.core.client.form.TextArea;
@@ -36,29 +37,32 @@ interface UpdatePermanentIdRequestUiBinder extends UiBinder statusCombo;
@UiField
TextArea commentsEditor;
- private final PermanentIdRequestAutoBeanFactory factory;
- @SuppressWarnings("unused")
- private final PermanentIdRequest request;
- @SuppressWarnings("unused")
- private final PermanentIdRequestView.Presenter presenter;
-
- public UpdatePermanentIdRequestDialog(final PermanentIdRequest request,
- final PermanentIdRequestView.Presenter presenter,
- final PermanentIdRequestAutoBeanFactory factory) {
+ private final PermanentIdRequestAutoBeanFactory factory;
+ public UpdatePermanentIdRequestDialog(String curr_status,
+ final PermanentIdRequesDetails details,
+ PermanentIdRequestAutoBeanFactory factory) {
this.factory = factory;
- this.request = request;
- this.presenter = presenter;
add(uiBinder.createAndBindUi(this));
- currentStatusLabel.setText(request.getStatus());
- commentsEditor.setHeight(200);
-
+ currentStatusLabel.setText(curr_status);
+ currentStatusLabel.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ RequestHistoryDialog dlg = new RequestHistoryDialog(
+ details.getRequestor().getUsername() + "-" + details.getType(),
+ details.getHistory());
+ dlg.show();
+ }
+ });
+ userEmail.setText(details.getRequestor().getEmail());
}
@UiFactory
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java
new file mode 100644
index 000000000..3bf4e68d4
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java
@@ -0,0 +1,30 @@
+package org.iplantc.de.client.models.identifiers;
+
+import org.iplantc.de.client.models.UserBootstrap;
+import org.iplantc.de.client.models.requestStatus.RequestHistory;
+
+import com.google.web.bindery.autobean.shared.AutoBean;
+
+import java.util.List;
+
+/**
+ *
+ *
+ * @author sriram
+ *
+ */
+public interface PermanentIdRequesDetails {
+
+ String getId();
+
+ String getType();
+
+ String getFolder();
+
+ @AutoBean.PropertyName("requested_by")
+ UserBootstrap getRequestor();
+
+ @AutoBean.PropertyName("history")
+ List getHistory();
+
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestAutoBeanFactory.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestAutoBeanFactory.java
index dd767d85a..6c4dc0a0b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestAutoBeanFactory.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestAutoBeanFactory.java
@@ -16,4 +16,6 @@ public interface PermanentIdRequestAutoBeanFactory extends AutoBeanFactory {
AutoBean getAllRequests();
AutoBean getStatus();
+
+ AutoBean getDeatils();
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestStatusHistory.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestStatusHistory.java
deleted file mode 100644
index 3db8c081f..000000000
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestStatusHistory.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.iplantc.de.client.models.identifiers;
-
-import com.google.web.bindery.autobean.shared.AutoBean.PropertyName;
-
-import java.util.Date;
-
-/**
- *
- *
- * @author sriram
- *
- */
-public interface PermanentIdRequestStatusHistory {
-
- String getStatus();
-
- @PropertyName("updated_by")
- String getUpdatedBy();
-
- @PropertyName("status_date")
- Date getStatusDate();
-
- String getComments();
-
-}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestPresenterDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestPresenterDefaultAppearance.java
index 8d588ede7..63329d0a4 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestPresenterDefaultAppearance.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestPresenterDefaultAppearance.java
@@ -47,4 +47,15 @@ public String statusUpdateSuccess() {
return displayStrings.statusUpdateSuccess();
}
+ @Override
+ public String updateStatus() {
+ return displayStrings.updateStatus();
+ }
+
+ @Override
+ public String update() {
+ return displayStrings.update();
+ }
+
+
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
index 162fa075a..6b9f1de37 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
@@ -123,16 +123,6 @@ public String commentsLbl() {
return displayStrings.commentsLbl();
}
- @Override
- public String updateStatus() {
- return displayStrings.updateStatus();
- }
-
- @Override
- public String update() {
- return displayStrings.update();
- }
-
@Override
public String request() {
return displayStrings.request();
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/diskResource/toolbar/ToolbarDisplayMessages.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/diskResource/toolbar/ToolbarDisplayMessages.properties
index 43d127cd5..1fd0f2bb6 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/diskResource/toolbar/ToolbarDisplayMessages.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/diskResource/toolbar/ToolbarDisplayMessages.properties
@@ -43,5 +43,5 @@ importFromCoge = Import Genome from CoGe...
selectMetadataFile = Select Metadata File...
applyBulkMetadata = Apply Bulk Metadata
requestDOI = Request DOI
-doiLinkMsg = Please read DOI Manual and check if you meet the requirements for submitting a DOI Reqest.
Yes, I have read the manual.
+doiLinkMsg = Please read DOI Manual and check if you meet the requirements for submitting a DOI Request.
Yes, I have read the manual.
needDOI = I need DOI
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenterTest.java b/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenterTest.java
index 99fe7d1b3..c1c7b444c 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenterTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenterTest.java
@@ -90,7 +90,7 @@ public void testCreatePermanentId_NoRequestSelected() {
public void testUpdateRequest() {
presenter.setSelectedRequest(mockSelectedRequest);
when(mockSelectedRequest.getId()).thenReturn("101010101");
- presenter.updateRequest(mockRequestUpdate);
+ presenter.doUpdateRequest(mockRequestUpdate);
verify(mockPrFacade).updatePermanentIdRequestStatus(mockSelectedRequest.getId(),
mockRequestUpdate,
stirngCallbackCaptor.capture());
@@ -100,7 +100,7 @@ public void testUpdateRequest() {
public void testUpdateRequest_nullUpdate() {
presenter.setSelectedRequest(mockSelectedRequest);
when(mockSelectedRequest.getId()).thenReturn("101010101");
- presenter.updateRequest(null);
+ presenter.doUpdateRequest(null);
verifyZeroInteractions(mockPrFacade);
}
From 2aba15bc6db9195250506ec23875f43fb3b1cb2d Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Mon, 22 Feb 2016 13:42:45 -0700
Subject: [PATCH 039/183] CORE-7512 address PR comments.
---
.../PermanentIdRequestPresenter.java | 28 +++++------
.../PermanentIdRequestAdminServiceFacade.java | 6 ++-
...manentIdRequestAdminServiceFacadeImpl.java | 46 +++++++++++++++++--
.../views/PermanentIdRequestView.java | 5 +-
.../views/UpdatePermanentIdRequest.ui.xml | 2 +-
.../views/UpdatePermanentIdRequestDialog.java | 4 +-
.../PermanentIdRequestAutoBeanFactory.java | 2 +-
...ls.java => PermanentIdRequestDetails.java} | 2 +-
.../PermIdRequestDisplayStrings.java | 2 +
.../PermIdRequestDisplayStrings.properties | 1 +
...rmanentIdRequestViewDefaultAppearance.java | 5 ++
11 files changed, 74 insertions(+), 29 deletions(-)
rename ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/{PermanentIdRequesDetails.java => PermanentIdRequestDetails.java} (91%)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
index 96c0392e9..bbb31033e 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
@@ -5,9 +5,9 @@
import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.PermanentIdRequestPresenterAppearance;
import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.Presenter;
import org.iplantc.de.admin.desktop.client.permIdRequest.views.UpdatePermanentIdRequestDialog;
-import org.iplantc.de.client.models.identifiers.PermanentIdRequesDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequest;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestList;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
import org.iplantc.de.client.services.DiskResourceServiceFacade;
@@ -20,8 +20,6 @@
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasOneWidget;
import com.google.inject.Inject;
-import com.google.web.bindery.autobean.shared.AutoBean;
-import com.google.web.bindery.autobean.shared.AutoBeanCodex;
import com.sencha.gxt.widget.core.client.event.SelectEvent;
@@ -79,7 +77,7 @@ public void go(HasOneWidget container) {
@Override
public void getPermIdRequests() {
view.mask(I18N.DISPLAY.loadingMask());
- prsvc.getPermanentIdRequests(new AsyncCallback() {
+ prsvc.getPermanentIdRequests(new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
@@ -89,12 +87,9 @@ public void onFailure(Throwable caught) {
}
@Override
- public void onSuccess(String result) {
- view.unmask();
- final AutoBean decode =
- AutoBeanCodex.decode(factory, PermanentIdRequestList.class, result);
-
- view.loadRequests(decode.as().getRequests());
+ public void onSuccess(PermanentIdRequestList result) {
+ view.unmask();
+ view.loadRequests(result.getRequests());
}
});
@@ -137,7 +132,7 @@ public void onSuccess(String result) {
@Override
public void onUpdateRequest() {
- getRequestDetails(new AsyncCallback() {
+ getRequestDetails(new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
view.unmask();
@@ -146,13 +141,11 @@ public void onFailure(Throwable caught) {
}
@Override
- public void onSuccess(String result) {
+ public void onSuccess(PermanentIdRequestDetails result) {
view.unmask();
- final AutoBean decode =
- AutoBeanCodex.decode(factory, PermanentIdRequesDetails.class, result);
final UpdatePermanentIdRequestDialog dialog = new UpdatePermanentIdRequestDialog(
selectedRequest.getStatus(),
- decode.as(),
+ result,
factory);
dialog.setHeadingText(appearance.updateStatus());
dialog.getOkButton().setText(appearance.update());
@@ -182,7 +175,8 @@ public void onFailure(Throwable caught) {
loadPermIdRequests();
IplantAnnouncer.getInstance()
.schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure()));
- IplantErrorDialog ied = new IplantErrorDialog(I18N.DISPLAY.error(), caught.getMessage());
+ IplantErrorDialog ied =
+ new IplantErrorDialog(I18N.DISPLAY.error(), caught.getMessage());
ied.show();
}
@@ -201,7 +195,7 @@ public void onSuccess(String result) {
}
@Override
- public void getRequestDetails(AsyncCallback callback) {
+ public void getRequestDetails(AsyncCallback callback) {
if (selectedRequest != null) {
view.mask(I18N.DISPLAY.loadingMask());
prsvc.getRequestDetails(selectedRequest.getId(), callback);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
index 05c84bb03..d0e203198 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/PermanentIdRequestAdminServiceFacade.java
@@ -1,5 +1,7 @@
package org.iplantc.de.admin.desktop.client.permIdRequest.service;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestList;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -15,7 +17,7 @@ public interface PermanentIdRequestAdminServiceFacade {
public final String PERMID_ADMIN_REQUEST = "org.iplantc.services.admin.permIdRequests";
- void getPermanentIdRequests(AsyncCallback callback);
+ void getPermanentIdRequests(AsyncCallback callback);
void updatePermanentIdRequestStatus(String requestId,
PermanentIdRequestUpdate status,
@@ -23,6 +25,6 @@ void updatePermanentIdRequestStatus(String requestId,
void createPermanentId(String id, AsyncCallback asyncCallback);
- void getRequestDetails(String id, AsyncCallback asyncCallback);
+ void getRequestDetails(String id, AsyncCallback asyncCallback);
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
index e4491f04b..331d30e5b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/service/imp/PermanentIdRequestAdminServiceFacadeImpl.java
@@ -1,13 +1,18 @@
package org.iplantc.de.admin.desktop.client.permIdRequest.service.imp;
import org.iplantc.de.admin.desktop.client.permIdRequest.service.PermanentIdRequestAdminServiceFacade;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestList;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
+import org.iplantc.de.client.services.converters.AsyncCallbackConverter;
import org.iplantc.de.shared.services.BaseServiceCallWrapper.Type;
import org.iplantc.de.shared.services.DiscEnvApiService;
import org.iplantc.de.shared.services.ServiceCallWrapper;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
+import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanCodex;
import com.google.web.bindery.autobean.shared.AutoBeanUtils;
import com.google.web.bindery.autobean.shared.Splittable;
@@ -19,14 +24,47 @@
*/
public class PermanentIdRequestAdminServiceFacadeImpl implements PermanentIdRequestAdminServiceFacade {
+ private class DOIRquestDetailsCallbackConverter
+ extends AsyncCallbackConverter {
+
+ public DOIRquestDetailsCallbackConverter(AsyncCallback callback) {
+ super(callback);
+ }
+
+ @Override
+ protected PermanentIdRequestDetails convertFrom(String result) {
+ final AutoBean decode =
+ AutoBeanCodex.decode(factory, PermanentIdRequestDetails.class, result);
+ return decode.as();
+ }
+ }
+
+ private class DOIRequestsCallbackConverter extends AsyncCallbackConverter {
+ public DOIRequestsCallbackConverter(AsyncCallback callback) {
+ super(callback);
+ }
+
+ @Override
+ protected PermanentIdRequestList convertFrom(String result) {
+ final AutoBean decode =
+ AutoBeanCodex.decode(factory, PermanentIdRequestList.class, result);
+ return decode.as();
+ }
+
+
+ }
+
@Inject
private DiscEnvApiService deService;
+ @Inject
+ private PermanentIdRequestAutoBeanFactory factory;
+
@Override
- public void getPermanentIdRequests(AsyncCallback callback) {
+ public void getPermanentIdRequests(AsyncCallback callback) {
String address = PERMID_ADMIN_REQUEST;
final ServiceCallWrapper wrapper = new ServiceCallWrapper(Type.GET, address);
- deService.getServiceData(wrapper, callback);
+ deService.getServiceData(wrapper, new DOIRequestsCallbackConverter(callback));
}
@Override
@@ -48,10 +86,10 @@ public void createPermanentId(String requestId, AsyncCallback asyncCallb
}
@Override
- public void getRequestDetails(String id, AsyncCallback asyncCallback) {
+ public void getRequestDetails(String id, AsyncCallback asyncCallback) {
String address = PERMID_ADMIN_REQUEST + "/" + id;
final ServiceCallWrapper wrapper = new ServiceCallWrapper(Type.GET, address);
- deService.getServiceData(wrapper, asyncCallback);
+ deService.getServiceData(wrapper, new DOIRquestDetailsCallbackConverter(asyncCallback));
}
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
index c36ea7823..8a408cbce 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/PermanentIdRequestView.java
@@ -3,6 +3,7 @@
import org.iplantc.de.client.models.IsMaskable;
import org.iplantc.de.client.models.diskResources.Folder;
import org.iplantc.de.client.models.identifiers.PermanentIdRequest;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
import org.iplantc.de.client.services.DiskResourceServiceFacade;
@@ -72,6 +73,8 @@ public interface PermanentIdRequestViewAppearance {
String commentsLbl();
String request();
+
+ String userEmail();
}
public interface Presenter {
@@ -92,7 +95,7 @@ public interface Presenter {
void createPermanentId();
- void getRequestDetails(AsyncCallback callback);
+ void getRequestDetails(AsyncCallback callback);
}
public interface PermanentIdRequestPresenterAppearance {
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
index 3e96f429c..47e05b87e 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequest.ui.xml
@@ -20,7 +20,7 @@
-
+
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
index 8268bd8e7..5d6a42616 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialog.java
@@ -1,6 +1,6 @@
package org.iplantc.de.admin.desktop.client.permIdRequest.views;
-import org.iplantc.de.client.models.identifiers.PermanentIdRequesDetails;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestStatus;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
@@ -48,7 +48,7 @@ interface UpdatePermanentIdRequestUiBinder extends UiBinder getStatus();
- AutoBean getDeatils();
+ AutoBean getDetails();
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestDetails.java
similarity index 91%
rename from ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java
rename to ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestDetails.java
index 3bf4e68d4..9dac01b22 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequesDetails.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/models/identifiers/PermanentIdRequestDetails.java
@@ -13,7 +13,7 @@
* @author sriram
*
*/
-public interface PermanentIdRequesDetails {
+public interface PermanentIdRequestDetails {
String getId();
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.java
index 6973a6892..f3050b207 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.java
@@ -52,4 +52,6 @@ public interface PermIdRequestDisplayStrings extends Messages {
String statusUpdateFailure();
String statusUpdateSuccess();
+
+ String userEmail();
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.properties b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.properties
index c722f4fcc..65176f041 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.properties
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermIdRequestDisplayStrings.properties
@@ -23,3 +23,4 @@ metadataSaveError = Metadata invlid. Please fix the errors and try again!
requestLoadFailure = Unable to load permanentId requests!
statusUpdateFailure = Unable to update the status of this request!
statusUpdateSuccess = Request updated!
+userEmail = Email
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
index 6b9f1de37..71888ff97 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/admin/permIdRequest/PermanentIdRequestViewDefaultAppearance.java
@@ -128,4 +128,9 @@ public String request() {
return displayStrings.request();
}
+ @Override
+ public String userEmail() {
+ return displayStrings.userEmail();
+ }
+
}
From ab050106416bbc75f6b927cefb47ddfe70239e41 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Mon, 22 Feb 2016 13:51:12 -0700
Subject: [PATCH 040/183] Remove mistakenly-preserved commas.
---
libs/clj-icat-direct/src/clj_icat_direct/queries.clj | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index a6bf1ee88..da5137b94 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -546,7 +546,7 @@
"WITH user_groups AS ( SELECT g.group_user_id FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
- AND u.zone_name = ? ),
+ AND u.zone_name = ? )
SELECT DISTINCT
c.parent_coll_name as dir_name,
@@ -593,7 +593,7 @@
FROM r_user_main u
JOIN r_user_group g ON g.user_id = u.user_id
WHERE u.user_name = ?
- AND u.zone_name = ? ),
+ AND u.zone_name = ? )
SELECT count(DISTINCT c.coll_id) FROM r_coll_main c
JOIN r_objt_access a ON c.coll_id = a.object_id
From cac46d7af05414b963b83b82091f59ae7b376c27 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Mon, 22 Feb 2016 14:07:59 -0700
Subject: [PATCH 041/183] Reinstate ANY(ARRAY(...)) for consistency.
---
libs/clj-icat-direct/src/clj_icat_direct/queries.clj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index da5137b94..11d77950e 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -581,7 +581,7 @@
data_objs AS ( SELECT data_id
FROM r_data_main
- WHERE coll_id IN ( SELECT coll_id FROM parent ))
+ WHERE coll_id = ANY(ARRAY( SELECT coll_id FROM parent )) )
SELECT count(DISTINCT d.data_id) FROM r_objt_access a
JOIN data_objs d ON a.object_id = d.data_id
From f8f28320b31c62f39fbda5abd1729e532193c5c0 Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Mon, 22 Feb 2016 14:34:56 -0700
Subject: [PATCH 042/183] Remove DISTINCT on coll_id -- it's not
database-enforced unique but we have bigger problems if it's not actually
unique than this count being wrong.
---
libs/clj-icat-direct/src/clj_icat_direct/queries.clj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
index 11d77950e..6c44c854c 100644
--- a/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
+++ b/libs/clj-icat-direct/src/clj_icat_direct/queries.clj
@@ -523,7 +523,7 @@
WHERE u.user_name = ?
AND u.zone_name = ? ),
- parent AS ( SELECT DISTINCT coll_id, coll_name from r_coll_main
+ parent AS ( SELECT coll_id, coll_name from r_coll_main
WHERE coll_name = ?
OR coll_name LIKE ? || '/%' ),
From a685f1244aa4dd4655eb79d8c0d588889ab2bc9b Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 13:51:39 -0700
Subject: [PATCH 043/183] CORE-4345 Fix Notification DeleteAll query string
category.toString returns, for example, 'Tool Request', which
after it gets encoded becomes 'tool+request' which is the
expected input for the Notification service's filter parameter.
category.name returns 'TOOLREQUEST', which after it gets encoded
becomes 'toolrequest' which won't be handled properly by the
service.
---
.../de/client/services/impl/MessageServiceFacadeImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
index 5c08ca990..6b3c5e6d2 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/client/services/impl/MessageServiceFacadeImpl.java
@@ -146,7 +146,7 @@ public void deleteAll(NotificationCategory category, AsyncCallback callb
String address = deProperties.getMuleServiceBaseUrl() + "notifications/delete-all"; //$NON-NLS-1$
if (NotificationCategory.ALL != category) {
- address += "?filter=" + URL.encodeQueryString(category.name().toLowerCase());
+ address += "?filter=" + URL.encodeQueryString(category.toString().toLowerCase());
}
ServiceCallWrapper wrapper = new ServiceCallWrapper(DELETE, address);
From 0ba23b3bfbfb5b94872d824e68915510cfc6d8ff Mon Sep 17 00:00:00 2001
From: Ian McEwen
Date: Tue, 23 Feb 2016 09:52:31 -0700
Subject: [PATCH 044/183] CORE-7522: require at least one path in the Paths
schema.
---
services/data-info/src/data_info/routes/domain/common.clj | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/services/data-info/src/data_info/routes/domain/common.clj b/services/data-info/src/data_info/routes/domain/common.clj
index 8fd49a30a..8c5cd555a 100644
--- a/services/data-info/src/data_info/routes/domain/common.clj
+++ b/services/data-info/src/data_info/routes/domain/common.clj
@@ -11,18 +11,16 @@
(def DataIdPathParam (describe UUID "The data item's UUID"))
(s/defschema Paths
- {:paths (describe [NonBlankString] "A list of iRODS paths")})
+ {:paths (describe [(s/one NonBlankString "path") NonBlankString] "A list of iRODS paths")})
(s/defschema OptionalPaths
- (-> Paths
- (->optional-param :paths)))
+ {(s/optional-key :paths) (describe [NonBlankString] "A list of iRODS paths")})
(s/defschema DataIds
{:ids (describe [UUID] "A list of iRODS data-object UUIDs")})
(s/defschema OptionalPathsOrDataIds
- (-> (merge DataIds Paths)
- (->optional-param :paths)
+ (-> (merge DataIds OptionalPaths)
(->optional-param :ids)))
(def ValidInfoTypesEnum (apply s/enum (hm/supported-formats)))
From e19025825360816a4fadc274c2cb0805bb324885 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Tue, 23 Feb 2016 11:12:34 -0700
Subject: [PATCH 045/183] CORE-7512 fix tests.
---
.../commons/client/widgets/IPlantAnchor.java | 10 ++++++
.../UpdatePermanentIdRequestDialogTest.java | 35 +++++++++++++------
2 files changed, 35 insertions(+), 10 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/commons/client/widgets/IPlantAnchor.java b/ui/de-lib/src/main/java/org/iplantc/de/commons/client/widgets/IPlantAnchor.java
index f9e396719..a94d2f39a 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/commons/client/widgets/IPlantAnchor.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/commons/client/widgets/IPlantAnchor.java
@@ -25,10 +25,13 @@ public static interface IPlantAnchorAppearance {
void onUpdateText(XElement element, String text);
void render(SafeHtmlBuilder sb);
+
}
private final IPlantAnchorAppearance appearance;
+ private String text;
+
@UiConstructor
public IPlantAnchor(String text) {
this(text, -1);
@@ -44,6 +47,7 @@ public IPlantAnchor(String text, int width) {
* @param text text to display
*/
public IPlantAnchor(String text, int width, IPlantAnchorAppearance appearance) {
+ this.text = text;
this.appearance = appearance;
SafeHtmlBuilder sb = new SafeHtmlBuilder();
this.appearance.render(sb);
@@ -66,6 +70,12 @@ public HandlerRegistration addClickHandler(ClickHandler handler) {
}
public void setText(String text) {
+ this.text = text;
appearance.onUpdateText(getElement(), text);
}
+
+ public String getText() {
+ return text;
+ }
+
}
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialogTest.java b/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialogTest.java
index 0bccc2691..885f6fef2 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialogTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/admin/desktop/client/permIdRequest/views/UpdatePermanentIdRequestDialogTest.java
@@ -1,23 +1,24 @@
package org.iplantc.de.admin.desktop.client.permIdRequest.views;
-import org.iplantc.de.admin.desktop.client.permIdRequest.views.PermanentIdRequestView.PermanentIdRequestViewAppearance;
+import static org.junit.Assert.assertEquals;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.when;
+
+import org.iplantc.de.client.models.UserBootstrap;
import org.iplantc.de.client.models.identifiers.PermanentIdRequest;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestAutoBeanFactory;
+import org.iplantc.de.client.models.identifiers.PermanentIdRequestDetails;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestStatus;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
+import org.iplantc.de.commons.client.widgets.IPlantAnchor;
import com.google.gwt.user.client.ui.Label;
-import com.google.gwtmockito.GwtMockitoTestRunner;
import com.google.gwtmockito.GxtMockitoTestRunner;
import com.google.web.bindery.autobean.shared.AutoBean;
-import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.form.SimpleComboBox;
import com.sencha.gxt.widget.core.client.form.TextArea;
-import static org.junit.Assert.assertEquals;
-import static org.mockito.Mockito.*;
-
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
@@ -27,7 +28,10 @@
public class UpdatePermanentIdRequestDialogTest {
@Mock
- Label mockCurrentStatusLabel;
+ IPlantAnchor mockCurrentStatusLabel;
+
+ @Mock
+ Label mockUserEmail;
@Mock
SimpleComboBox mockStatusCombo;
@@ -50,17 +54,25 @@ public class UpdatePermanentIdRequestDialogTest {
@Mock
AutoBean mockAutoBeanStatus;
+ @Mock
+ PermanentIdRequestDetails mockDetails;
+
+ @Mock
+ UserBootstrap mockStrap;
+
private UpdatePermanentIdRequestDialog dialog;
@Before
public void setUp() {
- dialog = new UpdatePermanentIdRequestDialog(mockRequest,
- mockPresenter,
+ when(mockDetails.getRequestor()).thenReturn(mockStrap);
+ when(mockStrap.getEmail()).thenReturn("foo@bar.com");
+ dialog = new UpdatePermanentIdRequestDialog(PermanentIdRequestStatus.Submitted.toString(),
+ mockDetails,
mockPrfactory);
dialog.commentsEditor = mockCommentsEditor;
dialog.currentStatusLabel = mockCurrentStatusLabel;
dialog.statusCombo = mockStatusCombo;
-
+ dialog.userEmail = mockUserEmail;
}
@@ -69,6 +81,9 @@ public void testGetPermanentIdRequestUpdate() {
when(mockStatusCombo.getCurrentValue()).thenReturn(PermanentIdRequestStatus.Approved);
when(mockCommentsEditor.getValue()).thenReturn("testing");
when(mockCurrentStatusLabel.getText()).thenReturn(PermanentIdRequestStatus.Submitted.toString());
+ when(mockUserEmail.getText()).thenReturn("foo@bar.com");
+
+
when(mockPrfactory.getStatus()).thenReturn(mockAutoBeanStatus);
when(mockAutoBeanStatus.as()).thenReturn(mockStatusUpdate);
final PermanentIdRequestUpdate pru = mock(PermanentIdRequestUpdate.class);
From 4be9d20c0c2c2c76ab0c7acb18634295cfcad9f8 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Tue, 23 Feb 2016 15:00:22 -0700
Subject: [PATCH 046/183] CORE-7512 organize imports.
From a830a3c6c26d58a55448c9667a84ebcb5c591478 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 11 Feb 2016 14:49:33 -0700
Subject: [PATCH 047/183] CORE-6341 Move NotificationMessage model
---
.../client/views/widgets/UnseenNotificationsView.java | 4 ++--
.../desktop/client/views/windows/NotificationWindow.java | 9 ---------
.../{views => model}/NotificationMessageProperties.java | 5 ++++-
3 files changed, 6 insertions(+), 12 deletions(-)
rename ui/de-lib/src/main/java/org/iplantc/de/notifications/client/{views => model}/NotificationMessageProperties.java (79%)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/UnseenNotificationsView.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/UnseenNotificationsView.java
index 790de4149..98f40c9a3 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/UnseenNotificationsView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/widgets/UnseenNotificationsView.java
@@ -3,7 +3,7 @@
import org.iplantc.de.desktop.client.DesktopView;
import org.iplantc.de.client.models.notifications.NotificationMessage;
import org.iplantc.de.commons.client.widgets.IPlantAnchor;
-import org.iplantc.de.notifications.client.views.NotificationMessageProperties;
+import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
import com.google.gwt.cell.client.Cell;
import com.google.gwt.core.client.GWT;
@@ -165,4 +165,4 @@ void onSeeAllNotificationsSelected(ClickEvent event) {
public void onMarkAllSeenClicked(ClickEvent event) {
presenter.doMarkAllSeen(true);
}
-}
\ No newline at end of file
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
index b26d02b10..180240400 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
@@ -36,15 +36,6 @@
*/
public class NotificationWindow extends IplantWindowBase {
- private class NotificationKeyProvider implements ModelKeyProvider {
-
- @Override
- public String getKey(NotificationMessage item) {
- return item.getId();
- }
-
- }
-
private static CheckBoxSelectionModel checkBoxModel;
private final IplantDisplayStrings displayStrings;
private NotificationView.Presenter presenter;
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationMessageProperties.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/model/NotificationMessageProperties.java
similarity index 79%
rename from ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationMessageProperties.java
rename to ui/de-lib/src/main/java/org/iplantc/de/notifications/client/model/NotificationMessageProperties.java
index 4b034c76e..cfa9a1dc7 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationMessageProperties.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/model/NotificationMessageProperties.java
@@ -1,12 +1,13 @@
/**
*
*/
-package org.iplantc.de.notifications.client.views;
+package org.iplantc.de.notifications.client.model;
import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.models.notifications.NotificationMessage;
import com.sencha.gxt.core.client.ValueProvider;
+import com.sencha.gxt.data.shared.ModelKeyProvider;
import com.sencha.gxt.data.shared.PropertyAccess;
/**
@@ -15,6 +16,8 @@
*/
public interface NotificationMessageProperties extends PropertyAccess {
+ ModelKeyProvider id();
+
ValueProvider category();
ValueProvider message();
From 983060a680e9d15bd02b1794dfb5ab2821f14bf2 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Thu, 11 Feb 2016 14:56:23 -0700
Subject: [PATCH 048/183] CORE-6341 Move UI components out of
NotificationWindow
---
.../views/windows/NotificationWindow.java | 55 +------------------
.../client/views/NotificationViewImpl.java | 54 ++++++++++++++++++
2 files changed, 55 insertions(+), 54 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
index 180240400..51d4cc3a4 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
@@ -52,11 +52,7 @@ public class NotificationWindow extends IplantWindowBase {
public void show(C windowConfig, String tag,
boolean isMaximizable) {
NotifyWindowConfig notifyWindowConfig = (NotifyWindowConfig) windowConfig;
- NotificationKeyProvider keyProvider = new NotificationKeyProvider();
- ListStore store = new ListStore<>(keyProvider);
- ColumnModel cm = buildNotificationColumnModel();
- NotificationView view = new NotificationViewImpl(store, cm, checkBoxModel);
- presenter = new NotificationPresenterImpl(view);
+
presenter.go(this);
if (notifyWindowConfig != null) {
presenter.filterBy(notifyWindowConfig.getSortCategory());
@@ -70,53 +66,4 @@ public WindowState getWindowState() {
return createWindowState(config);
}
- @SuppressWarnings("unchecked")
- private ColumnModel buildNotificationColumnModel() {
- NotificationMessageProperties props = GWT.create(NotificationMessageProperties.class);
- List> configs = new LinkedList<>();
-
- checkBoxModel = new CheckBoxSelectionModel<>(new IdentityValueProvider());
- @SuppressWarnings("rawtypes")
- ColumnConfig colCheckBox = checkBoxModel.getColumn();
- configs.add(colCheckBox);
-
- ColumnConfig colCategory = new ColumnConfig<>(props.category(), 100);
- colCategory.setHeader(displayStrings.category());
- configs.add(colCategory);
- colCategory.setMenuDisabled(true);
- colCategory.setSortable(false);
-
- ColumnConfig colMessage = new ColumnConfig<>(new IdentityValueProvider(), 420);
- colMessage.setHeader(displayStrings.messagesGridHeader());
- colMessage.setCell(new NotificationMessageCell());
- configs.add(colMessage);
- colMessage.setSortable(false);
- colMessage.setMenuDisabled(true);
-
- ColumnConfig colTimestamp = new ColumnConfig<>(new ValueProvider() {
-
- @Override
- public Date getValue(NotificationMessage object) {
- return new Date(object.getTimestamp());
- }
-
- @Override
- public void setValue(NotificationMessage object,
- Date value) {
- // do nothing
- }
-
- @Override
- public String getPath() {
- return "timestamp";
- }
- }, 170);
- colTimestamp.setCell(new DateCell(DateTimeFormat
- .getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM)));
- colTimestamp.setHeader(displayStrings.createdDateGridHeader());
-
- configs.add(colTimestamp);
- return new ColumnModel<>(configs);
- }
-
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
index 689adc934..13a2505b5 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
@@ -185,4 +185,58 @@ public void unmask() {
public TextButton getRefreshButton() {
return toolBar.getRefreshButton();
}
+
+
+ @UiFactory
+ ColumnModel createColumnModel() {
+ NotificationMessageProperties props = GWT.create(NotificationMessageProperties.class);
+ List> configs = new LinkedList<>();
+
+ checkBoxModel =
+ new CheckBoxSelectionModel<>(new IdentityValueProvider());
+ @SuppressWarnings("rawtypes")
+ ColumnConfig colCheckBox = checkBoxModel.getColumn();
+ configs.add(colCheckBox);
+
+ ColumnConfig colCategory =
+ new ColumnConfig<>(props.category(),
+ appearance.categoryColumnWidth(),
+ appearance.category());
+ configs.add(colCategory);
+ colCategory.setMenuDisabled(true);
+ colCategory.setSortable(false);
+
+ ColumnConfig colMessage =
+ new ColumnConfig<>(new IdentityValueProvider(),
+ appearance.messagesColumnWidth(),
+ appearance.messagesGridHeader());
+ colMessage.setCell(new NotificationMessageCell());
+ configs.add(colMessage);
+ colMessage.setSortable(false);
+ colMessage.setMenuDisabled(true);
+
+ ColumnConfig colTimestamp = new ColumnConfig<>(new ValueProvider() {
+
+ @Override
+ public Date getValue(NotificationMessage object) {
+ return new Date(object.getTimestamp());
+ }
+
+ @Override
+ public void setValue(NotificationMessage object,
+ Date value) {
+ // do nothing
+ }
+
+ @Override
+ public String getPath() {
+ return "timestamp";
+ }
+ }, appearance.createdDateColumnWidth(), appearance.createdDateGridHeader());
+ colTimestamp.setCell(new DateCell(DateTimeFormat
+ .getFormat(DateTimeFormat.PredefinedFormat.DATE_TIME_MEDIUM)));
+
+ configs.add(colTimestamp);
+ return new ColumnModel<>(configs);
+ }
}
From 65a3a44435dff646ad7c917784a274b7556a8d20 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 11:22:06 -0700
Subject: [PATCH 049/183] CORE-6341 Implement Notification's Appearance pattern
with dependency injection
---
.../views/windows/NotificationWindow.java | 33 ++-------
.../presenter/NotificationPresenterImpl.java | 44 ++++++------
.../views/NotificationToolbarViewImpl.java | 15 ++--
.../client/views/NotificationView.java | 26 +++++--
.../client/views/NotificationViewImpl.java | 62 ++++++++--------
.../views/cells/NotificationMessageCell.java | 28 ++++----
.../client/views/cells/RequestStatusCell.java | 36 ++++++----
.../org/iplantc/de/theme/base/Base.gwt.xml | 1 +
.../NotificationViewDefaultAppearance.java | 72 +++++++++++++++++++
.../notifications/Notifications.gwt.xml | 15 ++++
...ificationMessageCellDefaultAppearance.java | 27 +++++++
.../RequestStatusCellDefaultAppearance.java | 25 +++++++
12 files changed, 268 insertions(+), 116 deletions(-)
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/NotificationViewDefaultAppearance.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/Notifications.gwt.xml
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/NotificationMessageCellDefaultAppearance.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/RequestStatusCellDefaultAppearance.java
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
index 51d4cc3a4..c6a7c0496 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/desktop/client/views/windows/NotificationWindow.java
@@ -1,49 +1,28 @@
package org.iplantc.de.desktop.client.views.windows;
import org.iplantc.de.client.models.WindowState;
-import org.iplantc.de.client.models.notifications.NotificationCategory;
-import org.iplantc.de.client.models.notifications.NotificationMessage;
import org.iplantc.de.commons.client.views.window.configs.ConfigFactory;
import org.iplantc.de.commons.client.views.window.configs.NotifyWindowConfig;
import org.iplantc.de.commons.client.views.window.configs.WindowConfig;
import org.iplantc.de.desktop.shared.DeModule;
-import org.iplantc.de.notifications.client.presenter.NotificationPresenterImpl;
-import org.iplantc.de.notifications.client.views.NotificationMessageProperties;
import org.iplantc.de.notifications.client.views.NotificationView;
-import org.iplantc.de.notifications.client.views.NotificationViewImpl;
-import org.iplantc.de.notifications.client.views.cells.NotificationMessageCell;
-import org.iplantc.de.resources.client.messages.IplantDisplayStrings;
-import com.google.gwt.cell.client.DateCell;
-import com.google.gwt.core.shared.GWT;
-import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.inject.Inject;
-import com.sencha.gxt.core.client.IdentityValueProvider;
-import com.sencha.gxt.core.client.ValueProvider;
-import com.sencha.gxt.data.shared.ListStore;
-import com.sencha.gxt.data.shared.ModelKeyProvider;
-import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
-import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
-import com.sencha.gxt.widget.core.client.grid.ColumnModel;
-
-import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
-
/**
* @author sriram, jstroot
*/
public class NotificationWindow extends IplantWindowBase {
- private static CheckBoxSelectionModel checkBoxModel;
- private final IplantDisplayStrings displayStrings;
private NotificationView.Presenter presenter;
+ private NotificationView.NotificationViewAppearance appearance;
@Inject
- NotificationWindow(final IplantDisplayStrings displayStrings) {
- this.displayStrings = displayStrings;
- setHeadingText(displayStrings.notifications());
+ NotificationWindow(NotificationView.Presenter presenter,
+ NotificationView.NotificationViewAppearance appearance) {
+ this.presenter = presenter;
+ this.appearance = appearance;
+ setHeadingText(appearance.notifications());
ensureDebugId(DeModule.WindowIds.NOTIFICATION);
setSize("600", "375");
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index d6ca2b8de..17b12ca35 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -1,7 +1,6 @@
package org.iplantc.de.notifications.client.presenter;
import org.iplantc.de.client.events.EventBus;
-import org.iplantc.de.client.gin.ServicesInjector;
import org.iplantc.de.client.models.HasId;
import org.iplantc.de.client.models.notifications.Notification;
import org.iplantc.de.client.models.notifications.NotificationCategory;
@@ -12,12 +11,10 @@
import org.iplantc.de.commons.client.ErrorHandler;
import org.iplantc.de.notifications.client.events.DeleteNotificationsUpdateEvent;
import org.iplantc.de.notifications.client.events.NotificationCountUpdateEvent;
+import org.iplantc.de.notifications.client.gin.factory.NotificationViewFactory;
+import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
import org.iplantc.de.notifications.client.views.NotificationToolbarView;
-import org.iplantc.de.notifications.client.views.NotificationToolbarViewImpl;
import org.iplantc.de.notifications.client.views.NotificationView;
-import org.iplantc.de.resources.client.messages.I18N;
-import org.iplantc.de.resources.client.messages.IplantDisplayStrings;
-import org.iplantc.de.resources.client.messages.IplantErrorStrings;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
@@ -27,10 +24,12 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.HasOneWidget;
+import com.google.inject.Inject;
import com.google.web.bindery.autobean.shared.Splittable;
import com.google.web.bindery.autobean.shared.impl.StringQuoter;
import com.sencha.gxt.data.client.loader.RpcProxy;
+import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.SortDir;
import com.sencha.gxt.data.shared.SortInfo;
import com.sencha.gxt.data.shared.SortInfoBean;
@@ -110,33 +109,36 @@ public void onSuccess(String result1) {
});
}
}
-
- private final IplantDisplayStrings displayStrings;
-
- private final IplantErrorStrings errorStrings;
-
EventBus eventBus;
MessageServiceFacade messageServiceFacade;
- NotificationToolbarView toolbar;
+ private final ListStore listStore;
+ private final NotificationToolbarView toolbar;
private final NotificationView view;
private PagingLoadResult callbackResult;
+ private NotificationView.NotificationViewAppearance appearance;
NotificationCategory currentCategory;
private final JsonUtil jsonUtil;
- public NotificationPresenterImpl(final NotificationView view) {
- this.view = view;
- this.errorStrings = I18N.ERROR;
- this.displayStrings = I18N.DISPLAY;
- this.messageServiceFacade = ServicesInjector.INSTANCE.getMessageServiceFacade();
- this.eventBus = EventBus.getInstance();
+ @Inject
+ public NotificationPresenterImpl(final NotificationViewFactory viewFactory,
+ NotificationView.NotificationViewAppearance appearance,
+ NotificationToolbarView toolbar,
+ NotificationMessageProperties messageProperties) {
+ this.appearance = appearance;
+ this.listStore = createListStore(messageProperties);
+ this.view = viewFactory.create(listStore);
currentCategory = NotificationCategory.ALL;
- toolbar = new NotificationToolbarViewImpl();
this.jsonUtil = JsonUtil.getInstance();
toolbar.setPresenter(this);
view.setNorthWidget(toolbar);
this.view.setPresenter(this);
setRefreshButton(view.getRefreshButton());
// set default cat
+
+ ListStore createListStore(NotificationMessageProperties messageProperties) {
+ return new ListStore<>(messageProperties.id());
+ }
+
}
@Override
@@ -243,7 +245,7 @@ public void execute() {
messageServiceFacade.deleteMessages(obj, new AsyncCallback() {
@Override
public void onFailure(Throwable caught) {
- ErrorHandler.post(errorStrings.notificationDeletFail(), caught);
+ ErrorHandler.post(appearance.notificationDeleteFail(), caught);
}
@Override
@@ -274,7 +276,6 @@ public void onNotificationSelection(List items) {
@Override
public void setRefreshButton(TextButton refreshBtn) {
if (refreshBtn != null) {
- refreshBtn.setText(displayStrings.refresh());
toolbar.setRefreshButton(refreshBtn);
}
}
@@ -308,7 +309,8 @@ public void load(final FilterPagingLoadConfig loadConfig,
final PagingLoader> loader = new PagingLoader<>(proxy);
loader.setRemoteSort(true);
- loader.addLoadHandler(new LoadResultListStoreBinding>(view.getListStore()));
+ loader.addLoadHandler(new LoadResultListStoreBinding>(
+ listStore));
loader.useLoadConfig(buildDefaultLoadConfig());
return loader;
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
index 915e6b0aa..8b9697286 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
@@ -12,7 +12,9 @@
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.uibinder.client.UiTemplate;
+import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
import com.sencha.gxt.data.shared.StringLabelProvider;
import com.sencha.gxt.widget.core.client.button.TextButton;
@@ -24,7 +26,7 @@
* @author sriram
*
*/
-public class NotificationToolbarViewImpl implements NotificationToolbarView {
+public class NotificationToolbarViewImpl extends Composite implements NotificationToolbarView {
private static NotificationToolbarUiBinder uiBinder = GWT.create(NotificationToolbarUiBinder.class);
@@ -32,7 +34,6 @@ public class NotificationToolbarViewImpl implements NotificationToolbarView {
interface NotificationToolbarUiBinder extends UiBinder {
}
- private final Widget widget;
private Presenter presenter;
@UiField
@@ -47,9 +48,12 @@ interface NotificationToolbarUiBinder extends UiBinder cboFilter = new SimpleComboBox(
new StringLabelProvider());
+ private NotificationView.NotificationViewAppearance appearance;
- public NotificationToolbarViewImpl() {
- widget = uiBinder.createAndBindUi(this);
+ @Inject
+ public NotificationToolbarViewImpl(NotificationView.NotificationViewAppearance appearance) {
+ this.appearance = appearance;
+ initWidget(uiBinder.createAndBindUi(this));
initFilters();
}
@@ -75,7 +79,7 @@ public void onSelection(SelectionEvent event) {
@Override
public Widget asWidget() {
- return widget;
+ return this;
}
@Override
@@ -107,6 +111,7 @@ public void setPresenter(Presenter p) {
@Override
public void setRefreshButton(TextButton refreshBtn) {
+ refreshBtn.setText(appearance.refresh());
menuToolBar.insert(refreshBtn, 1);
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
index 0836e6893..76d5cb157 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
@@ -5,7 +5,6 @@
import com.google.gwt.user.client.ui.IsWidget;
-import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;
import com.sencha.gxt.data.shared.loader.PagingLoader;
@@ -13,7 +12,28 @@
import java.util.List;
-public interface NotificationView extends IsWidget {
+ interface NotificationViewAppearance {
+
+ String notifications();
+
+ String refresh();
+
+ String notificationDeleteFail();
+
+ String category();
+
+ int categoryColumnWidth();
+
+ String messagesGridHeader();
+
+ int messagesColumnWidth();
+
+ String createdDateGridHeader();
+
+ int createdDateColumnWidth();
+
+ }
+
public interface Presenter extends org.iplantc.de.commons.client.presenter.Presenter {
/**
* Filters the list of notifications by a given Category.
@@ -58,8 +78,6 @@ public interface Presenter extends org.iplantc.de.commons.client.presenter.Prese
public void setPresenter(final Presenter presenter);
- public ListStore getListStore();
-
/**
* loads notifications using given laod conig
*
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
index 13a2505b5..17768bd7a 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
@@ -3,33 +3,46 @@
*/
package org.iplantc.de.notifications.client.views;
-import org.iplantc.de.commons.client.widgets.DEPagingToolbar;
+import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.models.notifications.NotificationMessage;
+import org.iplantc.de.commons.client.widgets.DEPagingToolbar;
+import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
+import org.iplantc.de.notifications.client.views.cells.NotificationMessageCell;
import org.iplantc.de.resources.client.messages.I18N;
+import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiFactory;
import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.uibinder.client.UiTemplate;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.google.inject.assistedinject.Assisted;
+import com.sencha.gxt.core.client.IdentityValueProvider;
import com.sencha.gxt.core.client.Style.SelectionMode;
+import com.sencha.gxt.core.client.ValueProvider;
import com.sencha.gxt.data.shared.ListStore;
import com.sencha.gxt.data.shared.loader.FilterPagingLoadConfig;
import com.sencha.gxt.data.shared.loader.PagingLoadResult;
import com.sencha.gxt.data.shared.loader.PagingLoader;
+import com.sencha.gxt.widget.core.client.Composite;
import com.sencha.gxt.widget.core.client.FramedPanel;
import com.sencha.gxt.widget.core.client.button.TextButton;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer;
import com.sencha.gxt.widget.core.client.container.BorderLayoutContainer.BorderLayoutData;
import com.sencha.gxt.widget.core.client.event.RefreshEvent;
+import com.sencha.gxt.widget.core.client.grid.CheckBoxSelectionModel;
+import com.sencha.gxt.widget.core.client.grid.ColumnConfig;
import com.sencha.gxt.widget.core.client.grid.ColumnModel;
import com.sencha.gxt.widget.core.client.grid.Grid;
-import com.sencha.gxt.widget.core.client.grid.GridSelectionModel;
import com.sencha.gxt.widget.core.client.selection.SelectionChangedEvent;
import com.sencha.gxt.widget.core.client.selection.SelectionChangedEvent.SelectionChangedHandler;
+import java.util.Date;
+import java.util.LinkedList;
import java.util.List;
/**
@@ -39,7 +52,7 @@
* @author sriram
*
*/
-public class NotificationViewImpl implements NotificationView {
+public class NotificationViewImpl extends Composite implements NotificationView {
private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
@@ -47,36 +60,25 @@ public class NotificationViewImpl implements NotificationView {
interface MyUiBinder extends UiBinder {
}
- @UiField(provided = true)
- final ListStore listStore;
- @UiField(provided = true)
- final ColumnModel cm;
-
- @UiField
- Grid grid;
-
- @UiField
- FramedPanel mainPanel;
-
- @UiField
- BorderLayoutContainer con;
-
- @UiField
- DEPagingToolbar toolBar;
- @UiField
- BorderLayoutData northData;
+ @UiField(provided = true) final ListStore listStore;
+ @UiField Grid grid;
+ @UiField FramedPanel mainPanel;
+ @UiField BorderLayoutContainer con;
+ @UiField DEPagingToolbar toolBar;
+ @UiField BorderLayoutData northData;
- private final Widget widget;
- private Presenter presenter;
+ CheckBoxSelectionModel checkBoxModel;
+ private NotificationViewAppearance appearance;
- public NotificationViewImpl(ListStore listStore,
- ColumnModel cm, GridSelectionModel sm) {
- this.cm = cm;
+ @Inject
+ public NotificationViewImpl(@Assisted ListStore listStore,
+ NotificationViewAppearance appearance) {
this.listStore = listStore;
- this.widget = uiBinder.createAndBindUi(this);
+ this.appearance = appearance;
+ initWidget(uiBinder.createAndBindUi(this));
toolBar.getElement().getStyle().setProperty("borderBottom", "none");
- grid.setSelectionModel(sm);
+ grid.setSelectionModel(checkBoxModel);
grid.getSelectionModel().setSelectionMode(SelectionMode.MULTI);
addGridSelectionHandler();
addGridRefreshHandler();
@@ -109,7 +111,7 @@ public void onSelectionChanged(SelectionChangedEvent event)
*/
@Override
public Widget asWidget() {
- return widget;
+ return this;
}
/*
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/NotificationMessageCell.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/NotificationMessageCell.java
index 1a0844ff5..c1acb1b7b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/NotificationMessageCell.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/NotificationMessageCell.java
@@ -24,6 +24,7 @@
import com.google.common.collect.Lists;
import com.google.gwt.cell.client.AbstractCell;
+import com.google.gwt.cell.client.Cell;
import com.google.gwt.cell.client.ValueUpdater;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Element;
@@ -32,8 +33,6 @@
import com.google.web.bindery.autobean.shared.AutoBean;
import com.google.web.bindery.autobean.shared.AutoBeanCodex;
-import com.sencha.gxt.core.client.util.Format;
-
import java.util.ArrayList;
import java.util.List;
@@ -46,26 +45,22 @@
*/
public class NotificationMessageCell extends AbstractCell {
+ public interface NotificationMessageCellAppearance {
+ void render(Cell.Context context, NotificationMessage value, SafeHtmlBuilder sb);
+ }
+
+ private final NotificationMessageCellAppearance appearance =
+ GWT.create(NotificationMessageCellAppearance.class);
+
private final DiskResourceAutoBeanFactory drFactory = GWT.create(DiskResourceAutoBeanFactory.class);
private final AnalysesAutoBeanFactory analysesFactory = GWT.create(AnalysesAutoBeanFactory.class);
private final NotificationAutoBeanFactory notificationFactory = GWT.create(NotificationAutoBeanFactory.class);
private final DiskResourceUtil diskResourceUtil = DiskResourceUtil.getInstance();
+
public NotificationMessageCell() {
super("click"); //$NON-NLS-1$
}
- @Override
- public void render(Context context, NotificationMessage value, SafeHtmlBuilder sb) {
- String style = "white-space:pre-wrap;text-overflow:ellipsis;overflow:hidden;"; //$NON-NLS-1$
-
- if (value.getContext() != null) {
- style += "cursor:pointer; text-decoration:underline;"; //$NON-NLS-1$
- }
-
- sb.appendHtmlConstant(Format.substitute("{1}
", style, //$NON-NLS-1$
- value.getMessage()));
- }
-
@Override
public void onBrowserEvent(Context context, Element parent, NotificationMessage value,
NativeEvent event, ValueUpdater valueUpdater) {
@@ -153,4 +148,9 @@ public void onBrowserEvent(Context context, Element parent, NotificationMessage
}
}
+ @Override
+ public void render(Context context, NotificationMessage value, SafeHtmlBuilder sb) {
+ appearance.render(context, value, sb);
+ }
+
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/RequestStatusCell.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/RequestStatusCell.java
index 1976f36b9..b414412b9 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/RequestStatusCell.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/cells/RequestStatusCell.java
@@ -1,13 +1,11 @@
package org.iplantc.de.notifications.client.views.cells;
-import org.iplantc.de.client.models.tool.Tool;
import org.iplantc.de.client.models.toolRequest.ToolRequestStatus;
import com.google.gwt.cell.client.AbstractCell;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
-import com.sencha.gxt.core.client.util.Format;
-
/**
* A Cell for displaying a ToolRequestStatus in a grid with its associated help text as a QuickTip.
*
@@ -16,24 +14,32 @@
*/
public class RequestStatusCell extends AbstractCell {
+ public interface RequestStatusCellAppearance {
+ void render(Context context, String helpText, String value, SafeHtmlBuilder sb);
+ }
+
+ private RequestStatusCellAppearance appearance = GWT.create(RequestStatusCellAppearance.class);
+
@Override
public void render(Context context, String value, SafeHtmlBuilder sb) {
- String qtip = ""; //$NON-NLS-1$
+
+ String helpText;
if (value != null && (value.equalsIgnoreCase(ToolRequestStatus.Completion.toString()) || value.equalsIgnoreCase(ToolRequestStatus.Evaluation.toString())
- || value.equalsIgnoreCase(ToolRequestStatus.Failed.toString()) || value.equalsIgnoreCase(ToolRequestStatus.Installation.toString())
- || value.equalsIgnoreCase(ToolRequestStatus.Pending.toString()) || value.equalsIgnoreCase(ToolRequestStatus.Submitted.toString())
- || value.equalsIgnoreCase(ToolRequestStatus.Validation.toString())) ) {
- qtip = Format.substitute("qtip=\"{0}\"", ToolRequestStatus.valueOf(value).getHelpText()); //$NON-NLS-1$
- sb.appendHtmlConstant(Format.substitute("{1}
", qtip, value));
+ || value.equalsIgnoreCase(ToolRequestStatus.Failed.toString())
+ || value.equalsIgnoreCase(ToolRequestStatus.Installation.toString())
+ || value.equalsIgnoreCase(ToolRequestStatus.Pending.toString())
+ || value.equalsIgnoreCase(ToolRequestStatus.Submitted.toString()) || value
+ .equalsIgnoreCase(ToolRequestStatus.Validation.toString()))) {
+ helpText = ToolRequestStatus.valueOf(value).getHelpText();
+
} else if (value != null) {
- qtip = Format.substitute("qtip=\"{0}\"", ToolRequestStatus.valueOf(ToolRequestStatus.Other.toString()).getHelpText()); //$NON-NLS-1$
- sb.appendHtmlConstant(Format.substitute("{1}
", qtip, value));
- } else{
- sb.appendHtmlConstant(Format.substitute("{0}
", value));
+ helpText = ToolRequestStatus.valueOf(ToolRequestStatus.Other.toString())
+ .getHelpText();
+ } else {
+ helpText = null;
}
-
- //$NON-NLS-1$
+ appearance.render(context, helpText, value, sb);
}
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/Base.gwt.xml b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/Base.gwt.xml
index 306ab0cd8..9acdf71d5 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/Base.gwt.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/Base.gwt.xml
@@ -7,6 +7,7 @@
+
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/NotificationViewDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/NotificationViewDefaultAppearance.java
new file mode 100644
index 000000000..7273a39fa
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/NotificationViewDefaultAppearance.java
@@ -0,0 +1,72 @@
+package org.iplantc.de.theme.base.client.notifications;
+
+import org.iplantc.de.notifications.client.views.NotificationView;
+import org.iplantc.de.resources.client.messages.IplantDisplayStrings;
+import org.iplantc.de.resources.client.messages.IplantErrorStrings;
+
+import com.google.gwt.core.client.GWT;
+
+/**
+ * @author aramsey
+ */
+public class NotificationViewDefaultAppearance implements NotificationView.NotificationViewAppearance {
+
+ private IplantDisplayStrings iplantDisplayStrings;
+ private IplantErrorStrings iplantErrorStrings;
+
+ public NotificationViewDefaultAppearance() {
+ this(GWT.create(IplantDisplayStrings.class),
+ (GWT.create(IplantErrorStrings.class)));
+ }
+
+ public NotificationViewDefaultAppearance(IplantDisplayStrings iplantDisplayStrings,
+ IplantErrorStrings iplantErrorStrings) {
+ this.iplantDisplayStrings = iplantDisplayStrings;
+ this.iplantErrorStrings = iplantErrorStrings;
+ }
+
+ @Override
+ public String notifications() {
+ return iplantDisplayStrings.notifications();
+ }
+
+ @Override
+ public String refresh() {
+ return iplantDisplayStrings.refresh();
+ }
+
+ @Override
+ public String notificationDeleteFail() {
+ return iplantErrorStrings.notificationDeletFail();
+ }
+
+ @Override
+ public String category() {
+ return iplantDisplayStrings.category();
+ }
+
+ @Override
+ public int categoryColumnWidth() {
+ return 100;
+ }
+
+ @Override
+ public String messagesGridHeader() {
+ return iplantDisplayStrings.messagesGridHeader();
+ }
+
+ @Override
+ public int messagesColumnWidth() {
+ return 420;
+ }
+
+ @Override
+ public String createdDateGridHeader() {
+ return iplantDisplayStrings.createdDateGridHeader();
+ }
+
+ @Override
+ public int createdDateColumnWidth() {
+ return 170;
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/Notifications.gwt.xml b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/Notifications.gwt.xml
new file mode 100644
index 000000000..c95926c00
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/Notifications.gwt.xml
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/NotificationMessageCellDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/NotificationMessageCellDefaultAppearance.java
new file mode 100644
index 000000000..6f5915a67
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/NotificationMessageCellDefaultAppearance.java
@@ -0,0 +1,27 @@
+package org.iplantc.de.theme.base.client.notifications.cells;
+
+import org.iplantc.de.client.models.notifications.NotificationMessage;
+import org.iplantc.de.notifications.client.views.cells.NotificationMessageCell;
+
+import com.google.gwt.cell.client.Cell;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+
+import com.sencha.gxt.core.client.util.Format;
+
+/**
+ * @author aramsey
+ */
+public class NotificationMessageCellDefaultAppearance implements NotificationMessageCell.NotificationMessageCellAppearance {
+
+ @Override
+ public void render(Cell.Context context, NotificationMessage value, SafeHtmlBuilder sb) {
+ String style = "white-space:pre-wrap;text-overflow:ellipsis;overflow:hidden;"; //$NON-NLS-1$
+
+ if (value.getContext() != null) {
+ style += "cursor:pointer; text-decoration:underline;"; //$NON-NLS-1$
+ }
+
+ sb.appendHtmlConstant(Format.substitute("{1}
", style, //$NON-NLS-1$
+ value.getMessage()));
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/RequestStatusCellDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/RequestStatusCellDefaultAppearance.java
new file mode 100644
index 000000000..677a8789a
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/notifications/cells/RequestStatusCellDefaultAppearance.java
@@ -0,0 +1,25 @@
+package org.iplantc.de.theme.base.client.notifications.cells;
+
+import org.iplantc.de.notifications.client.views.cells.RequestStatusCell;
+
+import com.google.gwt.cell.client.Cell;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+
+import com.sencha.gxt.core.client.util.Format;
+
+/**
+ * @author aramsey
+ */
+public class RequestStatusCellDefaultAppearance implements RequestStatusCell.RequestStatusCellAppearance {
+ @Override
+ public void render(Cell.Context context, String helpText, String value, SafeHtmlBuilder sb) {
+ String qtip = "";
+
+ if (helpText != null) {
+ qtip = Format.substitute("qtip=\"{0}\"", helpText);
+ sb.appendHtmlConstant(Format.substitute("{1}
", qtip, value));
+ } else{
+ sb.appendHtmlConstant(Format.substitute("{0}
", value));
+ }
+ }
+}
From e95b663582953f03ebd299e0f24e109eee95e88e Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 11:07:26 -0700
Subject: [PATCH 050/183] CORE-6341 Minor file rename
---
.../de/notifications/client/views/NotificationViewImpl.java | 6 ++----
...{NotificationView.ui.xml => NotificationViewImpl.ui.xml} | 0
2 files changed, 2 insertions(+), 4 deletions(-)
rename ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/{NotificationView.ui.xml => NotificationViewImpl.ui.xml} (100%)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
index 17768bd7a..1d8897b2b 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
@@ -54,12 +54,10 @@
*/
public class NotificationViewImpl extends Composite implements NotificationView {
- private static MyUiBinder uiBinder = GWT.create(MyUiBinder.class);
-
- @UiTemplate("NotificationView.ui.xml")
- interface MyUiBinder extends UiBinder {
+ interface NotificationViewImplUiBinder extends UiBinder {
}
+ private static NotificationViewImplUiBinder uiBinder = GWT.create(NotificationViewImplUiBinder.class);
@UiField(provided = true) final ListStore listStore;
@UiField Grid grid;
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.ui.xml b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.ui.xml
similarity index 100%
rename from ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.ui.xml
rename to ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.ui.xml
From 6be180a4c267f84ec99f4e59360ab29191c28f05 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 12:24:15 -0700
Subject: [PATCH 051/183] CORE-6341 Notification Gin and dependency injection
---
.../client/gin/NotificationGinModule.java | 24 +++++++++++++++++++
.../gin/factory/NotificationViewFactory.java | 14 +++++++++++
.../presenter/NotificationPresenterImpl.java | 7 +++---
.../org/iplantc/de/client/gin/DEInjector.java | 4 +++-
4 files changed, 44 insertions(+), 5 deletions(-)
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/NotificationGinModule.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/factory/NotificationViewFactory.java
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/NotificationGinModule.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/NotificationGinModule.java
new file mode 100644
index 000000000..8cf2af420
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/NotificationGinModule.java
@@ -0,0 +1,24 @@
+package org.iplantc.de.notifications.client.gin;
+
+import org.iplantc.de.notifications.client.gin.factory.NotificationViewFactory;
+import org.iplantc.de.notifications.client.presenter.NotificationPresenterImpl;
+import org.iplantc.de.notifications.client.views.NotificationToolbarView;
+import org.iplantc.de.notifications.client.views.NotificationToolbarViewImpl;
+import org.iplantc.de.notifications.client.views.NotificationView;
+import org.iplantc.de.notifications.client.views.NotificationViewImpl;
+
+import com.google.gwt.inject.client.AbstractGinModule;
+import com.google.gwt.inject.client.assistedinject.GinFactoryModuleBuilder;
+
+/**
+ * @author aramsey
+ */
+public class NotificationGinModule extends AbstractGinModule {
+ @Override
+ protected void configure() {
+ install(new GinFactoryModuleBuilder().implement(NotificationView.class, NotificationViewImpl.class).build(
+ NotificationViewFactory.class));
+ bind(NotificationToolbarView.class).to(NotificationToolbarViewImpl.class);
+ bind(NotificationView.Presenter.class).to(NotificationPresenterImpl.class);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/factory/NotificationViewFactory.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/factory/NotificationViewFactory.java
new file mode 100644
index 000000000..6313d5000
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/gin/factory/NotificationViewFactory.java
@@ -0,0 +1,14 @@
+package org.iplantc.de.notifications.client.gin.factory;
+
+import org.iplantc.de.client.models.notifications.NotificationMessage;
+import org.iplantc.de.notifications.client.views.NotificationView;
+
+import com.sencha.gxt.data.shared.ListStore;
+
+/**
+ * @author aramsey
+ */
+public interface NotificationViewFactory {
+
+ NotificationView create(ListStore listStore);
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index 17b12ca35..f7b6f975d 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -109,15 +109,15 @@ public void onSuccess(String result1) {
});
}
}
- EventBus eventBus;
- MessageServiceFacade messageServiceFacade;
private final ListStore listStore;
private final NotificationToolbarView toolbar;
private final NotificationView view;
private PagingLoadResult callbackResult;
private NotificationView.NotificationViewAppearance appearance;
NotificationCategory currentCategory;
- private final JsonUtil jsonUtil;
+ @Inject EventBus eventBus;
+ @Inject MessageServiceFacade messageServiceFacade;
+ @Inject JsonUtil jsonUtil;
@Inject
public NotificationPresenterImpl(final NotificationViewFactory viewFactory,
@@ -128,7 +128,6 @@ public NotificationPresenterImpl(final NotificationViewFactory viewFactory,
this.listStore = createListStore(messageProperties);
this.view = viewFactory.create(listStore);
currentCategory = NotificationCategory.ALL;
- this.jsonUtil = JsonUtil.getInstance();
toolbar.setPresenter(this);
view.setNorthWidget(toolbar);
this.view.setPresenter(this);
diff --git a/ui/de-webapp/src/main/java/org/iplantc/de/client/gin/DEInjector.java b/ui/de-webapp/src/main/java/org/iplantc/de/client/gin/DEInjector.java
index 6e054488d..519d00fb6 100644
--- a/ui/de-webapp/src/main/java/org/iplantc/de/client/gin/DEInjector.java
+++ b/ui/de-webapp/src/main/java/org/iplantc/de/client/gin/DEInjector.java
@@ -9,6 +9,7 @@
import org.iplantc.de.desktop.client.gin.DEGinModule;
import org.iplantc.de.diskResource.client.gin.DiskResourceGinModule;
import org.iplantc.de.fileViewers.client.gin.FileViewerGinModule;
+import org.iplantc.de.notifications.client.gin.NotificationGinModule;
import org.iplantc.de.tags.client.gin.TagsGinModule;
import org.iplantc.de.tools.requests.client.gin.ToolRequestGinModule;
@@ -29,7 +30,8 @@
DiskResourceGinModule.class,
CommentsGinModule.class,
TagsGinModule.class,
- FileViewerGinModule.class})
+ FileViewerGinModule.class,
+ NotificationGinModule.class})
public interface DEInjector extends Ginjector {
public static final DEInjector INSTANCE = GWT.create(DEInjector.class);
From ecc6527f1531e0b63d42c3acf0e828b180ad4597 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 12:25:34 -0700
Subject: [PATCH 052/183] CORE-6341 Remove Notification presenter references
and fire events
---
.../events/NotificationGridRefreshEvent.java | 29 +++++++
.../events/NotificationSelectionEvent.java | 43 +++++++++++
...ificationToolbarDeleteAllClickedEvent.java | 30 ++++++++
...NotificationToolbarDeleteClickedEvent.java | 30 ++++++++
.../NotificationToolbarSelectionEvent.java | 43 +++++++++++
.../presenter/NotificationPresenterImpl.java | 77 +++++++++++--------
.../client/views/NotificationToolbarView.java | 20 ++---
.../views/NotificationToolbarViewImpl.java | 36 ++++++---
.../client/views/NotificationView.java | 15 ++--
.../client/views/NotificationViewImpl.java | 40 ++++------
10 files changed, 274 insertions(+), 89 deletions(-)
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationGridRefreshEvent.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationSelectionEvent.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteAllClickedEvent.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteClickedEvent.java
create mode 100644 ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarSelectionEvent.java
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationGridRefreshEvent.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationGridRefreshEvent.java
new file mode 100644
index 000000000..337e8560e
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationGridRefreshEvent.java
@@ -0,0 +1,29 @@
+package org.iplantc.de.notifications.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+/**
+ * @author aramsey
+ */
+public class NotificationGridRefreshEvent extends GwtEvent {
+ public static Type TYPE =
+ new Type();
+
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ protected void dispatch(NotificationGridRefreshEventHandler handler) {
+ handler.onNotificationGridRefresh(this);
+ }
+
+ public interface NotificationGridRefreshEventHandler extends EventHandler {
+ void onNotificationGridRefresh(NotificationGridRefreshEvent event);
+ }
+
+ public interface HasNotificationGridRefreshEventHandlers {
+ HandlerRegistration addNotificationGridRefreshEventHandler(NotificationGridRefreshEventHandler handler);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationSelectionEvent.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationSelectionEvent.java
new file mode 100644
index 000000000..b39407c19
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationSelectionEvent.java
@@ -0,0 +1,43 @@
+package org.iplantc.de.notifications.client.events;
+
+import org.iplantc.de.client.models.notifications.NotificationMessage;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import java.util.List;
+
+/**
+ * @author aramsey
+ */
+public class NotificationSelectionEvent extends GwtEvent {
+
+ private List items;
+
+ public static Type TYPE =
+ new Type();
+
+ public NotificationSelectionEvent(List items) {
+ this.items = items;
+ }
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ protected void dispatch(NotificationSelectionEventHandler handler) {
+ handler.onNotificationSelection(this);
+ }
+
+ public interface NotificationSelectionEventHandler extends EventHandler {
+ void onNotificationSelection(NotificationSelectionEvent event);
+ }
+
+ public List getNotifications() {
+ return items;
+ }
+
+ public interface HasNotificationSelectionEventHandlers {
+ HandlerRegistration addNotificationSelectionEventHandler (NotificationSelectionEventHandler handler);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteAllClickedEvent.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteAllClickedEvent.java
new file mode 100644
index 000000000..8ca0aac90
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteAllClickedEvent.java
@@ -0,0 +1,30 @@
+package org.iplantc.de.notifications.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+/**
+ * @author aramsey
+ */
+public class NotificationToolbarDeleteAllClickedEvent
+ extends GwtEvent {
+ public static Type TYPE =
+ new Type();
+
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ protected void dispatch(NotificationToolbarDeleteAllClickedEventHandler handler) {
+ handler.onNotificationToolbarDeleteAllClicked(this);
+ }
+
+ public static interface NotificationToolbarDeleteAllClickedEventHandler extends EventHandler {
+ void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event);
+ }
+
+ public interface HasNotificationToolbarDeleteAllClickedEventHandlers {
+ HandlerRegistration addNotificationToolbarDeleteAllClickedEventHandler(NotificationToolbarDeleteAllClickedEventHandler handler);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteClickedEvent.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteClickedEvent.java
new file mode 100644
index 000000000..b3f944c43
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarDeleteClickedEvent.java
@@ -0,0 +1,30 @@
+package org.iplantc.de.notifications.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+/**
+ * @author aramsey
+ */
+public class NotificationToolbarDeleteClickedEvent
+ extends GwtEvent {
+ public static Type TYPE =
+ new Type();
+
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ protected void dispatch(NotificationToolbarDeleteClickedEventHandler handler) {
+ handler.onNotificationToolbarDeleteClicked(this);
+ }
+
+ public static interface NotificationToolbarDeleteClickedEventHandler extends EventHandler {
+ void onNotificationToolbarDeleteClicked(NotificationToolbarDeleteClickedEvent event);
+ }
+
+ public interface HasNotificationToolbarDeleteClickedEventHandlers {
+ HandlerRegistration addNotificationToolbarDeleteClickedEventHandler(NotificationToolbarDeleteClickedEventHandler handler);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarSelectionEvent.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarSelectionEvent.java
new file mode 100644
index 000000000..bbff690e3
--- /dev/null
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/events/NotificationToolbarSelectionEvent.java
@@ -0,0 +1,43 @@
+package org.iplantc.de.notifications.client.events;
+
+import org.iplantc.de.client.models.notifications.NotificationCategory;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+/**
+ * @author aramsey
+ */
+public class NotificationToolbarSelectionEvent
+ extends GwtEvent {
+
+ private NotificationCategory notificationCategory;
+
+ public NotificationToolbarSelectionEvent (NotificationCategory notificationCategory) {
+ this.notificationCategory = notificationCategory;
+ }
+
+ public NotificationCategory getNotificationCategory() {
+ return notificationCategory;
+ }
+
+ public static Type TYPE =
+ new Type();
+
+ public Type getAssociatedType() {
+ return TYPE;
+ }
+
+ protected void dispatch(NotificationToolbarSelectionEventHandler handler) {
+ handler.onNotificationToolbarSelection(this);
+ }
+
+ public static interface NotificationToolbarSelectionEventHandler extends EventHandler {
+ void onNotificationToolbarSelection(NotificationToolbarSelectionEvent event);
+ }
+
+ public interface HasNotificationToolbarSelectionEventHandlers {
+ HandlerRegistration addNotificationToolbarSelectionEventHandler(NotificationToolbarSelectionEventHandler handler);
+ }
+}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
index f7b6f975d..07b30ce3d 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImpl.java
@@ -11,6 +11,11 @@
import org.iplantc.de.commons.client.ErrorHandler;
import org.iplantc.de.notifications.client.events.DeleteNotificationsUpdateEvent;
import org.iplantc.de.notifications.client.events.NotificationCountUpdateEvent;
+import org.iplantc.de.notifications.client.events.NotificationGridRefreshEvent;
+import org.iplantc.de.notifications.client.events.NotificationSelectionEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteAllClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarSelectionEvent;
import org.iplantc.de.notifications.client.gin.factory.NotificationViewFactory;
import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
import org.iplantc.de.notifications.client.views.NotificationToolbarView;
@@ -52,7 +57,12 @@
*
* @author sriram
*/
-public class NotificationPresenterImpl implements NotificationView.Presenter, NotificationToolbarView.Presenter {
+public class NotificationPresenterImpl implements NotificationView.Presenter,
+ NotificationGridRefreshEvent.NotificationGridRefreshEventHandler,
+ NotificationSelectionEvent.NotificationSelectionEventHandler,
+ NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler,
+ NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler,
+ NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler {
private final class NotificationServiceCallback extends NotificationCallback {
private final AsyncCallback> callback;
@@ -84,8 +94,8 @@ public void onSuccess(String result) {
messages.add(n.getMessage());
}
- callbackResult = new PagingLoadResultBean<>(messages, total,
- loadConfig.getOffset());
+ PagingLoadResult callbackResult =
+ new PagingLoadResultBean<>(messages, total, loadConfig.getOffset());
callback.onSuccess(callbackResult);
List hasIds = Lists.newArrayList();
@@ -112,7 +122,6 @@ public void onSuccess(String result1) {
private final ListStore listStore;
private final NotificationToolbarView toolbar;
private final NotificationView view;
- private PagingLoadResult callbackResult;
private NotificationView.NotificationViewAppearance appearance;
NotificationCategory currentCategory;
@Inject EventBus eventBus;
@@ -128,16 +137,32 @@ public NotificationPresenterImpl(final NotificationViewFactory viewFactory,
this.listStore = createListStore(messageProperties);
this.view = viewFactory.create(listStore);
currentCategory = NotificationCategory.ALL;
- toolbar.setPresenter(this);
+ this.toolbar = toolbar;
view.setNorthWidget(toolbar);
- this.view.setPresenter(this);
+
setRefreshButton(view.getRefreshButton());
- // set default cat
+ addEventHandlers();
+ }
+
+ private void addEventHandlers() {
+ view.addNotificationGridRefreshEventHandler(this);
+ view.addNotificationSelectionEventHandler(this);
+ toolbar.addNotificationToolbarDeleteAllClickedEventHandler(this);
+ toolbar.addNotificationToolbarDeleteClickedEventHandler(this);
+ toolbar.addNotificationToolbarSelectionEventHandler(this);
+ }
ListStore createListStore(NotificationMessageProperties messageProperties) {
return new ListStore<>(messageProperties.id());
}
+ @Override
+ public void onNotificationGridRefresh(NotificationGridRefreshEvent event) {
+ if (listStore.size() > 0) {
+ toolbar.setDeleteAllButtonEnabled(true);
+ } else {
+ toolbar.setDeleteAllButtonEnabled(false);
+ }
}
@Override
@@ -181,16 +206,11 @@ public void filterBy(NotificationCategory category) {
}
@Override
- public NotificationCategory getCurrentCategory() {
- return currentCategory;
- }
-
- @Override
- public void onGridRefresh() {
- if (view.getListStore().size() > 0) {
- toolbar.setDeleteAllButtonEnabled(true);
+ public void onNotificationSelection(NotificationSelectionEvent event) {
+ if (event.getNotifications() == null || event.getNotifications().size() == 0) {
+ toolbar.setDeleteButtonEnabled(false);
} else {
- toolbar.setDeleteAllButtonEnabled(false);
+ toolbar.setDeleteButtonEnabled(true);
}
}
@@ -200,8 +220,9 @@ public void go(HasOneWidget container) {
view.setLoader(initProxyLoader());
}
+
@Override
- public void onDeleteAllClicked() {
+ public void onNotificationToolbarDeleteAllClicked(NotificationToolbarDeleteAllClickedEvent event) {
view.mask();
messageServiceFacade.deleteAll(currentCategory, new AsyncCallback() {
@@ -219,11 +240,10 @@ public void onSuccess(String result) {
eventBus.fireEvent(event);
}
});
-
}
@Override
- public void onDeleteClicked() {
+ public void onNotificationToolbarDeleteClicked(NotificationToolbarDeleteClickedEvent event) {
final List notifications = view.getSelectedItems();
final Command callback = new Command() {
@Override
@@ -255,21 +275,11 @@ public void onSuccess(String result) {
}
});
}
-
}
@Override
- public void onFilterSelection(NotificationCategory cat) {
- filterBy(cat);
- }
-
- @Override
- public void onNotificationSelection(List items) {
- if (items == null || items.size() == 0) {
- toolbar.setDeleteButtonEnabled(false);
- } else {
- toolbar.setDeleteButtonEnabled(true);
- }
+ public void onNotificationToolbarSelection(NotificationToolbarSelectionEvent event) {
+ filterBy(event.getNotificationCategory());
}
@Override
@@ -279,6 +289,11 @@ public void setRefreshButton(TextButton refreshBtn) {
}
}
+ @Override
+ public NotificationCategory getCurrentCategory() {
+ return currentCategory;
+ }
+
private PagingLoader> initProxyLoader() {
RpcProxy> proxy = new RpcProxy>() {
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarView.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarView.java
index 09f3a2c07..ce9c05764 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarView.java
@@ -1,6 +1,9 @@
package org.iplantc.de.notifications.client.views;
import org.iplantc.de.client.models.notifications.NotificationCategory;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteAllClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarSelectionEvent;
import com.google.gwt.user.client.ui.IsWidget;
@@ -12,24 +15,15 @@
* @author sriram
*
*/
-public interface NotificationToolbarView extends IsWidget {
-
- public interface Presenter {
-
- void onFilterSelection(NotificationCategory cat);
-
- void onDeleteClicked();
-
- void onDeleteAllClicked();
-
- }
+public interface NotificationToolbarView extends IsWidget,
+ NotificationToolbarDeleteClickedEvent.HasNotificationToolbarDeleteClickedEventHandlers,
+ NotificationToolbarDeleteAllClickedEvent.HasNotificationToolbarDeleteAllClickedEventHandlers,
+ NotificationToolbarSelectionEvent.HasNotificationToolbarSelectionEventHandlers {
void setDeleteButtonEnabled(boolean enabled);
void setDeleteAllButtonEnabled(boolean enabled);
- void setPresenter(Presenter p);
-
void setRefreshButton(TextButton refreshBtn);
void setCurrentCategory(NotificationCategory category);
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
index 8b9697286..2edf32b58 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationToolbarViewImpl.java
@@ -4,10 +4,14 @@
package org.iplantc.de.notifications.client.views;
import org.iplantc.de.client.models.notifications.NotificationCategory;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteAllClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarSelectionEvent;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.logical.shared.SelectionEvent;
import com.google.gwt.event.logical.shared.SelectionHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
@@ -34,8 +38,6 @@ public class NotificationToolbarViewImpl extends Composite implements Notificati
interface NotificationToolbarUiBinder extends UiBinder {
}
- private Presenter presenter;
-
@UiField
TextButton btnDelete;
@@ -58,6 +60,24 @@ public NotificationToolbarViewImpl(NotificationView.NotificationViewAppearance a
initFilters();
}
+ @Override
+ public HandlerRegistration addNotificationToolbarDeleteAllClickedEventHandler(
+ NotificationToolbarDeleteAllClickedEvent.NotificationToolbarDeleteAllClickedEventHandler handler) {
+ return addHandler(handler, NotificationToolbarDeleteAllClickedEvent.TYPE);
+ }
+
+ @Override
+ public HandlerRegistration addNotificationToolbarDeleteClickedEventHandler(
+ NotificationToolbarDeleteClickedEvent.NotificationToolbarDeleteClickedEventHandler handler) {
+ return addHandler(handler, NotificationToolbarDeleteClickedEvent.TYPE);
+ }
+
+ @Override
+ public HandlerRegistration addNotificationToolbarSelectionEventHandler(
+ NotificationToolbarSelectionEvent.NotificationToolbarSelectionEventHandler handler) {
+ return addHandler(handler, NotificationToolbarSelectionEvent.TYPE);
+ }
+
private void initFilters() {
cboFilter.add(NotificationCategory.NEW);
cboFilter.add(NotificationCategory.ALL);
@@ -71,7 +91,7 @@ private void initFilters() {
cboFilter.addSelectionHandler(new SelectionHandler() {
@Override
public void onSelection(SelectionEvent event) {
- presenter.onFilterSelection(event.getSelectedItem());
+ fireEvent(new NotificationToolbarSelectionEvent(event.getSelectedItem()));
}
});
cboFilter.setEditable(false);
@@ -95,18 +115,12 @@ public void setDeleteAllButtonEnabled(boolean enabled) {
@UiHandler("btnDelete")
public void deleteClicked(SelectEvent event) {
- presenter.onDeleteClicked();
+ fireEvent(new NotificationToolbarDeleteClickedEvent());
}
@UiHandler("btnDeleteAll")
public void deleteAllClicked(SelectEvent event) {
- presenter.onDeleteAllClicked();
- }
-
- @Override
- public void setPresenter(Presenter p) {
- this.presenter = p;
-
+ fireEvent(new NotificationToolbarDeleteAllClickedEvent());
}
@Override
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
index 76d5cb157..8947237c4 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationView.java
@@ -2,6 +2,8 @@
import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.models.notifications.NotificationMessage;
+import org.iplantc.de.notifications.client.events.NotificationGridRefreshEvent;
+import org.iplantc.de.notifications.client.events.NotificationSelectionEvent;
import com.google.gwt.user.client.ui.IsWidget;
@@ -12,6 +14,9 @@
import java.util.List;
+public interface NotificationView extends IsWidget,
+ NotificationGridRefreshEvent.HasNotificationGridRefreshEventHandlers,
+ NotificationSelectionEvent.HasNotificationSelectionEventHandlers {
interface NotificationViewAppearance {
String notifications();
@@ -49,17 +54,9 @@ public interface Presenter extends org.iplantc.de.commons.client.presenter.Prese
*/
public FilterPagingLoadConfig buildDefaultLoadConfig();
- /**
- *
- *
- */
- public void onNotificationSelection(List items);
-
void setRefreshButton(TextButton refreshBtn);
NotificationCategory getCurrentCategory();
-
- void onGridRefresh();
}
/**
@@ -76,8 +73,6 @@ public interface Presenter extends org.iplantc.de.commons.client.presenter.Prese
*/
public List getSelectedItems();
- public void setPresenter(final Presenter presenter);
-
/**
* loads notifications using given laod conig
*
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
index 1d8897b2b..c518a465f 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/client/views/NotificationViewImpl.java
@@ -6,12 +6,15 @@
import org.iplantc.de.client.models.notifications.NotificationCategory;
import org.iplantc.de.client.models.notifications.NotificationMessage;
import org.iplantc.de.commons.client.widgets.DEPagingToolbar;
+import org.iplantc.de.notifications.client.events.NotificationGridRefreshEvent;
+import org.iplantc.de.notifications.client.events.NotificationSelectionEvent;
import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
import org.iplantc.de.notifications.client.views.cells.NotificationMessageCell;
import org.iplantc.de.resources.client.messages.I18N;
import com.google.gwt.cell.client.DateCell;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiFactory;
@@ -82,11 +85,22 @@ public NotificationViewImpl(@Assisted ListStore listStore,
addGridRefreshHandler();
}
+
+ @Override
+ public HandlerRegistration addNotificationGridRefreshEventHandler(NotificationGridRefreshEvent.NotificationGridRefreshEventHandler handler) {
+ return addHandler(handler, NotificationGridRefreshEvent.TYPE);
+ }
+
+ @Override
+ public HandlerRegistration addNotificationSelectionEventHandler(NotificationSelectionEvent.NotificationSelectionEventHandler handler) {
+ return addHandler(handler, NotificationSelectionEvent.TYPE);
+ }
+
private void addGridRefreshHandler() {
grid.addRefreshHandler(new RefreshEvent.RefreshHandler() {
@Override
public void onRefresh(RefreshEvent event) {
- presenter.onGridRefresh();
+ fireEvent(new NotificationGridRefreshEvent());
}
});
}
@@ -97,7 +111,7 @@ private void addGridSelectionHandler() {
@Override
public void onSelectionChanged(SelectionChangedEvent event) {
- presenter.onNotificationSelection(event.getSelection());
+ fireEvent(new NotificationSelectionEvent(event.getSelection()));
}
});
}
@@ -122,28 +136,6 @@ public List getSelectedItems() {
return grid.getSelectionModel().getSelectedItems();
}
- /*
- * (non-Javadoc)
- *
- * @see
- * org.iplantc.de.client.gxt3.views.NotificationView#setPresenter(org.iplantc.de.client.gxt3.views
- * .NotificationView.Presenter)
- */
- @Override
- public void setPresenter(Presenter presenter) {
- this.presenter = presenter;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.iplantc.de.client.gxt3.views.NotificationView#getListStore()
- */
- @Override
- public ListStore getListStore() {
- return listStore;
- }
-
@SuppressWarnings("unchecked")
@Override
public void loadNotifications(FilterPagingLoadConfig config) {
From 615028ed491f5f47411333713772f6344a07a848 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 11:20:16 -0700
Subject: [PATCH 053/183] CORE-6341 Refactor Notifications tests
---
.../NotificationPresenterImplTest.java | 50 +++++++++++++++----
1 file changed, 39 insertions(+), 11 deletions(-)
diff --git a/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
index 9afc5ee34..de1513ec8 100644
--- a/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
+++ b/ui/de-lib/src/test/java/org/iplantc/de/notifications/client/presenter/NotificationPresenterImplTest.java
@@ -11,6 +11,12 @@
import org.iplantc.de.client.models.notifications.NotificationMessage;
import org.iplantc.de.client.services.MessageServiceFacade;
import org.iplantc.de.notifications.client.events.DeleteNotificationsUpdateEvent;
+import org.iplantc.de.notifications.client.events.NotificationGridRefreshEvent;
+import org.iplantc.de.notifications.client.events.NotificationSelectionEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteAllClickedEvent;
+import org.iplantc.de.notifications.client.events.NotificationToolbarDeleteClickedEvent;
+import org.iplantc.de.notifications.client.gin.factory.NotificationViewFactory;
+import org.iplantc.de.notifications.client.model.NotificationMessageProperties;
import org.iplantc.de.notifications.client.views.NotificationToolbarView;
import org.iplantc.de.notifications.client.views.NotificationView;
@@ -37,7 +43,10 @@
@RunWith(GxtMockitoTestRunner.class)
public class NotificationPresenterImplTest {
+ @Mock NotificationViewFactory viewFactoryMock;
+ @Mock NotificationView.NotificationViewAppearance appearanceMock;
@Mock NotificationView viewMock;
+ @Mock NotificationMessageProperties messagePropertiesMock;
@Mock MessageServiceFacade messageServiceFacadeMock;
@Mock NotificationToolbarView toolbarViewMock;
@Mock EventBus eventBusMock;
@@ -53,59 +62,75 @@ public class NotificationPresenterImplTest {
@Before
public void setUp() {
+ when(viewFactoryMock.create(listStoreMock)).thenReturn(viewMock);
when(currentCategoryMock.toString()).thenReturn("sample");
when(viewMock.getCurrentLoadConfig()).thenReturn(mock(FilterPagingLoadConfig.class));
when(notificationMessageMock.getId()).thenReturn("id");
- uut = new NotificationPresenterImpl(viewMock);
-
+ uut = new NotificationPresenterImpl(viewFactoryMock,
+ appearanceMock,
+ toolbarViewMock,
+ messagePropertiesMock) {
+ @Override
+ ListStore createListStore(NotificationMessageProperties messageProperties) {
+ return listStoreMock;
+ }
+ };
uut.currentCategory = currentCategoryMock;
uut.messageServiceFacade = messageServiceFacadeMock;
- uut.toolbar = toolbarViewMock;
uut.eventBus = eventBusMock;
}
@Test
public void testOnNotificationGridRefresh_emptyListStore() {
+ NotificationGridRefreshEvent eventMock = mock(NotificationGridRefreshEvent.class);
when(listStoreMock.size()).thenReturn(0);
- when(viewMock.getListStore()).thenReturn(listStoreMock);
- uut.onGridRefresh();
+ uut.onNotificationGridRefresh(eventMock);
verify(toolbarViewMock).setDeleteAllButtonEnabled(eq(false));
}
@Test
public void testOnNotificationGridRefresh_nonEmptyListStore() {
+ NotificationGridRefreshEvent eventMock = mock(NotificationGridRefreshEvent.class);
when(listStoreMock.size()).thenReturn(5);
- when(viewMock.getListStore()).thenReturn(listStoreMock);
- uut.onGridRefresh();
+ uut.onNotificationGridRefresh(eventMock);
+
verify(toolbarViewMock).setDeleteAllButtonEnabled(eq(true));
}
@Test
public void testOnNotificationSelection_emptyListStore() {
+ NotificationSelectionEvent eventMock = mock(NotificationSelectionEvent.class);
+ when(eventMock.getNotifications()).thenReturn(listMock);
when(listMock.size()).thenReturn(0);
- uut.onNotificationSelection(listMock);
+ uut.onNotificationSelection(eventMock);
+
verify(toolbarViewMock).setDeleteButtonEnabled(eq(false));
}
@Test
public void testOnNotificationSelection_nonEmptyListStore() {
+ NotificationSelectionEvent eventMock = mock(NotificationSelectionEvent.class);
+ when(eventMock.getNotifications()).thenReturn(listMock);
when(listMock.size()).thenReturn(5);
- uut.onNotificationSelection(listMock);
+ uut.onNotificationSelection(eventMock);
+
verify(toolbarViewMock).setDeleteButtonEnabled(eq(true));
}
@Test
public void testOnNotificationToolbarDeleteAllClicked() {
- uut.onDeleteAllClicked();
+ NotificationToolbarDeleteAllClickedEvent eventMock = mock(NotificationToolbarDeleteAllClickedEvent.class);
+ uut.onNotificationToolbarDeleteAllClicked(eventMock);
verify(viewMock).mask();
verify(messageServiceFacadeMock).deleteAll(eq(currentCategoryMock), asyncCallbackStringCaptor.capture());
+
AsyncCallback asyncCallback = asyncCallbackStringCaptor.getValue();
asyncCallback.onSuccess("result");
@@ -117,6 +142,8 @@ public void testOnNotificationToolbarDeleteAllClicked() {
@Test
public void testOnNotificationToolbarDeleteClicked() {
+ NotificationToolbarDeleteClickedEvent eventMock = mock(NotificationToolbarDeleteClickedEvent.class);
+
when(listMock.isEmpty()).thenReturn(false);
when(listMock.size()).thenReturn(1);
when(iteratorMock.hasNext()).thenReturn(true, false);
@@ -124,7 +151,8 @@ public void testOnNotificationToolbarDeleteClicked() {
when(listMock.iterator()).thenReturn(iteratorMock);
when(viewMock.getSelectedItems()).thenReturn(listMock);
- uut.onDeleteClicked();
+ uut.onNotificationToolbarDeleteClicked(eventMock);
+
verify(messageServiceFacadeMock).deleteMessages(isA(JSONObject.class), asyncCallbackStringCaptor.capture());
From 52dd3530ba938bb713952ae93ab420f6d8b102a2 Mon Sep 17 00:00:00 2001
From: Ashley Ramsey
Date: Mon, 22 Feb 2016 13:22:58 -0700
Subject: [PATCH 054/183] CORE-6341 Add commons to Notifications GWT xml
---
.../java/org/iplantc/de/notifications/Notifications.gwt.xml | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/notifications/Notifications.gwt.xml b/ui/de-lib/src/main/java/org/iplantc/de/notifications/Notifications.gwt.xml
index 8b7195cab..72ee660a0 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/notifications/Notifications.gwt.xml
+++ b/ui/de-lib/src/main/java/org/iplantc/de/notifications/Notifications.gwt.xml
@@ -3,5 +3,7 @@
+
+
-
\ No newline at end of file
+
From 400b5fc10cc53c665e384c8300842fc2470c2259 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Wed, 24 Feb 2016 10:38:23 -0700
Subject: [PATCH 055/183] CORE-7445 display error when file upload fails when
uploading a file > 2G. Note: No specific error msg is displayed cos UI does
not receive one.
---
.../views/dialogs/SimpleFileUploadDialog.java | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/views/dialogs/SimpleFileUploadDialog.java b/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/views/dialogs/SimpleFileUploadDialog.java
index 5ca7c090c..85a4ac9bf 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/views/dialogs/SimpleFileUploadDialog.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/views/dialogs/SimpleFileUploadDialog.java
@@ -10,8 +10,10 @@
import org.iplantc.de.commons.client.info.IplantAnnouncer;
import org.iplantc.de.commons.client.validators.DiskResourceNameValidator;
import org.iplantc.de.commons.client.views.dialogs.IPlantDialog;
+import org.iplantc.de.commons.client.views.dialogs.IplantErrorDialog;
import org.iplantc.de.commons.client.widgets.IPCFileUploadField;
import org.iplantc.de.diskResource.client.events.FileUploadedEvent;
+import org.iplantc.de.resources.client.messages.I18N;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
@@ -253,12 +255,19 @@ void onSubmitComplete(SubmitCompleteEvent event) {
String results = Format.stripTags(results2);
Splittable split = StringQuoter.split(results);
IPCFileUploadField field = fufList.get(formList.indexOf(event.getSource()));
- if (split.isUndefined("file") || (split.get("file") == null)) {
- field.markInvalid(appearance.fileUploadsFailed(Lists.newArrayList(field.getValue())));
- IplantAnnouncer.getInstance().schedule(
- new ErrorAnnouncementConfig(appearance.fileUploadsFailed(Lists.newArrayList(field.getValue()))));
+ if (split == null) {
+ IplantAnnouncer.getInstance()
+ .schedule(new ErrorAnnouncementConfig(appearance.fileUploadsFailed(Lists.newArrayList(
+ field.getValue()))));
} else {
- eventBus.fireEvent(new FileUploadedEvent(uploadDest, field.getValue(), results));
+ if (split.isUndefined("file") || (split.get("file") == null)) {
+ field.markInvalid(appearance.fileUploadsFailed(Lists.newArrayList(field.getValue())));
+ IplantAnnouncer.getInstance()
+ .schedule(new ErrorAnnouncementConfig(appearance.fileUploadsFailed(Lists.newArrayList(
+ field.getValue()))));
+ } else {
+ eventBus.fireEvent(new FileUploadedEvent(uploadDest, field.getValue(), results));
+ }
}
if (submittedForms.size() == 0) {
From 7779ffe2994e8dad1a28a1402e74be1eea555257 Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Wed, 24 Feb 2016 14:06:12 -0700
Subject: [PATCH 056/183] CORE-7374 Add terrain.clients.ezid-test.
---
services/terrain/src/terrain/clients/ezid.clj | 2 +-
.../test/terrain/clients/ezid_test.clj | 105 ++++++++++++++++++
2 files changed, 106 insertions(+), 1 deletion(-)
create mode 100644 services/terrain/test/terrain/clients/ezid_test.clj
diff --git a/services/terrain/src/terrain/clients/ezid.clj b/services/terrain/src/terrain/clients/ezid.clj
index f79a03acb..50045cf69 100644
--- a/services/terrain/src/terrain/clients/ezid.clj
+++ b/services/terrain/src/terrain/clients/ezid.clj
@@ -1,4 +1,4 @@
-(ns ^{:author psarando} terrain.clients.ezid
+(ns terrain.clients.ezid
(:use [ring.util.http-response :only [charset]]
[slingshot.slingshot :only [try+ throw+]])
(:require [cemerick.url :as curl]
diff --git a/services/terrain/test/terrain/clients/ezid_test.clj b/services/terrain/test/terrain/clients/ezid_test.clj
new file mode 100644
index 000000000..216df57f2
--- /dev/null
+++ b/services/terrain/test/terrain/clients/ezid_test.clj
@@ -0,0 +1,105 @@
+(ns terrain.clients.ezid-test
+ (:use [clojure.test]
+ [terrain.clients.ezid]))
+
+;; Re-def private functions so they can be tested in this namespace.
+(def anvl-escape #'terrain.clients.ezid/anvl-escape)
+(def anvl-unescape #'terrain.clients.ezid/anvl-unescape)
+(def anvl-decode #'terrain.clients.ezid/anvl-decode)
+(def anvl-encode #'terrain.clients.ezid/anvl-encode)
+
+(deftest anvl-escape-test
+ (is (= (anvl-escape "Test % escape") "Test %25 escape")
+ "anvl-escape '%' character")
+ (is (= (anvl-escape "Test \n escape") "Test %0A escape")
+ "anvl-escape '\\n' character")
+ (is (= (anvl-escape "Test \r escape") "Test %0D escape")
+ "anvl-escape '\\r' character")
+ (is (= (anvl-escape "Test : escape") "Test %3A escape")
+ "anvl-escape ':' character")
+ (is (= (anvl-escape "% This \n is \r a : Test") "%25 This %0A is %0D a %3A Test")
+ "anvl-escape characters forwards")
+ (is (= (anvl-escape ": This \r is \n a % Test") "%3A This %0D is %0A a %25 Test")
+ "anvl-escape characters backwards")
+ (is (= (anvl-escape "%test: This \r\n is a %25 Test\n") "%25test%3A This %0D%0A is a %2525 Test%0A")
+ "anvl-escape mixed characters"))
+
+(deftest anvl-unescape-test
+ (is (= (anvl-unescape "Test %3A unescape") "Test : unescape")
+ "anvl-unescape ':' character")
+ (is (= (anvl-unescape "Test %0D unescape") "Test \r unescape")
+ "anvl-unescape '\\r' character")
+ (is (= (anvl-unescape "Test %0A unescape") "Test \n unescape")
+ "anvl-unescape '\\n' character")
+ (is (= (anvl-unescape "Test %25 unescape") "Test % unescape")
+ "anvl-unescape '%' character")
+ (is (= (anvl-unescape "%3A This %0D is %0A a %25 Test") ": This \r is \n a % Test")
+ "anvl-unescape characters forwards")
+ (is (= (anvl-unescape "%25 This %0A is %0D a %3A Test") "% This \n is \r a : Test")
+ "anvl-unescape characters backwards")
+ (is (= (anvl-unescape "%25test%3A This %0D%0A is a %2525 Test%0A") "%test: This \r\n is a %25 Test\n")
+ "anvl-unescape mixed characters"))
+
+(deftest anvl-decode-test
+ (is (= (anvl-decode "") {})
+ "anvl-decode Empty ANVL string")
+ (is (= (anvl-decode "Not an ANVL string") "Not an ANVL string")
+ "anvl-decode Not an ANVL string")
+ (is (= (anvl-decode ["Not" "a string"]) ["Not" "a string"])
+ "anvl-decode Not a string")
+ (is (= (anvl-decode {:not "a string"}) {:not "a string"})
+ "anvl-decode Not a string")
+ (is (= (anvl-decode "some: simple string") {:some "simple string"})
+ "anvl-decode 1 key with a simple string")
+ (is (= (anvl-decode "test: %3A unescape") {:test ": unescape"})
+ "anvl-decode 1 key with a ':' character")
+ (is (= (anvl-decode "test: %0D unescape") {:test "\r unescape"})
+ "anvl-decode 1 key with a '\\r' character")
+ (is (= (anvl-decode "test: %0A unescape") {:test "\n unescape"})
+ "anvl-decode 1 key with a '\\n' character")
+ (is (= (anvl-decode "test: %25 unescape") {:test "% unescape"})
+ "anvl-decode 1 key with a '%' character")
+ (is (= (anvl-decode
+ "test1: %25 unescape\ntest2: %0A unescape\ntest3: %0D unescape\ntest4: %3A unescape")
+ {:test1 "% unescape"
+ :test2 "\n unescape"
+ :test3 "\r unescape"
+ :test4 ": unescape"})
+ "anvl-decode 4 keys, 1 escaped character each")
+ (is (= (anvl-decode
+"test1: %3A This %0D is %0A a %25 Test
+test2: %25 This %0A is %0D a %3A Test
+test3: %25test%3A This %0D%0A is a %2525 Test%0A")
+ {:test1 ": This \r is \n a % Test"
+ :test2 "% This \n is \r a : Test"
+ :test3 "%test: This \r\n is a %25 Test\n"})
+ "anvl-decode 3 keys, mixed escaped characters"))
+
+(deftest anvl-encode-test
+ (is (= (anvl-encode {}) "")
+ "anvl-encode Empty ANVL string")
+ (is (= (anvl-encode {:some "simple string"}) "some: simple string")
+ "anvl-encode 1 key with a simple string")
+ (is (= (anvl-encode {:test "% unescape"}) "test: %25 unescape")
+ "anvl-encode 1 key with a '%' character")
+ (is (= (anvl-encode {:test "\n unescape"}) "test: %0A unescape")
+ "anvl-encode 1 key with a '\\n' character")
+ (is (= (anvl-encode {:test "\r unescape"}) "test: %0D unescape")
+ "anvl-encode 1 key with a '\\r' character")
+ (is (= (anvl-encode {:test ": unescape"}) "test: %3A unescape")
+ "anvl-encode 1 key with a ':' character")
+ (is (= (anvl-encode
+ {:test1 "% unescape"
+ :test2 "\n unescape"
+ :test3 "\r unescape"
+ :test4 ": unescape"})
+ "test1: %25 unescape\ntest2: %0A unescape\ntest3: %0D unescape\ntest4: %3A unescape")
+ "anvl-encode 4 keys, 1 escaped character each")
+ (is (= (anvl-encode
+ {:test1 ": This \r is \n a % Test"
+ :test2 "% This \n is \r a : Test"
+ :test3 "%test: This \r\n is a %25 Test\n"})
+"test1: %3A This %0D is %0A a %25 Test
+test2: %25 This %0A is %0D a %3A Test
+test3: %25test%3A This %0D%0A is a %2525 Test%0A")
+ "anvl-encode 3 keys, mixed escaped characters"))
From 3449d4a634e61f21aed192527a243a54baf6fac7 Mon Sep 17 00:00:00 2001
From: Sriram Srinivasan
Date: Wed, 24 Feb 2016 14:27:41 -0700
Subject: [PATCH 057/183] CORE-7519 fix error message details display.
---
.../presenter/PermanentIdRequestPresenter.java | 5 ++---
.../java/org/iplantc/de/commons/client/ErrorHandler.java | 8 ++++----
.../presenters/toolbar/ToolbarViewPresenterImpl.java | 7 ++-----
.../commons/error/ErrorHandlerDefaultAppearance.java | 4 ++--
4 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
index bbb31033e..eb45f00b4 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/admin/desktop/client/permIdRequest/presenter/PermanentIdRequestPresenter.java
@@ -11,6 +11,7 @@
import org.iplantc.de.client.models.identifiers.PermanentIdRequestList;
import org.iplantc.de.client.models.identifiers.PermanentIdRequestUpdate;
import org.iplantc.de.client.services.DiskResourceServiceFacade;
+import org.iplantc.de.commons.client.ErrorHandler;
import org.iplantc.de.commons.client.info.ErrorAnnouncementConfig;
import org.iplantc.de.commons.client.info.IplantAnnouncer;
import org.iplantc.de.commons.client.info.SuccessAnnouncementConfig;
@@ -175,9 +176,7 @@ public void onFailure(Throwable caught) {
loadPermIdRequests();
IplantAnnouncer.getInstance()
.schedule(new ErrorAnnouncementConfig(appearance.createPermIdFailure()));
- IplantErrorDialog ied =
- new IplantErrorDialog(I18N.DISPLAY.error(), caught.getMessage());
- ied.show();
+ ErrorHandler.post(appearance.createPermIdFailure(), caught);
}
@Override
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/commons/client/ErrorHandler.java b/ui/de-lib/src/main/java/org/iplantc/de/commons/client/ErrorHandler.java
index fd9a8dacc..baf8f97be 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/commons/client/ErrorHandler.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/commons/client/ErrorHandler.java
@@ -162,11 +162,11 @@ private static String parseExceptionJson(Throwable caught) {
}
if (jsonError != null) {
- String name = JsonUtil.getInstance().getString(jsonError, "name"); //$NON-NLS-1$
- String message = JsonUtil.getInstance().getString(jsonError, "message"); //$NON-NLS-1$
+ String error_code = JsonUtil.getInstance().getString(jsonError, "error_code"); //$NON-NLS-1$
+ String message = JsonUtil.getInstance().getString(jsonError, "reason"); //$NON-NLS-1$
- if (!message.isEmpty() || !name.isEmpty()) {
- exceptionMessage = appearance.errorReport(name, message);
+ if (!message.isEmpty() || !error_code.isEmpty()) {
+ exceptionMessage = appearance.errorReport(error_code, message);
}
}
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/presenters/toolbar/ToolbarViewPresenterImpl.java b/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/presenters/toolbar/ToolbarViewPresenterImpl.java
index d38c93fe8..4e5ba7199 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/presenters/toolbar/ToolbarViewPresenterImpl.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/diskResource/client/presenters/toolbar/ToolbarViewPresenterImpl.java
@@ -21,11 +21,11 @@
import org.iplantc.de.client.services.DiskResourceServiceFacade;
import org.iplantc.de.client.services.FileEditorServiceFacade;
import org.iplantc.de.client.services.PermIdRequestUserServiceFacade;
+import org.iplantc.de.commons.client.ErrorHandler;
import org.iplantc.de.commons.client.info.ErrorAnnouncementConfig;
import org.iplantc.de.commons.client.info.IplantAnnouncer;
import org.iplantc.de.commons.client.info.SuccessAnnouncementConfig;
import org.iplantc.de.commons.client.views.dialogs.IPlantDialog;
-import org.iplantc.de.commons.client.views.dialogs.IplantErrorDialog;
import org.iplantc.de.commons.client.views.window.configs.ConfigFactory;
import org.iplantc.de.commons.client.views.window.configs.FileViewerWindowConfig;
import org.iplantc.de.commons.client.views.window.configs.PathListWindowConfig;
@@ -47,7 +47,6 @@
import org.iplantc.de.diskResource.client.views.dialogs.CreateNcbiSraFolderStructureDialog;
import org.iplantc.de.diskResource.client.views.dialogs.GenomeSearchDialog;
import org.iplantc.de.diskResource.client.views.toolbar.dialogs.TabFileConfigDialog;
-import org.iplantc.de.resources.client.messages.I18N;
import com.google.common.base.Preconditions;
import com.google.gwt.user.client.rpc.AsyncCallback;
@@ -405,9 +404,7 @@ public void onDoiRequest(String uuid) {
public void onFailure(Throwable caught) {
IplantAnnouncer.getInstance()
.schedule(new ErrorAnnouncementConfig(appearance.doiRequestFail()));
- IplantErrorDialog iplantErrorDialog =
- new IplantErrorDialog(I18N.DISPLAY.error(), caught.getMessage());
- iplantErrorDialog.show();
+ ErrorHandler.post(appearance.doiRequestFail(),caught);
}
@Override
diff --git a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/commons/error/ErrorHandlerDefaultAppearance.java b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/commons/error/ErrorHandlerDefaultAppearance.java
index 3505a8e0c..585f1ddd6 100644
--- a/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/commons/error/ErrorHandlerDefaultAppearance.java
+++ b/ui/de-lib/src/main/java/org/iplantc/de/theme/base/client/commons/error/ErrorHandlerDefaultAppearance.java
@@ -34,8 +34,8 @@ public String error() {
}
@Override
- public String errorReport(String name, String message) {
- return errorStrings.errorReport(name, message);
+ public String errorReport(String err_code, String message) {
+ return errorStrings.errorReport(err_code, message);
}
@Override
From 5e7290e9fc302e88150dbd4caba3590e25399593 Mon Sep 17 00:00:00 2001
From: Paul Sarando
Date: Wed, 24 Feb 2016 15:08:12 -0700
Subject: [PATCH 058/183] CORE-7374 Add test2junit to terrain.
---
services/terrain/.gitignore | 2 ++
services/terrain/project.clj | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/services/terrain/.gitignore b/services/terrain/.gitignore
index 9e4e28ebd..b60c4834d 100644
--- a/services/terrain/.gitignore
+++ b/services/terrain/.gitignore
@@ -26,3 +26,5 @@
.env
.vagrant/
*.swp
+build.xml
+test2junit
diff --git a/services/terrain/project.clj b/services/terrain/project.clj
index 5d20fb22f..2616a37a0 100644
--- a/services/terrain/project.clj
+++ b/services/terrain/project.clj
@@ -43,7 +43,8 @@
[org.iplantc/heuristomancer "5.2.5.0"]
[org.iplantc/service-logging "5.2.5.0"]]
:plugins [[lein-ring "0.9.2" :exclusions [org.clojure/clojure]]
- [swank-clojure "1.4.2" :exclusions [org.clojure/clojure]]]
+ [swank-clojure "1.4.2" :exclusions [org.clojure/clojure]]
+ [test2junit "1.1.3"]]
:profiles {:dev {:resource-paths ["conf/test"]}
:uberjar {:aot :all}}
:main ^:skip-aot terrain.core
From c8948e1f9538a1ee29ce1d90181b83894735e4f0 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 14:14:03 -0700
Subject: [PATCH 059/183] CORE-3358: modified the POST /apps endpoint so that
it verifies that another app with the same name doesn't already exist in the
user's workspace
---
services/apps/src/apps/persistence/app_metadata.clj | 11 +++++++++++
services/apps/src/apps/service/apps/de/edit.clj | 5 +++--
.../apps/src/apps/service/apps/de/validation.clj | 12 ++++++++++--
3 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/services/apps/src/apps/persistence/app_metadata.clj b/services/apps/src/apps/persistence/app_metadata.clj
index f500bdf4f..ca9fe95f4 100644
--- a/services/apps/src/apps/persistence/app_metadata.clj
+++ b/services/apps/src/apps/persistence/app_metadata.clj
@@ -8,6 +8,7 @@
[apps.util.assertions]
[apps.util.conversions :only [remove-nil-vals]])
(:require [clojure.set :as set]
+ [clojure.string :as string]
[kameleon.app-listing :as app-listing]
[korma.core :as sql]
[apps.persistence.app-metadata.delete :as delete]
@@ -710,3 +711,13 @@
{:u.username username})
{:aca.app_id (uuidify app-id)
:l.id [not= (user-favorite-subselect :w.root_category_id faves-idx)]})))))
+
+(defn list-duplicate-apps
+ "List apps with the same name that exist in the same category as the new app."
+ [app-name category-ids]
+ (select [:apps :a]
+ (fields :a.id :a.name :a.description)
+ (join [:app_category_app :aca] {:a.id :aca.app_id})
+ (where {:aca.app_category_id [in category-ids]
+ (raw "trim(both from a.name)") (string/trim app-name)
+ :a.deleted false})))
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index 460b3b533..67e3d2cf0 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -8,7 +8,7 @@
[kameleon.entities]
[kameleon.uuids :only [uuidify]]
[apps.metadata.params :only [format-reference-genome-value]]
- [apps.service.apps.de.validation :only [verify-app-editable verify-app-permission]]
+ [apps.service.apps.de.validation :only [verify-app-editable verify-app-permission validate-app-name]]
[apps.util.config :only [workspace-dev-app-category-index]]
[apps.util.conversions :only [remove-nil-vals convert-rule-argument]]
[apps.validation :only [validate-parameter]]
@@ -384,7 +384,8 @@
(defn add-app
"This service will add a single-step App, including the information at its top level."
- [user {:keys [references groups] :as app}]
+ [{:keys [username] :as user} {app-name :name :keys [references groups] :as app}]
+ (validate-app-name app-name [(get-user-subcategory username (workspace-dev-app-category-index))])
(transaction
(let [app-id (:id (persistence/add-app app))
tool-id (->> app :tools first :id)
diff --git a/services/apps/src/apps/service/apps/de/validation.clj b/services/apps/src/apps/service/apps/de/validation.clj
index 6a7feaf7a..bf2dd9556 100644
--- a/services/apps/src/apps/service/apps/de/validation.clj
+++ b/services/apps/src/apps/service/apps/de/validation.clj
@@ -1,11 +1,11 @@
(ns apps.service.apps.de.validation
- (:use [clojure-commons.exception-util :only [forbidden]]
+ (:use [clojure-commons.exception-util :only [forbidden exists]]
[slingshot.slingshot :only [try+ throw+]]
[korma.core :exclude [update]]
[kameleon.core]
[kameleon.entities]
[kameleon.queries :only [parameter-types-for-tool-type]]
- [apps.persistence.app-metadata :only [get-app]])
+ [apps.persistence.app-metadata :only [get-app list-duplicate-apps]])
(:require [apps.service.apps.de.permissions :as perms]
[clojure.string :as string]))
@@ -137,3 +137,11 @@
[user app]
(verify-app-permission user app "write")
(verify-app-not-public app))
+
+(defn validate-app-name
+ "Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
+ category is treated as an exception because it's intended to be a staging area for new apps."
+ [app-name category-ids]
+ (when (seq (list-duplicate-apps app-name category-ids))
+ (exists "An app with the same name already exists in one of the same categories."
+ :app_name app-name :category_ids category-ids)))
From 748efbf2648feac1910d636fcfdf59fa5634ef84 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 14:32:35 -0700
Subject: [PATCH 060/183] CORE-3358: changed the types of two configuration
parameters to UUID
---
services/apps/src/apps/service/apps/de/admin.clj | 5 ++---
services/apps/src/apps/service/apps/de/metadata.clj | 3 +--
services/apps/src/apps/util/config.clj | 4 ++--
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/services/apps/src/apps/service/apps/de/admin.clj b/services/apps/src/apps/service/apps/de/admin.clj
index 3efb4106c..f9b98027d 100644
--- a/services/apps/src/apps/service/apps/de/admin.clj
+++ b/services/apps/src/apps/service/apps/de/admin.clj
@@ -1,6 +1,5 @@
(ns apps.service.apps.de.admin
- (:use [kameleon.uuids :only [uuidify]]
- [korma.db :only [transaction]]
+ (:use [korma.db :only [transaction]]
[apps.persistence.app-metadata.relabel :only [update-app-labels]]
[apps.util.assertions :only [assert-not-nil]]
[apps.util.config :only [workspace-public-id]]
@@ -106,7 +105,7 @@
(validate-subcategory-name parent_id name)
(validate-category-empty parent_id)
(transaction
- (let [category-id (:id (app-groups/create-app-group (uuidify (workspace-public-id)) category))]
+ (let [category-id (:id (app-groups/create-app-group (workspace-public-id) category))]
(app-groups/add-subgroup parent_id category-id)
category-id)))
diff --git a/services/apps/src/apps/service/apps/de/metadata.clj b/services/apps/src/apps/service/apps/de/metadata.clj
index 7c8b71129..8b76ea7c6 100644
--- a/services/apps/src/apps/service/apps/de/metadata.clj
+++ b/services/apps/src/apps/service/apps/de/metadata.clj
@@ -6,7 +6,6 @@
decategorize-app
get-app-subcategory-id
remove-app-from-category]]
- [kameleon.uuids :only [uuidify]]
[apps.service.apps.de.validation :only [app-publishable? verify-app-permission]]
[apps.util.config :only [workspace-beta-app-category-id
workspace-favorites-app-category-index]]
@@ -146,7 +145,7 @@
(amp/set-app-references app-id references)
(amp/set-app-suggested-categories app-id categories)
(decategorize-app app-id)
- (add-app-to-category app-id (uuidify (workspace-beta-app-category-id)))
+ (add-app-to-category app-id (workspace-beta-app-category-id))
(iplant-groups/make-app-public app-id))
nil)
diff --git a/services/apps/src/apps/util/config.clj b/services/apps/src/apps/util/config.clj
index 98048e0c7..d6a3c83e1 100644
--- a/services/apps/src/apps/util/config.clj
+++ b/services/apps/src/apps/util/config.clj
@@ -115,12 +115,12 @@
[props config-valid configs]
"apps.workspace.favorites-app-category-index")
-(cc/defprop-str workspace-beta-app-category-id
+(cc/defprop-uuid workspace-beta-app-category-id
"The UUID of the default Beta app category."
[props config-valid configs]
"apps.workspace.beta-app-category-id")
-(cc/defprop-str workspace-public-id
+(cc/defprop-uuid workspace-public-id
"The UUID of the default Beta app category."
[props config-valid configs]
"apps.workspace.public-id")
From 2bcf29df598cb741b93cfdb941dedaee072dfa71 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 16:00:38 -0700
Subject: [PATCH 061/183] CORE-3358: updated the PATCH /apps/:app-id endpoint
to check for duplicate app names
---
.../src/apps/persistence/app_metadata.clj | 25 ++++++++++++++-----
.../apps/src/apps/service/apps/de/edit.clj | 5 ++--
.../src/apps/service/apps/de/validation.clj | 12 ++++++---
3 files changed, 30 insertions(+), 12 deletions(-)
diff --git a/services/apps/src/apps/persistence/app_metadata.clj b/services/apps/src/apps/persistence/app_metadata.clj
index ca9fe95f4..75266e00a 100644
--- a/services/apps/src/apps/persistence/app_metadata.clj
+++ b/services/apps/src/apps/persistence/app_metadata.clj
@@ -712,12 +712,25 @@
{:aca.app_id (uuidify app-id)
:l.id [not= (user-favorite-subselect :w.root_category_id faves-idx)]})))))
-(defn list-duplicate-apps
- "List apps with the same name that exist in the same category as the new app."
- [app-name category-ids]
+(defn- list-duplicate-apps*
+ [app-name category-id-set]
(select [:apps :a]
(fields :a.id :a.name :a.description)
(join [:app_category_app :aca] {:a.id :aca.app_id})
- (where {:aca.app_category_id [in category-ids]
- (raw "trim(both from a.name)") (string/trim app-name)
- :a.deleted false})))
+ (where {(raw "trim(both from a.name)") (string/trim app-name)
+ :a.deleted false
+ :aca.app_category_id [in category-id-set]})))
+
+(defn- app-category-id-subselect
+ [app-id beta-app-category-id]
+ (subselect :app_category_app
+ (fields :app_category_id)
+ (where {:app_id app-id
+ :app_category_id [not= beta-app-category-id]})))
+
+(defn list-duplicate-apps
+ "List apps with the same name that exist in the same category as the new app."
+ ([app-name category-ids]
+ (list-duplicate-apps* app-name category-ids))
+ ([app-name app-id beta-app-category-id]
+ (list-duplicate-apps* app-name (app-category-id-subselect app-id beta-app-category-id))))
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index 67e3d2cf0..9eb983a3a 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -9,7 +9,7 @@
[kameleon.uuids :only [uuidify]]
[apps.metadata.params :only [format-reference-genome-value]]
[apps.service.apps.de.validation :only [verify-app-editable verify-app-permission validate-app-name]]
- [apps.util.config :only [workspace-dev-app-category-index]]
+ [apps.util.config :only [workspace-dev-app-category-index workspace-beta-app-category-id]]
[apps.util.conversions :only [remove-nil-vals convert-rule-argument]]
[apps.validation :only [validate-parameter]]
[apps.workspace :only [get-workspace]]
@@ -459,7 +459,8 @@
(defn relabel-app
"This service allows labels to be updated in any app, whether or not the app has been submitted
for public use."
- [user {app-id :id :as body}]
+ [user {app-name :name app-id :id :as body}]
+ (validate-app-name app-name app-id (workspace-beta-app-category-id))
(let [app (persistence/get-app app-id)]
(when-not (user-owns-app? user app)
(verify-app-permission user app "write")))
diff --git a/services/apps/src/apps/service/apps/de/validation.clj b/services/apps/src/apps/service/apps/de/validation.clj
index bf2dd9556..6eab93868 100644
--- a/services/apps/src/apps/service/apps/de/validation.clj
+++ b/services/apps/src/apps/service/apps/de/validation.clj
@@ -141,7 +141,11 @@
(defn validate-app-name
"Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
category is treated as an exception because it's intended to be a staging area for new apps."
- [app-name category-ids]
- (when (seq (list-duplicate-apps app-name category-ids))
- (exists "An app with the same name already exists in one of the same categories."
- :app_name app-name :category_ids category-ids)))
+ ([app-name category-ids]
+ (when (seq (list-duplicate-apps app-name category-ids))
+ (exists "An app with the same name already exists in one of the selected categories."
+ :app_name app-name :category_ids category-ids)))
+ ([app-name app-id beta-category-id]
+ (when (seq (list-duplicate-apps app-name app-id beta-category-id))
+ (exists "An app with the same name already exists in one of the same categories."
+ :app_name app-name :app_id app-id))))
From 7d8a58a006c86d4d4be46f471726e1156566b676 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 16:43:00 -0700
Subject: [PATCH 062/183] CORE-3358: modified the PUT /apps/:app-id endpoint to
check for duplicate app names
---
services/apps/src/apps/service/apps/de/edit.clj | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index 9eb983a3a..3567be3c6 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -347,8 +347,9 @@
(defn update-app
"This service will update a single-step App, including the information at its top level and the
tool used by its single task, as long as the App has not been submitted for public use."
- [user {app-id :id :keys [references groups] :as app}]
+ [user {app-id :id app-name :name :keys [references groups] :as app}]
(verify-app-editable user (persistence/get-app app-id))
+ (validate-app-name app-name app-id (workspace-beta-app-category-id))
(transaction
(persistence/update-app app)
(let [tool-id (->> app :tools first :id)
From 883c6894286bf37e386256d7ca5a3c871e81cb98 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 17:40:52 -0700
Subject: [PATCH 063/183] CORE-3358: modified the POST /admin/apps/categories
endpoint to check for duplicate names
---
.../src/apps/persistence/app_metadata.clj | 8 ++++++++
.../apps/service/apps/de/categorization.clj | 13 +++++++++++--
.../src/apps/service/apps/de/validation.clj | 19 +++++++++++++++----
3 files changed, 34 insertions(+), 6 deletions(-)
diff --git a/services/apps/src/apps/persistence/app_metadata.clj b/services/apps/src/apps/persistence/app_metadata.clj
index 75266e00a..0f0504c27 100644
--- a/services/apps/src/apps/persistence/app_metadata.clj
+++ b/services/apps/src/apps/persistence/app_metadata.clj
@@ -692,6 +692,14 @@
(map (juxt :id :name))
(into {})))
+(defn get-app-name
+ [app-id]
+ (->> (select :apps
+ (fields :name)
+ (where {:id (uuidify app-id)}))
+ first
+ :name))
+
(defn- user-favorite-subselect
[root-category-field faves-idx]
(subselect [:app_category_group :acg]
diff --git a/services/apps/src/apps/service/apps/de/categorization.clj b/services/apps/src/apps/service/apps/de/categorization.clj
index 109313d34..1635c6490 100644
--- a/services/apps/src/apps/service/apps/de/categorization.clj
+++ b/services/apps/src/apps/service/apps/de/categorization.clj
@@ -4,7 +4,9 @@
[kameleon.app-groups]
[kameleon.entities]
[apps.validation]
- [slingshot.slingshot :only [throw+]]))
+ [slingshot.slingshot :only [throw+]])
+ (:require [apps.persistence.app-metadata :as ap]
+ [apps.service.apps.de.validation :as av]))
(defn- categorize-app
"Associates an app with an app category."
@@ -48,11 +50,18 @@
:path path}))
(dorun (map (partial validate-category-id path) category-ids)))
+(defn- validate-app-name
+ "Validates the app name to ensure that there are no apps with the same name in any of the
+ destination categories."
+ [app-id category-ids path]
+ (av/validate-app-name-with-path (ap/get-app-name app-id) category-ids path))
+
(defn- validate-category
"Validates each categorized app in the request."
[{app-id :app_id category-ids :category_ids :as category} path]
(validate-app-info app-id path)
- (validate-category-ids category-ids path))
+ (validate-category-ids category-ids path)
+ (validate-app-name app-id category-ids path))
(defn- validate-request-body
"Validates the request body."
diff --git a/services/apps/src/apps/service/apps/de/validation.clj b/services/apps/src/apps/service/apps/de/validation.clj
index 6eab93868..6d2cd61b9 100644
--- a/services/apps/src/apps/service/apps/de/validation.clj
+++ b/services/apps/src/apps/service/apps/de/validation.clj
@@ -138,14 +138,25 @@
(verify-app-permission user app "write")
(verify-app-not-public app))
+(def ^:private duplicate-app-selected-categories-msg
+ "An app with the same name already exists in one of the selected categories.")
+
+(def ^:private duplicate-app-existing-categories-msg
+ "An app with the same name already exists in one of the same categories.")
+
(defn validate-app-name
"Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
category is treated as an exception because it's intended to be a staging area for new apps."
([app-name category-ids]
(when (seq (list-duplicate-apps app-name category-ids))
- (exists "An app with the same name already exists in one of the selected categories."
- :app_name app-name :category_ids category-ids)))
+ (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids)))
([app-name app-id beta-category-id]
(when (seq (list-duplicate-apps app-name app-id beta-category-id))
- (exists "An app with the same name already exists in one of the same categories."
- :app_name app-name :app_id app-id))))
+ (exists duplicate-app-existing-categories-msg :app_name app-name :app_id app-id))))
+
+(defn validate-app-name-with-path
+ "Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
+ category is treated as an exception because it's intended to be a staging area for new apps."
+ [app-name category-ids path]
+ (when (seq (list-duplicate-apps app-name category-ids))
+ (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids :path path)))
From e7f2e04aca4b63f1c83088ba0868a0aca0874a1e Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 18:12:30 -0700
Subject: [PATCH 064/183] CORE-3358: modified the PATCH /admin/apps/:app-id
endpoint to check for duplicate app names
---
services/apps/src/apps/service/apps/de/admin.clj | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/services/apps/src/apps/service/apps/de/admin.clj b/services/apps/src/apps/service/apps/de/admin.clj
index f9b98027d..04bb62e71 100644
--- a/services/apps/src/apps/service/apps/de/admin.clj
+++ b/services/apps/src/apps/service/apps/de/admin.clj
@@ -2,11 +2,12 @@
(:use [korma.db :only [transaction]]
[apps.persistence.app-metadata.relabel :only [update-app-labels]]
[apps.util.assertions :only [assert-not-nil]]
- [apps.util.config :only [workspace-public-id]]
+ [apps.util.config :only [workspace-public-id workspace-beta-app-category-id]]
[slingshot.slingshot :only [throw+]])
(:require [clojure.tools.logging :as log]
[kameleon.app-groups :as app-groups]
- [apps.persistence.app-metadata :as persistence]))
+ [apps.persistence.app-metadata :as persistence]
+ [apps.service.apps.de.validation :as av]))
(def ^:private max-app-category-name-len 255)
@@ -90,8 +91,10 @@
(defn update-app
"This service updates high-level details and labels in an App, and can mark or unmark the app as
deleted or disabled in the database."
- [{app-id :id :as app}]
+ [{app-name :name app-id :id :as app}]
(validate-app-existence app-id)
+ (when-not (nil? app-name)
+ (av/validate-app-name app-name app-id (workspace-beta-app-category-id)))
(transaction
(if (empty? (select-keys app [:name :description :wiki_url :references :groups]))
(update-app-deleted-disabled app)
From 8cfb90aa454673a1d9cc73c74f14eb2db96ceb7e Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Wed, 24 Feb 2016 19:02:30 -0700
Subject: [PATCH 065/183] CORE-3358: fixed a bug that prevented apps from being
updated when their names were not changed
---
.../src/apps/persistence/app_metadata.clj | 14 ++++++-----
.../apps/service/apps/de/categorization.clj | 5 ++--
.../apps/src/apps/service/apps/de/edit.clj | 5 ++--
.../src/apps/service/apps/de/validation.clj | 25 +++++++++----------
4 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/services/apps/src/apps/persistence/app_metadata.clj b/services/apps/src/apps/persistence/app_metadata.clj
index 0f0504c27..bf9f9f416 100644
--- a/services/apps/src/apps/persistence/app_metadata.clj
+++ b/services/apps/src/apps/persistence/app_metadata.clj
@@ -721,13 +721,14 @@
:l.id [not= (user-favorite-subselect :w.root_category_id faves-idx)]})))))
(defn- list-duplicate-apps*
- [app-name category-id-set]
+ [app-name app-id category-id-set]
(select [:apps :a]
(fields :a.id :a.name :a.description)
(join [:app_category_app :aca] {:a.id :aca.app_id})
(where {(raw "trim(both from a.name)") (string/trim app-name)
:a.deleted false
- :aca.app_category_id [in category-id-set]})))
+ :aca.app_category_id [in category-id-set]
+ :a.id [not= app-id]})))
(defn- app-category-id-subselect
[app-id beta-app-category-id]
@@ -738,7 +739,8 @@
(defn list-duplicate-apps
"List apps with the same name that exist in the same category as the new app."
- ([app-name category-ids]
- (list-duplicate-apps* app-name category-ids))
- ([app-name app-id beta-app-category-id]
- (list-duplicate-apps* app-name (app-category-id-subselect app-id beta-app-category-id))))
+ [app-name app-id beta-app-category-id category-ids]
+ (->> (if (seq category-ids)
+ (remove (partial = beta-app-category-id) category-ids)
+ (app-category-id-subselect app-id beta-app-category-id))
+ (list-duplicate-apps* app-name app-id)))
diff --git a/services/apps/src/apps/service/apps/de/categorization.clj b/services/apps/src/apps/service/apps/de/categorization.clj
index 1635c6490..a520180e6 100644
--- a/services/apps/src/apps/service/apps/de/categorization.clj
+++ b/services/apps/src/apps/service/apps/de/categorization.clj
@@ -6,7 +6,8 @@
[apps.validation]
[slingshot.slingshot :only [throw+]])
(:require [apps.persistence.app-metadata :as ap]
- [apps.service.apps.de.validation :as av]))
+ [apps.service.apps.de.validation :as av]
+ [apps.util.config :as cfg]))
(defn- categorize-app
"Associates an app with an app category."
@@ -54,7 +55,7 @@
"Validates the app name to ensure that there are no apps with the same name in any of the
destination categories."
[app-id category-ids path]
- (av/validate-app-name-with-path (ap/get-app-name app-id) category-ids path))
+ (av/validate-app-name (ap/get-app-name app-id) app-id (cfg/workspace-beta-app-category-id) category-ids path))
(defn- validate-category
"Validates each categorized app in the request."
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index 3567be3c6..d84e7224c 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -386,9 +386,10 @@
(defn add-app
"This service will add a single-step App, including the information at its top level."
[{:keys [username] :as user} {app-name :name :keys [references groups] :as app}]
- (validate-app-name app-name [(get-user-subcategory username (workspace-dev-app-category-index))])
(transaction
- (let [app-id (:id (persistence/add-app app))
+ (let [cat-id (get-user-subcategory username (workspace-dev-app-category-index))
+ _ (validate-app-name app-name nil (workspace-beta-app-category-id) [cat-id])
+ app-id (:id (persistence/add-app app))
tool-id (->> app :tools first :id)
task-id (-> (assoc app :id app-id :tool_id tool-id)
(add-single-step-task)
diff --git a/services/apps/src/apps/service/apps/de/validation.clj b/services/apps/src/apps/service/apps/de/validation.clj
index 6d2cd61b9..e9e511d4e 100644
--- a/services/apps/src/apps/service/apps/de/validation.clj
+++ b/services/apps/src/apps/service/apps/de/validation.clj
@@ -147,16 +147,15 @@
(defn validate-app-name
"Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
category is treated as an exception because it's intended to be a staging area for new apps."
- ([app-name category-ids]
- (when (seq (list-duplicate-apps app-name category-ids))
- (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids)))
- ([app-name app-id beta-category-id]
- (when (seq (list-duplicate-apps app-name app-id beta-category-id))
- (exists duplicate-app-existing-categories-msg :app_name app-name :app_id app-id))))
-
-(defn validate-app-name-with-path
- "Verifies that an app with the same name doesn't already exist in any of the same app categories. The beta
- category is treated as an exception because it's intended to be a staging area for new apps."
- [app-name category-ids path]
- (when (seq (list-duplicate-apps app-name category-ids))
- (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids :path path)))
+ ([app-name app-id beta-app-category-id]
+ (validate-app-name app-name app-id beta-app-category-id nil))
+ ([app-name app-id beta-app-category-id category-ids]
+ (when (seq (list-duplicate-apps app-name app-id beta-app-category-id category-ids))
+ (if (seq category-ids)
+ (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids)
+ (exists duplicate-app-existing-categories-msg :app_name app-name :app_id app-id))))
+ ([app-name app-id beta-app-category-id category-ids path]
+ (when (seq (list-duplicate-apps app-name app-id beta-app-category-id category-ids))
+ (if (seq category-ids)
+ (exists duplicate-app-selected-categories-msg :app_name app-name :category_ids category-ids :path path)
+ (exists duplicate-app-existing-categories-msg :app_name app-name :app_id app-id :path path)))))
From bf0b06c497d6f94b926ab944d10bf7496dadc486 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Thu, 25 Feb 2016 13:49:23 -0700
Subject: [PATCH 066/183] CORE-3358: implemented some code review suggestsions
---
libs/kameleon/src/kameleon/util.clj | 7 +++++++
services/apps/src/apps/persistence/app_metadata.clj | 9 +++++----
services/apps/src/apps/service/apps/de/admin.clj | 6 +++---
3 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/libs/kameleon/src/kameleon/util.clj b/libs/kameleon/src/kameleon/util.clj
index 0662e9d91..250e00bb5 100644
--- a/libs/kameleon/src/kameleon/util.clj
+++ b/libs/kameleon/src/kameleon/util.clj
@@ -6,3 +6,10 @@
[desc query]
(log/debug desc (sql-only (select query)))
query)
+
+(defn normalize-string
+ "Normalizes a string for use in comparisons. Comparisons in which this function is used on both sides will be
+ case-insensitive with leading and trailing whitespace removed and consecutive whitespace collapsed to a single
+ space."
+ [s]
+ (sqlfn lower (sqlfn regexp_replace (sqlfn trim s) "\\s+" " ")))
diff --git a/services/apps/src/apps/persistence/app_metadata.clj b/services/apps/src/apps/persistence/app_metadata.clj
index bf9f9f416..7c18c468b 100644
--- a/services/apps/src/apps/persistence/app_metadata.clj
+++ b/services/apps/src/apps/persistence/app_metadata.clj
@@ -1,6 +1,7 @@
(ns apps.persistence.app-metadata
"Persistence layer for app metadata."
(:use [kameleon.entities]
+ [kameleon.util :only [normalize-string]]
[kameleon.uuids :only [uuidify]]
[korma.core :exclude [update]]
[korma.db :only [transaction]]
@@ -725,10 +726,10 @@
(select [:apps :a]
(fields :a.id :a.name :a.description)
(join [:app_category_app :aca] {:a.id :aca.app_id})
- (where {(raw "trim(both from a.name)") (string/trim app-name)
- :a.deleted false
- :aca.app_category_id [in category-id-set]
- :a.id [not= app-id]})))
+ (where {(normalize-string :a.name) (normalize-string app-name)
+ :a.deleted false
+ :aca.app_category_id [in category-id-set]
+ :a.id [not= app-id]})))
(defn- app-category-id-subselect
[app-id beta-app-category-id]
diff --git a/services/apps/src/apps/service/apps/de/admin.clj b/services/apps/src/apps/service/apps/de/admin.clj
index 04bb62e71..39c6a5839 100644
--- a/services/apps/src/apps/service/apps/de/admin.clj
+++ b/services/apps/src/apps/service/apps/de/admin.clj
@@ -92,10 +92,10 @@
"This service updates high-level details and labels in an App, and can mark or unmark the app as
deleted or disabled in the database."
[{app-name :name app-id :id :as app}]
- (validate-app-existence app-id)
- (when-not (nil? app-name)
- (av/validate-app-name app-name app-id (workspace-beta-app-category-id)))
(transaction
+ (validate-app-existence app-id)
+ (when-not (nil? app-name)
+ (av/validate-app-name app-name app-id (workspace-beta-app-category-id)))
(if (empty? (select-keys app [:name :description :wiki_url :references :groups]))
(update-app-deleted-disabled app)
(update-app-details app))))
From 7fff047943c332a57c4ea8e4894c0a806fab01f1 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Thu, 25 Feb 2016 15:29:15 -0700
Subject: [PATCH 067/183] CORE-3358: fixed a couple of potential race
conditions
---
services/apps/src/apps/service/apps/de/categorization.clj | 5 +++--
services/apps/src/apps/service/apps/de/edit.clj | 4 ++--
2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/services/apps/src/apps/service/apps/de/categorization.clj b/services/apps/src/apps/service/apps/de/categorization.clj
index a520180e6..ffa53a17d 100644
--- a/services/apps/src/apps/service/apps/de/categorization.clj
+++ b/services/apps/src/apps/service/apps/de/categorization.clj
@@ -73,5 +73,6 @@
(defn categorize-apps
"A service that categorizes one or more apps in the database."
[{:keys [categories] :as body}]
- (validate-request-body body)
- (transaction (dorun (map categorize-app categories))))
+ (transaction
+ (validate-request-body body)
+ (dorun (map categorize-app categories))))
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index d84e7224c..e45076bc6 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -349,8 +349,8 @@
tool used by its single task, as long as the App has not been submitted for public use."
[user {app-id :id app-name :name :keys [references groups] :as app}]
(verify-app-editable user (persistence/get-app app-id))
- (validate-app-name app-name app-id (workspace-beta-app-category-id))
(transaction
+ (validate-app-name app-name app-id (workspace-beta-app-category-id))
(persistence/update-app app)
(let [tool-id (->> app :tools first :id)
app-task (->> (get-app-details app-id) :tasks first)
@@ -462,8 +462,8 @@
"This service allows labels to be updated in any app, whether or not the app has been submitted
for public use."
[user {app-name :name app-id :id :as body}]
- (validate-app-name app-name app-id (workspace-beta-app-category-id))
(let [app (persistence/get-app app-id)]
+ (validate-app-name app-name app-id (workspace-beta-app-category-id))
(when-not (user-owns-app? user app)
(verify-app-permission user app "write")))
(transaction (persistence/update-app-labels body))
From 50e1f105e2fab77b2b0d064bad11d15f91c34406 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Thu, 25 Feb 2016 15:49:32 -0700
Subject: [PATCH 068/183] CORE-3358: fixed yet another editing bug
---
services/apps/src/apps/service/apps/de/edit.clj | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/services/apps/src/apps/service/apps/de/edit.clj b/services/apps/src/apps/service/apps/de/edit.clj
index e45076bc6..23c55ee8b 100644
--- a/services/apps/src/apps/service/apps/de/edit.clj
+++ b/services/apps/src/apps/service/apps/de/edit.clj
@@ -463,8 +463,9 @@
for public use."
[user {app-name :name app-id :id :as body}]
(let [app (persistence/get-app app-id)]
- (validate-app-name app-name app-id (workspace-beta-app-category-id))
(when-not (user-owns-app? user app)
(verify-app-permission user app "write")))
- (transaction (persistence/update-app-labels body))
+ (transaction
+ (validate-app-name app-name app-id (workspace-beta-app-category-id))
+ (persistence/update-app-labels body))
(get-app-ui user app-id))
From de1cd7914fba8acd4cef68b191cc37c94902c3ed Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Thu, 25 Feb 2016 17:44:20 -0700
Subject: [PATCH 069/183] CORE-7180: A partial implementation of using Agave
app search for the analysis listing endpoints. This still needs to be tested
---
libs/mescal/src/mescal/agave_de_v2.clj | 6 ++++--
.../src/mescal/agave_de_v2/app_listings.clj | 17 ++++++++++-------
libs/mescal/src/mescal/agave_v2.clj | 9 ++++++---
libs/mescal/src/mescal/core.clj | 5 ++++-
libs/mescal/src/mescal/de.clj | 4 +++-
services/apps/src/apps/service/apps/agave.clj | 8 ++++----
.../src/apps/service/apps/agave/listings.clj | 2 +-
7 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/libs/mescal/src/mescal/agave_de_v2.clj b/libs/mescal/src/mescal/agave_de_v2.clj
index c6d2ce70c..f281780a3 100644
--- a/libs/mescal/src/mescal/agave_de_v2.clj
+++ b/libs/mescal/src/mescal/agave_de_v2.clj
@@ -14,8 +14,10 @@
(into {} (map (juxt :id :status) (.listSystems agave))))
(defn list-apps
- [agave jobs-enabled?]
- (app-listings/list-apps agave (get-system-statuses agave) jobs-enabled?))
+ ([agave jobs-enabled?]
+ (app-listings/list-apps agave (get-system-statuses agave) jobs-enabled?))
+ ([agave jbos-enabled? app-ids]
+ (app-listings/list-apps agave (get-system-statuses agave) jobs-enabled? app-ids)))
(defn- app-matches?
[search-term app]
diff --git a/libs/mescal/src/mescal/agave_de_v2/app_listings.clj b/libs/mescal/src/mescal/agave_de_v2/app_listings.clj
index ada030b46..c9366a278 100644
--- a/libs/mescal/src/mescal/agave_de_v2/app_listings.clj
+++ b/libs/mescal/src/mescal/agave_de_v2/app_listings.clj
@@ -38,11 +38,14 @@
:permission "read"
:wiki_url ""}))
+(defn- format-app-listing-response
+ [listing statuses jobs-enabled?]
+ (assoc (hpc-app-group)
+ :apps (map (partial format-app-listing statuses jobs-enabled?) listing)
+ :app_count (count listing)))
+
(defn list-apps
- [agave statuses jobs-enabled?]
- (let [listing (.listApps agave)
- total (count listing)
- listing (map (partial format-app-listing statuses jobs-enabled?) listing)]
- (assoc (hpc-app-group)
- :apps listing
- :app_count total)))
+ ([agave statuses jobs-enabled?]
+ (format-app-listing-response (.listApps agave) statuses jobs-enabled?))
+ ([agave statuses jobs-enabled? app-ids]
+ (format-app-listing-response (.listApps agave app-ids) statuses jobs-enabled?)))
diff --git a/libs/mescal/src/mescal/agave_v2.clj b/libs/mescal/src/mescal/agave_v2.clj
index 9134427a2..14845deca 100644
--- a/libs/mescal/src/mescal/agave_v2.clj
+++ b/libs/mescal/src/mescal/agave_v2.clj
@@ -11,7 +11,7 @@
[mescal.util :as util])
(:import [java.io IOException]))
-; FIXME Update apps service exception handling when this exception handling is updated
+ ; FIXME Update apps service exception handling when this exception handling is updated
(defn- agave-unavailable
[e]
(let [msg "Agave appears to be unavailable at this time"]
@@ -95,8 +95,11 @@
(agave-get token-info-fn timeout (curl/url base-url "/systems/v2/" system-name)))
(defn list-apps
- [base-url token-info-fn timeout page-len]
- (agave-get token-info-fn timeout (curl/url base-url "/apps/v2/") {:page-len page-len}))
+ ([base-url token-info-fn timeout page-len]
+ (agave-get token-info-fn timeout (curl/url base-url "/apps/v2/") {:page-len page-len}))
+ ([base-url token-info-fn timeout page-len app-ids]
+ (->> {:page-len page-len :id.in (string/join "," app-ids)}
+ (agave-get token-info-fn timeout (curl/url base-url "/apps/v2/")))))
(defn get-app
[base-url token-info-fn timeout app-id]
diff --git a/libs/mescal/src/mescal/core.clj b/libs/mescal/src/mescal/core.clj
index 4c1c85405..1492d52af 100644
--- a/libs/mescal/src/mescal/core.clj
+++ b/libs/mescal/src/mescal/core.clj
@@ -5,7 +5,7 @@
"A client for the Agave API."
(listSystems [_])
(getSystemInfo [_ system-name])
- (listApps [_])
+ (listApps [_] [_ app-ids])
(getApp [_ app-id])
(submitJob [_ submission])
(listJobs [_] [_ job-ids])
@@ -29,6 +29,9 @@
(listApps [_]
(v2/check-access-token token-info-fn timeout)
(v2/list-apps base-url token-info-fn timeout page-len))
+ (listApps [_ app-ids]
+ (v2/check-access-token token-info-fn timeout)
+ (v2/list-apps base-url token-info-fn timeout page-len app-ids))
(getApp [_ app-id]
(v2/check-access-token token-info-fn timeout)
(v2/get-app base-url token-info-fn timeout app-id))
diff --git a/libs/mescal/src/mescal/de.clj b/libs/mescal/src/mescal/de.clj
index ad2c1bc72..f5f2be9fa 100644
--- a/libs/mescal/src/mescal/de.clj
+++ b/libs/mescal/src/mescal/de.clj
@@ -5,7 +5,7 @@
(defprotocol DeAgaveClient
"An Agave client with customizations that are specific to the discovery environment."
(hpcAppGroup [_])
- (listApps [_])
+ (listApps [_] [_ app-ids])
(searchApps [_ search-term])
(getApp [_ app-id])
(getAppDetails [_ app-id])
@@ -30,6 +30,8 @@
(v2/hpc-app-group))
(listApps [_]
(v2/list-apps agave jobs-enabled?))
+ (listApps [_ app-ids]
+ (v2/list-apps agave jobs-enabled? app-ids))
(searchApps [_ search-term]
(v2/search-apps agave jobs-enabled? search-term))
(getApp [_ app-id]
diff --git a/services/apps/src/apps/service/apps/agave.clj b/services/apps/src/apps/service/apps/agave.clj
index 7c4f128e2..47c4c9c2a 100644
--- a/services/apps/src/apps/service/apps/agave.clj
+++ b/services/apps/src/apps/service/apps/agave.clj
@@ -81,10 +81,10 @@
(job-listings/list-jobs self user params))
(loadAppTables [_ app-ids]
- (if (and (user-has-access-token?)
- (some (complement util/uuid?) app-ids))
- (listings/load-app-tables agave)
- []))
+ (let [agave-app-ids (remove util/uuid? app-ids)]
+ (if (and (seq agave-app-ids) (user-has-access-token?))
+ (listings/load-app-tables agave agave-app-ids)
+ [])))
(submitJob [this submission]
(when-not (util/uuid? (:app_id submission))
diff --git a/services/apps/src/apps/service/apps/agave/listings.clj b/services/apps/src/apps/service/apps/agave/listings.clj
index afa272014..bf48a936d 100644
--- a/services/apps/src/apps/service/apps/agave/listings.clj
+++ b/services/apps/src/apps/service/apps/agave/listings.clj
@@ -27,7 +27,7 @@
nil)))
(defn load-app-tables
- [agave]
+ [agave app-ids]
(try+
(->> (.listApps agave)
(:apps)
From 8563d6198d8831535858c1f0882287941ce1e381 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Fri, 26 Feb 2016 16:59:25 -0700
Subject: [PATCH 070/183] CORE-7180: created an easier way to test mescal in
the REPL
---
libs/mescal/src/mescal/test.clj | 79 +++++++++++++++++++++++++++++++++
1 file changed, 79 insertions(+)
create mode 100644 libs/mescal/src/mescal/test.clj
diff --git a/libs/mescal/src/mescal/test.clj b/libs/mescal/src/mescal/test.clj
new file mode 100644
index 000000000..75b400850
--- /dev/null
+++ b/libs/mescal/src/mescal/test.clj
@@ -0,0 +1,79 @@
+(ns mescal.test
+ (:require [authy.core :as authy]
+ [cemerick.url :as curl]
+ [mescal.core :as mc]
+ [mescal.de :as md]))
+
+(defn- get-agave-base-url []
+ (System/getenv "AGAVE_BASE_URL"))
+
+(defn- get-agave-storage-system []
+ (System/getenv "AGAVE_STORAGE_SYSTEM"))
+
+(defn- get-api-key []
+ (System/getenv "AGAVE_API_KEY"))
+
+(defn- get-api-secret []
+ (System/getenv "AGAVE_API_SECRET"))
+
+(defn- prompt-for-username []
+ (print "username: ")
+ (flush)
+ (read-line))
+
+(defn- prompt-for-password []
+ (print "password: ")
+ (flush)
+ (.. System console readPassword))
+
+(defn- get-username []
+ (or (System/getenv "IPLANT_CAS_SHORT")
+ (prompt-for-username)))
+
+(defn- get-password []
+ (or (System/getenv "IPLANT_CAS_PASS")
+ (prompt-for-password)))
+
+(defn- get-oauth-info [base-url api-key api-secret]
+ {:api-name "agave"
+ :client-key api-key
+ :client-secret api-secret
+ :token-uri (str (curl/url base-url "oauth2" "token"))})
+
+(defn- get-token [base-url api-key api-secret username password]
+ (let [oauth-info (get-oauth-info base-url api-key api-secret)]
+ (authy/get-access-token-for-credentials oauth-info username password)))
+
+(defn get-test-agave-client
+ ([]
+ (get-test-agave-client {}))
+ ([agave-params]
+ (get-test-agave-client agave-params (get-username)))
+ ([agave-params username]
+ (get-test-agave-client agave-params username (get-password)))
+ ([agave-params username password]
+ (get-test-agave-client agave-params username password (get-api-key) (get-api-secret)))
+ ([agave-params username password api-key api-secret]
+ (let [base-url (get-agave-base-url)
+ storage-system (get-agave-storage-system)
+ token-info (get-token base-url api-key api-secret username password)
+ agave-params (flatten (seq agave-params))]
+ (apply mc/agave-client-v2 base-url storage-system (constantly token-info) agave-params))))
+
+(defn get-test-de-agave-client
+ ([]
+ (get-test-de-agave-client {}))
+ ([agave-params]
+ (get-test-de-agave-client agave-params true))
+ ([agave-params jobs-enabled?]
+ (get-test-de-agave-client agave-params jobs-enabled? (get-username)))
+ ([agave-params jobs-enabled? username]
+ (get-test-de-agave-client agave-params jobs-enabled? username (get-password)))
+ ([agave-params jobs-enabled? username password]
+ (get-test-de-agave-client agave-params jobs-enabled? username password (get-api-key) (get-api-secret)))
+ ([agave-params jobs-enabled? username password api-key api-secret]
+ (let [base-url (get-agave-base-url)
+ storage-system (get-agave-storage-system)
+ token-info (get-token base-url api-key api-secret username password)
+ agave-params (flatten (seq agave-params))]
+ (apply md/de-agave-client-v2 base-url storage-system (constantly token-info) jobs-enabled? agave-params))))
From 19f41af6444d5d3bac9359571ece3198723dc2bb Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Fri, 26 Feb 2016 17:01:01 -0700
Subject: [PATCH 071/183] CORE-7180: added a limit for the maximum number of
items in a search query parameter that is sent to Agave
---
libs/mescal/src/mescal/agave_de_v2.clj | 2 +-
libs/mescal/src/mescal/agave_v2.clj | 12 ++++++------
libs/mescal/src/mescal/core.clj | 15 +++++++++------
3 files changed, 16 insertions(+), 13 deletions(-)
diff --git a/libs/mescal/src/mescal/agave_de_v2.clj b/libs/mescal/src/mescal/agave_de_v2.clj
index f281780a3..c684f7c40 100644
--- a/libs/mescal/src/mescal/agave_de_v2.clj
+++ b/libs/mescal/src/mescal/agave_de_v2.clj
@@ -16,7 +16,7 @@
(defn list-apps
([agave jobs-enabled?]
(app-listings/list-apps agave (get-system-statuses agave) jobs-enabled?))
- ([agave jbos-enabled? app-ids]
+ ([agave jobs-enabled? app-ids]
(app-listings/list-apps agave (get-system-statuses agave) jobs-enabled? app-ids)))
(defn- app-matches?
diff --git a/libs/mescal/src/mescal/agave_v2.clj b/libs/mescal/src/mescal/agave_v2.clj
index 14845deca..d93d00e4a 100644
--- a/libs/mescal/src/mescal/agave_v2.clj
+++ b/libs/mescal/src/mescal/agave_v2.clj
@@ -11,7 +11,7 @@
[mescal.util :as util])
(:import [java.io IOException]))
- ; FIXME Update apps service exception handling when this exception handling is updated
+; FIXME Update apps service exception handling when this exception handling is updated
(defn- agave-unavailable
[e]
(let [msg "Agave appears to be unavailable at this time"]
@@ -60,19 +60,19 @@
:socket-timeout timeout}))))
(defn- agave-get-paged
- [token-info-fn timeout page-len url]
+ [token-info-fn timeout page-len url & [params]]
(->> (iterate (partial + page-len) 0)
- (map (partial hash-map :limit page-len :offset))
+ (map (partial assoc (or params {}) :limit page-len :offset))
(map (partial agave-get* token-info-fn timeout url))
(take-upto (comp (partial > page-len) count))
(apply concat)))
(defn agave-get
- [token-info-fn timeout url & [{:keys [page-len]}]]
+ [token-info-fn timeout url & [{:keys [page-len] :as params}]]
(set-ext-svc-tag! "agave")
(if page-len
- (agave-get-paged token-info-fn timeout page-len url)
- (agave-get* token-info-fn timeout url)))
+ (agave-get-paged token-info-fn timeout page-len url (dissoc params :page-len))
+ (agave-get* token-info-fn timeout url params)))
(defn agave-post
[token-info-fn timeout url body]
diff --git a/libs/mescal/src/mescal/core.clj b/libs/mescal/src/mescal/core.clj
index 1492d52af..3f3f4636f 100644
--- a/libs/mescal/src/mescal/core.clj
+++ b/libs/mescal/src/mescal/core.clj
@@ -18,7 +18,7 @@
(agaveFilePath [_ file-url])
(storageSystem [_]))
-(deftype AgaveClientV2 [base-url storage-system token-info-fn timeout page-len]
+(deftype AgaveClientV2 [base-url storage-system token-info-fn timeout page-len max-query-items]
AgaveClient
(listSystems [_]
(v2/check-access-token token-info-fn timeout)
@@ -31,7 +31,9 @@
(v2/list-apps base-url token-info-fn timeout page-len))
(listApps [_ app-ids]
(v2/check-access-token token-info-fn timeout)
- (v2/list-apps base-url token-info-fn timeout page-len app-ids))
+ (if (> (count app-ids) max-query-items)
+ (v2/list-apps base-url token-info-fn timeout page-len)
+ (v2/list-apps base-url token-info-fn timeout page-len app-ids)))
(getApp [_ app-id]
(v2/check-access-token token-info-fn timeout)
(v2/get-app base-url token-info-fn timeout app-id))
@@ -69,8 +71,9 @@
storage-system))
(defn agave-client-v2
- [base-url storage-system token-info-fn & {:keys [timeout page-len]
- :or {timeout 5000
- page-len 100}}]
+ [base-url storage-system token-info-fn & {:keys [timeout page-len max-query-items]
+ :or {timeout 5000
+ page-len 100
+ max-query-items 50}}]
(let [token-info-wrapper-fn (memoize #(ref (token-info-fn)))]
- (AgaveClientV2. base-url storage-system token-info-wrapper-fn timeout page-len)))
+ (AgaveClientV2. base-url storage-system token-info-wrapper-fn timeout page-len max-query-items)))
From 6b79567b91d8da9fc5662ee9e154b850539d2458 Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Fri, 26 Feb 2016 18:00:10 -0700
Subject: [PATCH 072/183] CORE-7180: fixed a missed code modification
---
services/apps/src/apps/service/apps/agave/listings.clj | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/services/apps/src/apps/service/apps/agave/listings.clj b/services/apps/src/apps/service/apps/agave/listings.clj
index bf48a936d..5c6a1f44c 100644
--- a/services/apps/src/apps/service/apps/agave/listings.clj
+++ b/services/apps/src/apps/service/apps/agave/listings.clj
@@ -29,7 +29,7 @@
(defn load-app-tables
[agave app-ids]
(try+
- (->> (.listApps agave)
+ (->> (.listApps agave app-ids)
(:apps)
(map (juxt :id identity))
(into {})
From 71d793629f55b329b880ac5a098abb3dd70c167a Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Fri, 26 Feb 2016 18:23:45 -0700
Subject: [PATCH 073/183] CORE-7180: removed the optional username and password
prompts from mescal.test since doesn't work in the REPL
---
libs/mescal/src/mescal/test.clj | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/libs/mescal/src/mescal/test.clj b/libs/mescal/src/mescal/test.clj
index 75b400850..403638813 100644
--- a/libs/mescal/src/mescal/test.clj
+++ b/libs/mescal/src/mescal/test.clj
@@ -16,23 +16,11 @@
(defn- get-api-secret []
(System/getenv "AGAVE_API_SECRET"))
-(defn- prompt-for-username []
- (print "username: ")
- (flush)
- (read-line))
-
-(defn- prompt-for-password []
- (print "password: ")
- (flush)
- (.. System console readPassword))
-
(defn- get-username []
- (or (System/getenv "IPLANT_CAS_SHORT")
- (prompt-for-username)))
+ (System/getenv "IPLANT_CAS_SHORT"))
(defn- get-password []
- (or (System/getenv "IPLANT_CAS_PASS")
- (prompt-for-password)))
+ (System/getenv "IPLANT_CAS_PASS"))
(defn- get-oauth-info [base-url api-key api-secret]
{:api-name "agave"
From 80dd82a2bedea9862907740a2fe23ccb60a0a37c Mon Sep 17 00:00:00 2001
From: Dennis Roberts
Date: Mon, 29 Feb 2016 16:17:26 -0700
Subject: [PATCH 074/183] CORE-3599: updated the notification agent
documentation in a couple of places
---
services/NotificationAgent/README.markdown | 40 ++++++++++++++++++++--
1 file changed, 37 insertions(+), 3 deletions(-)
diff --git a/services/NotificationAgent/README.markdown b/services/NotificationAgent/README.markdown
index 2c57daf2b..c24b8c9ec 100644
--- a/services/NotificationAgent/README.markdown
+++ b/services/NotificationAgent/README.markdown
@@ -368,7 +368,22 @@ Marking a notification as seen prevents it from being returned by the
`/unseen-messages` endpoint. The intent is for this endpoint to be called when
the user has seen a notification for the first time. This services requires a `user`
query parameter that provides the name of the user who is marking these messages as
-seen. This service accepts a request body in the following format:
+seen. This service accepts the following query parameters:
+
+
+
+ |