incubator-connectors-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piergior...@apache.org
Subject svn commit: r1203860 [1/4] - in /incubator/lcf/branches/CONNECTORS-287: ./ connectors/alfresco/ connectors/alfresco/connector/ connectors/alfresco/connector/src/ connectors/alfresco/connector/src/main/ connectors/alfresco/connector/src/main/java/ conne...
Date Fri, 18 Nov 2011 21:42:11 GMT
Author: piergiorgio
Date: Fri Nov 18 21:42:08 2011
New Revision: 1203860

URL: http://svn.apache.org/viewvc?rev=1203860&view=rev
Log:
the first implementation of the Alfresco Connector (CONNECTORS-287)

Added:
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/NodeUtils.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/PropertiesUtils.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/SearchUtils.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.html   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editConfiguration.js   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.html   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/editSpecification.js   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/viewConfiguration.html   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/resource/org/apache/manifoldcf/crawler/connectors/alfresco/viewSpecification.html   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/Base.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/BaseHSQLDB.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/BasePostgresql.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/SanityHSQLDBTest.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/SanityPostgresqlTest.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/alfresco/tests/SanityTest.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/pom.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/alfresco-web-service-client-4.0.b.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/h2-1.3.158.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/jetty-plus-6.1.26.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/mail.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/opensaml-1.0.1.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/wss4j-1.5.4-patched.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/lib/xmlsec-1.4.1.jar   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/README-ANT.txt   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/README-m2.txt   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/build.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/pom.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/java/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/properties/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/properties/local/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/properties/local/README-properties.txt   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/properties/local/alfresco-global.properties   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/resources/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/resources/log4j.properties   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/META-INF/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/META-INF/MANIFEST.MF   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/WEB-INF/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/WEB-INF/README-WEB-INF.txt   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/WEB-INF/faces-config-custom.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/alfresco-war/src/main/webapp/WEB-INF/lib/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/pom.xml   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/apache/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/apache/manifoldcf/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/apache/manifoldcf/alfresco_tests/
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/apache/manifoldcf/alfresco_tests/APISanityIT.java   (with props)
    incubator/lcf/branches/CONNECTORS-287/tests/alfresco/src/test/java/org/apache/manifoldcf/alfresco_tests/Base.java   (with props)
Modified:
    incubator/lcf/branches/CONNECTORS-287/build.xml
    incubator/lcf/branches/CONNECTORS-287/pom.xml
    incubator/lcf/branches/CONNECTORS-287/tests/pom.xml

Modified: incubator/lcf/branches/CONNECTORS-287/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/build.xml?rev=1203860&r1=1203859&r2=1203860&view=diff
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/build.xml (original)
+++ incubator/lcf/branches/CONNECTORS-287/build.xml Fri Nov 18 21:42:08 2011
@@ -30,6 +30,8 @@
         <ant dir="site" target="clean"/>
         <ant dir="framework" target="clean"/>
         <delete dir="framework/lib"/>
+        <ant dir="connectors/alfresco" target="clean"/>
+        <delete dir="connectors/alfresco/lib"/>
         <ant dir="connectors/cmis" target="clean"/>
         <delete dir="connectors/cmis/lib"/>
         <ant dir="connectors/activedirectory" target="clean"/>
@@ -75,6 +77,8 @@
         <delete dir="framework/build"/>
         <delete dir="framework/dist"/>
         <delete dir="framework/lib"/>
+        <ant dir="connectors/alfresco" target="clean"/>
+        <delete dir="connectors/alfresco/lib"/>
         <ant dir="connectors/cmis" target="clean"/>
         <delete dir="connectors/cmis/lib"/>
         <ant dir="connectors/activedirectory" target="clean"/>
@@ -243,6 +247,32 @@
     <target name="run-tests-HSQLDB-activedirectory-connector" depends="setup-activedirectory-connector,setup-activedirectory-connector-tests">
         <ant dir="connectors/activedirectory" target="run-tests-HSQLDB"/>
     </target>
+    
+    <target name="setup-alfresco-connector" depends="build-framework">
+        <mkdir dir="connectors/alfresco/lib"/>
+        <copy todir="connectors/alfresco/lib">
+            <fileset dir="framework/lib"/>
+        </copy>
+        <copy todir="connectors/alfresco/lib">
+            <fileset dir="lib">
+                <include name="alfresco-web-service-client*.jar"/>
+                <include name="axis*.jar"/>	
+                <include name="commons-discovery*.jar"/>
+                <include name="commons-logging*.jar"/>
+                <include name="commons-lang*.jar"/>
+                <include name="mail*.jar"/>
+                <include name="opensaml*.jar"/>
+                <include name="wsdl4j*.jar"/>
+                <include name="wss4j*.jar"/>
+                <include name="xalan*.jar"/>
+                <include name="xercesImpl*.jar"/>
+                <include name="xmlsec*.jar"/>
+            </fileset>
+        </copy>
+        <copy todir="connectors/alfresco/lib">
+            <fileset dir="framework/build/jar"/>
+        </copy>
+    </target>
 
     <target name="setup-cmis-connector" depends="build-framework">
         <mkdir dir="connectors/cmis/lib"/>
@@ -271,6 +301,13 @@
             <fileset dir="framework/build/jar"/>
         </copy>
     </target>
+    
+    <target name="setup-alfresco-connector-tests" depends="build-tests-framework">
+        <mkdir dir="connectors/alfresco/lib"/>
+        <copy todir="connectors/alfresco/lib">
+            <fileset dir="framework/build/test-jar"/>
+        </copy>
+    </target>
 
     <target name="setup-cmis-connector-tests" depends="build-tests-framework">
         <mkdir dir="connectors/cmis/lib"/>
@@ -279,29 +316,57 @@
         </copy>
     </target>
 
+	<target name="build-alfresco-connector" depends="setup-alfresco-connector">
+        <ant dir="connectors/alfresco" target="build"/>
+    </target>
+	
     <target name="build-cmis-connector" depends="setup-cmis-connector">
         <ant dir="connectors/cmis" target="build"/>
     </target>
     
+    <target name="doc-alfresco-connector" depends="setup-alfresco-connector">
+        <ant dir="connectors/alfresco" target="doc"/>
+    </target>
+    
     <target name="doc-cmis-connector" depends="setup-cmis-connector">
         <ant dir="connectors/cmis" target="doc"/>
     </target>
+    
+    <target name="build-tests-alfresco-connector" depends="setup-alfresco-connector,setup-alfresco-connector-tests">
+        <ant dir="connectors/alfresco" target="build-tests"/>
+    </target>
 
     <target name="build-tests-cmis-connector" depends="setup-cmis-connector,setup-cmis-connector-tests">
         <ant dir="connectors/cmis" target="build-tests"/>
     </target>
+    
+     <target name="run-tests-alfresco-connector" depends="setup-alfresco-connector,setup-alfresco-connector-tests">
+        <ant dir="connectors/alfresco" target="run-tests"/>
+    </target>
 
     <target name="run-tests-cmis-connector" depends="setup-cmis-connector,setup-cmis-connector-tests">
         <ant dir="connectors/cmis" target="run-tests"/>
     </target>
 
+	<target name="run-tests-derby-alfresco-connector" depends="setup-alfresco-connector,setup-alfresco-connector-tests">
+        <ant dir="connectors/alfresco" target="run-tests-derby"/>
+    </target>
+
     <target name="run-tests-derby-cmis-connector" depends="setup-cmis-connector,setup-cmis-connector-tests">
         <ant dir="connectors/cmis" target="run-tests-derby"/>
     </target>
+    
+    <target name="run-tests-postgresql-alfresco-connector" depends="setup-alfresco-connector,setup-alfresco-connector-tests">
+        <ant dir="connectors/alfresco" target="run-tests-postgresql"/>
+    </target>
 
     <target name="run-tests-postgresql-cmis-connector" depends="setup-cmis-connector,setup-cmis-connector-tests">
         <ant dir="connectors/cmis" target="run-tests-postgresql"/>
     </target>
+    
+    <target name="run-tests-HSQLDB-alfresco-connector" depends="setup-alfresco-connector,setup-alfresco-connector-tests">
+        <ant dir="connectors/alfresco" target="run-tests-HSQLDB"/>
+    </target>
 
     <target name="run-tests-HSQLDB-cmis-connector" depends="setup-cmis-connector,setup-cmis-connector-tests">
         <ant dir="connectors/cmis" target="run-tests-HSQLDB"/>
@@ -1152,7 +1217,35 @@
 	  <fileset dir="connectors/activedirectory/dist/doc"/>
         </copy>
     </target>
+    
+    <target name="calculate-alfresco-condition" depends="build-alfresco-connector">
+        <available file="connectors/alfresco/dist/lib" type="dir" property="alfresco.exists"/>
+        <condition property="alfresco.include">
+            <isset property="alfresco.exists"/>
+        </condition>
+    </target>
+
+    <target name="calculate-alfresco-doc-condition" depends="doc-alfresco-connector">
+        <available file="connectors/alfresco/dist/doc" type="dir" property="alfresco-doc.exists"/>
+        <condition property="alfresco-doc.include">
+            <isset property="alfresco-doc.exists"/>
+        </condition>
+    </target>
+
+    <target name="deliver-alfresco-connector" depends="calculate-alfresco-condition" if="alfresco.include">
+        <mkdir dir="dist/lib"/>
+        <copy todir="dist/lib">
+            <fileset dir="connectors/alfresco/dist/lib"/>
+        </copy>
+    </target>
 
+    <target name="deliver-alfresco-connector-doc" depends="calculate-alfresco-doc-condition" if="alfresco-doc.include">
+        <mkdir dir="dist/doc/api/alfresco"/>
+        <copy todir="dist/doc/api/alfresco">
+	  <fileset dir="connectors/alfresco/dist/doc"/>
+        </copy>
+    </target>
+    
     <target name="calculate-cmis-condition" depends="build-cmis-connector">
         <available file="connectors/cmis/dist/lib" type="dir" property="cmis.exists"/>
         <condition property="cmis.include">
@@ -1709,6 +1802,14 @@
         </copy>
         <replace file="dist/example/connectors.xml" token="&lt;!-- Add your authority connectors here --&gt;" value="&lt;!-- Add your authority connectors here --&gt;&#0010;  &lt;authorityconnector name=&quot;Active Directory&quot; class=&quot;org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority&quot;/&gt;"/>
     </target>
+    
+    <target name="deliver-alfresco-example" depends="deliver-framework-example,calculate-alfresco-condition" if="alfresco.include">
+        <mkdir dir="dist/example/connector-lib"/>
+        <copy todir="dist/example/connector-lib">
+            <fileset dir="connectors/alfresco/dist/lib"/>
+        </copy>
+        <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Alfresco&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.alfresco.AlfrescoRepositoryConnector&quot;/&gt;"/>
+    </target>
 
     <target name="deliver-cmis-example" depends="deliver-framework-example,calculate-cmis-condition" if="cmis.include">
         <mkdir dir="dist/example/connector-lib"/>
@@ -1885,7 +1986,7 @@
         <replace file="dist/example/connectors.xml" token="&lt;!-- Add your repository connectors here --&gt;" value="&lt;!-- Add your repository connectors here --&gt;&#0010;  &lt;repositoryconnector name=&quot;Wiki&quot; class=&quot;org.apache.manifoldcf.crawler.connectors.wiki.WikiConnector&quot;/&gt;"/>
     </target>
 
-    <target name="deliver-example" depends="deliver-framework-example,deliver-activedirectory-example,deliver-cmis-example,deliver-documentum-example,deliver-filesystem-example,deliver-filenet-example,deliver-gts-example,deliver-jcifs-example,deliver-jdbc-example,deliver-livelink-example,deliver-memex-example,deliver-meridio-example,deliver-nullauthority-example,deliver-nulloutput-example,deliver-opensearchserver-example,deliver-rss-example,deliver-sharepoint-example,deliver-solr-example,deliver-webcrawler-example,deliver-wiki-example">
+    <target name="deliver-example" depends="deliver-framework-example,deliver-activedirectory-example,deliver-alfresco-example,deliver-cmis-example,deliver-documentum-example,deliver-filesystem-example,deliver-filenet-example,deliver-gts-example,deliver-jcifs-example,deliver-jdbc-example,deliver-livelink-example,deliver-memex-example,deliver-meridio-example,deliver-nullauthority-example,deliver-nulloutput-example,deliver-opensearchserver-example,deliver-rss-example,deliver-sharepoint-example,deliver-solr-example,deliver-webcrawler-example,deliver-wiki-example">
         <!-- Build a manifest file.  There doesn't seem to be any good way to do this automatically in ant without developing my own
         custom task, so I've hard coded all the class path libs. -->
         <mkdir dir="build/example"/>
@@ -1922,6 +2023,15 @@
         </and>
       </condition>
     </target>
+    
+    <target name="calculate-alfresco-tests-condition" depends="calculate-alfresco-condition,calculate-nulloutput-condition">
+      <condition property="alfresco-tests.include">
+        <and>
+            <isset property="alfresco.include"/>
+            <isset property="nulloutput.include"/>
+        </and>
+      </condition>
+    </target>
 
     <target name="calculate-cmis-tests-condition" depends="calculate-cmis-condition,calculate-nulloutput-condition">
       <condition property="cmis-tests.include">
@@ -2158,6 +2268,41 @@
             </classpath>
         </javac>
     </target>
+    
+    <target name="compile-alfresco-tests" depends="build-framework,build-alfresco-connector,build-nulloutput-connector,calculate-alfresco-tests-condition,build-tests-alfresco-connector,build-tests-nulloutput-connector" if="alfresco-tests.include">
+        <mkdir dir="build/alfresco-tests/classes"/>
+        <javac srcdir="tests/alfresco/src/test/java" destdir="build/alfresco-tests/classes" target="1.5" source="1.5" debug="true" debuglevel="lines,vars,source">
+            <classpath>
+                 <fileset dir="framework/lib"> 
+                    <include name="*.jar"/> 
+                </fileset>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+            </classpath>
+        </javac>
+    </target>
 
     <target name="compile-cmis-tests" depends="build-framework,build-cmis-connector,build-nulloutput-connector,calculate-cmis-tests-condition,build-tests-cmis-connector,build-tests-nulloutput-connector" if="cmis-tests.include">
         <mkdir dir="build/cmis-tests/classes"/>
@@ -2193,6 +2338,44 @@
             </classpath>
         </javac>
     </target>
+    
+    <target name="compile-alfresco-loadtests" depends="build-framework,build-alfresco-connector,build-nulloutput-connector,calculate-alfresco-tests-condition,build-tests-alfresco-connector,build-tests-nulloutput-connector" if="alfresco-tests.include">
+        <mkdir dir="build/alfresco-loadtests/classes"/>
+        <javac srcdir="tests/alfresco/src/test/java" destdir="build/alfresco-loadtests/classes" target="1.5" source="1.5" debug="true" debuglevel="lines,vars,source">
+            <classpath>
+          <fileset dir="lib">
+            <include name="h2*.jar"/>
+          </fileset>
+                 <fileset dir="framework/lib"> 
+                    <include name="*.jar"/> 
+                </fileset>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+            </classpath>
+        </javac>
+    </target>
 
     <target name="compile-cmis-loadtests" depends="build-framework,build-cmis-connector,build-nulloutput-connector,calculate-cmis-tests-condition,build-tests-cmis-connector,build-tests-nulloutput-connector" if="cmis-tests.include">
         <mkdir dir="build/cmis-loadtests/classes"/>
@@ -2474,6 +2657,43 @@
             <!-- MHL -->
         </junit>
     </target>
+    
+    <target name="run-alfresco-tests-derby" depends="compile-alfresco-tests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-output/alfresco"/>
+        <junit fork="true" maxmemory="128m" dir="test-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+            <test name="org.apache.manifoldcf.alfresco_tests.APISanityIT" todir="test-output/alfresco"/>
+            <!-- MHL -->
+        </junit>
+    </target>
 
     <target name="run-cmis-tests-derby" depends="compile-cmis-tests,calculate-cmis-tests-condition" if="cmis-tests.include">
         <mkdir dir="test-output/cmis"/>
@@ -2547,6 +2767,42 @@
             <!-- MHL -->
         </junit>
     </target>
+    
+    <target name="run-alfresco-loadtests-derby" depends="compile-alfresco-loadtests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-output/alfresco"/>
+        <junit fork="true" maxmemory="256m" dir="test-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-loadtests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+            <!-- MHL -->
+        </junit>
+    </target>
 
     <target name="run-sharepoint-tests-derby" depends="compile-sharepoint-tests,calculate-sharepoint-tests-condition" if="sharepoint-tests.include">
         <mkdir dir="test-output/sharepoint"/>
@@ -2754,6 +3010,42 @@
             
         </junit>
     </target>
+    
+    <target name="run-alfresco-tests-postgresql" depends="compile-alfresco-tests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-output/alfresco"/>
+        <junit fork="true" maxmemory="128m" dir="test-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+            <!-- MHL -->
+        </junit>
+    </target>
 
     <target name="run-cmis-tests-postgresql" depends="compile-cmis-tests,calculate-cmis-tests-condition" if="cmis-tests.include">
         <mkdir dir="test-output/cmis"/>
@@ -2790,6 +3082,42 @@
             <!-- MHL -->
         </junit>
     </target>
+    
+    <target name="run-alfresco-loadtests-postgresql" depends="compile-alfresco-loadtests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-output/alfresco"/>
+        <junit fork="true" maxmemory="256m" dir="test-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/cmis/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-loadtests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+            <!-- MHL -->
+        </junit>
+    </target>
 
     <target name="run-cmis-loadtests-postgresql" depends="compile-cmis-loadtests,calculate-cmis-tests-condition" if="cmis-tests.include">
         <mkdir dir="test-output/cmis"/>
@@ -2893,7 +3221,7 @@
             </classpath>
             <formatter type="brief" usefile="false"/>
 	    
-            <test name="org.apache.manifoldcf.filesystem_loadtests.BigCrawlHSQLDBTest" todir="test-postgresql-output/filesystem"/>
+            <test name="org.apache.manifoldcf.filesystem_loadtests.BigCrawlHSQLDBTest" todir="test-HSQLDB-output/filesystem"/>
 
             <!-- MHL -->
         </junit>
@@ -3032,6 +3360,42 @@
             <!-- MHL -->
         </junit>
     </target>
+    
+    <target name="run-alfresco-tests-HSQLDB" depends="compile-alfresco-tests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-output/alfresco"/>
+        <junit fork="true" maxmemory="128m" dir="test-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-tests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+        	 
+        </junit>
+    </target>
 
     <target name="run-cmis-tests-HSQLDB" depends="compile-cmis-tests,calculate-cmis-tests-condition" if="cmis-tests.include">
         <mkdir dir="test-output/cmis"/>
@@ -3068,6 +3432,46 @@
             <!-- MHL -->
         </junit>
     </target>
+    
+    <target name="run-alfresco-loadtests-HSQLDB" depends="compile-alfresco-loadtests,calculate-alfresco-tests-condition" if="alfresco-tests.include">
+        <mkdir dir="test-HSQLDB-output/alfresco"/>
+        <junit fork="true" maxmemory="1024m" dir="test-HSQLDB-output/alfresco" outputtoformatters="true" showoutput="true" haltonfailure="true">
+            <classpath>
+            	<fileset dir="lib">
+            	            <include name="h2*.jar"/>
+            	          </fileset>
+                <fileset dir="framework/lib">
+                    <include name="*.jar"/>
+                </fileset>
+	      <fileset dir="framework/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="framework/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+  	      <fileset dir="connectors/alfresco/lib">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/alfresco/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/jar">
+		<include name="*.jar"/>
+	      </fileset>
+	      <fileset dir="connectors/nulloutput/build/test-jar">
+		<include name="*.jar"/>
+	      </fileset>
+                <pathelement location="build/alfresco-loadtests/classes"/>
+            </classpath>
+            <formatter type="brief" usefile="false"/>
+	    
+        	<test name="org.apache.manifoldcf.alfresco_tests.APISanityIT" todir="test-HSQLDB-output/alfresco"/>
+       	
+        </junit>
+    </target>
 
     <target name="run-cmis-loadtests-HSQLDB" depends="compile-cmis-loadtests,calculate-cmis-tests-condition" if="cmis-tests.include">
         <mkdir dir="test-output/cmis"/>
@@ -3171,37 +3575,37 @@
         </junit>
     </target>
 
-    <target name="run-tests-open-connectors" depends="run-tests-activedirectory-connector,run-tests-cmis-connector,run-tests-filesystem-connector,run-tests-nullauthority-connector,run-tests-nulloutput-connector,run-tests-rss-connector,run-tests-solr-connector,run-tests-webcrawler-connector,run-tests-wiki-connector,run-tests-jdbc-connector"/>
+    <target name="run-tests-open-connectors" depends="run-tests-activedirectory-connector,run-tests-alfresco-connector,run-tests-cmis-connector,run-tests-filesystem-connector,run-tests-nullauthority-connector,run-tests-nulloutput-connector,run-tests-rss-connector,run-tests-solr-connector,run-tests-webcrawler-connector,run-tests-wiki-connector,run-tests-jdbc-connector"/>
     <target name="run-tests-lgpl-connectors" depends="run-tests-jcifs-connector"/>
     <target name="run-tests-proprietary-connectors" depends="run-tests-documentum-connector,run-tests-filenet-connector,run-tests-livelink-connector,run-tests-memex-connector,run-tests-meridio-connector,run-tests-sharepoint-connector"/>
 
-    <target name="run-tests-derby-open-connectors" depends="run-tests-derby-activedirectory-connector,run-tests-derby-cmis-connector,run-tests-derby-filesystem-connector,run-tests-derby-nullauthority-connector,run-tests-derby-nulloutput-connector,run-tests-derby-rss-connector,run-tests-derby-solr-connector,run-tests-derby-webcrawler-connector,run-tests-derby-wiki-connector,run-tests-derby-jdbc-connector"/>
+    <target name="run-tests-derby-open-connectors" depends="run-tests-derby-activedirectory-connector,run-tests-derby-alfresco-connector,run-tests-derby-cmis-connector,run-tests-derby-filesystem-connector,run-tests-derby-nullauthority-connector,run-tests-derby-nulloutput-connector,run-tests-derby-rss-connector,run-tests-derby-solr-connector,run-tests-derby-webcrawler-connector,run-tests-derby-wiki-connector,run-tests-derby-jdbc-connector"/>
     <target name="run-tests-derby-lgpl-connectors" depends="run-tests-derby-jcifs-connector"/>
     <target name="run-tests-derby-proprietary-connectors" depends="run-tests-derby-documentum-connector,run-tests-derby-filenet-connector,run-tests-derby-livelink-connector,run-tests-derby-memex-connector,run-tests-derby-meridio-connector,run-tests-derby-sharepoint-connector"/>
     
-    <target name="end-to-end-tests-derby" depends="run-filesystem-tests-derby,run-wiki-tests-derby,run-cmis-tests-derby,run-sharepoint-tests-derby"/>
+    <target name="end-to-end-tests-derby" depends="run-filesystem-tests-derby,run-wiki-tests-derby,run-alfresco-tests-derby,run-cmis-tests-derby,run-sharepoint-tests-derby"/>
 
-    <target name="run-tests-postgresql-open-connectors" depends="run-tests-postgresql-activedirectory-connector,run-tests-postgresql-cmis-connector,run-tests-postgresql-filesystem-connector,run-tests-postgresql-nullauthority-connector,run-tests-postgresql-nulloutput-connector,run-tests-postgresql-rss-connector,run-tests-postgresql-solr-connector,run-tests-postgresql-webcrawler-connector,run-tests-postgresql-wiki-connector,run-tests-postgresql-jdbc-connector,run-tests-postgresql-opensearchserver-connector"/>
+    <target name="run-tests-postgresql-open-connectors" depends="run-tests-postgresql-activedirectory-connector,run-tests-postgresql-alfresco-connector,run-tests-postgresql-cmis-connector,run-tests-postgresql-filesystem-connector,run-tests-postgresql-nullauthority-connector,run-tests-postgresql-nulloutput-connector,run-tests-postgresql-rss-connector,run-tests-postgresql-solr-connector,run-tests-postgresql-webcrawler-connector,run-tests-postgresql-wiki-connector,run-tests-postgresql-jdbc-connector,run-tests-postgresql-opensearchserver-connector"/>
     <target name="run-tests-postgresql-lgpl-connectors" depends="run-tests-postgresql-jcifs-connector"/>
     <target name="run-tests-postgresql-proprietary-connectors" depends="run-tests-postgresql-documentum-connector,run-tests-postgresql-filenet-connector,run-tests-postgresql-livelink-connector,run-tests-postgresql-memex-connector,run-tests-postgresql-meridio-connector,run-tests-postgresql-sharepoint-connector"/>
     
