manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1449487 - in /manifoldcf/branches/CONNECTORS-63/framework: crawler-ui/src/main/webapp/ pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/
Date Sun, 24 Feb 2013 14:44:30 GMT
Author: kwright
Date: Sun Feb 24 14:44:29 2013
New Revision: 1449487

URL: http://svn.apache.org/r1449487
Log:
Move activities list assembly into common ManifoldCF method.

Modified:
    manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
    manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
    manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/resultreport.jsp
    manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/simplereport.jsp
    manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java

Modified: manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp?rev=1449487&r1=1449486&r2=1449487&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxactivityreport.jsp
Sun Feb 24 14:44:29 2013
@@ -343,54 +343,9 @@ if (maintenanceUnderway == false)
 	String[] activityList = null;
 	if (reportConnection.length() > 0)
 	{
-		IRepositoryConnection thisConnection = connMgr.load(reportConnection);
-		if (thisConnection == null)
+		activityList = org.apache.manifoldcf.crawler.system.ManifoldCF.getActivitiesList(threadContext,reportConnection);
+		if (activityList == null)
 			reportConnection = "";
-		else
-		{
-			String[] outputActivityList = OutputConnectionManagerFactory.getAllOutputActivities(threadContext);
-			String[] connectorActivityList = RepositoryConnectorFactory.getActivitiesList(threadContext,thisConnection.getClassName());
-			String[] globalActivityList = IRepositoryConnectionManager.activitySet;
-			activityList = new String[outputActivityList.length + ((connectorActivityList==null)?0:connectorActivityList.length)
+ globalActivityList.length];
-			int k2 = 0;
-			int j;
-			if (outputActivityList != null)
-			{
-				j = 0;
-				while (j < outputActivityList.length)
-				{
-					activityList[k2++] = outputActivityList[j++];
-				}
-			}
-			if (connectorActivityList != null)
-			{
-				j = 0;
-				while (j < connectorActivityList.length)
-				{
-					activityList[k2++] = connectorActivityList[j++];
-				}
-			}
-			j = 0;
-			while (j < globalActivityList.length)
-			{
-				activityList[k2++] = globalActivityList[j++];
-			}
-			java.util.Arrays.sort(activityList);
-
-			selectedActivities = new HashMap();
-			String[] activitiesToNote;
-			j = 0;
-			if (reportActivities == null)
-				activitiesToNote = activityList;
-			else
-				activitiesToNote = reportActivities;
-
-			while (j < activitiesToNote.length)
-			{
-				String activity = activitiesToNote[j++];
-				selectedActivities.put(activity,activity);
-			}
-		}
 	}
 
 %>

Modified: manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp?rev=1449487&r1=1449486&r2=1449487&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/maxbandwidthreport.jsp
Sun Feb 24 14:44:29 2013
@@ -343,54 +343,9 @@ if (maintenanceUnderway == false)
 	String[] activityList = null;
 	if (reportConnection.length() > 0)
 	{
-		IRepositoryConnection thisConnection = connMgr.load(reportConnection);
-		if (thisConnection == null)
+		activityList = org.apache.manifoldcf.crawler.system.ManifoldCF.getActivitiesList(threadContext,reportConnection);
+		if (activityList == null)
 			reportConnection = "";
-		else
-		{
-			String[] outputActivityList = OutputConnectionManagerFactory.getAllOutputActivities(threadContext);
-			String[] connectorActivityList = RepositoryConnectorFactory.getActivitiesList(threadContext,thisConnection.getClassName());
-			String[] globalActivityList = IRepositoryConnectionManager.activitySet;
-			activityList = new String[outputActivityList.length + ((connectorActivityList==null)?0:connectorActivityList.length)
+ globalActivityList.length];
-			int k2 = 0;
-			int j;
-			if (outputActivityList != null)
-			{
-				j = 0;
-				while (j < outputActivityList.length)
-				{
-					activityList[k2++] = outputActivityList[j++];
-				}
-			}
-			if (connectorActivityList != null)
-			{
-				j = 0;
-				while (j < connectorActivityList.length)
-				{
-					activityList[k2++] = connectorActivityList[j++];
-				}
-			}
-			j = 0;
-			while (j < globalActivityList.length)
-			{
-				activityList[k2++] = globalActivityList[j++];
-			}
-			java.util.Arrays.sort(activityList);
-
-			selectedActivities = new HashMap();
-			String[] activitiesToNote;
-			j = 0;
-			if (reportActivities == null)
-				activitiesToNote = activityList;
-			else
-				activitiesToNote = reportActivities;
-
-			while (j < activitiesToNote.length)
-			{
-				String activity = activitiesToNote[j++];
-				selectedActivities.put(activity,activity);
-			}
-		}
 	}
 
 %>

