You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@manifoldcf.apache.org by kw...@apache.org on 2015/06/15 13:19:21 UTC

svn commit: r1685547 - in /manifoldcf/trunk: CHANGES.txt framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Author: kwright
Date: Mon Jun 15 11:19:21 2015
New Revision: 1685547

URL: http://svn.apache.org/r1685547
Log:
Fix for CONNECTORS-1213.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1685547&r1=1685546&r2=1685547&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Jun 15 11:19:21 2015
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.2-dev =====================
 
+CONNECTORS-1213: Job notification information did not export/import
+correctly.
+(Cathal McGuinness, Karl Wright)
+
 CONNECTORS-1203: SharePoint connector did not consistently use
 internal metadata names throughout.
 (Dale Dreiske, Karl Wright)

Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java?rev=1685547&r1=1685546&r2=1685547&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java Mon Jun 15 11:19:21 2015
@@ -124,7 +124,7 @@ public class JobManager implements IJobM
     throws java.io.IOException, ManifoldCFException
   {
     // Write a version indicator
-    ManifoldCF.writeDword(os,6);
+    ManifoldCF.writeDword(os,8);
     // Get the job list
     IJobDescription[] list = getAllJobs();
     // Write the number of authorities
@@ -183,6 +183,16 @@ public class JobManager implements IJobM
         ManifoldCF.writeString(os,job.getPipelineStageDescription(j));
         ManifoldCF.writeString(os,job.getPipelineStageSpecification(j).toXML());
       }
+      
+      // Write notification information
+      ManifoldCF.writeDword(os,job.countNotifications());
+      for (int j = 0; j < job.countNotifications(); j++)
+      {
+        ManifoldCF.writeString(os,job.getNotificationConnectionName(j));
+        ManifoldCF.writeString(os,job.getNotificationDescription(j));
+        ManifoldCF.writeString(os,job.getNotificationSpecification(j).toXML());
+      }
+
     }
   }
 
@@ -209,7 +219,7 @@ public class JobManager implements IJobM
     throws java.io.IOException, ManifoldCFException
   {
     int version = ManifoldCF.readDword(is);
-    if (version != 5 && version != 6)
+    if (version != 5 && version != 6 && version != 8)
       throw new java.io.IOException("Unknown job configuration version: "+Integer.toString(version));
     int count = ManifoldCF.readDword(is);
     for (int i = 0; i < count; i++)
@@ -269,6 +279,18 @@ public class JobManager implements IJobM
         job.addPipelineStage(prerequisite,isOutput == 0x1,connectionName,description).fromXML(specification);
       }
       
+      if (version >= 8)
+      {
+        int notificationCount = ManifoldCF.readDword(is);
+        for (int j = 0; j < notificationCount; j++)
+        {
+          String connectionName = ManifoldCF.readString(is);
+          String description = ManifoldCF.readString(is);
+          String specification = ManifoldCF.readString(is);
+          job.addNotification(connectionName, description).fromXML(specification);
+        }
+      }
+      
       // Attempt to save this job
       save(job);
     }