-    <target name="end-to-end-tests-postgresql" depends="run-filesystem-tests-postgresql,run-wiki-tests-postgresql,run-cmis-tests-postgresql,run-sharepoint-tests-postgresql"/>
+    <target name="end-to-end-tests-postgresql" depends="run-filesystem-tests-postgresql,run-wiki-tests-postgresql,run-alfresco-tests-postgresql,run-cmis-tests-postgresql,run-sharepoint-tests-postgresql"/>
 
-    <target name="run-tests-HSQLDB-open-connectors" depends="run-tests-HSQLDB-activedirectory-connector,run-tests-HSQLDB-cmis-connector,run-tests-HSQLDB-filesystem-connector,run-tests-HSQLDB-nullauthority-connector,run-tests-HSQLDB-nulloutput-connector,run-tests-HSQLDB-rss-connector,run-tests-HSQLDB-solr-connector,run-tests-HSQLDB-webcrawler-connector,run-tests-HSQLDB-wiki-connector,run-tests-HSQLDB-jdbc-connector,run-tests-HSQLDB-opensearchserver-connector"/>
+    <target name="run-tests-HSQLDB-open-connectors" depends="run-tests-HSQLDB-activedirectory-connector,run-tests-HSQLDB-alfresco-connector,run-tests-HSQLDB-cmis-connector,run-tests-HSQLDB-filesystem-connector,run-tests-HSQLDB-nullauthority-connector,run-tests-HSQLDB-nulloutput-connector,run-tests-HSQLDB-rss-connector,run-tests-HSQLDB-solr-connector,run-tests-HSQLDB-webcrawler-connector,run-tests-HSQLDB-wiki-connector,run-tests-HSQLDB-jdbc-connector,run-tests-HSQLDB-opensearchserver-connector"/>
     <target name="run-tests-HSQLDB-lgpl-connectors" depends="run-tests-HSQLDB-jcifs-connector"/>
     <target name="run-tests-HSQLDB-proprietary-connectors" depends="run-tests-HSQLDB-documentum-connector,run-tests-HSQLDB-filenet-connector,run-tests-HSQLDB-livelink-connector,run-tests-HSQLDB-memex-connector,run-tests-HSQLDB-meridio-connector,run-tests-HSQLDB-sharepoint-connector"/>
     
-    <target name="end-to-end-tests-HSQLDB" depends="run-filesystem-tests-HSQLDB,run-wiki-tests-HSQLDB,run-cmis-tests-HSQLDB,run-sharepoint-tests-HSQLDB"/>
+    <target name="end-to-end-tests-HSQLDB" depends="run-filesystem-tests-HSQLDB,run-wiki-tests-HSQLDB,run-alfresco-tests-HSQLDB,run-cmis-tests-HSQLDB,run-sharepoint-tests-HSQLDB"/>
 
-    <target name="end-to-end-loadtests-derby" depends="run-filesystem-loadtests-derby,run-rss-loadtests-derby,run-wiki-loadtests-derby,run-cmis-loadtests-derby,run-sharepoint-loadtests-derby"/>
+    <target name="end-to-end-loadtests-derby" depends="run-filesystem-loadtests-derby,run-rss-loadtests-derby,run-wiki-loadtests-derby,run-alfresco-loadtests-derby,run-cmis-loadtests-derby,run-sharepoint-loadtests-derby"/>
 
-    <target name="end-to-end-loadtests-postgresql" depends="run-filesystem-loadtests-postgresql,run-rss-loadtests-postgresql,run-wiki-loadtests-postgresql,run-cmis-loadtests-postgresql,run-sharepoint-loadtests-postgresql"/>
+    <target name="end-to-end-loadtests-postgresql" depends="run-filesystem-loadtests-postgresql,run-rss-loadtests-postgresql,run-wiki-loadtests-postgresql,run-alfresco-loadtests-postgresql,run-cmis-loadtests-postgresql,run-sharepoint-loadtests-postgresql"/>
 
