 
 
 
-
-"-----------------------------------------------------------
-Get data window requests
-
-this waits for requests on the channel
-'client-query-cache-requests' and then gets the corresponding
-data and updates the internal cache
------------------------------------------------------------"
-(go
- (loop []
-   (let [request (<! client-data-window-requests)]  ; <-- reads the request from the channel
-
-
-      (update-or-create-data-window
-       (:key    request)
-       (:start  request)
-       (:end    request)
-       (:ui     request)))
-   (recur)))
-
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<-- :profession)
-
-
-
-This is used from a GUI data component to read
-a value from the current record
-
-It is actually called from the <-- macro
--------------------------------------------------"
-(defn <---fn [record  field  path  relative-path]
-
-  ;(log (pr-str (-> record :value field))))
-  (-> record :value field))
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<--pos)
-
-
-
-This is used from a GUI data component to read
-the record position. This starts from 1. It is most
-useful when showing a list of records which are
-numbered such as:
-
-1) eggs
-2) beans
-3) soup
-
-It is actually called from the <--pos macro
--------------------------------------------------"
-(defn <---pos [record  path  relative-path]
-
-    (-> record :pos))
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-"-------------------------------------------------
-(<--id)
-
-
-
-Actually <---id and this is used from a GUI data
-component to read the record ID, as stored in the
-database.
-
-It is actually called from the <--id macro
--------------------------------------------------"
-(defn <---id [record-id  record  path  relative-path]
-
-    record-id)
-
-
-(defn session-user-id-fn []
-  (((get @data-state :session) :user ) :id)
-  )



  (let [
        full-path             (into [] (flatten (conj
                                                 component-path
                                                 relative-path
                                                 [])))

        data-window-key      {
                               :ui-component-name   ui-component-name
                               :relative-path       relative-path
                               :component-path      component-path
                               :data-source         data-source
                               :fields              fields
                               :where               where
                               :path                relative-path
                               :full-path           full-path
                               :db-table            db-table
                               :params              params
                               :order               order
                               :realtime            realtime
                               }
        ]
    (update-data-source-fields   data-source  fields)


    (go














"-----------------------------------------------------------
Get data window requests

this waits for requests on the channel
'client-query-cache-requests' and then gets the corresponding
data and updates the internal cache
-----------------------------------------------------------"
(go
 (loop []
   (let [request (<! client-data-window-requests)]  ; <-- reads the request from the channel


      (update-or-create-data-window
       (:key    request)
       (:start  request)
       (:end    request)
       (:ui     request)))
   (recur)))













"-------------------------------------------------
(<-- :profession)



This is used from a GUI data component to read
a value from the current record

It is actually called from the <-- macro
-------------------------------------------------"
(defn <---fn [record  field  path  relative-path]

  ;(log (pr-str (-> record :value field))))
  (-> record :value field))















"-------------------------------------------------
(<--pos)



This is used from a GUI data component to read
the record position. This starts from 1. It is most
useful when showing a list of records which are
numbered such as:

1) eggs
2) beans
3) soup

It is actually called from the <--pos macro
-------------------------------------------------"
(defn <---pos [record  path  relative-path]

    (-> record :pos))
















"-------------------------------------------------
(<--id)



Actually <---id and this is used from a GUI data
component to read the record ID, as stored in the
database.

It is actually called from the <--id macro
-------------------------------------------------"
(defn <---id [record-id  record  path  relative-path]

    record-id)


(defn session-user-id-fn []
  (((get @data-state :session) :user ) :id))



