Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2013
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. In UI namespace
  2. (defprotocol CRUD
  3.   "Create/read/update/delete operations on katello entities via the UI"
  4.   (create [x] "Create an entity in the UI")
  5.   (read [x] "Get details on an entity from the UI")
  6.   (update* [x new-x] "Change an existing entity in UI, from x to new-x")
  7.   (delete [x] "Delete an existing entity in the UI"))
  8.  
  9.  
  10. In environments namespace.
  11.  
  12. (defn- create
  13.   "Creates an environment with the given name, and a map containing
  14.   the organization name to create the environment in, the prior
  15.   environment, and an optional description."
  16.   [{:keys [name label org description prior]}]
  17.   (nav/go-to ::new-page org)
  18.   (sel/fill-ajax-form {::name-text name
  19.                        (fn [label] (when label
  20.                                      (browser fireEvent ::name-text "blur")
  21.                                      (browser ajaxWait)
  22.                                      (browser setText ::label-text label))) [label]
  23.                        ::description-text description
  24.                        ::prior (:name prior)}
  25.                       ::create)
  26.   (notification/success-type :env-create))
  27.  
  28. (defn only-katello [task]
  29.   (if (rest/is-headpin?)
  30.         task
  31.         ;; how to implement code for no-op??))
  32.  
  33. (extend katello.Environment
  34.   ui/CRUD {:create (only-katello #'create)
  35.            :update* edit
  36.            :delete delete}
  37.  
  38.  
  39. Question :-  What could I be missing in (only-katello function ?
  40.  
  41. Error faced :-   IllegalArgumentException No implementation of method: :create of protocol: #'katello.ui/CRUD found for class: katello.Environment  clojure.core/-cache-protocol-fn (core_deftype.clj:541)
  42.  
  43. While trying the beow.
  44.  
  45. => (def env11 (first katello.conf/*environments*))
  46. #'user/env11
  47. => env11
  48. #katello.Environment{:id nil, :name "Development", :label nil, :description nil, :org #katello.Organization{:id nil, :name "ACME_Corporation", :label nil, :description nil, :initial-env nil}, :prior #katello.Environment{:id nil, :name "Library", :label nil, :description nil, :org #katello.Organization{:id nil, :name "ACME_Corporation", :label nil, :description nil, :initial-env nil}, :prior nil, :next nil}, :next nil}
  49. => (katello.ui/create env11)
  50. IllegalArgumentException No implementation of method: :create of protocol: #'katello.ui/CRUD found for class: katello.Environment  clojure.core/-cache-protocol-fn (core_deftype.clj:541)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement