• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Changing the user owner of a PrintJob

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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:



 
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic