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 2013/06/30 16:15:50 UTC
svn commit: r1498128 [1/2] - in /manifoldcf/trunk: ./ connectors/
connectors/regexpmapper/
framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/
framework/crawler-ui/src/main/webapp/ framework/example-common/
framework/pull-...
Author: kwright
Date: Sun Jun 30 14:15:49 2013
New Revision: 1498128
URL: http://svn.apache.org/r1498128
Log:
Add mapper plugins and functionality. Fix for CONNECTORS-703.
Added:
manifoldcf/trunk/connectors/regexpmapper/ (props changed)
- copied from r1498126, manifoldcf/branches/CONNECTORS-703/connectors/regexpmapper/
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editmapper.jsp
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/crawler-ui/src/main/webapp/editmapper.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listmappers.jsp
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/crawler-ui/src/main/webapp/listmappers.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewmapper.jsp
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/crawler-ui/src/main/webapp/viewmapper.jsp
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/BaseMappersInitializationCommand.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/BaseMappersInitializationCommand.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineMappingConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteMappingConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/RegisterMapper.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/RegisterMapper.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/SynchronizeMappers.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/SynchronizeMappers.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/UnRegisterAllMappers.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/UnRegisterAllMappers.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/UnRegisterMapper.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/UnRegisterMapper.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectionManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnector.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IMappingConnectorManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectionManagerFactory.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorFactory.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/MappingConnectorManagerFactory.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/
- copied from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapconnmgr/
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/
- copied from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mappers/
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/
- copied from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/mapping/
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/MappingRequest.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/MappingRequest.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/MappingThread.java
- copied unchanged from r1498126, manifoldcf/branches/CONNECTORS-703/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/MappingThread.java
Modified:
manifoldcf/trunk/ (props changed)
manifoldcf/trunk/CHANGES.txt
manifoldcf/trunk/build.xml
manifoldcf/trunk/connectors/pom.xml
manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp
manifoldcf/trunk/framework/example-common/connectors.xml
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthCheckThread.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthRequest.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/Logging.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/ManifoldCF.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/RequestQueue.java
manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/crawler/system/ManifoldCF.java
manifoldcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_en_US.properties
manifoldcf/trunk/framework/ui-core/src/main/native2ascii/org/apache/manifoldcf/ui/i18n/common_ja_JP.properties
Propchange: manifoldcf/trunk/
------------------------------------------------------------------------------
Merged /manifoldcf/branches/CONNECTORS-703:r1494936-1498126
Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Sun Jun 30 14:15:49 2013
@@ -3,6 +3,10 @@ $Id$
======================= 1.3-dev =====================
+CONNECTORS-703: Add mapper plugin functionality, and regular expression
+mapper. WARNING: This change represents a schema change!!
+(Maciej Lizewski, Karl Wright)
+
CONNECTORS-740: Add documentation for filesystem connector changes
and for filesystem output connector. Also refactor filesystem connector
for better UI.
Modified: manifoldcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Sun Jun 30 14:15:49 2013
@@ -80,6 +80,7 @@
<ant dir="connectors/nullauthority" target="clean"/>
<ant dir="connectors/nulloutput" target="clean"/>
<ant dir="connectors/rss" target="clean"/>
+ <ant dir="connectors/regexpmapper" target="clean"/>
<ant dir="connectors/sharepoint" target="clean"/>
<ant dir="connectors/webcrawler" target="clean"/>
<ant dir="connectors/wiki" target="clean"/>
@@ -136,6 +137,7 @@
<ant dir="connectors/nullauthority" target="clean"/>
<ant dir="connectors/nulloutput" target="clean"/>
<ant dir="connectors/rss" target="clean"/>
+ <ant dir="connectors/regexpmapper" target="clean"/>
<ant dir="connectors/sharepoint" target="clean"/>
<ant dir="connectors/webcrawler" target="clean"/>
<ant dir="connectors/wiki" target="clean"/>
@@ -981,6 +983,42 @@
<ant dir="connectors/rss" target="run-tests-HSQLDB"/>
</target>
+ <target name="setup-regexp-mapper" depends="build-framework" if="downloaded"/>
+
+ <target name="setup-regexp-mapper-tests" depends="build-tests-framework" if="downloaded"/>
+
+ <target name="build-regexp-mapper" depends="setup-regexp-mapper" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="build"/>
+ </target>
+
+ <target name="doc-regexp-mapper" depends="setup-regexp-mapper" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="doc"/>
+ </target>
+
+ <target name="build-tests-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="build-tests"/>
+ </target>
+
+ <target name="run-tests-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="run-tests"/>
+ </target>
+
+ <target name="run-tests-derby-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="run-tests-derby"/>
+ </target>
+
+ <target name="run-tests-postgresql-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="run-tests-postgresql"/>
+ </target>
+
+ <target name="run-tests-mysql-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="run-tests-mysql"/>
+ </target>
+
+ <target name="run-tests-HSQLDB-regexp-mapper" depends="setup-regexp-mapper,setup-regexp-mapper-tests" if="downloaded">
+ <ant dir="connectors/regexpmapper" target="run-tests-HSQLDB"/>
+ </target>
+
<target name="setup-sharepoint-connector" depends="build-framework" if="downloaded"/>
<target name="setup-sharepoint-connector-tests" depends="build-tests-framework" if="downloaded"/>
@@ -1261,7 +1299,25 @@
</condition>
</target>
-
+ <target name="general-add-mapping-connector-commented" depends="general-connector-runnable-check" unless="${connector-name}.is-runnable">
+ <replace file="dist/connectors.xml" token="<!-- Add your mapping connectors here -->" value="<!-- Add your mapping connectors here -->
 <!--mappingconnector name="${connector-label}" class="${connector-class}"/-->"/>
+ </target>
+
+ <target name="general-add-mapping-connector-non-commented" depends="general-connector-runnable-check" if="${connector-name}.is-runnable">
+ <replace file="dist/connectors.xml" token="<!-- Add your mapping connectors here -->" value="<!-- Add your mapping connectors here -->
 <mappingconnector name="${connector-label}" class="${connector-class}"/>"/>
+ </target>
+
+ <target name="general-add-mapping-connector-proprietary-commented" depends="general-connector-proprietary-runnable-check" unless="${connector-name}.is-proprietary-runnable">
+ <replace file="dist/connectors-proprietary.xml" token="<!-- Add your mapping connectors here -->" value="<!-- Add your mapping connectors here -->
 <!--mappingconnector name="${connector-label}" class="${connector-class}"/-->"/>
+ </target>
+
+ <target name="general-add-mapping-connector-proprietary-non-commented" depends="general-connector-proprietary-runnable-check" if="${connector-name}.is-proprietary-runnable">
+ <replace file="dist/connectors-proprietary.xml" token="<!-- Add your mapping connectors here -->" value="<!-- Add your mapping connectors here -->
 <mappingconnector name="${connector-label}" class="${connector-class}"/>"/>
+ </target>
+
+ <target name="general-add-mapping-connector" depends="general-add-mapping-connector-commented,general-add-mapping-connector-non-commented,general-add-mapping-connector-proprietary-commented,general-add-mapping-connector-proprietary-non-commented">
+ </target>
+
<target name="general-add-authority-connector-commented" depends="general-connector-runnable-check" unless="${connector-name}.is-runnable">
<replace file="dist/connectors.xml" token="<!-- Add your authority connectors here -->" value="<!-- Add your authority connectors here -->
 <!--authorityconnector name="${connector-label}" class="${connector-class}"/-->"/>
