commit b8cb0ca1acac411e0dc1672b36b8288f62f18c70
parent 5917ee1ecaecb951de9bf890b69f028fdfd9ddaa
Author: Tomas Hlavaty <tom@logand.com>
Date: Sat, 10 Aug 2013 23:46:56 +0200
validate-job implemented
Diffstat:
M | ipp.lisp | | | 63 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--- |
1 file changed, 60 insertions(+), 3 deletions(-)
diff --git a/ipp.lisp b/ipp.lisp
@@ -25,7 +25,8 @@
(:export :create-job
:get-jobs
:list-printers
- :print-job))
+ :print-job
+ :validate-job))
(in-package :ipp)
@@ -90,7 +91,9 @@
(:job-state . nil)
(:job-state-reasons . nil)
(:limit . :integer)
- (:requested-attributes . :keyword))))
+ (:requested-attributes . :keyword)
+ (:status-message . :nameWithoutLanguage) ;; TODO really?
+ )))
(defun attribute-tag (attribute)
(or (cdr (assoc attribute attributes))
@@ -348,7 +351,50 @@
:copies ,copies
:sides ,sides))))
-;; TODO validate-job
+(defun validate-job (ipp-client
+ printer-uri
+ request-file
+ response-file
+ request-id
+ &key
+ (attributes-charset "utf-8")
+ (attributes-natural-language "en")
+ (requesting-user-name (user-name))
+ job-name
+ (ipp-attribute-fidelity t)
+ document-name
+ document-format
+ document-natural-language
+ compression
+ job-k-octets
+ job-impressions
+ job-media-sheets
+ copies
+ sides)
+ (ipp ipp-client
+ printer-uri
+ request-file
+ response-file
+ nil
+ request-id
+ :validate-job
+ `((,(tag :operation-attributes-tag)
+ :attributes-charset ,attributes-charset
+ :attributes-natural-language ,attributes-natural-language
+ :printer-uri ,printer-uri)
+ (,(tag :job-attributes-tag)
+ :requesting-user-name ,requesting-user-name
+ :job-name ,job-name
+ :ipp-attribute-fidelity ,ipp-attribute-fidelity
+ :document-name ,document-name
+ :document-format ,document-format
+ :document-natural-language ,document-natural-language
+ :compression ,compression
+ :job-k-octets ,job-k-octets
+ :job-impressions ,job-impressions
+ :job-media-sheets ,job-media-sheets
+ :copies ,copies
+ :sides ,sides))))
(defun create-job (ipp-client
printer-uri
@@ -550,6 +596,17 @@
)
#+nil
+(ipp:validate-job 'ipp-client
+ "http://localhost:631/printers/Virtual_PDF_Printer"
+ "request2.dat"
+ "response2.dat"
+ 314
+ :ipp-attribute-fidelity nil
+ :copies 2
+ :sides "two-sided-long-edge"
+ )
+
+#+nil
(ipp:create-job 'ipp-client
"http://localhost:631/printers/Virtual_PDF_Printer"
"create-jobs.in"