Modified: manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/resultreport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/resultreport.jsp?rev=1449487&r1=1449486&r2=1449487&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/resultreport.jsp
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/resultreport.jsp
Sun Feb 24 14:44:29 2013
@@ -370,54 +370,9 @@ if (maintenanceUnderway == false)
 	String[] activityList = null;
 	if (reportConnection.length() > 0)
 	{
-		IRepositoryConnection thisConnection = connMgr.load(reportConnection);
-		if (thisConnection == null)
+		activityList = org.apache.manifoldcf.crawler.system.ManifoldCF.getActivitiesList(threadContext,reportConnection);
+		if (activityList == null)
 			reportConnection = "";
-		else
-		{
-			String[] outputActivityList = OutputConnectionManagerFactory.getAllOutputActivities(threadContext);
-			String[] connectorActivityList = RepositoryConnectorFactory.getActivitiesList(threadContext,thisConnection.getClassName());
-			String[] globalActivityList = IRepositoryConnectionManager.activitySet;
-			activityList = new String[outputActivityList.length + ((connectorActivityList==null)?0:connectorActivityList.length)
+ globalActivityList.length];
-			int k2 = 0;
-			int j;
-			if (outputActivityList != null)
-			{
-				j = 0;
-				while (j < outputActivityList.length)
-				{
-					activityList[k2++] = outputActivityList[j++];
-				}
-			}
-			if (connectorActivityList != null)
-			{
-				j = 0;
-				while (j < connectorActivityList.length)
-				{
-					activityList[k2++] = connectorActivityList[j++];
-				}
-			}
-			j = 0;
-			while (j < globalActivityList.length)
-			{
-				activityList[k2++] = globalActivityList[j++];
-			}
-			java.util.Arrays.sort(activityList);
-
-			selectedActivities = new HashMap();
-			String[] activitiesToNote;
-			j = 0;
-			if (reportActivities == null)
-				activitiesToNote = activityList;
-			else
-				activitiesToNote = reportActivities;
-
-			while (j < activitiesToNote.length)
-			{
-				String activity = activitiesToNote[j++];
-				selectedActivities.put(activity,activity);
-			}
-		}
 	}
 
 %>

Modified: manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/simplereport.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/simplereport.jsp?rev=1449487&r1=1449486&r2=1449487&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/simplereport.jsp
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/crawler-ui/src/main/webapp/simplereport.jsp
Sun Feb 24 14:44:29 2013
@@ -298,54 +298,9 @@ if (maintenanceUnderway == false)
 	String[] activityList = null;
 	if (reportConnection.length() > 0)
 	{
-		IRepositoryConnection thisConnection = connMgr.load(reportConnection);
-		if (thisConnection == null)
+		activityList = org.apache.manifoldcf.crawler.system.ManifoldCF.getActivitiesList(threadContext,reportConnection);
+		if (activityList == null)
 			reportConnection = "";
-		else
-		{
-			String[] outputActivityList = OutputConnectionManagerFactory.getAllOutputActivities(threadContext);
-			String[] connectorActivityList = RepositoryConnectorFactory.getActivitiesList(threadContext,thisConnection.getClassName());
-			String[] globalActivityList = IRepositoryConnectionManager.activitySet;
-			activityList = new String[outputActivityList.length + ((connectorActivityList==null)?0:connectorActivityList.length)
+ globalActivityList.length];
-			int k2 = 0;
-			int j;
-			if (outputActivityList != null)
-			{
-				j = 0;
-				while (j < outputActivityList.length)
-				{
-					activityList[k2++] = outputActivityList[j++];
-				}
-			}
-			if (connectorActivityList != null)
-			{
-				j = 0;
-				while (j < connectorActivityList.length)
-				{
-					activityList[k2++] = connectorActivityList[j++];
-				}
-			}
-			j = 0;
-			while (j < globalActivityList.length)
-			{
-				activityList[k2++] = globalActivityList[j++];
-			}
-			java.util.Arrays.sort(activityList);
-
-			selectedActivities = new HashMap();
-			String[] activitiesToNote;
-			j = 0;
-			if (reportActivities == null)
-				activitiesToNote = activityList;
-			else
-				activitiesToNote = reportActivities;
-
-			while (j < activitiesToNote.length)
-			{
-				String activity = activitiesToNote[j++];
-				selectedActivities.put(activity,activity);
-			}
-		}
 	}
 
 %>

Modified: manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java?rev=1449487&r1=1449486&r2=1449487&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
(original)
+++ manifoldcf/branches/CONNECTORS-63/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
Sun Feb 24 14:44:29 2013
@@ -1573,6 +1573,46 @@ public class ManifoldCF extends org.apac
     return outputActivityName+" ("+outputConnectionName+")";
   }
 
+  /** Get the activities list for a given repository connection.
+  */
+  public static String[] getActivitiesList(IThreadContext threadContext, String connectionName)
+    throws ManifoldCFException
+  {
+    IRepositoryConnectionManager connectionManager = RepositoryConnectionManagerFactory.make(threadContext);
+    IRepositoryConnection thisConnection = connectionManager.load(connectionName);
+    if (thisConnection == null)
+      return null;
+    String[] outputActivityList = OutputConnectionManagerFactory.getAllOutputActivities(threadContext);
+    String[] connectorActivityList = RepositoryConnectorFactory.getActivitiesList(threadContext,thisConnection.getClassName());
+    String[] globalActivityList = IRepositoryConnectionManager.activitySet;
+    String[] activityList = new String[outputActivityList.length + ((connectorActivityList==null)?0:connectorActivityList.length)
+ globalActivityList.length];
+    int k2 = 0;
+    int j;
+    if (outputActivityList != null)
+    {
+      j = 0;
+      while (j < outputActivityList.length)
+      {
+        activityList[k2++] = outputActivityList[j++];
+      }
+    }
+    if (connectorActivityList != null)
+    {
+      j = 0;
+      while (j < connectorActivityList.length)
+      {
+        activityList[k2++] = connectorActivityList[j++];
+      }
+    }
+    j = 0;
+    while (j < globalActivityList.length)
+    {
+      activityList[k2++] = globalActivityList[j++];
+    }
+    java.util.Arrays.sort(activityList);
+    return activityList;
+  }
+  
   private static final int IV_LENGTH = 16;
   
   private static Cipher getCipher(final int mode, final String passCode, final byte[] iv)
throws GeneralSecurityException,



Mime
View raw message