Browse Source

Some renaming. Implemenation of the search tasklist use-case (for
prototype).

tj 8 years ago
parent
commit
de85565f04

+ 19 - 15
controller/bugpile-controller.el

@@ -32,16 +32,18 @@
 
 (defun bugpile-controller-index-handler (httpcon)
   "Serves the start-page of the Bugpile application"
+  (elnode-log-access "bugpile-controller" httpcon)
   (elnode-send-file httpcon
                     (iorg-controller--org-to-html
                      (concat
                       (iorg-projects-get-project-info
                        "bugpile" :view)
-                       "bugpile-index.org"))))
+                       "bugpile-view-index.org"))))
 
 
 (defun bugpile-controller-open-new-task-handler (httpcon)
   "Serve a form page for a new task and process user input."
+  (elnode-log-access "bugpile-controller" httpcon)  
   ;; (elnode-send-file httpcon
   ;;                   (iorg-controller--org-to-html
   ;;                    (concat
@@ -53,22 +55,24 @@
 (defun bugpile-controller-search-tasklist-handler (httpcon)
   "Serve a form page for query composition, process the user
 query and present the result list."
-  ;; (elnode-send-file httpcon
-  ;;                   (iorg-controller--org-to-html
-  ;;                    (concat
-  ;;                     (iorg-projects-get-project-info
-  ;;                      "bugpile" :view)
-  ;;                      "bugpile-index.org"))))
-)
+  (elnode-log-access "bugpile-controller" httpcon)
+  (elnode-send-file httpcon
+                    (iorg-controller--org-to-html
+                     (concat
+                      (iorg-projects-get-project-info
+                       "bugpile" :view)
+                       "bugpile-view-search-task-list.org"))))
+
 
 (defun bugpile-controller-take-action-on-selected-tasks-handler (httpcon)
   "Perform the action chosen by the user on all selected tasks."
-  ;; (elnode-send-file httpcon
-  ;;                   (iorg-controller--org-to-html
-  ;;                    (concat
-  ;;                     (iorg-projects-get-project-info
-  ;;                      "bugpile" :view)
-  ;;                      "bugpile-index.org"))))
-)
+  (elnode-log-access "bugpile-controller" httpcon)
+  (elnode-send-file httpcon
+                    (iorg-controller--org-to-html
+                     (concat
+                      (iorg-projects-get-project-info
+                       "bugpile" :view)
+                       "bugpile-view-take-action-on-selected-tasks.org"))))
+
 
 (provide 'bugpile-controller)

+ 21 - 9
doc/gsoc/midterm-eval.org

@@ -288,16 +288,28 @@ customizable in 'iorg-projects-config'.
 
 ** play with bugpile
 after re-launch (and most likely restart of Emacs), try the following:
+*** search tasklist (rudimentary functionality)
+1. evaluate
+
+#+begin_src emacs-lisp
+(setq org-columns-default-format
+ "%40ITEM(Task) %TODO %object-foo %html-edit %TAGS")
+#+end_src
+
+#+results:
+: %40ITEM(Task) %TODO %object-foo %html-edit %TAGS
+
+2. delete the ID in /bugpile/objects/iorg-dblock-collect.org and
+create a new one on you machine with org-id-get-create
+
+3. use this new ID in the header of the dynamic block in file
+bugpile-view-take-action-on-selected-tasks.org in the
+/bugpile/view/take-action-on-selected-tasks/ directory.
+4. update the dblock with org-dblock-update
+5. open http://localhost:8008 in a browser again and follow the
+   'search tasklist' and then 'result list' links. 
+*** edit task (more or less)
 
-1. add the feature-obj.org and bug-obj.org files to you agenda-files.
-   actually, to use org tag and property search in a project, all the
-   xyz-obj.org files in /bugpile/objects/ should be in the agenda file
-   list - and only those. (this caused a lot of trouble on my side, is
-   it buggy or unstable to change the agenda files?)
-2. open http://localhost:8008 in a browser again to see the index.html
-   page of the bugpile project.
-3. click on open new task
- 
 
 
 

+ 0 - 4
iorg-dblock-collect.org

@@ -1,4 +0,0 @@
-*      
-  :PROPERTIES:
-  :ID:       dd369e45-c335-4d14-a8e0-06ae854aada3
-  :END:

+ 9 - 20
objects/bug-obj.org

@@ -1,13 +1,10 @@
 #+Title: The objects file for class 'bug'
 
-* TODO bug                                                          :foo:bar:
+* TODO bug                                                          :bug:iorg:
   :PROPERTIES:
   :object-foo: bug task html obj
-  :html-headline-forms: notext
-  :html-edit: link
-  :html-edit-value: Edit
-  :html-send-button: Send
-  :html-reset-button: Reset
+  :html-form: iorg-controller-edit-handler
+  :html-button-value: edit
   :task-author: 
   :task-closed: 
   :task-opened: 
@@ -16,18 +13,15 @@
   :task-project: 
   :bug-is-upstream: no
   :bug-need-skills: intermediate
-  :ID:       40717d2f-4187-4bca-a242-52666ed99990
+  :ID:       14edcf29-a65c-49b5-813b-259b16b72c56
   :END:
 
 
-* TODO bug                                                          :foo:bar:
+* TODO bug                                                          :iorg:bug:
   :PROPERTIES:
   :object-foo: bug task html obj
-  :html-headline-forms: notext
-  :html-edit: link
-  :html-edit-value: Edit
-  :html-send-button: Send
-  :html-reset-button: Reset
+  :html-form: iorg-controller-edit-handler
+  :html-button-value: edit
   :task-author: 
   :task-closed: 
   :task-opened: 
@@ -36,19 +30,14 @@
   :task-project: 
   :bug-is-upstream: no
   :bug-need-skills: intermediate
-  :ID:       ae32d1c4-4669-472f-a354-6adc192a1671
+  :ID:       7d1af136-c8f3-4a46-a79f-e16f3c9a6d97
   :END:
 
 
 * File Local Variables (iOrg class properties)              :file_local_vars:
+  [2012-07-09 Mo 03:41]
 # Local Variables:
 # object-foo_ALL: "bug task html obj"
-# html-edit_ALL: "link button"
-# html-headline_forms_ALL: "all notext todo text tag"
-# html-index-action: "nil"
-# html-edit-action: "nil"
-# html-send-action: "nil"
-# html-reset-action: "nil"
 # task-priority_ALL: "urgent high medium low"
 # task-project_ALL: "org babel agenda exporter iorg"
 # bug-is-upstream_ALL: "yes no maybe"

+ 2 - 11
objects/classes/html-class.org

@@ -3,17 +3,8 @@
 *  html                                                    :abstract:
   :PROPERTIES:
   :iorg-super: object
-  :html-edit_ALL-C: link button    
-  :html-headline_forms_ALL-C: all notext todo text tag
-  :html-index-action-C:   nil
-  :html-edit-action-C:    nil
-  :html-send-action-C:    nil
-  :html-reset-action-C:   nil
-  :html-headline-forms: notext
-  :html-edit: link    
-  :html-edit-value: Edit
-  :html-send-button: Send
-  :html-reset-button: Reset
+  :html-form: iorg-controller-edit-handler
+  :html-button-value: submit
   :object-foo: html
   :object-foo_ALL-C: html
   :END:

+ 9 - 20
objects/feature-obj.org

@@ -1,13 +1,10 @@
 #+Title: The objects file for class 'feature'
 
-* TODO feature                                                      :kung:fu:
+* TODO feature                                                      :iorg:feature: 
   :PROPERTIES:
   :object-foo: feature task html obj
-  :html-headline-forms: notext
-  :html-edit: link
-  :html-edit-value: Edit
-  :html-send-button: Send
-  :html-reset-button: Reset
+  :html-form: iorg-controller-edit-handler
+  :html-button-value: submit
   :task-author: 
   :task-closed: 
   :task-opened: 
@@ -16,17 +13,14 @@
   :task-project: 
   :feature-category: nice-to-have
   :task-priority: low
-  :ID:       a30e39b2-1e13-427d-b8c9-f1a86ee11703
+  :ID:       7a44a449-cdac-436d-8d01-1a7931303294
   :END:
 
-* TODO feature                                                      :kung:fu:
+* TODO feature                                                      :iorg:feature:
   :PROPERTIES:
   :object-foo: feature task html obj
-  :html-headline-forms: notext
-  :html-edit: link
-  :html-edit-value: Edit
-  :html-send-button: Send
-  :html-reset-button: Reset
+  :html-form: iorg-controller-edit-handler
+  :html-button-value: submit
   :task-author: 
   :task-closed: 
   :task-opened: 
@@ -35,18 +29,13 @@
   :task-project: 
   :feature-category: nice-to-have
   :task-priority: low
-  :ID:       5e46a165-bb09-41c7-bee8-f129445ab47f
+  :ID:       3c422e72-fcc6-43e8-8fba-626b8ced7b9e
   :END:
 
 * File Local Variables (iOrg class properties)              :file_local_vars:
+  [2012-07-09 Mo 03:43]
 # Local Variables:
 # object-foo_ALL: "feature task html obj"
-# html-edit_ALL: "link button"
-# html-headline_forms_ALL: "all notext todo text tag"
-# html-index-action: "nil"
-# html-edit-action: "nil"
-# html-send-action: "nil"
-# html-reset-action: "nil"
 # task-priority_ALL: "urgent high medium low"
 # task-project_ALL: "org babel agenda exporter iorg"
 # feature-category_ALL: "must-nave nice-to-have may-be-once"

+ 39 - 0
objects/iorg-dblock-collect.org

@@ -0,0 +1,39 @@
+*      
+  :PROPERTIES:
+  :ID:       6f780841-1905-442e-b881-534f89b4d57e
+  :END:
+** TODO bug                                                         :foo:bar:
+       :PROPERTIES:
+       :object-foo: bug
+       :html-edit: link 
+       :END:
+** TODO bug                                                         :feng:shui:
+       :PROPERTIES:
+       :object-foo: task
+       :html-edit: link 
+       :END:
+** TODO bug                                                         :foo:bar:
+       :PROPERTIES:
+       :object-foo: bug
+       :html-edit: button
+       :END:
+** TODO bug                                                         :kung:fu:
+       :PROPERTIES:
+       :object-foo: html
+       :html-edit: button
+       :END:
+** TODO bug                                                         :foo:bar:
+       :PROPERTIES:
+       :object-foo: obj
+       :html-edit: link 
+       :END:
+** TODO bug                                                         :hello:world:
+       :PROPERTIES:
+       :object-foo: bug
+       :html-edit: link 
+       :END:
+** TODO bug                                                         :foo:bar:
+      :PROPERTIES:
+      :object-foo: task
+      :html-edit: button
+      :END:

view/bugpile-index.org → view/bugpile-view-index.org


+ 37 - 0
view/search-tasklist/bugpile-view-search-tasklist.org

@@ -37,4 +37,41 @@
   :ID:       c2ff8888-632d-4ecd-850d-af6f9c620098
   :END:
 
+Lets assume that this is a page with a HTML form that allows the user
+to build a query based on _tags_ and _property values_ of tasks. There
+might be a textfield for free text input and one or more html select
+boxes that allow the user to choose from a list of allowed values. 
 
+Matching tags and properties is functionality already available in Org
+mode (org-tags-view), as well as constructing sparse trees from regexp
+searches (with org-occur).
+
+Thus, making all the iOrg object files in /bugpile/objects/ members of
+the Org agenda-file-list enables selection of objects (that are
+nothing else but Org outline trees) by tag or property value or by
+regular expression search in the objects content. 
+
+Its all there, but unfortunately there are a few unconveniences:
+
+ 1. Both functions mentioned above do not return a list of sub-trees
+    they match but are called for side-effects. A deeper look into the
+    search and matching mechanism seems neccesary to get similar
+    functions to org-tags-view and org-occur that return a list of
+    matched subtrees (or their IDs). 
+ 2. On a server exclusively used for one iOrg application its ok to
+    define the applications object files as only Org agenda files. On a
+    private machine it is not, since then all the Org mode agenda
+    functionality is gone. Mixing private agenda files and e.g.
+    bugpile object files in the agenda-file-list doesn't seem to be a
+    good idea either. And changing the agenda files on the fly can
+    become a real hassle with preserved old state, strange error
+    messages and required Emacs re-start. An alternative variable that
+    holds e.g. the bugpile-object-files and exists in parallel to the
+    org-agenda-files seems neccesary. 
+
+Since both features, match functions that return the matched subtrees
+and a separate list of application-object-files, are not yet
+incorporated in bugpile, we cannot make use of Org modes power here
+and simply link to an (imaginary) [[http://localhost:8008/take-action-on-selected-tasks][result list]]. 
+
+ 

+ 41 - 1
view/take-action-on-selected-tasks/bugpile-view-take-action-on-selected-tasks.org

@@ -32,11 +32,51 @@
 /Select Tasks in the Result List/
 /and choose an Action to take on them/
 
-* Resultlist
+* Result List
   :PROPERTIES:
   :ID:       2e4d1477-2ea2-400e-b937-14408d7e2285
   :END:
 
+This is an imaginary result list of a user query. It shows all the
+tasks that were matched by the query either in tags, properties or
+free text (content). The result list is produced inside a dynamic
+block as a column view of a utility files that is used to collect all
+matching subtrees as second level entries under a top-level entry with
+a global ID, that is used as attribute of the dynamic block. 
+
+This is likely not portable to another machine yet, so you might have
+to delete the ID in /bugpile/objects/iorg-dblock-collect.org and
+create a new one on you machine with org-id-get-create, and then use
+this new ID in the header of the dynamic block in file
+bugpile-view-take-action-on-selected-tasks.org in the
+/bugpile/view/take-action-on-selected-tasks/ directory.
+
+For this page to be real
+ 1. the column view should present entries that were matched and
+    collected due to a user query
+ 2. the iorg-html export-backend should put a html checkbox in front
+    of each table row, put a html selectbox with possible actions at
+    the bottom of the page, and wrap the whole thing in a html form.
+
+ 
+
+#+BEGIN: columnview :hlines 1 :id #("6f780841-1905-442e-b881-534f89b4d57e" 0 36 (fontified t face org-property-value))
+| Task   | TODO | object-foo | html-edit | TAGS          |
+|--------+------+------------+-----------+---------------|
+| *      |      |            |           |               |
+| ** bug | TODO | bug        | link      | :foo:bar:     |
+| ** bug | TODO | task       | link      | :feng:shui:   |
+| ** bug | TODO | bug        | button    | :foo:bar:     |
+| ** bug | TODO | html       | button    | :kung:fu:     |
+| ** bug | TODO | obj        | link      | :foo:bar:     |
+| ** bug | TODO | bug        | link      | :hello:world: |
+| ** bug | TODO | task       | button    | :foo:bar:     |
+#+END:
+
+
+
+
+