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/17 08:42:47 UTC
svn commit: r1603070 - in /manifoldcf/branches/CONNECTORS-962/framework:
crawler-ui/src/main/webapp/
ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/
Author: kwright
Date: Tue Jun 17 06:42:47 2014
New Revision: 1603070
URL: http://svn.apache.org/r1603070
Log:
Loosen the restriction on deleting pipeline stages
Modified:
manifoldcf/branches/CONNECTORS-962/framework/crawler-ui/src/main/webapp/editjob.jsp
manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties
Modified: manifoldcf/branches/CONNECTORS-962/framework/crawler-ui/src/main/webapp/editjob.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/crawler-ui/src/main/webapp/editjob.jsp?rev=1603070&r1=1603069&r2=1603070&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-962/framework/crawler-ui/src/main/webapp/editjob.jsp (original)
+++ manifoldcf/branches/CONNECTORS-962/framework/crawler-ui/src/main/webapp/editjob.jsp Tue Jun 17 06:42:47 2014
@@ -1058,6 +1058,9 @@
</td>
</tr>
<%
+ // A map of stage number to reference count
+ Map<Integer,Integer> referenceCounts = new HashMap<Integer,Integer>();
+ // A list of precedents to pick from, displayed at the end
List<Integer> precedents = new ArrayList<Integer>();
// Repository connection is always allowed
precedents.add(new Integer(0));
@@ -1068,6 +1071,15 @@
alreadyPresent.add(pipelineConnectionNames[j]);
else
precedents.add(new Integer(j+1));
+ if (pipelinePrerequisites[j] != -1)
+ {
+ Integer thisOne = new Integer(pipelinePrerequisites[j]);
+ Integer x = referenceCounts.get(thisOne);
+ if (x == null)
+ referenceCounts.put(thisOne,new Integer(1));
+ else
+ referenceCounts.put(thisOne,new Integer(x.intValue() + 1));
+ }
}
for (int j = 0; j < pipelineConnectionNames.length; j++)
{
@@ -1082,10 +1094,13 @@
<input name="pipeline_<%=j%>_op" type="hidden" value="Continue"/>
<a name="pipeline_<%=j%>_tag"/>
<%
- if (!pipelineIsOutputs[j])
+ // We don't want to leave orphans around. If the pipeline stage is an output, we can delete it ONLY if:
+ // -- the precedent is -1, OR
+ // -- the precedent is not -1 BUT more than one stage refers to the precedent
+ if (!pipelineIsOutputs[j] || pipelinePrerequisites[j] == -1 || referenceCounts.get(new Integer(pipelinePrerequisites[j])).intValue() > 1)
{
%>
- <input type="button" value="<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Delete")%>" alt='<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Deletetransformation")%>' onclick="javascript:DeletePipelineStage(<%=j%>);"/>
+ <input type="button" value="<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Delete")%>" alt='<%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editjob.Deletepipelinestage")%>' onclick="javascript:DeletePipelineStage(<%=j%>);"/>
<%
}
if (transformationList.length > 0)
Modified: manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties?rev=1603070&r1=1603069&r2=1603070&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties (original)
+++ manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties Tue Jun 17 06:42:47 2014
@@ -410,13 +410,16 @@ editjob.StageConnectionName=Connection n
editjob.Repository=Repository
editjob.Output=Output
editjob.Transformation=Transformation
-editjob.InsertBefore=Insert before
+editjob.InsertTransformationBefore=Insert transformation before
+editjob.InsertOutputBefore=Insert output before
editjob.Insertnewstagehere=Insert new stage here
editjob.SelectATransformationStageConnectionName=Select a transformation stage connection name
editjob.SelectAnOutputStageConnectionName=Select an output stage connection name
editjob.AddAnOutput=Add an output
editjob.AddOutput=Add output
-editjob.Deletetransformation=Delete transformation
+editjob.Deletepipelinestage=Delete pipeline stage
+editjob.Insertnewtransformationhere=Insert new transformation here
+editjob.Insertnewoutputhere=Insert new output here
editjob.NoRepositoryConnectionsDefinedCreateOneFirst=No repository connections defined - create one first
editjob.NoOutputConnectionsDefinedCreateOneFirst=No output connections defined - create one first
Modified: manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties?rev=1603070&r1=1603069&r2=1603070&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties (original)
+++ manifoldcf/branches/CONNECTORS-962/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_zh_CN.properties Tue Jun 17 06:42:47 2014
@@ -443,7 +443,7 @@ editjob.SelectATransformationStageConnec
editjob.SelectAnOutputStageConnectionName=Select an output stage connection name
editjob.AddAnOutput=Add an output
editjob.AddOutput=Add output
-editjob.Deletetransformation=Delete transformation
+editjob.Deletepipelinestage=Delete pipeline stage
editjob.Insertnewtransformationhere=Insert new transformation here
editjob.Insertnewoutputhere=Insert new output here