[bknr-cvs] hans changed trunk/bknr/web/src/images/im

BKNR Commits bknr at bknr.net
Mon Sep 8 16:30:09 UTC 2008


Revision: 3847
Author: hans
URL: http://bknr.net/trac/changeset/3847

Minor tweaks to image import handler.

U   trunk/bknr/web/src/images/image-handlers.lisp
U   trunk/bknr/web/src/images/image.lisp
U   trunk/bknr/web/src/images/import-images-handler.lisp

Modified: trunk/bknr/web/src/images/image-handlers.lisp
===================================================================
--- trunk/bknr/web/src/images/image-handlers.lisp	2008-09-08 16:29:10 UTC (rev 3846)
+++ trunk/bknr/web/src/images/image-handlers.lisp	2008-09-08 16:30:08 UTC (rev 3847)
@@ -156,7 +156,7 @@
   ("/image-union" image-union-handler)
   ("/image-intersection" image-intersection-handler)
   ("/image" imageproc-handler)
-  ("/image-import" image-import-handler)
+  ("/import-images" import-images-handler)
   ("/session-image" session-image-handler)
   ("/xml-image-query" xml-image-query-handler)
   ("/xml-image-browser" xml-image-browser-handler))

Modified: trunk/bknr/web/src/images/image.lisp
===================================================================
--- trunk/bknr/web/src/images/image.lisp	2008-09-08 16:29:10 UTC (rev 3846)
+++ trunk/bknr/web/src/images/image.lisp	2008-09-08 16:30:08 UTC (rev 3847)
@@ -153,7 +153,7 @@
                args)))))
 
 (defun directory-recursive (pathname &key list-directories)
-  (loop for file in (directory pathname)
+  (loop for file in (directory (merge-pathnames #P"**/*.*" pathname))
         when (pathname-name file)
         collect file
         unless (pathname-name file)

Modified: trunk/bknr/web/src/images/import-images-handler.lisp
===================================================================
--- trunk/bknr/web/src/images/import-images-handler.lisp	2008-09-08 16:29:10 UTC (rev 3846)
+++ trunk/bknr/web/src/images/import-images-handler.lisp	2008-09-08 16:30:08 UTC (rev 3847)
@@ -2,13 +2,13 @@
 
 (enable-interpol-syntax)
 
-(defclass image-import-handler (import-handler)
+(defclass import-images-handler (import-handler)
   ())
 
-(defmethod import-handler-spool-files ((handler image-import-handler))
+(defmethod import-handler-spool-files ((handler import-images-handler))
   (image-directory-recursive (import-handler-import-pathname handler)))
 
-(defmethod handle-form ((handler image-import-handler) action)
+(defmethod handle-form ((handler import-images-handler) action)
   (with-bknr-page (:title #?"image import directory")
     ((:form :method "post")
      ((:div :class "keyword-choose")
@@ -25,11 +25,11 @@
 	     "Set keywords from directory"))
       (:div (submit-button "import" "Import"))))
     ((:div :class "import-list")
-     (:h2 "Images present in import spool:")
+     (:h2 "Images present in import spool directory " (:b (:princ (import-handler-import-pathname handler))))
      (loop for file in (import-handler-spool-files handler)
 	   do (html (:princ-safe (namestring file)) (:br))))))
 
-(defmethod import-handler-import-files ((handler image-import-handler))
+(defmethod import-handler-import-files ((handler import-images-handler))
   (let* ((keywords (keywords-from-query-param-list (query-param-list "keyword")))
 	 (spool-dir (import-handler-import-pathname handler))
 	 (class-name (apply #'find-symbol (reverse (split "::?" (query-param "class-name"))))))
@@ -40,7 +40,7 @@
 		      :spool (import-handler-spool-dir handler)
 		      :keywords-from-dir (query-param "keyfromdir"))))
 
-(defmethod handle-form ((handler image-import-handler) (action (eql :import)))
+(defmethod handle-form ((handler import-images-handler) (action (eql :import)))
   (let* ((import-log (import-handler-import-files handler))
 	 (successful-images (remove-if-not #'(lambda (element) (typep element 'store-image))
 					   import-log




More information about the Bknr-cvs mailing list