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 2014/06/02 19:42:10 UTC

svn commit: r1599277 - in /manifoldcf/branches/CONNECTORS-946/framework: agents/src/main/java/org/apache/manifoldcf/agents/interfaces/ agents/src/main/java/org/apache/manifoldcf/agents/output/ agents/src/main/java/org/apache/manifoldcf/agents/transform...

Author: kwright
Date: Mon Jun  2 17:42:10 2014
New Revision: 1599277

URL: http://svn.apache.org/r1599277
Log:
Add IPipelineConnector methods for naming javascript functions uniquely

Modified:
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/output/BaseOutputConnector.java
    manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/transformation/BaseTransformationConnector.java
    manifoldcf/branches/CONNECTORS-946/framework/crawler-ui/src/main/webapp/editjob.jsp

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java?rev=1599277&r1=1599276&r2=1599277&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/interfaces/IPipelineConnector.java Mon Jun  2 17:42:10 2014
@@ -124,7 +124,19 @@ public interface IPipelineConnector exte
   // in that the first bunch cannot assume that the current connector object is connected, while the second bunch can.  That is why the first bunch
   // receives a thread context argument for all UI methods, while the second bunch does not need one (since it has already been applied via the connect()
   // method, above).
-    
+
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber);
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber);
+
   /** Output the specification header section.
   * This method is called in the head section of a job page which has selected a pipeline connection of the current type.  Its purpose is to add the required tabs
   * to the list, and to output any javascript methods that might be needed by the job editing HTML.

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/output/BaseOutputConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/output/BaseOutputConnector.java?rev=1599277&r1=1599276&r2=1599277&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/output/BaseOutputConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/output/BaseOutputConnector.java Mon Jun  2 17:42:10 2014
@@ -299,6 +299,26 @@ public abstract class BaseOutputConnecto
   // receives a thread context argument for all UI methods, while the second bunch does not need one (since it has already been applied via the connect()
   // method, above).
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "checkOutputSpecification";
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "checkOutputSpecificationForSave";
+  }
+
   /** Output the specification header section.
   * This method is called in the head section of a job page which has selected an output connection of the current type.  Its purpose is to add the required tabs
   * to the list, and to output any javascript methods that might be needed by the job editing HTML.

Modified: manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/transformation/BaseTransformationConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/transformation/BaseTransformationConnector.java?rev=1599277&r1=1599276&r2=1599277&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/transformation/BaseTransformationConnector.java (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/agents/src/main/java/org/apache/manifoldcf/agents/transformation/BaseTransformationConnector.java Mon Jun  2 17:42:10 2014
@@ -174,6 +174,26 @@ public abstract class BaseTransformation
   // receives a thread context argument for all UI methods, while the second bunch does not need one (since it has already been applied via the connect()
   // method, above).
 
+  /** Obtain the name of the form check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form check javascript method.
+  */
+  @Override
+  public String getFormCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "checkSpecification_"+connectionSequenceNumber;
+  }
+
+  /** Obtain the name of the form presave check javascript method to call.
+  *@param connectionSequenceNumber is the unique number of this connection within the job.
+  *@return the name of the form presave check javascript method.
+  */
+  @Override
+  public String getFormPresaveCheckJavascriptMethodName(int connectionSequenceNumber)
+  {
+    return "checkSpecificationForSave_"+connectionSequenceNumber;
+  }
+
   /** Output the specification header section.
   * This method is called in the head section of a job page which has selected an output connection of the current type.  Its purpose is to add the required tabs
   * to the list, and to output any javascript methods that might be needed by the job editing HTML.

Modified: manifoldcf/branches/CONNECTORS-946/framework/crawler-ui/src/main/webapp/editjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-946/framework/crawler-ui/src/main/webapp/editjob.jsp?rev=1599277&r1=1599276&r2=1599277&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-946/framework/crawler-ui/src/main/webapp/editjob.jsp (original)
+++ manifoldcf/branches/CONNECTORS-946/framework/crawler-ui/src/main/webapp/editjob.jsp Mon Jun  2 17:42:10 2014
@@ -302,6 +302,9 @@
 				if (checkSpecificationForSave() == false)
 					return;
 			}
+			// Check the transformation parts.  But since each transformation connector needs
+			// to supply a unique javascript method to call, it's not clear how we do this.
+			// MHL
 			document.editjob.op.value="Save";
 			document.editjob.submit();
 		}
@@ -319,6 +322,39 @@
 		postFormNew();
 	}
 
+	function InsertPipelineStage(n)
+	{
+		if (editjob.pipeline_connectionname.value == "")
+		{
+			alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"editjob.PipelineStageConnectionNameMustNotBeNull")%>");
+			editjob..pipeline_connectionname.focus();
+			return;
+		}
+		eval("document.editjob.pipeline_"+n+"_op.value = 'Insert'");
+		postFormSetAnchor("pipeline_"+(n+1)+"_tag");
+	}
+
+	function AppendPipelineStage()
+	{
+		if (editjob.pipeline_connectionname.value == "")
+		{
+			alert("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"editjob.PipelineStageConnectionNameMustNotBeNull")%>");
+			editjob..pipeline_connectionname.focus();
+			return;
+		}
+		document.editjob.pipeline_op.value="Add";
+		postFormSetAnchor("pipeline_tag");
+	}
+	
+	function DeletePipelineStage(n)
+	{
+		eval("document.editjob.pipeline_"+n+"_op.value = 'Delete'");
+		if (n == 0)
+			postFormSetAnchor("pipeline_tag");
+		else
+			postFormSetAnchor("pipeline_"+(n-1)+"_tag");
+	}
+	
 	function AddScheduledTime()
 	{
 		if (editjob.duration.value != "" && !isInteger(editjob.duration.value))
@@ -387,6 +423,9 @@
 			if (checkSpecification() == false)
 				return false;
 		}
+		// Check the transformation parts.  But since each transformation connector needs
+		// to supply a unique javascript method to call, it's not clear how we do this.
+		// MHL
 		return true;
 	}