-    <target name="end-to-end-loadtests-HSQLDB" depends="run-filesystem-loadtests-HSQLDB,run-rss-loadtests-HSQLDB,run-wiki-loadtests-HSQLDB,run-cmis-loadtests-HSQLDB,run-sharepoint-loadtests-HSQLDB"/>
+    <target name="end-to-end-loadtests-HSQLDB" depends="run-filesystem-loadtests-HSQLDB,run-rss-loadtests-HSQLDB,run-wiki-loadtests-HSQLDB,run-alfresco-loadtests-HSQLDB,run-cmis-loadtests-HSQLDB,run-sharepoint-loadtests-HSQLDB"/>
 
 
-    <target name="deliver-open-connectors" depends="deliver-nullauthority-connector,deliver-activedirectory-connector,deliver-cmis-connector,deliver-filesystem-connector,deliver-rss-connector,deliver-webcrawler-connector,deliver-wiki-connector,deliver-jdbc-connector"/>
-    <target name="deliver-open-connectors-doc" depends="deliver-nullauthority-connector-doc,deliver-activedirectory-connector-doc,deliver-cmis-connector-doc,deliver-filesystem-connector-doc,deliver-rss-connector-doc,deliver-webcrawler-connector-doc,deliver-wiki-connector-doc,deliver-jdbc-connector-doc"/>
+    <target name="deliver-open-connectors" depends="deliver-nullauthority-connector,deliver-activedirectory-connector,deliver-alfresco-connector,deliver-cmis-connector,deliver-filesystem-connector,deliver-rss-connector,deliver-webcrawler-connector,deliver-wiki-connector,deliver-jdbc-connector"/>
+    <target name="deliver-open-connectors-doc" depends="deliver-nullauthority-connector-doc,deliver-activedirectory-connector-doc,deliver-alfresco-connector-doc,deliver-cmis-connector-doc,deliver-filesystem-connector-doc,deliver-rss-connector-doc,deliver-webcrawler-connector-doc,deliver-wiki-connector-doc,deliver-jdbc-connector-doc"/>
     
     <target name="deliver-output-connectors" depends="deliver-gts-connector,deliver-solr-connector,deliver-nulloutput-connector,deliver-opensearchserver-connector"/>
     <target name="deliver-output-connectors-doc" depends="deliver-gts-connector-doc,deliver-solr-connector-doc,deliver-nulloutput-connector-doc,deliver-opensearchserver-connector-doc"/>

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml Fri Nov 18 21:42:08 2011
@@ -0,0 +1,86 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+ contributor license agreements.  See the NOTICE file distributed with
+ this work for additional information regarding copyright ownership.
+ The ASF licenses this file to You under the Apache License, Version 2.0
+ (the "License"); you may not use this file except in compliance with
+ the License.  You may obtain a copy of the License at
+
+     http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<project default="all">
+
+    <target name="clean">
+        <delete dir="build"/>
+        <delete dir="dist"/>
+    </target>
+    
+    <target name="doc">
+        <mkdir dir="dist/doc"/>
+        <javadoc destdir="dist/doc" source="1.5">
+            <classpath>
+                <fileset dir="lib" includes="*.jar"/>
+            </classpath>
+            <fileset dir="connector/src/main/java" includes="**/*.java"/>
+        </javadoc>
+    </target>
+
+    <target name="compile-connector">
+        <mkdir dir="build/connector/classes"/>
+        <javac srcdir="connector/src/main/java" destdir="build/connector/classes" target="1.5" source="1.5" debug="true" debuglevel="lines,vars,source">
+            <classpath>
+                <fileset dir="lib" includes="*.jar"/>
+            </classpath>
+        </javac>
+    </target>
+
+    <target name="jar-connector" depends="compile-connector">
+        <mkdir dir="build/jar"/>
+        <jar destfile="build/jar/mcf-alfresco-connector.jar">
+        	<fileset dir="build/connector/classes"/>
+          <fileset dir="connector/src/main/resource" />
+        </jar>
+    </target>
+
+    <target name="lib" depends="jar-connector">
+        <mkdir dir="dist/lib"/>
+        <copy todir="dist/lib">
+            <fileset dir="build/jar">
+                <include name="mcf-alfresco-connector.jar"/>
+            </fileset>
+            <fileset dir="lib">
+                <include name="alfresco-web-service-client*.jar"/>
+                <include name="axis*.jar"/>	
+                <include name="commons-discovery*.jar"/>
+                <include name="commons-logging*.jar"/>
+            	  <include name="commong-lang*.jar"/>
+                <include name="jaxrpc*.jar"/>
+                <include name="mail*.jar"/>
+                <include name="opensaml*.jar"/>
+                <include name="wsdl4j*.jar"/>
+                <include name="wss4j*.jar"/>
+                <include name="xalan*.jar"/>
+            	  <include name="xercesImpl*.jar"/>
+                <include name="xmlsec*.jar"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="build" depends="lib"/>
+    <target name="build-tests">
+      <mkdir dir="build/test-jar"/>
+    </target>
+    <target name="run-tests"/>
+    <target name="run-tests-derby"/>
+    <target name="run-tests-postgresql"/>
+    <target name="run-tests-HSQLDB"/>
+    <target name="all" depends="build,doc,build-tests,run-tests,run-tests-derby,run-tests-postgresql,run-tests-HSQLDB"/>
+    
+</project>

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/build.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF Fri Nov 18 21:42:08 2011
@@ -0,0 +1,3 @@
+Manifest-Version: 1.0
+Class-Path: 
+

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java Fri Nov 18 21:42:08 2011
@@ -0,0 +1,710 @@
+package org.apache.manifoldcf.crawler.connectors.alfresco;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.InterruptedIOException;
+import java.io.UnsupportedEncodingException;
+import java.util.Iterator;
+import java.util.List;
+
+import org.alfresco.webservice.authentication.AuthenticationFault;
+import org.alfresco.webservice.content.Content;
+import org.alfresco.webservice.repository.QueryResult;
+import org.alfresco.webservice.types.NamedValue;
+import org.alfresco.webservice.types.Node;
+import org.alfresco.webservice.types.Predicate;
+import org.alfresco.webservice.types.Reference;
+import org.alfresco.webservice.types.ResultSet;
+import org.alfresco.webservice.types.ResultSetRow;
+import org.alfresco.webservice.util.AuthenticationDetails;
+import org.alfresco.webservice.util.AuthenticationUtils;
+import org.alfresco.webservice.util.WebServiceFactory;
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
+import org.apache.manifoldcf.agents.interfaces.ServiceInterruption;
+import org.apache.manifoldcf.core.interfaces.ConfigParams;
+import org.apache.manifoldcf.core.interfaces.IHTTPOutput;
+import org.apache.manifoldcf.core.interfaces.IPostParameters;
+import org.apache.manifoldcf.core.interfaces.IThreadContext;
+import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.core.interfaces.SpecificationNode;
+import org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector;
+import org.apache.manifoldcf.crawler.interfaces.DocumentSpecification;
+import org.apache.manifoldcf.crawler.interfaces.IProcessActivity;
+import org.apache.manifoldcf.crawler.interfaces.ISeedingActivity;
+import org.apache.manifoldcf.crawler.system.Logging;
+import org.apache.manifoldcf.ui.util.Encoder;
+
+public class AlfrescoRepositoryConnector extends BaseRepositoryConnector {
+
+  public final static String ACTIVITY_FETCH = "fetch";
+
+  public static final String CONFIG_PARAM_USERNAME = "username";
+  public static final String CONFIG_PARAM_PASSWORD = "password";
+  public static final String CONFIG_PARAM_ENDPOINT = "endpoint";
+
+  protected String username = null;
+  protected String password = null;
+  protected String endpoint = null;
+  protected AuthenticationDetails session = null;
+
+  protected static final long timeToRelease = 300000L;
+  protected long lastSessionFetch = -1L;
+
+  protected static final String RELATIONSHIP_CHILD = "child";
+
+  private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
+  private static final String EDIT_CONFIG_FORWARD = "editConfiguration.html";
+  private static final String EDIT_CONFIG_HEADER_FORWARD = "editConfiguration.js";
+
+  private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
+  private static final String EDIT_SPEC_FORWARD = "editSpecification.html";
+  private static final String EDIT_SPEC_HEADER_FORWARD = "editSpecification.js";
+
+  private static final String JOB_STARTPOINT_NODE_TYPE = "startpoint";
+  private static final String CONFIG_PARAM_LUCENE_QUERY = "luceneQuery";
+
+  private static final String TAB_LABEL_LUCENE_QUERY = "Lucene Query";
+
+ 
+
+  protected final static String ACTIVITY_READ = "read document";
+
+  public AlfrescoRepositoryConnector() {
+    super();
+  }
+
+  @Override
+  public String[] getActivitiesList() {
+    return new String[] { ACTIVITY_FETCH };
+  }
+
+  @Override
+  public String[] getBinNames(String documentIdentifier) {
+    return new String[] { endpoint };
+  }
+
+  @Override
+  public void disconnect() throws ManifoldCFException {
+    if (session != null) {
+      AuthenticationUtils.endSession();
+      session = null;
+      lastSessionFetch = -1L;
+    }
+
+    username = null;
+    password = null;
+    endpoint = null;
+
+  }
+
+  @Override
+  public void connect(ConfigParams configParams) {
+    super.connect(configParams);
+    username = params.getParameter(CONFIG_PARAM_USERNAME);
+    password = params.getParameter(CONFIG_PARAM_PASSWORD);
+    endpoint = params.getParameter(CONFIG_PARAM_ENDPOINT);
+  }
+
+  @Override
+  public String check() throws ManifoldCFException {
+    try {
+      checkConnection();
+      return super.check();
+    } catch (ServiceInterruption e) {
+      return "Connection temporarily failed: " + e.getMessage();
+    } catch (ManifoldCFException e) {
+      return "Connection failed: " + e.getMessage();
+    }
+  }
+
+  protected void getSession() throws ManifoldCFException, ServiceInterruption {
+    if (session == null) {
+      // Check for parameter validity
+
+      if (StringUtils.isEmpty(username))
+        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_USERNAME
+            + " required but not set");
+
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("Alfresco: Username = '" + username + "'");
+
+      if (StringUtils.isEmpty(password))
+        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_PASSWORD
+            + " required but not set");
+
+      Logging.connectors.debug("Alfresco: Password exists");
+
+      if (StringUtils.isEmpty(endpoint))
+        throw new ManifoldCFException("Parameter " + CONFIG_PARAM_ENDPOINT
+            + " required but not set");
+
+    WebServiceFactory.setEndpointAddress(endpoint);
+    try {
+      AuthenticationUtils.startSession(username, password);
+      session = AuthenticationUtils.getAuthenticationDetails();
+    } catch (AuthenticationFault e) {
+      Logging.connectors.warn(
+          "Alfresco: Error during authentication. Username: "+username + ", endpoint: "+endpoint
+              + e.getMessage(), e);
+      throw new ManifoldCFException("Alfresco: Error during authentication. Username: "+username + ", endpoint: "+endpoint
+          + e.getMessage(), e);
+    }
+    
+    lastSessionFetch = System.currentTimeMillis();
+    }
+  }
+
+  /**
+   * Release the session, if it's time.
+   */
+  protected void releaseCheck() throws ManifoldCFException {
+    if (lastSessionFetch == -1L)
+      return;
+
+    long currentTime = System.currentTimeMillis();
+    if (currentTime >= lastSessionFetch + timeToRelease) {
+        AuthenticationUtils.endSession();
+        session = null;
+        lastSessionFetch = -1L;
+    }
+  }
+
+  protected void checkConnection() throws ManifoldCFException,
+      ServiceInterruption {
+    while (true) {
+      getSession();
+      String ticket = AuthenticationUtils.getTicket();
+      if(StringUtils.isEmpty(ticket)){
+        Logging.connectors.error(
+            "Alfresco: Error during checking the connection.");
+        throw new ManifoldCFException( "Alfresco: Error during checking the connection.");
+      }
+      AuthenticationUtils.endSession();
+      session=null;
+      return;
+    }
+  }
+
+  @Override
+  public void poll() throws ManifoldCFException {
+    if (lastSessionFetch == -1L)
+      return;
+
+    long currentTime = System.currentTimeMillis();
+    if (currentTime >= lastSessionFetch + timeToRelease) {
+        try {
+          AuthenticationUtils.endSession();
+          session = null;
+          lastSessionFetch = -1L;
+        } catch (Exception e) {
+          Logging.connectors.error(
+              "Alfresco: Error during polling: "
+                  + e.getMessage(), e);
+          throw new ManifoldCFException("Alfresco: Error during polling: "
+              + e.getMessage(),e);
+        }
+    }
+  }
+
+  @Override
+  public void addSeedDocuments(ISeedingActivity activities,
+      DocumentSpecification spec, long startTime, long endTime)
+      throws ManifoldCFException, ServiceInterruption {
+
+    String luceneQuery = StringUtils.EMPTY;
+    int i = 0;
+    while (i < spec.getChildCount()) {
+      SpecificationNode sn = spec.getChild(i);
+      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+        luceneQuery = sn.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY);
+        break;
+      }
+      i++;
+    }
+
+    QueryResult queryResult = null;
+    if (StringUtils.isEmpty(luceneQuery)) {
+      // get documents from the root of the Alfresco Repository
+      queryResult = SearchUtils.getChildrenFromCompanyHome(username, password, session);
+    } else {
+      // execute a Lucene query against the repository
+      queryResult = SearchUtils.luceneSearch(username, password, session, luceneQuery);
+    }
+
+    if(queryResult!=null){
+      ResultSet resultSet = queryResult.getResultSet();
+      ResultSetRow[] resultSetRows = resultSet.getRows();
+      for (ResultSetRow resultSetRow : resultSetRows) {
+        activities.addSeedDocument(resultSetRow.getNode().getId());
+      }
+    }
+
+  }
+
+  @Override
+  public int getMaxDocumentRequest() {
+    return 1;
+  }
+
+  /**
+   * Return the list of relationship types that this connector recognizes.
+   * 
+   * @return the list.
+   */
+  @Override
+  public String[] getRelationshipTypes() {
+    return new String[] { RELATIONSHIP_CHILD };
+  }
+
+  /**
+   * Read the content of a resource, replace the variable ${PARAMNAME} with the
+   * value and copy it to the out.
+   * 
+   * @param resName
+   * @param out
+   * @throws ManifoldCFException
+   */
+  private void outputResource(String resName, IHTTPOutput out,
+      ConfigParams params) throws ManifoldCFException {
+    InputStream is = getClass().getResourceAsStream(resName);
+    BufferedReader br = null;
+    try {
+      br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+      String line;
+      while ((line = br.readLine()) != null) {
+        if (params != null) {
+          @SuppressWarnings("unchecked")
+          Iterator<String> i = params.listParameters();
+          boolean parsedLine = false;
+          while (i.hasNext()) {
+            String key = (String) i.next();
+            String value = Encoder.attributeEscape(params.getParameter(key));
+            String replacer = "${" + key.toUpperCase() + "}";
+            if (StringUtils.contains(line, replacer)) {
+              if (StringUtils.isEmpty(value)) {
+                out.println(StringUtils.replace(line, replacer,
+                    StringUtils.EMPTY));
+                parsedLine = true;
+              } else {
+                out.println(StringUtils.replace(line, replacer, value));
+                parsedLine = true;
+              }
+            } else if (StringUtils.contains(line, "${")) {
+              parsedLine = true;
+            } else if (!parsedLine) {
+              out.println(line);
+              parsedLine = true;
+            }
+          }
+        } else {
+          break;
+        }
+      }
+    } catch (UnsupportedEncodingException e) {
+      throw new ManifoldCFException(e);
+    } catch (IOException e) {
+      throw new ManifoldCFException(e);
+    } finally {
+      if (br != null)
+        IOUtils.closeQuietly(br);
+      if (is != null)
+        IOUtils.closeQuietly(is);
+    }
+  }
+
+  /**
+   * View configuration. This method is called in the body section of the
+   * connector's view configuration page. Its purpose is to present the
+   * connection information to the user. The coder can presume that the HTML
+   * that is output from this configuration will be within appropriate <html>
+   * and <body> tags.
+   * 
+   * @param threadContext
+   *          is the local thread context.
+   * @param out
+   *          is the output to which any HTML should be sent.
+   * @param parameters
+   *          are the configuration parameters, as they currently exist, for
+   *          this connection being configured.
+   */
+  @Override
+  public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
+      ConfigParams parameters) throws ManifoldCFException, IOException {
+    outputResource(VIEW_CONFIG_FORWARD, out, parameters);
+  }
+
+  /**
+   * Output the configuration header section. This method is called in the head
+   * section of the connector's configuration page. Its purpose is to add the
+   * required tabs to the list, and to output any javascript methods that might
+   * be needed by the configuration editing HTML.
+   * 
+   * @param threadContext
+   *          is the local thread context.
+   * @param out
+   *          is the output to which any HTML should be sent.
+   * @param parameters
+   *          are the configuration parameters, as they currently exist, for
+   *          this connection being configured.
+   * @param tabsArray
+   *          is an array of tab names. Add to this array any tab names that are
+   *          specific to the connector.
+   */
+  @Override
+  public void outputConfigurationHeader(IThreadContext threadContext,
+      IHTTPOutput out, ConfigParams parameters, List<String> tabsArray)
+      throws ManifoldCFException, IOException {
+    outputResource(EDIT_CONFIG_HEADER_FORWARD, out, parameters);
+  }
+
+  @Override
+  public void outputConfigurationBody(IThreadContext threadContext,
+      IHTTPOutput out, ConfigParams parameters, String tabName)
+      throws ManifoldCFException, IOException {
+
+    String username = parameters.getParameter(CONFIG_PARAM_USERNAME);
+    String password = parameters.getParameter(CONFIG_PARAM_PASSWORD);
+    String endpoint = parameters.getParameter(CONFIG_PARAM_ENDPOINT);
+
+    if (StringUtils.isEmpty(username))
+      username = StringUtils.EMPTY;
+    if (StringUtils.isEmpty(password))
+      password = StringUtils.EMPTY;
+    if (StringUtils.isEmpty(endpoint))
+      endpoint = StringUtils.EMPTY;
+
+    parameters.setParameter(CONFIG_PARAM_USERNAME, username);
+    parameters.setParameter(CONFIG_PARAM_PASSWORD, password);
+    parameters.setParameter(CONFIG_PARAM_ENDPOINT, endpoint);
+
+    outputResource(EDIT_CONFIG_FORWARD, out, parameters);
+  }
+
+  /**
+   * Process a configuration post. This method is called at the start of the
+   * connector's configuration page, whenever there is a possibility that form
+   * data for a connection has been posted. Its purpose is to gather form
+   * information and modify the configuration parameters accordingly. The name
+   * of the posted form is "editconnection".
+   * 
+   * @param threadContext
+   *          is the local thread context.
+   * @param variableContext
+   *          is the set of variables available from the post, including binary
+   *          file post information.
+   * @param parameters
+   *          are the configuration parameters, as they currently exist, for
+   *          this connection being configured.
+   * @return null if all is well, or a string error message if there is an error
+   *         that should prevent saving of the connection (and cause a
+   *         redirection to an error page).
+   */
+  @Override
+  public String processConfigurationPost(IThreadContext threadContext,
+      IPostParameters variableContext, ConfigParams parameters)
+      throws ManifoldCFException {
+
+    String username = variableContext.getParameter(CONFIG_PARAM_USERNAME);
+    if (StringUtils.isNotEmpty(username))
+      parameters.setParameter(CONFIG_PARAM_USERNAME, username);
+
+    String password = variableContext.getParameter(CONFIG_PARAM_PASSWORD);
+    if (StringUtils.isNotEmpty(password))
+      parameters.setParameter(CONFIG_PARAM_PASSWORD, password);
+
+    String endpoint = variableContext.getParameter(CONFIG_PARAM_ENDPOINT);
+    if (StringUtils.isNotEmpty(endpoint) && endpoint.length() > 0)
+      parameters.setParameter(CONFIG_PARAM_ENDPOINT, endpoint);
+
+    return null;
+  }
+
+  /**
+   * View specification. This method is called in the body section of a job's
+   * view page. Its purpose is to present the document specification information
+   * to the user. The coder can presume that the HTML that is output from this
+   * configuration will be within appropriate <html> and <body> tags.
+   * 
+   * @param out
+   *          is the output to which any HTML should be sent.
+   * @param ds
+   *          is the current document specification for this job.
+   */
+  @Override
+  public void viewSpecification(IHTTPOutput out, DocumentSpecification ds)
+      throws ManifoldCFException, IOException {
+    int i = 0;
+    boolean seenAny = false;
+    ConfigParams specificationParams = new ConfigParams();
+    while (i < ds.getChildCount()) {
+      SpecificationNode sn = ds.getChild(i);
+      if (sn.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+        if (seenAny == false) {
+          seenAny = true;
+        }
+        specificationParams.setParameter(
+            CONFIG_PARAM_LUCENE_QUERY.toUpperCase(),
+            sn.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY));
+      }
+      i++;
+    }
+    outputResource(VIEW_SPEC_FORWARD, out, specificationParams);
+  }
+
+  /**
+   * Process a specification post. This method is called at the start of job's
+   * edit or view page, whenever there is a possibility that form data for a
+   * connection has been posted. Its purpose is to gather form information and
+   * modify the document specification accordingly. The name of the posted form
+   * is "editjob".
+   * 
+   * @param variableContext
+   *          contains the post data, including binary file-upload information.
+   * @param ds
+   *          is the current document specification for this job.
+   * @return null if all is well, or a string error message if there is an error
+   *         that should prevent saving of the job (and cause a redirection to
+   *         an error page).
+   */
+  @Override
+  public String processSpecificationPost(IPostParameters variableContext,
+      DocumentSpecification ds) throws ManifoldCFException {
+    String luceneQuery = variableContext
+        .getParameter(CONFIG_PARAM_LUCENE_QUERY);
+    if (StringUtils.isNotEmpty(luceneQuery)) {
+      int i = 0;
+      while (i < ds.getChildCount()) {
+        SpecificationNode oldNode = ds.getChild(i);
+        if (oldNode.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+          ds.removeChild(i);
+          break;
+        }
+        i++;
+      }
+      SpecificationNode node = new SpecificationNode(JOB_STARTPOINT_NODE_TYPE);
+      node.setAttribute(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
+      variableContext.setParameter(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
+      ds.addChild(ds.getChildCount(), node);
+    } else {
+      int i = 0;
+      while (i < ds.getChildCount()) {
+        SpecificationNode oldNode = ds.getChild(i);
+        if (oldNode.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+          variableContext.setParameter(CONFIG_PARAM_LUCENE_QUERY,
+              oldNode.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY));
+        }
+        i++;
+      }
+    }
+
+    return null;
+  }
+
+  /**
+   * Output the specification body section. This method is called in the body
+   * section of a job page which has selected a repository connection of the
+   * current type. Its purpose is to present the required form elements for
+   * editing. The coder can presume that the HTML that is output from this
+   * configuration will be within appropriate <html>, <body>, and <form> tags.
+   * The name of the form is "editjob".
+   * 
+   * @param out
+   *          is the output to which any HTML should be sent.
+   * @param ds
+   *          is the current document specification for this job.
+   * @param tabName
+   *          is the current tab name.
+   */
+  @Override
+  public void outputSpecificationBody(IHTTPOutput out,
+      DocumentSpecification ds, String tabName) throws ManifoldCFException,
+      IOException {
+    if (tabName.equals(TAB_LABEL_LUCENE_QUERY)) {
+      String luceneQuery = StringUtils.EMPTY;
+      int i = 0;
+      while (i < ds.getChildCount()) {
+        SpecificationNode n = ds.getChild(i);
+        if (n.getType().equals(JOB_STARTPOINT_NODE_TYPE)) {
+          luceneQuery = n.getAttributeValue(CONFIG_PARAM_LUCENE_QUERY);
+          break;
+        }
+        i++;
+      }
+
+      ConfigParams params = new ConfigParams();
+      params.setParameter(CONFIG_PARAM_LUCENE_QUERY, luceneQuery);
+      outputResource(EDIT_SPEC_FORWARD, out, params);
+    }
+  }
+
+  /**
+   * Output the specification header section. This method is called in the head
+   * section of a job page which has selected a repository connection of the
+   * current type. Its purpose is to add the required tabs to the list, and to
+   * output any javascript methods that might be needed by the job editing HTML.
+   * 
+   * @param out
+   *          is the output to which any HTML should be sent.
+   * @param ds
+   *          is the current document specification for this job.
+   * @param tabsArray
+   *          is an array of tab names. Add to this array any tab names that are
+   *          specific to the connector.
+   */
+  @Override
+  public void outputSpecificationHeader(IHTTPOutput out,
+      DocumentSpecification ds, List<String> tabsArray)
+      throws ManifoldCFException, IOException {
+    tabsArray.add(TAB_LABEL_LUCENE_QUERY);
+    outputResource(EDIT_SPEC_HEADER_FORWARD, out, params);
+  }
+
+  @Override
+  public void processDocuments(String[] documentIdentifiers, String[] versions,
+      IProcessActivity activities, DocumentSpecification spec,
+      boolean[] scanOnly) throws ManifoldCFException, ServiceInterruption {
+
+    Logging.connectors.debug("Alfresco: Inside processDocuments");
+    int i = 0;
+
+    while (i < documentIdentifiers.length) {
+      long startTime = System.currentTimeMillis();
+      String nodeId = documentIdentifiers[i];
+
+      if (Logging.connectors.isDebugEnabled())
+        Logging.connectors.debug("Alfresco: Processing document identifier '"
+            + nodeId + "'");
+
+      Reference reference = new Reference();
+      reference.setStore(SearchUtils.STORE);
+      reference.setUuid(nodeId);
+
+      Predicate predicate = new Predicate();
+      predicate.setStore(SearchUtils.STORE);
+      predicate.setNodes(new Reference[] { reference });
+
+      // getting properties
+      Node resultNode = NodeUtils.get(username, password, session,predicate);
+      
+      String errorCode = "OK";
+      String errorDesc = StringUtils.EMPTY;
+
+      NamedValue[] properties = resultNode.getProperties();
+      boolean isDocument = ContentModelUtils.isDocument(properties);
+      
+      boolean isFolder = ContentModelUtils.isFolder(username, password, session, reference);
+      
+      //a generic node in Alfresco could have child-associations
+      if (isFolder) {
+        // ingest all the children of the folder
+        QueryResult queryResult = SearchUtils.getChildren(username, password, session, reference);
+        ResultSet resultSet = queryResult.getResultSet();
+        ResultSetRow[] resultSetRows = resultSet.getRows();
+        for (ResultSetRow resultSetRow : resultSetRows) {
+          String childNodeId = resultSetRow.getNode().getId();
+          activities.addDocumentReference(childNodeId, nodeId,
+              RELATIONSHIP_CHILD);
+        }
+      } 
+      
+      //a generic node in Alfresco could also have binaries content
+      if (isDocument) {
+        // this is a content to ingest
+        InputStream is = null;
+        long fileLength = 0;
+        try {
+          //properties ingestion
+          RepositoryDocument rd = new RepositoryDocument();
+          PropertiesUtils.ingestProperties(rd, properties);
+
+          // binaries ingestion - in Alfresco we could have more than one binary for each node (custom content models)
+          List<NamedValue> contentProperties = PropertiesUtils.getContentProperties(properties);
+          for (NamedValue contentProperty : contentProperties) {
+            //we are ingesting all the binaries defined as d:content property in the Alfresco content model
+            Content binary = ContentReader.read(username, password, session, predicate, contentProperty.getName());
+            fileLength = binary.getLength();
+            is = ContentReader.getBinary(binary, username, password, session);
+            rd.setBinary(is, fileLength);
+          }
+
+        } finally {
+          try {
+            if(is!=null){
+              is.close();
+            }
+          } catch (InterruptedIOException e) {
+            errorCode = "Interrupted error";
+            errorDesc = e.getMessage();
+            throw new ManifoldCFException(e.getMessage(), e,
+                ManifoldCFException.INTERRUPTED);
+          } catch (IOException e) {
+            errorCode = "IO ERROR";
+            errorDesc = e.getMessage();
+            Logging.connectors.warn(
+                "Alfresco: IOException closing file input stream: "
+                    + e.getMessage(), e);
+          }
+          
+          AuthenticationUtils.endSession();
+          session = null;
+          
+          activities.recordActivity(new Long(startTime), ACTIVITY_READ,
+              fileLength, nodeId, errorCode, errorDesc, null);
+        }
+        
+      }
+      i++;
+    }
+  }
+  
+  /** The short version of getDocumentVersions.
+   * Get document versions given an array of document identifiers.
+   * This method is called for EVERY document that is considered. It is
+   * therefore important to perform as little work as possible here.
+   *@param documentIdentifiers is the array of local document identifiers, as understood by this connector.
+   *@param spec is the current document specification for the current job.  If there is a dependency on this
+   * specification, then the version string should include the pertinent data, so that reingestion will occur
+   * when the specification changes.  This is primarily useful for metadata.
+   *@return the corresponding version strings, with null in the places where the document no longer exists.
+   * Empty version strings indicate that there is no versioning ability for the corresponding document, and the document
+   * will always be processed.
+   */
+  @Override
+  public String[] getDocumentVersions(String[] documentIdentifiers,
+      DocumentSpecification spec) throws ManifoldCFException,
+      ServiceInterruption {
+    String[] rval = new String[documentIdentifiers.length];
+    int i = 0;
+    while (i < rval.length){
+      Reference reference = new Reference();
+      reference.setStore(SearchUtils.STORE);
+      reference.setUuid(documentIdentifiers[i]);
+      
+      Predicate predicate = new Predicate();
+      predicate.setStore(SearchUtils.STORE);
+      predicate.setNodes(new Reference[]{reference});
+      
+      Node node = NodeUtils.get(username, password, session, predicate);
+      boolean isDocument = ContentModelUtils.isDocument(node.getProperties());
+      if(isDocument){
+        boolean isVersioned = NodeUtils.isVersioned(node.getAspects());
+        if(isVersioned){
+          rval[i] = NodeUtils.getVersionLabel(node.getProperties());
+        } else {
+          //a document that doesn't contain versioning information will always be processed
+          rval[i] = StringUtils.EMPTY;
+        }
+      } else {
+        //a space will always be processed
+        rval[i] = StringUtils.EMPTY;
+      }
+      i++;
+    }
+    return rval;
+  }
+
+}

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/AlfrescoRepositoryConnector.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java Fri Nov 18 21:42:08 2011
@@ -0,0 +1,7 @@
+package org.apache.manifoldcf.crawler.connectors.alfresco;
+
+public class Constants extends org.alfresco.webservice.util.Constants {
+  
+  public static final String PROP_VERSION_LABEL = createQNameString(NAMESPACE_CONTENT_MODEL, "versionLabel");
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/Constants.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java Fri Nov 18 21:42:08 2011
@@ -0,0 +1,72 @@
+package org.apache.manifoldcf.crawler.connectors.alfresco;
+
+import java.rmi.RemoteException;
+
+import org.alfresco.webservice.repository.QueryResult;
+import org.alfresco.webservice.repository.RepositoryFault;
+import org.alfresco.webservice.types.NamedValue;
+import org.alfresco.webservice.types.Reference;
+import org.alfresco.webservice.types.ResultSet;
+import org.alfresco.webservice.types.ResultSetRow;
+import org.alfresco.webservice.util.AuthenticationDetails;
+import org.alfresco.webservice.util.AuthenticationUtils;
+import org.alfresco.webservice.util.WebServiceFactory;
+import org.apache.manifoldcf.crawler.system.Logging;
+
+public class ContentModelUtils {
+
+  /**
+   * this method checks if a node is a document: verify if exists a property named cm:content.
+   * It could be improved to support any property that has a datatype d:content.
+   * @param properties
+   * @return TRUE if the node is a document, otherwise FALSE
+   */
+  public static boolean isDocument(NamedValue[] properties) {
+    for (NamedValue property : properties) {
+      if(property.getName().equals(Constants.PROP_CONTENT)){
+        return true;
+      }
+    }
+    return false;
+  }
+  
+  /**
+   * Check if the current node has associated children
+   * @param session
+   * @param node
+   * @return TRUE if the reference contains a node that is an Alfresco space, otherwise FALSE
+   */
+  public static boolean isFolder(String username, String password, AuthenticationDetails session, Reference node){
+    QueryResult queryResult = null;
+    try {
+      AuthenticationUtils.startSession(username, password);
+      session = AuthenticationUtils.getAuthenticationDetails();
+      queryResult = WebServiceFactory.getRepositoryService().queryChildren(node);
+    } catch (RepositoryFault e) {
+      Logging.connectors.warn(
+          "Alfresco: Repository Error during the queryChildren: "
+              + e.getMessage(), e);
+    } catch (RemoteException e) {
+      Logging.connectors.warn(
+          "Alfresco: Remote Error during the queryChildren: "
+              + e.getMessage(), e);
+    } finally {
+      AuthenticationUtils.endSession();
+      session = null;
+    }
+    
+    if(queryResult!=null){
+      ResultSet rs = queryResult.getResultSet();
+      if(rs!=null){
+        ResultSetRow[] rows = rs.getRows();
+        if(rows!=null){
+          if(rows.length>0){
+            return true;
+          }
+        }
+      }
+    }
+    return false;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentModelUtils.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java
URL: http://svn.apache.org/viewvc/incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java?rev=1203860&view=auto
==============================================================================
--- incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java (added)
+++ incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java Fri Nov 18 21:42:08 2011
@@ -0,0 +1,65 @@
+package org.apache.manifoldcf.crawler.connectors.alfresco;
+
+import java.io.InputStream;
+import java.rmi.RemoteException;
+
+import org.alfresco.webservice.authentication.AuthenticationFault;
+import org.alfresco.webservice.content.Content;
+import org.alfresco.webservice.content.ContentFault;
+import org.alfresco.webservice.content.ContentServiceSoapBindingStub;
+import org.alfresco.webservice.types.Predicate;
+import org.alfresco.webservice.util.AuthenticationDetails;
+import org.alfresco.webservice.util.AuthenticationUtils;
+import org.alfresco.webservice.util.ContentUtils;
+import org.alfresco.webservice.util.WebServiceFactory;
+import org.apache.manifoldcf.crawler.system.Logging;
+
+public class ContentReader {
+
+  /**
+   * Read the binary for the current content
+   * @param predicate
+   * @return an unique binary for content
+   */
+  public static Content read(String username, String password, AuthenticationDetails session, Predicate predicate, String contentProperty) {
+    Content[] resultBinary = null;
+    try {
+      AuthenticationUtils.startSession(username, password);
+      session = AuthenticationUtils.getAuthenticationDetails();
+      ContentServiceSoapBindingStub contentService = WebServiceFactory.getContentService();
+      resultBinary = contentService.read(predicate, contentProperty);
+    } catch (ContentFault e) {
+        Logging.connectors
+        .error(
+            "Alfresco: Content fault exception error during getting the content binary in processDocuments. " +
+            "Node: "+predicate.getNodes()[0].getPath() + ". "
+                + e.getMessage(), e);
+    } catch (RemoteException e) {
+        Logging.connectors
+        .error(
+            "Alfresco: Remote exception error during getting the content binary in processDocuments. " +
+            "Node: "+predicate.getNodes()[0].getPath() + ". "
+                + e.getMessage(), e);
+    } finally{
+      AuthenticationUtils.endSession();
+      session = null;
+    }
+    return resultBinary[0];
+  }
+  
+  public static InputStream getBinary(Content binary, String username, String password, AuthenticationDetails session){
+    InputStream is = null;
+    try {
+      AuthenticationUtils.startSession(username, password);
+      session = AuthenticationUtils.getAuthenticationDetails();
+      is = ContentUtils.getContentAsInputStream(binary);
+    } catch (AuthenticationFault e) {
+      Logging.connectors
+      .error(
+          "Alfresco: Error during getting the binary for the node: "+binary.getNode().getPath()+"."
+              + e.getMessage(), e);
+    }
+    return is;
+  }
+  
+}

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: incubator/lcf/branches/CONNECTORS-287/connectors/alfresco/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/alfresco/ContentReader.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain



Mime
View raw message