</target>
@@ -2285,6 +2341,43 @@
</antcall>
</target>
+ <target name="calculate-regexpmapper-condition" depends="build-regexp-mapper">
+ <available file="connectors/regexpmapper/dist/lib" type="dir" property="regexpmapper.exists"/>
+ <condition property="regexpmapper.include">
+ <and>
+ <isset property="regexpmapper.exists"/>
+ <isset property="downloaded"/>
+ </and>
+ </condition>
+ </target>
+
+ <target name="calculate-regexpmapper-doc-condition" depends="doc-regexp-mapper">
+ <available file="connectors/regexpmapper/dist/doc" type="dir" property="regexpmapper-doc.exists"/>
+ <condition property="regexpmapper-doc.include">
+ <and>
+ <isset property="regexpmapper-doc.exists"/>
+ <isset property="downloaded"/>
+ </and>
+ </condition>
+ </target>
+
+ <target name="deliver-regexp-mapper" depends="calculate-regexpmapper-condition" if="regexpmapper.include">
+ <antcall target="general-connector-delivery">
+ <param name="connector-name" value="regexpmapper"/>
+ </antcall>
+ <antcall target="general-add-mapping-connector">
+ <param name="connector-name" value="regexpmapper"/>
+ <param name="connector-label" value="Regular expression mapper"/>
+ <param name="connector-class" value="org.apache.manifoldcf.authorities.mappers.regexp.RegexpMapper"/>
+ </antcall>
+ </target>
+
+ <target name="deliver-regexp-mapper-doc" depends="calculate-regexpmapper-doc-condition" if="regexpmapper-doc.include">
+ <antcall target="general-connector-doc-delivery">
+ <param name="connector-name" value="regexpmapper"/>
+ </antcall>
+ </target>
+
<target name="calculate-sharepoint-condition" depends="build-sharepoint-connector">
<available file="connectors/sharepoint/dist/lib" type="dir" property="sharepoint.exists"/>
<condition property="sharepoint.include">
@@ -2879,16 +2972,19 @@
<target name="deliver-output-connectors" depends="deliver-gts-connector,deliver-solr-connector,deliver-nulloutput-connector,deliver-opensearchserver-connector,deliver-elasticsearch-connector"/>
<target name="deliver-output-connectors-doc" depends="deliver-gts-connector-doc,deliver-solr-connector-doc,deliver-nulloutput-connector-doc,deliver-opensearchserver-connector-doc,deliver-elasticsearch-connector-doc"/>
+ <target name="deliver-mapping-connectors" depends="deliver-regexp-mapper"/>
+ <target name="deliver-mapping-connectors-doc" depends="deliver-regexp-mapper-doc"/>
+
<target name="deliver-lgpl-connectors" depends="deliver-jcifs-connector"/>
<target name="deliver-lgpl-connectors-doc" depends="deliver-jcifs-connector-doc"/>
<target name="deliver-proprietary-connectors" depends="deliver-documentum-connector,deliver-filenet-connector,deliver-livelink-connector,deliver-memex-connector,deliver-meridio-connector,deliver-sharepoint-connector"/>
<target name="deliver-proprietary-connectors-doc" depends="deliver-documentum-connector-doc,deliver-filenet-connector-doc,deliver-livelink-connector-doc,deliver-memex-connector-doc,deliver-meridio-connector-doc,deliver-sharepoint-connector-doc"/>
- <target name="build" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors"/>
+ <target name="build" depends="deliver-framework,deliver-open-connectors,deliver-output-connectors,deliver-mapping-connectors,deliver-lgpl-connectors,deliver-proprietary-connectors"/>
<target name="tmpclean" depends="cleanup-afterbuild"/>
<target name="buildcln" depends="build,tmpclean"/>
- <target name="javadoc" depends="deliver-framework-doc,deliver-open-connectors-doc,deliver-output-connectors-doc,deliver-lgpl-connectors-doc,deliver-proprietary-connectors-doc"/>
+ <target name="javadoc" depends="deliver-framework-doc,deliver-open-connectors-doc,deliver-output-connectors-doc,deliver-mapping-connectors-doc,deliver-lgpl-connectors-doc,deliver-proprietary-connectors-doc"/>
<target name="doc" depends="deliver-site-doc"/>
<target name="set-version">
Modified: manifoldcf/trunk/connectors/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/pom.xml?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/pom.xml (original)
+++ manifoldcf/trunk/connectors/pom.xml Sun Jun 30 14:15:49 2013
@@ -55,6 +55,7 @@
<module>googledrive</module>
<module>jira</module>
<module>generic</module>
+ <module>regexpmapper</module>
</modules>
</project>
Propchange: manifoldcf/trunk/connectors/regexpmapper/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Sun Jun 30 14:15:49 2013
@@ -0,0 +1,10 @@
+build
+dist
+doc
+target
+test-output
+test-derby-output
+test-postgresql-output
+test-HSQLDB-output
+test-HSQLDBext-output
+test-mysql-output
Modified: manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java (original)
+++ manifoldcf/trunk/framework/authority-servlet/src/main/java/org/apache/manifoldcf/authorityservlet/UserACLServlet.java Sun Jun 30 14:15:49 2013
@@ -24,6 +24,7 @@ import org.apache.manifoldcf.authorities
import org.apache.manifoldcf.authorities.system.Logging;
import org.apache.manifoldcf.authorities.system.RequestQueue;
import org.apache.manifoldcf.authorities.system.AuthRequest;
+import org.apache.manifoldcf.authorities.system.MappingRequest;
import java.io.*;
import java.util.*;
@@ -137,38 +138,154 @@ public class UserACLServlet extends Http
Logging.authorityService.debug("Received authority request for user '"+userID+"'");
}
- RequestQueue queue = ManifoldCF.getRequestQueue();
+ RequestQueue<MappingRequest> mappingQueue = ManifoldCF.getMappingRequestQueue();
+ if (mappingQueue == null)
+ {
+ // System wasn't started; return unauthorized
+ throw new ManifoldCFException("System improperly initialized");
+ }
+
+ RequestQueue<AuthRequest> queue = ManifoldCF.getRequestQueue();
if (queue == null)
{
// System wasn't started; return unauthorized
throw new ManifoldCFException("System improperly initialized");
}
+
IThreadContext itc = ThreadContextFactory.make();
+
+ IMappingConnectionManager mappingConnManager = MappingConnectionManagerFactory.make(itc);
IAuthorityConnectionManager authConnManager = AuthorityConnectionManagerFactory.make(itc);
+ IMappingConnection[] mappingConnections = mappingConnManager.getAllConnections();
IAuthorityConnection[] connections = authConnManager.getAllConnections();
- int i = 0;
+
+ // One thread per connection, which is responsible for starting the mapping process when it is ready.
+ List<MappingOrderThread> mappingThreads = new ArrayList<MappingOrderThread>();
+ // One thread per authority, which is responsible for starting the auth request when it is ready.
+ List<AuthOrderThread> authThreads = new ArrayList<AuthOrderThread>();
+
+ Map<String,MappingRequest> mappingRequests = new HashMap<String,MappingRequest>();
+ Map<String,AuthRequest> authRequests = new HashMap<String,AuthRequest>();
+
+ Map<String,IMappingConnection> mappingConnMap = new HashMap<String,IMappingConnection>();
+
+ // Fill in mappingConnMap, since we need to be able to find connections given connection names
+ for (IMappingConnection c : mappingConnections)
+ {
+ mappingConnMap.put(c.getName(),c);
+ }
- AuthRequest[] requests = new AuthRequest[connections.length];
+ // Set of connections we need to fire off
+ Set<String> activeConnections = new HashSet<String>();
- // Queue up all the requests
- while (i < connections.length)
+ // We do the minimal set of mapping requests and authorities. Since it is the authority tokens we are
+ // looking for, we start there, and build authority requests first, then mapping requests that support them,
+ // etc.
+ // Create auth requests
+ for (int i = 0; i < connections.length; i++)
{
- IAuthorityConnection ac = connections[i];
+ IAuthorityConnection thisConnection = connections[i];
+ String identifyingString = thisConnection.getDescription();
+ if (identifyingString == null || identifyingString.length() == 0)
+ identifyingString = thisConnection.getName();
+
+ // Create a request
+ AuthRequest ar = new AuthRequest(
+ thisConnection.getClassName(),identifyingString,thisConnection.getConfigParams(),thisConnection.getMaxConnections());
+ authRequests.put(thisConnection.getName(), ar);
+
+ // We create an auth thread if there are prerequisites to meet.
+ // Otherwise, we just fire off the request
+ if (thisConnection.getPrerequisiteMapping() == null)
+ {
+ ar.setUserID(userID);
+ queue.addRequest(ar);
+ }
+ else
+ {
+ AuthOrderThread thread = new AuthOrderThread(identifyingString,
+ ar, thisConnection.getPrerequisiteMapping(),
+ queue, mappingRequests);
+ authThreads.add(thread);
+ activeConnections.add(thisConnection.getPrerequisiteMapping());
+ }
+ }
- String identifyingString = ac.getDescription();
+ // Create mapping requests
+ while (!activeConnections.isEmpty())
+ {
+ Iterator<String> connectionIter = activeConnections.iterator();
+ String connectionName = connectionIter.next();
+ IMappingConnection thisConnection = mappingConnMap.get(connectionName);
+ String identifyingString = thisConnection.getDescription();
if (identifyingString == null || identifyingString.length() == 0)
- identifyingString = ac.getName();
+ identifyingString = connectionName;
- AuthRequest ar = new AuthRequest(userID,ac.getClassName(),identifyingString,ac.getConfigParams(),ac.getMaxConnections());
- queue.addRequest(ar);
+ // Create a request
+ MappingRequest mr = new MappingRequest(
+ thisConnection.getClassName(),identifyingString,thisConnection.getConfigParams(),thisConnection.getMaxConnections());
+ mappingRequests.put(connectionName, mr);
- requests[i++] = ar;
+ // Either start up a thread, or just fire it off immediately.
+ if (thisConnection.getPrerequisiteMapping() == null)
+ {
+ mr.setUserID(userID);
+ mappingQueue.addRequest(mr);
+ }
+ else
+ {
+ //System.out.println("Mapper: prerequisite found: '"+thisConnection.getPrerequisiteMapping()+"'");
+ MappingOrderThread thread = new MappingOrderThread(identifyingString,
+ mr, thisConnection.getPrerequisiteMapping(), mappingQueue, mappingRequests);
+ mappingThreads.add(thread);
+ String p = thisConnection.getPrerequisiteMapping();
+ if (mappingRequests.get(p) == null)
+ activeConnections.add(p);
+ }
+ activeConnections.remove(connectionName);
}
-
+
+ // Start threads. We have to wait until all the requests have been
+ // at least created before we do this.
+ for (MappingOrderThread thread : mappingThreads)
+ {
+ thread.start();
+ }
+ for (AuthOrderThread thread : authThreads)
+ {
+ thread.start();
+ }
+
+ // Wait for the threads to finish up. This will guarantee that all entities have run to completion.
+ for (MappingOrderThread thread : mappingThreads)
+ {
+ thread.finishUp();
+ }
+ for (AuthOrderThread thread : authThreads)
+ {
+ thread.finishUp();
+ }
+
+ // This is probably unnecessary, but we do it anyway just to adhere to the contract
+ for (MappingRequest mr : mappingRequests.values())
+ {
+ mr.waitForComplete();
+ }
+
+ // Handle all exceptions thrown during mapping. In general this just means logging them, because
+ // the downstream authorities will presumably not find what they are looking for and error out that way.
+ for (MappingRequest mr : mappingRequests.values())
+ {
+ Throwable exception = mr.getAnswerException();
+ if (exception != null)
+ {
+ Logging.authorityService.warn("Mapping exception logged from "+mr.getIdentifyingString()+": "+exception.getMessage()+"; mapper aborted", exception);
+ }
+ }
+
// Now, work through the returning answers.
- i = 0;
// Ask all the registered authorities for their ACLs, and merge the final list together.
StringBuilder sb = new StringBuilder();
@@ -177,10 +294,10 @@ public class UserACLServlet extends Http
ServletOutputStream out = response.getOutputStream();
try
{
- while (i < connections.length)
+ for (int i = 0; i < connections.length; i++)
{
IAuthorityConnection ac = connections[i];
- AuthRequest ar = requests[i++];
+ AuthRequest ar = authRequests.get(ac.getName());
if (Logging.authorityService.isDebugEnabled())
Logging.authorityService.debug("Waiting for answer from connector class '"+ac.getClassName()+"' for user '"+userID+"'");
@@ -272,4 +389,130 @@ public class UserACLServlet extends Http
}
}
+ /** This thread is responsible for making sure that the constraints for a given mapping connection
+ * are met, and then when they are, firing off a MappingRequest. One of these threads is spun up
+ * for every IMappingConnection being handled.
+ * NOTE WELL: The number of threads this might require is worrisome. It is essentially
+ * <number_of_app_server_threads> * <number_of_mappers>. I will try later to see if I can find
+ * a way of limiting this to sane numbers.
+ */
+ protected static class MappingOrderThread extends Thread
+ {
+ protected final MappingRequest request;
+ protected final String prerequisite;
+ protected final Map<String,MappingRequest> requests;
+ protected final RequestQueue<MappingRequest> mappingRequestQueue;
+
+ protected Throwable exception = null;
+
+ public MappingOrderThread(
+ String identifyingString,
+ MappingRequest request,
+ String prerequisite,
+ RequestQueue<MappingRequest> mappingRequestQueue,
+ Map<String, MappingRequest> requests)
+ {
+ super();
+ this.request = request;
+ this.prerequisite = prerequisite;
+ this.mappingRequestQueue = mappingRequestQueue;
+ this.requests = requests;
+ setName("Constraint matcher for mapper '"+identifyingString+"'");
+ setDaemon(true);
+ }
+
+ public void run()
+ {
+ try
+ {
+ MappingRequest mappingRequest = requests.get(prerequisite);
+ mappingRequest.waitForComplete();
+ // Constraints are met. Fire off the request.
+ request.setUserID(mappingRequest.getAnswerResponse());
+ mappingRequestQueue.addRequest(request);
+ }
+ catch (Throwable e)
+ {
+ exception = e;
+ }
+ }
+
+ public void finishUp()
+ throws InterruptedException
+ {
+ join();
+ if (exception != null)
+ {
+ if (exception instanceof Error)
+ throw (Error)exception;
+ else if (exception instanceof RuntimeException)
+ throw (RuntimeException)exception;
+ }
+ }
+
+ }
+
+ /** This thread is responsible for making sure that the constraints for a given authority connection
+ * are met, and then when they are, firing off an AuthRequest. One of these threads is spun up
+ * for every IAuthorityConnection being handled.
+ * NOTE WELL: The number of threads this might require is worrisome. It is essentially
+ * <number_of_app_server_threads> * <number_of_authorities>. I will try later to see if I can find
+ * a way of limiting this to sane numbers.
+ */
+ protected static class AuthOrderThread extends Thread
+ {
+ protected final AuthRequest request;
+ protected final String prerequisite;
+ protected final Map<String,MappingRequest> mappingRequests;
+ protected final RequestQueue<AuthRequest> authRequestQueue;
+
+ protected Throwable exception = null;
+
+ public AuthOrderThread(
+ String identifyingString,
+ AuthRequest request,
+ String prerequisite,
+ RequestQueue<AuthRequest> authRequestQueue,
+ Map<String, MappingRequest> mappingRequests)
+ {
+ super();
+ this.request = request;
+ this.prerequisite = prerequisite;
+ this.authRequestQueue = authRequestQueue;
+ this.mappingRequests = mappingRequests;
+ setName("Constraint matcher for authority '"+identifyingString+"'");
+ setDaemon(true);
+ }
+
+ public void run()
+ {
+ try
+ {
+ MappingRequest mappingRequest = mappingRequests.get(prerequisite);
+ mappingRequest.waitForComplete();
+ // Constraints are met. Fire off the request. User may be null if mapper failed!!
+ request.setUserID(mappingRequest.getAnswerResponse());
+ authRequestQueue.addRequest(request);
+ }
+ catch (Throwable e)
+ {
+ exception = e;
+ }
+ }
+
+ public void finishUp()
+ throws InterruptedException
+ {
+ join();
+ if (exception != null)
+ {
+ if (exception instanceof Error)
+ throw (Error)exception;
+ else if (exception instanceof RuntimeException)
+ throw (RuntimeException)exception;
+ }
+ }
+
+ }
+
}
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/editauthority.jsp Sun Jun 30 14:15:49 2013
@@ -32,6 +32,8 @@
IAuthorityConnectionManager connMgr = AuthorityConnectionManagerFactory.make(threadContext);
// Also get the list of available connectors
IAuthorityConnectorManager connectorManager = AuthorityConnectorManagerFactory.make(threadContext);
+ // Get the mapping connection manager
+ IMappingConnectionManager mappingConnMgr = MappingConnectionManagerFactory.make(threadContext);
// Figure out what the current tab name is.
String tabName = variableContext.getParameter("tabname");
@@ -58,6 +60,7 @@
String className = "";
int maxConnections = 10;
ConfigParams parameters = new ConfigParams();
+ String prereq = null;
if (connection != null)
{
@@ -68,6 +71,7 @@
className = connection.getClassName();
parameters = connection.getConfigParams();
maxConnections = connection.getMaxConnections();
+ prereq = connection.getPrerequisiteMapping();
}
else
connectionName = null;
@@ -82,7 +86,10 @@
tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Name"));
tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Type"));
if (className.length() > 0)
+ {
+ tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Prerequisites"));
tabsArray.add(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Throttling"));
+ }
%>
@@ -232,7 +239,7 @@
if (set.getRowCount() == 0)
{
%>
- <p class="windowtitle">Edit Authority Connection</p>
+ <p class="windowtitle"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.EditAuthorityConnection")%></p>
<table class="displaytable"><tr><td class="message"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.NoAuthorityConnectorsRegistered")%></td></tr></table>
<%
}
@@ -338,7 +345,8 @@
<table class="displaytable">
<tr><td class="separator" colspan="5"><hr/></td></tr>
<tr>
- <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.ConnectionTypeColon")%></nobr></td><td class="value" colspan="4">
+ <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.ConnectionTypeColon")%></nobr></td>
+ <td class="value" colspan="4">
<%
if (className.length() > 0)
{
@@ -393,7 +401,70 @@
<%
}
+ // The "Prerequisites" tab
+ IMappingConnection[] mappingConnections = mappingConnMgr.getAllConnections();
+ if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Prerequisites")))
+ {
+%>
+ <table class="displaytable">
+ <tr><td class="separator" colspan="5"><hr/></td></tr>
+ <tr>
+ <td class="description"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.PrerequisiteUserMappingColon")%></nobr></td>
+ <td class="value" colspan="4">
+ <input type="hidden" name="prerequisites_present" value="true"/>
+<%
+ if (prereq == null)
+ {
+%>
+ <input type="radio" name="prerequisites" value="" checked="true"/> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.NoPrerequisites")%><br/>
+<%
+ }
+ else
+ {
+%>
+ <input type="radio" name="prerequisites" value=""/> <%=Messages.getBodyString(pageContext.getRequest().getLocale(),"editauthority.NoPrerequisites")%><br/>
+<%
+ }
+ for (IMappingConnection mappingConnection : mappingConnections)
+ {
+ String mappingName = mappingConnection.getName();
+ String mappingDescription = mappingName;
+ if (mappingConnection.getDescription() != null && mappingConnection.getDescription().length() > 0)
+ mappingDescription += " (" + mappingConnection.getDescription()+")";
+ if (prereq != null && prereq.equals(mappingName))
+ {
+%>
+ <input type="radio" name="prerequisites" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(mappingName)%>' checked="true"/> <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(mappingDescription)%><br/>
+<%
+ }
+ else
+ {
+%>
+ <input type="radio" name="prerequisites" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(mappingName)%>'/> <%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(mappingDescription)%><br/>
+<%
+ }
+ }
+%>
+ </td>
+ </tr>
+ </table>
+<%
+ }
+ else
+ {
+ // Hiddens for Prerequisites tab
+%>
+ <input type="hidden" name="prerequisites_present" value="true"/>
+<%
+ if (prereq != null)
+ {
+%>
+ <input type="hidden" name="prerequisites" value='<%=org.apache.manifoldcf.ui.util.Encoder.attributeEscape(prereq)%>'/>
+<%
+ }
+ }
+
// The "Throttling" tab
if (tabName.equals(Messages.getString(pageContext.getRequest().getLocale(),"editauthority.Throttling")))
{
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/execute.jsp Sun Jun 30 14:15:49 2013
@@ -47,6 +47,7 @@
IJobManager manager = JobManagerFactory.make(threadContext);
IRepositoryConnectionManager connManager = RepositoryConnectionManagerFactory.make(threadContext);
IAuthorityConnectionManager authConnManager = AuthorityConnectionManagerFactory.make(threadContext);
+ IMappingConnectionManager mappingConnManager = MappingConnectionManagerFactory.make(threadContext);
IOutputConnectionManager outputManager = OutputConnectionManagerFactory.make(threadContext);
String type = variableContext.getParameter("type");
@@ -250,7 +251,15 @@
x = variableContext.getParameter("maxconnections");
if (x != null && x.length() > 0)
connection.setMaxConnections(Integer.parseInt(x));
-
+ x = variableContext.getParameter("prerequisites_present");
+ if (x != null && x.equals("true"))
+ {
+ String y = variableContext.getParameter("prerequisites");
+ if (y != null && y.length() == 0)
+ y = null;
+ connection.setPrerequisiteMapping(y);
+ }
+
String error = AuthorityConnectorFactory.processConfigurationPost(threadContext,connection.getClassName(),variableContext,pageContext.getRequest().getLocale(),connection.getConfigParams());
if (error != null)
@@ -326,6 +335,129 @@
<%
}
}
+ else if (type != null && op != null && type.equals("mapper"))
+ {
+ // -- Mapping editing operations --
+ if (op.equals("Save") || op.equals("Continue"))
+ {
+ try
+ {
+ // Set up a connection object that is a merge of an existing connection object plus what was posted.
+ IMappingConnection connection = null;
+ boolean isNew = true;
+ String x = variableContext.getParameter("isnewconnection");
+ if (x != null)
+ isNew = x.equals("true");
+
+ String connectionName = variableContext.getParameter("connname");
+ // If the connectionname is not null, load the connection description and prepopulate everything with what comes from it.
+ if (connectionName != null && connectionName.length() > 0 && !isNew)
+ {
+ connection = mappingConnManager.load(connectionName);
+ }
+
+ if (connection == null)
+ {
+ connection = mappingConnManager.create();
+ if (connectionName != null && connectionName.length() > 0)
+ connection.setName(connectionName);
+ }
+
+ // Gather all the data from the form.
+ connection.setIsNew(isNew);
+ x = variableContext.getParameter("description");
+ if (x != null)
+ connection.setDescription(x);
+ x = variableContext.getParameter("classname");
+ if (x != null)
+ connection.setClassName(x);
+ x = variableContext.getParameter("maxconnections");
+ if (x != null && x.length() > 0)
+ connection.setMaxConnections(Integer.parseInt(x));
+ x = variableContext.getParameter("prerequisites_present");
+ if (x != null && x.equals("true"))
+ {
+ String y = variableContext.getParameter("prerequisites");
+ if (y != null && y.length() == 0)
+ y = null;
+ connection.setPrerequisiteMapping(y);
+ }
+
+ String error = MappingConnectorFactory.processConfigurationPost(threadContext,connection.getClassName(),variableContext,pageContext.getRequest().getLocale(),connection.getConfigParams());
+
+ if (error != null)
+ {
+ variableContext.setParameter("text",error);
+ variableContext.setParameter("target","listmappers.jsp");
+%>
+ <jsp:forward page="error.jsp"/>
+<%
+ }
+
+ if (op.equals("Continue"))
+ {
+ threadContext.save("ConnectionObject",connection);
+%>
+ <jsp:forward page="editmapper.jsp"/>
+<%
+ }
+ else if (op.equals("Save"))
+ {
+ mappingConnManager.save(connection);
+ variableContext.setParameter("connname",connectionName);
+%>
+ <jsp:forward page="viewmapper.jsp"/>
+<%
+ }
+ }
+ catch (ManifoldCFException e)
+ {
+ e.printStackTrace();
+ variableContext.setParameter("text",e.getMessage());
+ variableContext.setParameter("target","listmappers.jsp");
+%>
+ <jsp:forward page="error.jsp"/>
+<%
+ }
+ }
+ else if (op.equals("Delete"))
+ {
+ try
+ {
+ String connectionName = variableContext.getParameter("connname");
+ if (connectionName == null)
+ throw new ManifoldCFException("Missing connection parameter");
+ mappingConnManager.delete(connectionName);
+%>
+ <jsp:forward page="listmappers.jsp"/>
+<%
+ }
+ catch (ManifoldCFException e)
+ {
+ e.printStackTrace();
+ variableContext.setParameter("text",e.getMessage());
+ variableContext.setParameter("target","listmappers.jsp");
+%>
+ <jsp:forward page="error.jsp"/>
+<%
+ }
+ }
+ else if (op.equals("Cancel"))
+ {
+%>
+ <jsp:forward page="listmappers.jsp"/>
+<%
+ }
+ else
+ {
+ // Error
+ variableContext.setParameter("text","Illegal parameter to mapping execution page");
+ variableContext.setParameter("target","listmappers.jsp");
+%>
+ <jsp:forward page="error.jsp"/>
+<%
+ }
+ }
else if (type != null && op != null && type.equals("output"))
{
// -- Output connection editing operations --
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listauthorities.jsp Sun Jun 30 14:15:49 2013
@@ -38,7 +38,7 @@
function Delete(connectionName)
{
- if (confirm("Delete authority '"+connectionName+"'?"))
+ if (confirm("<%=Messages.getBodyJavascriptString(pageContext.getRequest().getLocale(),"listauthorities.DeleteAuthority")%> '"+connectionName+"'?"))
{
document.listconnections.op.value="Delete";
document.listconnections.connname.value=connectionName;
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listconnections.jsp Sun Jun 30 14:15:49 2013
@@ -91,7 +91,7 @@
String className = connection.getClassName();
String connectorName = connectorManager.getDescription(className);
if (connectorName == null)
- connectorName = className + "(uninstalled)";
+ connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"listconnections.uninstalled");;
String authorityName = connection.getACLAuthority();
int maxCount = connection.getMaxConnections();
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/listoutputs.jsp Sun Jun 30 14:15:49 2013
@@ -94,7 +94,7 @@
String className = connection.getClassName();
String connectorName = connectorManager.getDescription(className);
if (connectorName == null)
- connectorName = className + "(uninstalled)";
+ connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"listoutputs.uninstalled");;
int maxCount = connection.getMaxConnections();
%>
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/navigation.jsp Sun Jun 30 14:15:49 2013
@@ -34,6 +34,12 @@
<nobr><a class="menulink" href="listoutputs.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"navigation.Listoutputconnections")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.ListOutputConnections")%></a></nobr>
</li>
</ul>
+<p class="menumain"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.UserMappings")%></nobr></p>
+<ul class="menusecond">
+ <li class="menuitem">
+ <nobr><a class="menulink" href="listmappers.jsp" alt="<%=Messages.getAttributeString(pageContext.getRequest().getLocale(),"navigation.Listusermappings")%>"><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.ListUserMappings")%></a></nobr>
+ </li>
+</ul>
<p class="menumain"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"navigation.Authorities")%></nobr></p>
<ul class="menusecond">
<li class="menuitem">
Modified: manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp (original)
+++ manifoldcf/trunk/framework/crawler-ui/src/main/webapp/viewauthority.jsp Sun Jun 30 14:15:49 2013
@@ -83,6 +83,8 @@
if (connectorName == null)
connectorName = className + Messages.getString(pageContext.getRequest().getLocale(),"viewauthority.uninstalled");
int maxCount = connection.getMaxConnections();
+ String prereq = connection.getPrerequisiteMapping();
+
ConfigParams parameters = connection.getConfigParams();
// Do stuff so we can call out to display the parameters
@@ -120,15 +122,41 @@
<td class="separator" colspan="4"><hr/></td>
</tr>
<tr>
- <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.NameColon")%></nobr></td><td class="value" colspan="1"><%="<!--connection="+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)+"-->"%><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)%></nobr></td>
- <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.DescriptionColon")%></nobr></td><td class="value" colspan="1"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.NameColon")%></nobr></td>
+ <td class="value" colspan="1"><%="<!--connection="+org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)+"-->"%><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionName)%></nobr></td>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.DescriptionColon")%></nobr></td>
+ <td class="value" colspan="1"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(description)%></td>
</tr>
<tr>
<td class="separator" colspan="4"><hr/></td>
</tr>
<tr>
- <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.AuthorityTypeColon")%></nobr></td><td class="value" colspan="1"><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></nobr></td>
- <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.MaxConnectionsColon")%></nobr></td><td class="value" colspan="1"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(Integer.toString(maxCount))%></td>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.AuthorityTypeColon")%></nobr></td>
+ <td class="value" colspan="1"><nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectorName)%></nobr></td>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.MaxConnectionsColon")%></nobr></td>
+ <td class="value" colspan="1"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(Integer.toString(maxCount))%></td>
+ </tr>
+ <tr>
+ <td class="separator" colspan="4"><hr/></td>
+ </tr>
+ <tr>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.PrerequisiteUserMappingColon")%></nobr></td>
+ <td class="value" colspan="3">
+<%
+ if (prereq != null)
+ {
+%>
+ <nobr><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(prereq)%></nobr>
+<%
+ }
+ else
+ {
+%>
+ <nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.NoPrerequisites")%></nobr>
+<%
+ }
+%>
+ </td>
</tr>
<tr>
<td class="separator" colspan="4"><hr/></td>
@@ -145,7 +173,8 @@
<td class="separator" colspan="4"><hr/></td>
</tr>
<tr>
- <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.ConnectionStatusColon")%></nobr></td><td class="value" colspan="3"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionStatus)%></td>
+ <td class="description" colspan="1"><nobr><%=Messages.getBodyString(pageContext.getRequest().getLocale(),"viewauthority.ConnectionStatusColon")%></nobr></td>
+ <td class="value" colspan="3"><%=org.apache.manifoldcf.ui.util.Encoder.bodyEscape(connectionStatus)%></td>
</tr>
<tr>
<td class="separator" colspan="4"><hr/></td>
Modified: manifoldcf/trunk/framework/example-common/connectors.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/example-common/connectors.xml?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/example-common/connectors.xml (original)
+++ manifoldcf/trunk/framework/example-common/connectors.xml Sun Jun 30 14:15:49 2013
@@ -23,6 +23,7 @@
-->
<connectors>
<!-- Add your output connectors here -->
+ <!-- Add your mapping connectors here -->
<!-- Add your authority connectors here -->
<!-- Add your repository connectors here -->
</connectors>
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DefineAuthorityConnection.java Sun Jun 30 14:15:49 2013
@@ -28,66 +28,64 @@ import java.util.*;
*/
public class DefineAuthorityConnection
{
- public static final String _rcsid = "@(#)$Id: DefineAuthorityConnection.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DefineAuthorityConnection.java 988245 2010-08-23 18:39:35Z kwright $";
- private DefineAuthorityConnection()
- {
- }
-
-
- public static void main(String[] args)
- {
- if (args.length < 4)
- {
- System.err.println("Usage: DefineAuthorityConnection <connection_name> <description> <connector_class> <pool_max> <param1>=<value1> ...");
- System.exit(1);
- }
-
- String connectionName = args[0];
- String description = args[1];
- String connectorClass = args[2];
- String poolMax = args[3];
-
-
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
- IAuthorityConnection conn = mgr.create();
- conn.setName(connectionName);
- conn.setDescription(description);
- conn.setClassName(connectorClass);
- conn.setMaxConnections(new Integer(poolMax).intValue());
- ConfigParams x = conn.getConfigParams();
- int i = 4;
- while (i < args.length)
- {
- String arg = args[i++];
- // Parse
- int pos = arg.indexOf("=");
- if (pos == -1)
- throw new ManifoldCFException("Argument missing =");
- String name = arg.substring(0,pos);
- String value = arg.substring(pos+1);
- if (name.endsWith("assword"))
- x.setObfuscatedParameter(name,value);
- else
- x.setParameter(name,value);
- }
-
- // Now, save
- mgr.save(conn);
-
- }
- catch (Exception e)
- {
- e.printStackTrace(System.err);
- System.exit(2);
- }
- }
+ private DefineAuthorityConnection()
+ {
+ }
+
+
+ public static void main(String[] args)
+ {
+ if (args.length < 4)
+ {
+ System.err.println("Usage: DefineAuthorityConnection <connection_name> <description> <connector_class> <pool_max> <param1>=<value1> ...");
+ System.exit(1);
+ }
+
+ String connectionName = args[0];
+ String description = args[1];
+ String connectorClass = args[2];
+ String poolMax = args[3];
+
+
+ try
+ {
+ ManifoldCF.initializeEnvironment();
+ IThreadContext tc = ThreadContextFactory.make();
+ IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
+ IAuthorityConnection conn = mgr.create();
+ conn.setName(connectionName);
+ conn.setDescription(description);
+ conn.setClassName(connectorClass);
+ conn.setMaxConnections(new Integer(poolMax).intValue());
+ ConfigParams x = conn.getConfigParams();
+ int i = 4;
+ while (i < args.length)
+ {
+ String arg = args[i++];
+ // Parse
+ int pos = arg.indexOf("=");
+ if (pos == -1)
+ throw new ManifoldCFException("Argument missing =");
+ String name = arg.substring(0,pos);
+ String value = arg.substring(pos+1);
+ if (name.endsWith("assword"))
+ x.setObfuscatedParameter(name,value);
+ else
+ x.setParameter(name,value);
+ }
+
+ // Now, save
+ mgr.save(conn);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(System.err);
+ System.exit(2);
+ }
+ }
-
-
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/DeleteAuthorityConnection.java Sun Jun 30 14:15:49 2013
@@ -28,38 +28,38 @@ import java.util.*;
*/
public class DeleteAuthorityConnection
{
- public static final String _rcsid = "@(#)$Id: DeleteAuthorityConnection.java 988245 2010-08-23 18:39:35Z kwright $";
+ public static final String _rcsid = "@(#)$Id: DeleteAuthorityConnection.java 988245 2010-08-23 18:39:35Z kwright $";
- private DeleteAuthorityConnection()
- {
- }
-
-
- public static void main(String[] args)
- {
- if (args.length != 1)
- {
- System.err.println("Usage: DeleteAuthorityConnection <connection_name>");
- System.exit(1);
- }
-
- String connectionName = args[0];
- try
- {
- ManifoldCF.initializeEnvironment();
- IThreadContext tc = ThreadContextFactory.make();
- IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
- mgr.delete(connectionName);
-
- }
- catch (Exception e)
- {
- e.printStackTrace(System.err);
- System.exit(2);
- }
- }
+ private DeleteAuthorityConnection()
+ {
+ }
+
+
+ public static void main(String[] args)
+ {
+ if (args.length != 1)
+ {
+ System.err.println("Usage: DeleteAuthorityConnection <connection_name>");
+ System.exit(1);
+ }
+
+ String connectionName = args[0];
+ try
+ {
+ ManifoldCF.initializeEnvironment();
+ IThreadContext tc = ThreadContextFactory.make();
+ IAuthorityConnectionManager mgr = AuthorityConnectionManagerFactory.make(tc);
+ mgr.delete(connectionName);
+
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(System.err);
+ System.exit(2);
+ }
+ }
-
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authorities/BaseAuthorityConnector.java Sun Jun 30 14:15:49 2013
@@ -39,6 +39,7 @@ public abstract class BaseAuthorityConne
*@return the response tokens (according to the current authority).
* (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
*/
+ @Override
public AuthorizationResponse getAuthorizationResponse(String userName)
throws ManifoldCFException
{
@@ -67,6 +68,7 @@ public abstract class BaseAuthorityConne
*@param userName is the user name or identifier.
*@return the default response tokens, presuming that the connect method fails.
*/
+ @Override
public AuthorizationResponse getDefaultAuthorizationResponse(String userName)
{
String[] acls = getDefaultAccessTokens(userName);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnection.java Sun Jun 30 14:15:49 2013
@@ -36,6 +36,7 @@ public class AuthorityConnection impleme
protected String className = null;
protected ConfigParams configParams = new ConfigParams();
protected int maxCount = 100;
+ protected String prerequisiteMapping = null;
/** Constructor.
*/
@@ -55,6 +56,7 @@ public class AuthorityConnection impleme
rval.className = className;
rval.maxCount = maxCount;
rval.configParams = configParams.duplicate();
+ rval.prerequisiteMapping = prerequisiteMapping;
return rval;
}
@@ -146,4 +148,21 @@ public class AuthorityConnection impleme
return maxCount;
}
+ /** Set the prerequisite mapper, if any.
+ *@param mapping is the name of the mapping connection to use to get the input user name,
+ * or null.
+ */
+ public void setPrerequisiteMapping(String mapping)
+ {
+ prerequisiteMapping = mapping;
+ }
+
+ /** Get the prerequisite mapper, if any.
+ *@return the mapping connection name whose output should be used as the input user name.
+ */
+ public String getPrerequisiteMapping()
+ {
+ return prerequisiteMapping;
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/authority/AuthorityConnectionManager.java Sun Jun 30 14:15:49 2013
@@ -39,6 +39,7 @@ import org.apache.manifoldcf.crawler.int
* <tr><td>classname</td><td>VARCHAR(255)</td><td></td></tr>
* <tr><td>maxcount</td><td>BIGINT</td><td></td></tr>
* <tr><td>configxml</td><td>LONGTEXT</td><td></td></tr>
+ * <tr><td>mappingname</td><td>VARCHAR(32)</td><td></td></tr>
* </table>
* <br><br>
*
@@ -55,8 +56,7 @@ public class AuthorityConnectionManager
protected final static String classNameField = "classname";
protected final static String maxCountField = "maxcount";
protected final static String configField = "configxml";
-
- protected static Random random = new Random();
+ protected final static String mappingField = "mappingname";
// Cache manager
ICacheManager cacheManager;
@@ -77,6 +77,7 @@ public class AuthorityConnectionManager
/** Install the manager.
*/
+ @Override
public void install()
throws ManifoldCFException
{
@@ -93,11 +94,19 @@ public class AuthorityConnectionManager
map.put(classNameField,new ColumnDescription("VARCHAR(255)",false,false,null,null,false));
map.put(maxCountField,new ColumnDescription("BIGINT",false,false,null,null,false));
map.put(configField,new ColumnDescription("LONGTEXT",false,true,null,null,false));
+ map.put(mappingField,new ColumnDescription("VARCHAR(32)",false,true,null,null,false));
performCreate(map,null);
}
else
{
- // Upgrade code goes here
+ // Add the mappingField column
+ ColumnDescription cd = (ColumnDescription)existing.get(mappingField);
+ if (cd == null)
+ {
+ Map addMap = new HashMap();
+ addMap.put(mappingField,new ColumnDescription("VARCHAR(32)",false,true,null,null,false));
+ performAlter(addMap,null,null,null);
+ }
}
// Index management goes here
@@ -108,6 +117,7 @@ public class AuthorityConnectionManager
/** Uninstall the manager.
*/
+ @Override
public void deinstall()
throws ManifoldCFException
{
@@ -115,11 +125,12 @@ public class AuthorityConnectionManager
}
/** Export configuration */
+ @Override
public void exportConfiguration(java.io.OutputStream os)
throws java.io.IOException, ManifoldCFException
{
// Write a version indicator
- ManifoldCF.writeDword(os,1);
+ ManifoldCF.writeDword(os,2);
// Get the authority list
IAuthorityConnection[] list = getAllConnections();
// Write the number of authorities
@@ -134,15 +145,17 @@ public class AuthorityConnectionManager
ManifoldCF.writeString(os,conn.getClassName());
ManifoldCF.writeString(os,conn.getConfigParams().toXML());
ManifoldCF.writeDword(os,conn.getMaxConnections());
+ ManifoldCF.writeString(os,conn.getPrerequisiteMapping());
}
}
/** Import configuration */
+ @Override
public void importConfiguration(java.io.InputStream is)
throws java.io.IOException, ManifoldCFException
{
int version = ManifoldCF.readDword(is);
- if (version != 1)
+ if (version < 1 || version > 2)
throw new java.io.IOException("Unknown authority configuration version: "+Integer.toString(version));
int count = ManifoldCF.readDword(is);
int i = 0;
@@ -154,6 +167,10 @@ public class AuthorityConnectionManager
conn.setClassName(ManifoldCF.readString(is));
conn.getConfigParams().fromXML(ManifoldCF.readString(is));
conn.setMaxConnections(ManifoldCF.readDword(is));
+ if (version >= 2)
+ {
+ conn.setPrerequisiteMapping(ManifoldCF.readString(is));
+ }
// Attempt to save this connection
save(conn);
i++;
@@ -163,6 +180,7 @@ public class AuthorityConnectionManager
/** Obtain a list of the repository connections, ordered by name.
*@return an array of connection objects.
*/
+ @Override
public IAuthorityConnection[] getAllConnections()
throws ManifoldCFException
{
@@ -205,6 +223,7 @@ public class AuthorityConnectionManager
*@param name is the name of the repository connection.
*@return the loaded connection object, or null if not found.
*/
+ @Override
public IAuthorityConnection load(String name)
throws ManifoldCFException
{
@@ -215,6 +234,7 @@ public class AuthorityConnectionManager
*@param names are the names to load.
*@return the loaded connection objects.
*/
+ @Override
public IAuthorityConnection[] loadMultiple(String[] names)
throws ManifoldCFException
{
@@ -238,6 +258,7 @@ public class AuthorityConnectionManager
/** Create a new repository connection object.
*@return the new object.
*/
+ @Override
public IAuthorityConnection create()
throws ManifoldCFException
{
@@ -249,6 +270,7 @@ public class AuthorityConnectionManager
*@param object is the object to save.
*@return true if the object is created, false otherwise.
*/
+ @Override
public boolean save(IAuthorityConnection object)
throws ManifoldCFException
{
@@ -281,6 +303,7 @@ public class AuthorityConnectionManager
values.put(classNameField,object.getClassName());
values.put(maxCountField,new Long((long)object.getMaxConnections()));
values.put(configField,object.getConfigParams().toXML());
+ values.put(mappingField,object.getPrerequisiteMapping());
boolean isCreated;
@@ -349,6 +372,7 @@ public class AuthorityConnectionManager
*@param name is the name of the connection to delete. If the
* name does not exist, no error is returned.
*/
+ @Override
public void delete(String name)
throws ManifoldCFException
{
@@ -400,11 +424,31 @@ public class AuthorityConnectionManager
/** Get the authority connection name column.
*@return the name column.
*/
+ @Override
public String getAuthorityNameColumn()
{
return nameField;
}
+ /** Return true if the specified mapping name is referenced.
+ *@param mappingName is the mapping name.
+ *@return true if referenced, false otherwise.
+ */
+ @Override
+ public boolean isMappingReferenced(String mappingName)
+ throws ManifoldCFException
+ {
+ StringSetBuffer ssb = new StringSetBuffer();
+ ssb.add(getAuthorityConnectionsKey());
+ StringSet localCacheKeys = new StringSet(ssb);
+ ArrayList params = new ArrayList();
+ String query = buildConjunctionClause(params,new ClauseDescription[]{
+ new UnitaryClause(mappingField,mappingName)});
+ IResultSet set = performQuery("SELECT "+nameField+" FROM "+getTableName()+" WHERE "+query,params,
+ localCacheKeys,null);
+ return set.getRowCount() > 0;
+ }
+
// Caching strategy: Individual connection descriptions are cached, and there is a global cache key for the list of
// repository connections.
@@ -514,6 +558,7 @@ public class AuthorityConnectionManager
rc.setDescription((String)row.getValue(descriptionField));
rc.setClassName((String)row.getValue(classNameField));
rc.setMaxConnections((int)((Long)row.getValue(maxCountField)).longValue());
+ rc.setPrerequisiteMapping((String)row.getValue(mappingField));
String xml = (String)row.getValue(configField);
if (xml != null && xml.length() > 0)
rc.getConfigParams().fromXML(xml);
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/CacheKeyFactory.java Sun Jun 30 14:15:49 2013
@@ -45,4 +45,21 @@ public class CacheKeyFactory extends org
return "AUTHORITYCONNECTION_"+connectionName;
}
+ /** Construct a key which represents the general list of mapping connectors.
+ *@return the cache key.
+ */
+ public static String makeMappingConnectionsKey()
+ {
+ return "MAPPINGCONNECTIONS";
+ }
+
+ /** Construct a key which represents an individual mapping connection.
+ *@param connectionName is the name of the connection.
+ *@return the cache key.
+ */
+ public static String makeMappingConnectionKey(String connectionName)
+ {
+ return "MAPPINGCONNECTION_"+connectionName;
+ }
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnection.java Sun Jun 30 14:15:49 2013
@@ -80,4 +80,15 @@ public interface IAuthorityConnection
*/
public int getMaxConnections();
+ /** Set the prerequisite mapper, if any.
+ *@param mapping is the name of the mapping connection to use to get the input user name,
+ * or null.
+ */
+ public void setPrerequisiteMapping(String mapping);
+
+ /** Get the prerequisite mapper, if any.
+ *@return the mapping connection name whose output should be used as the input user name.
+ */
+ public String getPrerequisiteMapping();
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnectionManager.java Sun Jun 30 14:15:49 2013
@@ -58,6 +58,13 @@ public interface IAuthorityConnectionMan
public IAuthorityConnection load(String name)
throws ManifoldCFException;
+ /** Load multiple repository connections by name.
+ *@param names are the names to load.
+ *@return the loaded connection objects.
+ */
+ public IAuthorityConnection[] loadMultiple(String[] names)
+ throws ManifoldCFException;
+
/** Create a new authority connection object.
*@return the new object.
*/
@@ -90,4 +97,11 @@ public interface IAuthorityConnectionMan
*/
public String getAuthorityNameColumn();
+ /** Return true if the specified mapping name is referenced.
+ *@param mappingName is the mapping name.
+ *@return true if referenced, false otherwise.
+ */
+ public boolean isMappingReferenced(String mappingName)
+ throws ManifoldCFException;
+
}
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/interfaces/IAuthorityConnector.java Sun Jun 30 14:15:49 2013
@@ -32,7 +32,7 @@ import java.io.*;
public interface IAuthorityConnector extends IConnector
{
- /** Obtain the access tokens for a given user name.
+ /** Obtain the access tokens for a given Active Directory user name.
*@param userName is the user name or identifier.
*@return the response tokens (according to the current authority).
* (Should throws an exception only when a condition cannot be properly described within the authorization response object.)
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthCheckThread.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthCheckThread.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthCheckThread.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthCheckThread.java Sun Jun 30 14:15:49 2013
@@ -33,11 +33,11 @@ public class AuthCheckThread extends Thr
public static final String _rcsid = "@(#)$Id: AuthCheckThread.java 988245 2010-08-23 18:39:35Z kwright $";
// Local data
- protected RequestQueue requestQueue;
+ protected RequestQueue<AuthRequest> requestQueue;
/** Constructor.
*/
- public AuthCheckThread(String id, RequestQueue requestQueue)
+ public AuthCheckThread(String id, RequestQueue<AuthRequest> requestQueue)
throws ManifoldCFException
{
super();
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthRequest.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthRequest.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthRequest.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/AuthRequest.java Sun Jun 30 14:15:49 2013
@@ -32,10 +32,10 @@ public class AuthRequest
// This is where the request data actually lives
protected String userID;
- protected String className;
- protected String identifyingString;
- protected ConfigParams configParameters;
- protected int maxConnections;
+ protected final String className;
+ protected final String identifyingString;
+ protected final ConfigParams configParameters;
+ protected final int maxConnections;
// These are the possible results of the request
protected boolean answerComplete = false;
@@ -44,15 +44,20 @@ public class AuthRequest
/** Construct the request, and record the question.
*/
- public AuthRequest(String userID, String className, String identifyingString, ConfigParams configParameters, int maxConnections)
+ public AuthRequest(String className, String identifyingString, ConfigParams configParameters, int maxConnections)
{
- this.userID = userID;
this.className = className;
this.identifyingString = identifyingString;
this.configParameters = configParameters;
this.maxConnections = maxConnections;
}
+ /** Set the user ID we'll be using */
+ public void setUserID(String userID)
+ {
+ this.userID = userID;
+ }
+
/** Get the user id */
public String getUserID()
{
Modified: manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/Logging.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/Logging.java?rev=1498128&r1=1498127&r2=1498128&view=diff
==============================================================================
--- manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/Logging.java (original)
+++ manifoldcf/trunk/framework/pull-agent/src/main/java/org/apache/manifoldcf/authorities/system/Logging.java Sun Jun 30 14:15:49 2013
@@ -32,6 +32,7 @@ public class Logging extends org.apache.
// Public logger objects
public static Logger authorityService = null;
public static Logger authorityConnectors = null;
+ public static Logger mappingConnectors = null;
/** Initialize logger setup.
*/
@@ -45,6 +46,7 @@ public class Logging extends org.apache.
// package loggers
authorityService = newLogger("org.apache.manifoldcf.authorityservice");
authorityConnectors = newLogger("org.apache.manifoldcf.authorityconnectors");
+ mappingConnectors = newLogger("org.apache.manifoldcf.mappingconnectors");
}