manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1601882 - in /manifoldcf/trunk: ./ connectors/ connectors/forcedmetadata/ framework/crawler-ui/src/main/webapp/ framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/
Date Wed, 11 Jun 2014 13:15:46 GMT
Author: kwright
Date: Wed Jun 11 13:15:45 2014
New Revision: 1601882

URL: http://svn.apache.org/r1601882
Log:
Fix for CONNECTORS-961

Added:
    manifoldcf/trunk/connectors/forcedmetadata/
      - copied from r1601881, manifoldcf/branches/CONNECTORS-961/connectors/forcedmetadata/
Modified:
    manifoldcf/trunk/   (props changed)
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/pom.xml
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
    manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp
    manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/jobs/JobManager.java

Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
  Merged /manifoldcf/branches/CONNECTORS-961:r1601696-1601881

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1601882&r1=1601881&r2=1601882&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Jun 11 13:15:45 2014
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.7-dev =====================
 
+CONNECTORS-961: Debug pipeline usage in job UI, and add a Forced Metadata
+transformation connector that has a job tab.
+(Karl Wright)
+
 CONNECTORS-960: Remove Specification subclass usage from main connector API's.
 (Karl Wright)
 

Modified: manifoldcf/trunk/connectors/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/pom.xml?rev=1601882&r1=1601881&r2=1601882&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/pom.xml (original)
+++ manifoldcf/trunk/connectors/pom.xml Wed Jun 11 13:15:45 2014
@@ -60,6 +60,7 @@
     <module>regexpmapper</module>
     <module>email</module>
     <module>amazoncloudsearch</module>
+    <module>forcedmetadata</module>
   </modules>
 
 </project>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp?rev=1601882&r1=1601881&r2=1601882&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editjob.jsp Wed Jun 11 13:15:45
2014
@@ -184,11 +184,7 @@
 	{
 		outputConnection = outputMgr.load(outputName);
 	}
-	ITransformationConnection[] transformationConnections = new ITransformationConnection[transformationNames.length];
-	for (int j = 0; j < transformationConnections.length; j++)
-	{
-		transformationConnections[j] = transformationMgr.load(transformationNames[j]);
-	}
+	ITransformationConnection[] transformationConnections = transformationMgr.loadMultiple(transformationNames);
 
 	// Set up the predefined tabs
 	tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editjob.Name"));
@@ -1050,6 +1046,8 @@
 		{
 			String transformationName = transformationNames[j];
 			String transformationDescription = transformationDescriptions[j];
+			if (transformationDescription == null)
+				transformationDescription = "";
 %>
 						<tr class="<%=((displaySequence % 2)==0)?"evenformrow":"oddformrow"%>">
 							<td class="formcolumncell">
@@ -1187,6 +1185,8 @@
 		{
 			String transformationName = transformationNames[j];
 			String transformationDescription = transformationDescriptions[j];
+			if (transformationDescription == null)
+				transformationDescription = "";
 %>
 		  <input type="hidden" name="pipeline_<%=j%>_connectionname" value="<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(transformationName)%>"/>
 		  <input type="hidden" name="pipeline_<%=j%>_description" value="<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(transformationDescription)%>"/>
@@ -1663,7 +1663,7 @@
 		{
 			try
 			{
-				outputConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),outputSpecification,1,tabSequenceInt,tabName);
+				outputConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),outputSpecification,1+transformationConnections.length,tabSequenceInt,tabName);
 			}
 			finally
 			{
@@ -1693,6 +1693,23 @@
 <%
 		}
 	}
+	
+	for (int j = 0; j < transformationConnections.length; j++)
+	{
+		ITransformationConnector transformationConnector = transformationConnectorPool.grab(transformationConnections[j]);
+		if (transformationConnector != null)
+		{
+			try
+			{
+				transformationConnector.outputSpecificationBody(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),transformationSpecifications[j],1+j,tabSequenceInt,tabName);
+			}
+			finally
+			{
+				transformationConnectorPool.release(transformationConnections[j],transformationConnector);
+			}
+		}
+	}
+
 %>
 		  <table class="displaytable">
 			<tr><td class="separator" colspan="4"><hr/></td></tr>

Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp?rev=1601882&r1=1601881&r2=1601882&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewjob.jsp Wed Jun 11 13:15:45
2014
@@ -142,8 +142,23 @@
 
 		int priority = job.getPriority();
 
-		IRepositoryConnection connection = connManager.load(job.getConnectionName());
-		IOutputConnection outputConnection = outputManager.load(job.getOutputConnectionName());
+		String connectionName = job.getConnectionName();
+		String outputName = job.getOutputConnectionName();
+		String[] transformationNames = new String[job.countPipelineStages()];
+		String[] transformationDescriptions = new String[job.countPipelineStages()];
+		for (int j = 0; j < job.countPipelineStages(); j++)
+		{
+			transformationNames[j] = job.getPipelineStageConnectionName(j);
+			String transformationDescription = job.getPipelineStageDescription(j);
+			if (transformationDescription == null)
+				transformationDescription = "";
+			transformationDescriptions[j] = transformationDescription;
+		}
+
+		IRepositoryConnection connection = connManager.load(connectionName);
+		IOutputConnection outputConnection = outputManager.load(outputName);
+		ITransformationConnection[] transformationConnections = transformationManager.loadMultiple(transformationNames);
+
 		int model = RepositoryConnectorFactory.getConnectorModel(threadContext,connection.getClassName());
 		String[] relationshipTypes = RepositoryConnectorFactory.getRelationshipTypes(threadContext,connection.getClassName());
 		Map hopCountFilters = job.getHopCountFilters();
