diff options
author | Andrew Haley <aph@redhat.com> | 2010-04-27 16:52:33 +0000 |
---|---|---|
committer | Andrew Haley <aph@redhat.com> | 2010-04-27 16:52:33 +0000 |
commit | 9f2d38f872127e43bdbca9c5c8eaf81dafe7039c (patch) | |
tree | 3794ab31d8f5471c18579ddb496557760ffa8854 /gnu | |
parent | 0e24d2cf64e4384186a0b11489c139e645fd6743 (diff) | |
download | classpath-9f2d38f872127e43bdbca9c5c8eaf81dafe7039c.tar.gz |
2010-04-27 Andrew Haley <aph@redhat.com>
* gnu/javax/print/ipp/IppResponse.java (parseAttributes): Handle
IppValueTag.UNKNOWN.
* gnu/javax/print/ipp/IppRequest.java (writeOperationAttributes):
Handle RequestedAttributes.
* gnu/javax/print/ipp/IppPrintService.java (processResponse): Add
DocFlavor.SERVICE_FORMATTED.PAGEABLE and
DocFlavor.SERVICE_FORMATTED.PRINTABLE.
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/javax/print/ipp/IppPrintService.java | 11 | ||||
-rw-r--r-- | gnu/javax/print/ipp/IppRequest.java | 8 | ||||
-rw-r--r-- | gnu/javax/print/ipp/IppResponse.java | 11 |
3 files changed, 25 insertions, 5 deletions
diff --git a/gnu/javax/print/ipp/IppPrintService.java b/gnu/javax/print/ipp/IppPrintService.java index ce3ef9e15..56a41381f 100644 --- a/gnu/javax/print/ipp/IppPrintService.java +++ b/gnu/javax/print/ipp/IppPrintService.java @@ -356,8 +356,17 @@ public class IppPrintService implements PrintService // should not happen, all fields are public } } + + if (this.getClass() + .isAssignableFrom(gnu.javax.print.CupsPrintService.class)) + { +// CUPS always provides filters to convert from Postscript. +// This logic looks odd, but it's what OpenJDK does. + flavors.add(DocFlavor.SERVICE_FORMATTED.PAGEABLE); + flavors.add(DocFlavor.SERVICE_FORMATTED.PRINTABLE); + } } - + // printer uris Set uris = getPrinterAttributeSet(PrinterUriSupported.class); printerUris = new ArrayList(uris.size()); diff --git a/gnu/javax/print/ipp/IppRequest.java b/gnu/javax/print/ipp/IppRequest.java index 3de88715a..869f8224b 100644 --- a/gnu/javax/print/ipp/IppRequest.java +++ b/gnu/javax/print/ipp/IppRequest.java @@ -434,6 +434,8 @@ public class IppRequest PrinterURI printerUri = (PrinterURI) attributes.get(PrinterURI.class); JobUri jobUri = (JobUri) attributes.get(JobUri.class); JobId jobId = (JobId) attributes.get(JobId.class); + RequestedAttributes reqAttrs + = (RequestedAttributes)attributes.get(RequestedAttributes.class); if (printerUri != null && jobId == null && jobUri == null) { write(printerUri); @@ -467,6 +469,12 @@ public class IppRequest logger.log(Component.IPP, "Attribute: Name: <" + jobUri.getCategory() .getName() + "> Value: <" + jobUri.toString() + ">"); } + else if (reqAttrs != null) + { + write(reqAttrs); + attributes.remove(RequestedAttributes.class); + logger.log(Component.IPP, "RequestedAttributes: <" + reqAttrs + ">"); + } else { throw new IppException("Unknown target operation attribute combination."); diff --git a/gnu/javax/print/ipp/IppResponse.java b/gnu/javax/print/ipp/IppResponse.java index 21784d0f0..81a1eb47b 100644 --- a/gnu/javax/print/ipp/IppResponse.java +++ b/gnu/javax/print/ipp/IppResponse.java @@ -302,11 +302,14 @@ public class IppResponse // out-of-band values case IppValueTag.UNSUPPORTED: case IppValueTag.UNKNOWN: - case IppValueTag.NO_VALUE: // TODO implement out-of-band handling - // We currently throw an exception to see when it occurs - not yet :-) - throw new IppException( - "Unexpected name value for out-of-band value tag"); + // We currently throw an exception to see when it occurs - not yet :-) + throw new IppException( + "Unexpected name value for out-of-band value tag " + tag); + case IppValueTag.NO_VALUE: + attribute = null; + + break; case IppValueTag.INTEGER: int intValue = IppUtilities.convertToInt(value); attribute = IppUtilities.getIntegerAttribute(name, intValue); |