You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@storm.apache.org by bo...@apache.org on 2014/04/22 18:39:15 UTC

[03/10] git commit: URL-decode special chars in topo ids

URL-decode special chars in topo ids


Project: http://git-wip-us.apache.org/repos/asf/incubator-storm/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-storm/commit/193301f2
Tree: http://git-wip-us.apache.org/repos/asf/incubator-storm/tree/193301f2
Diff: http://git-wip-us.apache.org/repos/asf/incubator-storm/diff/193301f2

Branch: refs/heads/master
Commit: 193301f2d4d8188b5cee04f4cf982636ea6c6ba6
Parents: 4738718
Author: Derek Dagit <de...@yahoo-inc.com>
Authored: Sun Jan 12 00:50:36 2014 +0000
Committer: Derek Dagit <de...@yahoo-inc.com>
Committed: Wed Jan 15 03:16:52 2014 +0000

----------------------------------------------------------------------
 storm-core/src/clj/backtype/storm/ui/core.clj | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-storm/blob/193301f2/storm-core/src/clj/backtype/storm/ui/core.clj
----------------------------------------------------------------------
diff --git a/storm-core/src/clj/backtype/storm/ui/core.clj b/storm-core/src/clj/backtype/storm/ui/core.clj
index 63a3053..e46871a 100644
--- a/storm-core/src/clj/backtype/storm/ui/core.clj
+++ b/storm-core/src/clj/backtype/storm/ui/core.clj
@@ -29,6 +29,7 @@
             Nimbus$Client StormTopology GlobalStreamId RebalanceOptions
             KillOptions])
   (:import [java.io File])
+  (:import [java.net URLDecoder])
   (:require [compojure.route :as route]
             [compojure.handler :as handler]
             [ring.util.response :as resp]
@@ -1018,32 +1019,33 @@
   (GET "/topology/:id" [:as {cookies :cookies} id & m]
        (let [include-sys? (get-include-sys? cookies)]
          (try
-           (-> (topology-page id (:window m) include-sys?)
+           (-> (topology-page (URLDecoder/decode id) (:window m) include-sys?)
              (concat [(mk-system-toggle-button include-sys?)])
              ui-template)
            (catch Exception e (resp/redirect "/")))))
   (GET "/topology/:id/component/:component" [:as {cookies :cookies} id component & m]
        (let [include-sys? (get-include-sys? cookies)]
-         (-> (component-page id component (:window m) include-sys?)
+         (-> (component-page (URLDecoder/decode id)
+                             component (:window m) include-sys?)
              (concat [(mk-system-toggle-button include-sys?)])
              ui-template)))
   (POST "/topology/:id/activate" [id]
     (with-nimbus nimbus
-      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
+      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus (URLDecoder/decode id))
             name (.get_name tplg)]
         (.activate nimbus name)
         (log-message "Activating topology '" name "'")))
     (resp/redirect (str "/topology/" id)))
   (POST "/topology/:id/deactivate" [id]
     (with-nimbus nimbus
-      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
+      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus (URLDecoder/decode id))
             name (.get_name tplg)]
         (.deactivate nimbus name)
         (log-message "Deactivating topology '" name "'")))
     (resp/redirect (str "/topology/" id)))
   (POST "/topology/:id/rebalance/:wait-time" [id wait-time]
     (with-nimbus nimbus
-      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
+      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus (URLDecoder/decode id))
             name (.get_name tplg)
             options (RebalanceOptions.)]
         (.set_wait_secs options (Integer/parseInt wait-time))
@@ -1052,7 +1054,7 @@
     (resp/redirect (str "/topology/" id)))
   (POST "/topology/:id/kill/:wait-time" [id wait-time]
     (with-nimbus nimbus
-      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus id)
+      (let [tplg (.getTopologyInfo ^Nimbus$Client nimbus (URLDecoder/decode id))
             name (.get_name tplg)
             options (KillOptions.)]
         (.set_wait_secs options (Integer/parseInt wait-time))