@@ -61,6 +61,15 @@ open class IppPrinter(
6161 " media-source-supported" ,
6262 " ipp-versions-supported"
6363 )
64+ val cupsGetJobsRequestedAttributes = listOf (
65+ " job-id" ,
66+ " job-uri" ,
67+ " job-printer-uri" ,
68+ " job-state" ,
69+ " job-state-reasons" ,
70+ " job-name" ,
71+ " job-originating-user-name"
72+ )
6473 }
6574
6675 init {
@@ -122,10 +131,9 @@ open class IppPrinter(
122131 fun basicAuth (user : String , password : String ) =
123132 ippClient.basicAuth(user, password)
124133
125- var getJobsRequestedAttributes = mutableListOf (
126- " job-id" , " job-uri" , " job-printer-uri" , " job-state" , " job-name" ,
127- " job-state-reasons" , " job-originating-user-name"
128- )
134+ var getJobsRequestedAttributes: List <String >? =
135+ if (isCups()) cupsGetJobsRequestedAttributes
136+ else null // Printer or server decides which attributes to return.
129137
130138 // ---------------
131139 // IPP attributes
@@ -511,7 +519,7 @@ open class IppPrinter(
511519 whichJobs : WhichJobs ? = null,
512520 myJobs : Boolean? = null,
513521 limit : Int? = null,
514- requestedAttributes : List <String >? = getJobsRequestedAttributes
522+ requestedAttributes : List <String >? = getJobsRequestedAttributes // see also RFC 8011 Section 5.3
515523 ): Collection <IppJob > {
516524 logger.fine { " getJobs(whichJobs=$whichJobs , requestedAttributes=$requestedAttributes )" }
517525 val request = ippRequest(GetJobs , requestedAttributes = requestedAttributes).apply {
0 commit comments