Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Trouble finding source of PBM error problem



Thanks Paul,

On Mon, 23 Jun 2003 11:29:19 -0700, Paul Danbold <email@hidden> said:

>> - after clicking the Add button, i get the -1 error *before* the PM is
>> called to get its tickets and PDE paths! could it be the because of the
>> selected printer array returned from my PBM?
>
>Probably, please see comments below.

The short version is: I changed the URI to "file://dev/null" like you
suggested but I'm still get the -1 error.

>> <dict>
>> <key>Address</key>
>> <string>10.1.2.4</string>
>> <key>Connection</key>
>> <string>Generic LPR</string>
>> <key>Host</key>
>> <string>10.1.2.4</string>
>> <key>Model</key>
>> <string>Stylus Photo 750</string>
>> <key>Printer URI</key>
>> <string>lpd://10.1.2.4</string>
>
>You are specifying a cups backend with this key, but you're setting up
>a queue for a Tioga PM. For a Tioga PM the device URI must be
>file://dev/null.
...
>> dict to return from GetSelectedPrinters...
>> <dict>
>> <key>PrBrowser Selection Address</key>
>> <data>
...
>What's in the address dictionary? For cups queues, including
>PostScript printers, this key takes a dictionary containing the URL to
>the PPD file and the backend. Make sure your custom PBM does not
>include a kPMPPDNameKey in the kPMPrBrowserSelectAddrKey, otherwise we
>assume a cups driver.

The address dictionary was above, with "lpd://" in it. It doesn't include
kPMPPDNameKey, the comments in the LPR sample made it clear that I didn't
want that (yay for well commented sample code!).

Let me reorganize my PBM's log:


dict to return from GetSelectedPrinters (after adding lookupref
and putting in a CFArray):
==
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PrBrowser Selection Address</key>
<data>
PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIHBs
aXN0IFBVQkxJQyAiLS8vQXBwbGUgQ29tcHV0ZXIvL0RURCBQTElTVCAxLjAvL0VOIiAi
aHR0cDovL3d3dy5hcHBsZS5jb20vRFREcy9Qcm9wZXJ0eUxpc3QtMS4wLmR0ZCI+Cjxw
bGlzdCB2ZXJzaW9uPSIxLjAiPgo8ZGljdD4KCTxrZXk+QWRkcmVzczwva2V5PgoJPHN0
cmluZz4xMC4wLjAuMTwvc3RyaW5nPgoJPGtleT5Db25uZWN0aW9uPC9rZXk+Cgk8c3Ry
aW5nPk5vbi1Qb3N0U2NyaXB0IExQUjwvc3RyaW5nPgoJPGtleT5Ib3N0PC9rZXk+Cgk8
c3RyaW5nPjEwLjAuMC4xPC9zdHJpbmc+Cgk8a2V5Pk1vZGVsPC9rZXk+Cgk8c3RyaW5n
PlN0eWx1cyBQaG90byA3NTA8L3N0cmluZz4KCTxrZXk+UHJpbnRlciBVUkk8L2tleT4K
CTxzdHJpbmc+ZmlsZTovL2Rldi9udWxsPC9zdHJpbmc+Cgk8a2V5PlF1ZXVlPC9rZXk+
Cgk8c3RyaW5nPjwvc3RyaW5nPgo8L2RpY3Q+CjwvcGxpc3Q+Cg==
</data>
<key>PrBrowser Selection Kind</key>
<string>lpr host</string>
<key>PrBrowser Selection Name</key>
<string>10.0.0.1</string>
</dict>
</plist>
==
where PrBrowser Selection Address is:
==
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://
www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Address</key>
<string>10.0.0.1</string>
<key>Connection</key>
<string>Non-PostScript LPR</string>
<key>Host</key>
<string>10.0.0.1</string>
<key>Model</key>
<string>Stylus Photo 750</string>
<key>Printer URI</key>
<string>file://dev/null</string>
<key>Queue</key>
<string></string>
</dict>
</plist>
ubctrl==
LPR PBM LPRBrowserView::GetSelectedPrinters: result = 0


Notice I'm now putting in "file://dev/null" for the URI. But I'm still
getting the -1 alert the same as before. Is there something else wrong
with what I'm returning from GetSelectedPrinters? Is the address included
incorrectly in the "PrBrowser Selection Address" key of the enclosing
dictionary?

Is it time to burn a support incident on this? Would it be appropriate
for my colleague at WWDC to take it to the DTS lounge?

Thanks for your help on this.


A tangential issue: About the URI in the address dictionary, I'm a little
bit confused. I log the address passed to my Tioga PM's Initialize
function, and when successfully creating a USB queue, the address my PM
gets contains a valid Printer URI and not "file://dev/null":

<dict>
<key>Location</key>
<string>Pierre's Pismo</string>
<key>MANUFACTURER:</key>
<string>HEWLETT-PACKARD</string>
<key>MODEL:</key>
<string>DESKJET 895C</string>
<key>Printer URI</key>
<string>usb://HEWLETT-PACKARD/
DESKJET%20895C?serial=000000000000</string>
<key>SERN:</key>
<string>000000000000</string>
<key>USBAddressLocationID</key>
<string>100000</string>
</dict>


To continue the tangent, I would have liked to rely on the presence of a
valid URI key since it would improve the PM code that inspects address
dictionaries. Or at least a consistent kConnectionType key in the
address, like the LPR PBM sample says to include, but which the USB PBM
doesn't.

Also,

>> - it looks like my PM's CreatePrinterBrowserModuleInfo function isnt
>> getting called when my PBM opens, has its info dict been cached?
>
>We call CreatePrinterBrowserModuleInfo when we scan for PMs, prior to
>bringing up your PBM in Print Center.

Right, I forgot that. And searching my list archives for "cache" found
mention of this Print Center cache in ~/Library/Preferences/ByHost/
Removing this file made Print Center rescan my PM when I expected it to -
sanity restored.

Thanks again.

--
Pierre Houston <mailto:email@hidden>
Senior Software Engineer Direct Ph: (604) 296-3635
Strydent Software, Inc. <http://www.strydent.com>
Suite 488 - 2608 Granville St. Office Ph: (604) 296-3600
Vancouver, BC, Canada V6H 3V3 Fax: (604) 296-3699
_______________________________________________
printing mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/printing
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Trouble finding source of PBM error problem (From: Paul Danbold <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.