111 lines
3.2 KiB
Plaintext
111 lines
3.2 KiB
Plaintext
|
|
|
|
HttpExtensionProc():
|
|
|
|
- ListSharedPrinter():
|
|
- pAllInfo->iQueryCommand = CMD_ListPrinters)
|
|
- dwRet = ParseTemplateFile(pAllInfo);
|
|
- PreProc.ProcessHTML
|
|
|
|
or
|
|
|
|
|
|
- ShowPrinterPage():
|
|
if (pAllInfo->iQueryCommand == CMD_Invalid)
|
|
pAllInfo->iQueryCommand = CMD_ListJobs;
|
|
|
|
case CMD_ListJobs:
|
|
case CMD_ShowDetails:
|
|
case CMD_ShowJobInfo:
|
|
dwRet = ParseTemplateFile(pAllInfo, &ppi);
|
|
break;
|
|
|
|
|
|
|
|
=======================================================================
|
|
|
|
LPSTR GetTemplateFileName(PALLINFO pAllInfo)
|
|
{
|
|
LPSTR pszBuf = pAllInfo->pf.szStringBuf0;
|
|
LPSTR pszTmp = NULL;
|
|
|
|
// Find the root filename
|
|
switch (pAllInfo->iQueryCommand)
|
|
{
|
|
case CMD_ListJobs : pszTmp = "prtpage.htm"; break;
|
|
case CMD_ListPrinters : pszTmp = "prtlist.htm"; break;
|
|
case CMD_ShowDetails : pszTmp = "prtdtail.htm"; break; //NOTIMPL
|
|
case CMD_ShowJobInfo : pszTmp = "prtjobd.htm"; break; //NOTIMPL
|
|
case CMD_CreateExe : pszTmp = "prtinst.htm"; break; //NOTIMPL
|
|
// CMD_UploadFile,
|
|
// CMD_Install,
|
|
// CMD_JobControl
|
|
// CMD_JobStart,
|
|
// CMD_JobData,
|
|
// CMD_JobEnd,
|
|
};
|
|
|
|
- CMD_ShowJobInfo is invoked when user click on the icon on the left most column of the
|
|
job table in prtpage.htm (see <a href={=WinPrt.PrinterCommandURL}?ShowJobInfo&{=WinPrt.JobID}>)
|
|
|
|
- CMD_ShowDetails is there, in prtpage.htm when you click "Show Printer Details..."
|
|
|
|
- So there are 4 HTML pages running.
|
|
|
|
- ShowJobInfo() and ShowDetails are not used......
|
|
|
|
|
|
==========================================================================
|
|
|
|
prthtml.cxx:
|
|
|
|
- m_pTemplateData -> points to the beginning of the template file.
|
|
- m_pIn -> points to somewhere within the loaded template file.
|
|
|
|
==============
|
|
|
|
|
|
{WinPrt.PrinterCommandURL} writes: /scripts/sharename/.printer
|
|
{=WinPrt.PrinterShareURL} is http://server/sharename not used really for "href" commands.
|
|
|
|
|
|
|
|
|
|
{=WinPrt.PrinterCommandURL}?ShowDetails loads prtdtail.htm (print prop details page)
|
|
{=WinPrt.PrinterDetailsURL}
|
|
|
|
|
|
{=WinPrt.PrinterCommandURL}?CreateExe loads prtinst.htm (print install page)
|
|
{=WinPrt.PrinterInstallURL}
|
|
|
|
{=WinPrt.PrinterCommandURL}?ShowJobInfo&{=WinPrt.JobID}> loads prtjobd.htm (job detail page)
|
|
{=WinPrt.JobDetailsURL}
|
|
Job specific tags like this one are only valid in ShowJobInfo (prtjobd.htm) and inside BeginJob loop.
|
|
|
|
|
|
|
|
How can a custom tag get the job id? Add a JobID field to the struct and have it be filled for
|
|
the cases where JobID is relavant, like when inside a BeginJob or in ShowJobInfo page.
|
|
|
|
|
|
|
|
How to send commnads? call an exported API out of the tag processor.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
==================
|
|
|
|
Sharing:
|
|
|
|
1) If ISAPI installed, create wwwroot/sharename for all printrers. Currently done by
|
|
ShareThisPrinter() which is called during spooler init and later on.
|
|
|
|
2) If need to share all printers, including not shared ones, then during SplAddPrinter() create a
|
|
URL friendly name, and create wwwroot\thisURLFriendlyName. It could be done by replacing bad chars
|
|
with '_', then adding 1, 2, 3 to the end for uniqueness.
|
|
|
|
3) Currently WebUnshare is called from ShareThisPrinter() when the printer is being unshared, and it
|
|
deletes the wwwroot\sharename. |