]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 96] HylaFAX faxqclean, doneop: archive is an empty function
authorDarren Nickerson <darren.nickerson@ifax.com>
Fri, 3 May 2002 17:52:23 +0000 (17:52 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Fri, 3 May 2002 17:52:23 +0000 (17:52 +0000)
Added preliminary support for basic archiving - thanks Lee

configure
distrules
faxd/faxQCleanApp.c++
man/faxqclean.1m
man/faxstat.1
man/sendfax.1
pkg/sproto.stub.in
sendfax/sendfax.c++
util/Makefile.in
util/SendFaxJob.c++
util/SendFaxJob.h

index bd7f5bf5f12b63e98735a2d826344782efcf29e2..c2b1309167811a99ce40724c653b9c3a97dc26b3 100755 (executable)
--- a/configure
+++ b/configure
@@ -4612,6 +4612,7 @@ CONF_FILES="
     util/recvstats.sh
     util/faxcron.sh
     util/pagesizes
+    util/archive.sh
     util/faxrcvd.sh
     util/mkcover.sh
     util/notify.sh
index 6fabc1ce97993c0b98b37dcb1a33fd1620927255..82b6de9ca7299e9128ef698fff035c9b845880a5 100644 (file)
--- a/distrules
+++ b/distrules
@@ -344,6 +344,7 @@ HYLAFAXSRC=\
        util/pagesizes.in                       \
        util/notify.awk                         \
        util/faxcron.sh.in                      \
+       util/archive.sh                         \
        util/faxrcvd.sh                         \
        util/mkcover.sh                         \
        util/notify.sh                          \
index cf078e03311f0bf0958177389174cc6981031562..361a6d84935c5776fabe81eebf50a988fce0198f 100644 (file)
@@ -159,9 +159,8 @@ faxQCleanApp::scanDirectory(void)
                    } else if (archiving &&
                      strncmp(req->doneop, "archive", 7) == 0) {
                        /*
-                        * Job should be archived, create an entry in the
-                        * archive directory that contains the job's state,
-                        * references to the documents, and the session logs.
+                        * Job should be archived, pass the jobid
+                        * value to the archive script for archiving.
                         */
                        if (verbose)
                            printf("JOB %s: archive (%s)%s.\n"
@@ -241,8 +240,13 @@ faxQCleanApp::collectRefs(const FaxRequest& req)
  * Archive completed fax job.
  */
 void
-faxQCleanApp::archiveJob(const FaxRequest&)
+faxQCleanApp::archiveJob(const FaxRequest& req)
 {
+    // hand the archiving task off to the archiving command
+    fxStr cmd("bin/archive"
+       | quote |             req.jobid | enquote
+    );
+    runCmd(cmd, true);
 }
 
 /*
index 5c682fc28f95f22a0f7ee9750e758537db1f3249..5369ba43d8dc3954a6af8ee1c0b2c1ba2f2be953 100644 (file)
@@ -76,7 +76,6 @@ a specified threshold are removed.
 .TP 10
 .B \-a
 Enable job archiving support.
-\fINB: v4.0 does not include support for job archiving.\fP
 .TP 10
 .BI \-j " secs"
 Set the job age threshold (in seconds)
index 548c81edfdb31b3eeb5c12e1bf7fd0792ce8a459..8622c2d7c17a36b93fcf2ac5afbd3c660382c2c5 100644 (file)
@@ -91,11 +91,9 @@ directory on the server machine.
 .SH OPTIONS
 .TP 10
 .B \-a
-Display the status of all jobs that are stored in the
+Display the contents of the
 .B archive
 directory on the server machine
-(\fINB: this will always be empty for v4.0 because there is no
-support for job archiving\fP).
 .TP 10
 .B \-d
 Display the status of all jobs that have completed; i.e. those
index 513522a192c2b0d3bb74c263cc89f878fd654711..bea886016653521380f839b2c48f81dde8b7849b 100644 (file)
@@ -236,6 +236,10 @@ By default,
 schedules facsimile for immediate delivery.  Time should be given 
 in the user's local time.
 .TP
+.BI \-A
+Archive the job on the server according to the
+bin/archive script when the job is done.
+.TP
 .BI \-b " speed"
 Transmit facsimile documents using a signalling rate that is
 constrained to be at least
index a6b7897b6aba03facee2756f862061533e673b62..d7ef4d748691f30add106a2b6d02137a5ab3fcf3 100644 (file)
@@ -126,6 +126,7 @@ f none @SPOOL@/bin/pcl2fax=../util/pcl2fax.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/tiff2fax=../util/tiff2fax.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/notify=../util/notify.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/notify.awk=../@SRCDIR@/util/notify.awk 0444 @SYSUID@ @SYSGID@
+f none @SPOOL@/bin/archive=../util/archive.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/faxrcvd=../util/faxrcvd.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/pollrcvd=../util/pollrcvd.sh 0755 @SYSUID@ @SYSGID@
 f none @SPOOL@/bin/mkcover=../util/mkcover.sh 0755 @SYSUID@ @SYSGID@
index 9fc5d828ea66ec821389a16fc1e06bb58561f78d..a79e74f22f39a3a15af770bba6a994f97f50425d 100644 (file)
@@ -86,7 +86,7 @@ sendFaxApp::run(int argc, char** argv)
     int verbose = 0;
     SendFaxJob& proto = getProtoJob();
     db = new FaxDB(tildeExpand(dbName));
-    while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:U:V:W:x:X:y:Y:12lmnpvwDENR")) != -1)
+    while ((c = Sys::getopt(argc, argv, "a:b:B:c:C:d:f:F:h:i:I:k:M:P:r:s:t:T:U:V:W:x:X:y:Y:12lmnpvwADENR")) != -1)
     switch (c) {
     case '1':                  // restrict to 1D-encoded data
         proto.setDesiredDF(0);
@@ -97,6 +97,9 @@ sendFaxApp::run(int argc, char** argv)
     case 'a':                  // time at which to transmit job
         proto.setSendTime(optarg);
         break;
+    case 'A':                  // archive job
+        proto.setDoneOp("archive");
+        break;
     case 'b':                  // minimum transfer speed
         proto.setMinSpeed(optarg);
         break;
index 40c7fb9f6cbbc9c64f923c7dace58e0ab7746398..6da078b6aec92d36aba1a1121fdac9b311f3b3b4 100644 (file)
@@ -179,6 +179,7 @@ install: installClient
        ${PUTSUPD} -m 755 -src tiff2fax.sh -O tiff2fax
        ${PUTSUPD} -m 755 -src notify.sh -O notify
        ${PUTSUPD} -m 444 -src ${SRCDIR}/notify.awk -O notify.awk
+       ${PUTSUPD} -m 755 -src archive.sh -O archive
        ${PUTSUPD} -m 755 -src faxrcvd.sh -O faxrcvd
        ${PUTSUPD} -m 755 -src pollrcvd.sh -O pollrcvd
        ${PUTSUPD} -m 755 -src mkcover.sh -O mkcover
@@ -197,4 +198,4 @@ clobberconfig:
        -${RM} -f pagesizes xferfaxstats.sh recvstats.sh faxcron.sh \
                faxrcvd.sh mkcover.sh notify.sh pcl2fax.sh pollrcvd.sh \
                ps2fax.dps.sh ps2fax.gs.sh ps2fax.imp.sh tiff2fax.sh \
-               wedged.sh
+               wedged.sh archive.sh
index c049b8d9a7d52c04035c90020e20cdd8f615643c..949b1f0f527419bffffd7bca8464439fa6bb7de7 100644 (file)
@@ -201,6 +201,8 @@ SendFaxJob::setConfigItem(const char* tag, const char* value)
 #define        valeq(a,b)      (strcasecmp(a,b)==0)
 #define        valneq(a,b,n)   (strncasecmp(a,b,n)==0)
 
+void SendFaxJob::setDoneOp(const char* v)      { doneop = v; }
+
 bool
 SendFaxJob::setNotification(const char* v0)
 {
@@ -487,6 +489,9 @@ SendFaxJob::createJob(SendFaxClient& client, fxStr& emsg)
        CHECKPARM("USETAGLINE", true)
        CHECKPARM("TAGLINE", tagline)
     }
+    if (doneop == "archive") {
+       CHECKPARM("DONEOP", "archive")
+    }
     CHECKPARM("NOTIFY",
        notify == when_done     ? "done" :
        notify == when_requeued ? "done+requeue" :
index 0a84073c5be840d246f785d2a3d9cf69da4860e5..80b15f4b8b1feb32721939ab8f7f38f0a065bf52 100644 (file)
@@ -68,6 +68,7 @@ private:
     fxStr      jobid;                  // job ID
     fxStr      groupid;                // job-group ID
     fxStr      jobtag;                 // user-specified job identifier
+    fxStr      doneop;                 // job doneop control
     FaxNotify  notify;                 // job notification control
     fxStr      mailbox;                // mail address for notification
 
@@ -130,6 +131,8 @@ public:
     const fxStr& getJobID(void) const;
     const fxStr& getGroupID(void) const;
 
+    void setDoneOp(const char*);
+
     /*
      * Job notification.
      */