Printing postscript files without user intervention
I have a situation, we use jcaps/egate a product that incorporates java in its programming. Egate is used as a tool interfacing our patient database to external systems.
We are decomissioning the old system and moving to this new system in a few months.
Scenario:
a test result enters our system as a file as postscript/pcl form. File name contains patient ID.
I can using JAVA and Egate/jcaps pull the name apart, grab the ID, find outwhere the patient is and grab an associated printer queue associated with a ward the patient resides.
What I need to work out is how to, in java, grab the file (I will have reference to it includeing actual name and directory) and using the calculated printer queue, print this file to the queue. AND I have to monitor the print job. I have to confirm its been printed, if printed then the result file gets moved into a 'printed' area (I believe I can work this out) if it is not printed then it goes back into the 'pool' of reports to print and another attempt to print is made in a few minutes. And the process repeats. (I think I have a handle on moving, its the printing and printer/job status i having issue with)
I need to grab code that does the following:
1 - identifies whether the printer is available (idle or ready or some other 'ready' type status)
2 - print document to this printer queue.
3 - monitor print job until result returned (good, bad, cant print, printed)
- result determines whether file moved to done or retruned to print pool to try printing again later.
We currently do this on a VMS device, accessing datafiles on the VMS box, we utilise 2 methods, looking at VMS print queue status, and also using HP JetDirect syslogd server facilites on jet direct printers. If we can achieve this in java and using egate/jcaps this will also allow us to remove reliance on jet direct devices and use networked printers.
The printer queues would be constructed under a windows environment (Windows server 2003 Release 2)
I am new to java programming, coming from a non object oriented programming background I have been finding it difficult to get my head around things, but being able to play and test I have picked things up better than reading copious books, but thats not saying I wont read for results, I have attempted numerous web searches but still come up with not the right result I was looking for.
If anyone is able to point me to some resources that I could use or assist me I would be most greatful.
D