• Post Reply Bookmark Topic Watch Topic
  • New Topic

Changing the user owner of a PrintJob  RSS feed

 
Samuel Etterlen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi There,

In reference of Changing the printjob owner , i'm trying to set the JobOriginatingUserName of a PrintJob.

I set my Attribute like this:
HashPrintJobAttributeSet aset = new HashPrintJobAttributeSet();
aset.add(new JobOriginatingUserName("myusername", null));

I can set it to a PrintService like this:
     PrintService[] services = PrintServiceLookup.lookupPrintServices(null, aset);

But I can't set it to a docPrintJob:
job.print(myDoc, jobAttrSet);

Did somebody have some documentation on it ? My goal is to see my PrintJob in the printer manager running with the name "myusername" and not thename of the user who start the Java process....
 
Brett Spell
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, there's no way to set the user of a print job. JobOriginatingUserName is really only intended to be used to query (not set) the user name, which is why you can't assign a value for a PrintRequestAttributeSet.

As far as documentation on this goes, I believe this would be the most relevant page I can find offhand: Attribute Roles.

Basically what it says is that not every attribute is valid in every context.
 
Samuel Etterlen
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your precise answer...

In an other way, did you think that it's possible to instanciate a class on behalf of an other user ?
I saw that it's possible to do this in .net like this:



 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!