Browse Source

Renaming again to textbook MVC names. Moved handler for init.org from
iorg to bugpile.

tj 8 years ago
parent
commit
921c8fd4a9

+ 18 - 0
controller/bugpile-controller.el

@@ -0,0 +1,18 @@
+;;; bugpile-controller -- elnode handlers and such for handling web
+;;; POST/GET requests
+
+
+;; (defvar bugpile-controller-docroot-handler nil)
+
+(defun bugpile-controller-init-handler (httpcon)
+  "Serves the start-page of the Bugpile application"
+  (elnode-send-file httpcon
+                    (iorg--org-to-html
+                     (concat
+                      (iorg-projects--get-project-info
+                       "bugpile" :view)
+                       "index.org"))))
+
+;; TODO move urls from iorg to bugpile
+
+(provide 'bugpile-controller)

+ 0 - 10
iorg/lisp/iorg-controller.el

@@ -105,16 +105,6 @@ their counterparts in 'iorg-projects-config'"
        ;;:docroot (or docroot (cdr (assoc :port proj-config)))
        ))))
 
-(defun iorg-controller-init-handler (httpcon)
-  "Serves the start-page of the iOrg application"
-  (elnode-send-file httpcon
-                    (iorg--org-to-html
-                     (concat
-                      (iorg-projects--get-project-info
-                       
-;; TODO get actual project out of httpcon?
-;; concat project/view dir and index.org        
-                             ".org")))))
 
  (defun iorg-change-state-handler (httpcon)
   "Called by the elnode form handler to update task state."

+ 7 - 7
iorg/lisp/iorg-projects.el

@@ -53,7 +53,7 @@
                      "variable 'iorg-projects-config'"))
     (cond 
      ((member
-       key '(:docroot :model :view :controller :persistence :doc :test))
+       key '(:docroot :logiv :view :controller :objects :doc :test))
       (iorg-projects--normalize-existing-dir-name
        (concat
         (iorg-projects--normalize-existing-dir-name
@@ -73,20 +73,20 @@
                   (:host . "localhost")
                   (:port . "8088")
                   (:docroot . "docroot")
-                  (:model . "db")
+                  (:logic . "db")
                   (:view . "view") 
                   (:controller . "server")
-                  (:persistence . "objects")
+                  (:objects . "objects")
                   (:test . "test")
                   (:doc . "doc")))
     ("bugpile" . ((:dir . "~/git/bugpile/")
                (:host . "localhost")
                (:port . "8008")
                (:docroot . "docroot")
-               (:model . "model")
+               (:logic . "logic")
                (:view . "view") 
                (:controller . "controller")
-               (:persistence . "objects")
+               (:objects . "objects")
                (:test . "test")
                (:doc . "doc"))))
 
@@ -113,11 +113,11 @@ as 'http://HOST:PORT', e.g. 'http://localhost:8008'"
 
 
 (defcustom iorg-projects-urls
-  '(("bugpile" . (("^$"      . iorg-controller-init-handler)
+  '(("bugpile" . (("^$"      . bugpile-controller-init-handler)
                   ("^edit/$" . iorg-controller-edit-handler)
                   ("^send/$" . iorg-controller-send-handler)
                   ("^reset/$" . iorg-controller-reset-handler)))
-    ("test" .  (("^$"      . iorg-controller-init-handler)
+    ("test" .  (("^$"      . test-controller-init-handler)
                   ("^edit/$" . iorg-controller-edit-handler)
                   ("^send/$" . iorg-controller-send-handler)
                   ("^reset/$" . iorg-controller-reset-handler))))

db/bugpile-db.el → logic/bugpile-model.el


+ 0 - 8
server/bugpile-server.el

@@ -1,8 +0,0 @@
-;;; bugpile-server -- elnode handlers and such for handling web
-;;; POST/GET requests
-
-
-(defvar bugpile-server-docroot-handler nil)
-
-
-(provide 'bugpile-server)