@@ -180,18 +195,16 @@
 						<tr class="<%=((displaySequence % 2)==0)?"evenformrow":"oddformrow"%>">
 							<td class="formcolumncell"><%=(++displaySequence)%>.</td>
 							<td class="formcolumncell"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.RepositoryStage")%></td>
-							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(job.getConnectionName())%></td>
+							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)%></td>
 						</tr>
 <%
-		for (int j = 0; j < job.countPipelineStages(); j++)
+		for (int j = 0; j < transformationNames.length; j++)
 		{
-			String transformationConnectionName = job.getPipelineStageConnectionName(j);
-			String transformationDescription = job.getPipelineStageDescription(j);
 %>
 						<tr class="<%=((displaySequence % 2)==0)?"evenformrow":"oddformrow"%>">
 							<td class="formcolumncell"><%=(++displaySequence)%>.</td>
-							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(transformationDescription)%></td>
-							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(transformationConnectionName)%></td>
+							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(transformationDescriptions[j])%></td>
+							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(transformationNames[j])%></td>
 						</tr>
 <%
 		}
@@ -199,7 +212,7 @@
 						<tr class="<%=((displaySequence % 2)==0)?"evenformrow":"oddformrow"%>">
 							<td class="formcolumncell"><%=(++displaySequence)%>.</td>
 							<td class="formcolumncell"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.OutputStage")%></td>
-							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(job.getOutputConnectionName())%></td>
+							<td class="formcolumncell"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(outputName)%></td>
 						</tr>
 					</table>
 				</td>
@@ -693,7 +706,7 @@
 			{
 				try
 				{
-					outputConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),job.getOutputSpecification(),1);
+					outputConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),job.getOutputSpecification(),1+transformationConnections.length);
 				}
 				finally
 				{
@@ -704,6 +717,38 @@
 %>
 				</td>
 			</tr>
+<%
+		if (transformationConnections.length > 0)
+		{
+%>
+			<tr>
+				<td class="separator" colspan="4"><hr/></td>
+			</tr>
+			<tr>
+				<td colspan="4">
+<%
+			for (int j = 0; j < transformationConnections.length; j++)
+			{
+				OutputSpecification os = job.getPipelineStageSpecification(j);
+				ITransformationConnector transformationConnector = transformationConnectorPool.grab(transformationConnections[j]);
+				if (transformationConnector != null)
+				{
+					try
+					{
+						transformationConnector.viewSpecification(new org.apache.manifoldcf.ui.jsp.JspWrapper(out,adminprofile),pageContext.getRequest().getLocale(),os,1+j);
+					}
+					finally
+					{
+						transformationConnectorPool.release(transformationConnections[j],transformationConnector);
+					}
+				}
+			}
+%>
+				</td>
+			</tr>
+<%
+		}
+%>
 			<tr>
 				<td class="separator" colspan="4"><hr/></td>
 			</tr>
@@ -731,16 +776,16 @@
 			<tr>
 				<td class="separator" colspan="4"><hr/></td>
 			</tr>
-		<tr>
-			<td class="message" colspan="4">
-				<nobr>
-					<a href='<%="editjob.jsp?jobid="+jobID%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.EditThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Edit")%></a>
-					<a href='<%="javascript:Delete(\""+jobID+"\")"%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.DeleteThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Delete")%></a>
-					<a href='<%="editjob.jsp?origjobid="+jobID%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.CopyThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Copy")%></a>
-					<a href='<%="javascript:StartOver(\""+jobID+"\")"%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.ResetSeedingThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.ResetSeeding")%></a>
-				</nobr>
-			</td>
-		</tr>
+			<tr>
+				<td class="message" colspan="4">
+					<nobr>
+						<a href='<%="editjob.jsp?jobid="+jobID%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.EditThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Edit")%></a>
+						<a href='<%="javascript:Delete(\""+jobID+"\")"%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.DeleteThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Delete")%></a>
+						<a href='<%="editjob.jsp?origjobid="+jobID%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.CopyThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.Copy")%></a>
+						<a href='<%="javascript:StartOver(\""+jobID+"\")"%>' alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"viewjob.ResetSeedingThisJob")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewjob.ResetSeeding")%></a>
+					</nobr>
+				</td>
+			</tr>
 		</table>
 
 <%

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=1601882&r1=1601881&r2=1601882&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
Wed Jun 11 13:15:45 2014
@@ -562,6 +562,9 @@ public class JobManager implements IJobM
   {
     // Query for the matching jobs, and then for each job potentially adjust the state
     Long[] jobIDs = jobs.findJobsMatchingTransformations(list);
+    if (jobIDs.length == 0)
+      return;
+
     StringBuilder query = new StringBuilder();
     ArrayList newList = new ArrayList();
     
@@ -618,6 +621,9 @@ public class JobManager implements IJobM
   {
     // Query for the matching jobs, and then for each job potentially adjust the state
     Long[] jobIDs = jobs.findJobsMatchingTransformations(list);
+    if (jobIDs.length == 0)
+      return;
+
     StringBuilder query = new StringBuilder();
     ArrayList newList = new ArrayList();
     



Mime
View raw message