Intercepting/Preventing the popups on Document Distributions
- Prevent the SoftPro controlled Email/Publish/Save to File modal boxes from showing?
- Or how can I make the system run the Email print spooler last?
- Or how could I have SoftPro disable the other 3 distribution options when Email is selected?
I wrote a print job handler to replace the default email handler, following all of the examples and SDK documentation... but everything I have runs "After" SoftPro asks the user for input like the printer, the contacts, the attachment folder, or the file path. That is my problem.
More background to explain... I've registered all 3 print job stages and check the metadata to determine if someone is selecting "Email" to override and "do my own thing". So in the shell class header:
Code: Select all
//Print Job [ProvidePrintJobHandler("Q4 Print Job Pre Process Handler", typeof(KBTShell.CustomClasses.Q4PrintJobPreProcess), PrintJobStage.Preprocessing, 10)] [ProvidePrintJobHandler("Q4 Print Job Handler", typeof(KBTShell.CustomClasses.Q4PrintJobProcess), PrintJobStage.Processing, 10)] [ProvidePrintJobHandler("Q4 Print Job Post Handler", typeof(KBTShell.CustomClasses.Q4PrintJobPostProcess), PrintJobStage.Postprocessing, 10)]
Code: Select all
//Print job override base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobPreProcess()); base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobProcess()); base.RegisterPrintJobHandler(new KBTShell.CustomClasses.Q4PrintJobPostProcess());
My override of the email print job has its own dialog, which I show modally through a timer after the the print job overrides run. This works great and allows me a to develop a highly complex delivery system to meet all of our needs. I do it by simply initializing and passing in the printjob into the main shell reference, then enabling a variable which is on a timer to determine if it should show the form in the main shell class. So I run this on the post process override function. Again... works great!
Code: Select all
// Offload the values to an internal variable and set a timer on the main // shell class to run this AFTER the print job handler finishes so the dialog does not end up // showing "behind" the main SoftPro window. KBTShell.KBT.Q4DeliverySystemDialog = KBTShell.Helpers.PrinterHelpers.GetEmailDialog(printJob, ss); KBTShell.KBT.SOFTPRO_SHOW_EMAIL_DELIVERY = true; // Stop the email print job since everything else will be handled by the custom delivery system // that will open in 1 second. return PrintJobHandlerResult.Stop;
However, I am now finding that our users want to distribute to more than just email. They often click email and "Publish". Now, I can do both in one shot in my delivery system... but we now have the same z-index problem because both "Publish" and "Save as File" have system generated modal boxes (Email does too, but I use it to allow the user to select the recipients, so it's ok if that stays).
The print spooler does each of these 4 jobs independently and sequentially (with Email being second, always), so I now have the problem of having dual modal boxes open and the interface locking because my dialog opens after the Email spooler, executed on a timer, but the print subsystem still has to go through the whole process for "Publish." That means this box is shown modally, behind my dialog, which is also shown modally, causing the interface to become unresponsive.
So that is what shows up that gets "hidden" behind my interface, which is also modal "first" but technically shows up in the front.
If I check both "Email" and "Publish", I get the system email box (I'd rather not get it, but I can work with it or just tell people to click on through). Then they select a few email addresses and click OK here. Because I have no known way of preventing the "Publish" or "Save to File" pop ups if those options are also checked, we get locked up due to the z-index issue from conflicting modals.
The only thing close to a solution I've found is to set my dialog to be TopMost = false, but then an subsequent SoftPro input popups for "Publish" or "Save to File" will sit "on top" of the email system interface. This results in a "usable" but very confusing screen for the user.
That's at least usable, but it is going to confuse the heck out of the hundreds of people that use this unless we train them to never do more than one of the 4 options... also a solution, but I'd rather prevent the problem from happening and not rely on the users to remember one additional thing in their already extensive training.
Maybe I'm just looking for the wrong things... but in v 4.3, I don't see anything in the SDK that gets me any sort of hook, override, or control from any part of the Document Distribution screen. We are planning on working with SoftPro soon to get to a newer version of Select in case the answer to my problem lies there.
Thanks in advance. -Jason