manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rh...@apache.org
Subject svn commit: r1791418 [3/3] - in /manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo: ./ connector/src/main/java/org/apache/manifoldcf/authorities/authorities/nuxeo/ connector/src/main/java/org/apache/manifoldcf/crawler/connectors/nuxeo/ connector/s...
Date Fri, 14 Apr 2017 21:20:25 GMT
Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/nuxeo/viewConfiguration_conf.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/nuxeo/viewConfiguration_conf.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/nuxeo/viewConfiguration_conf.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/nuxeo/viewConfiguration_conf.html Fri Apr 14 21:20:25 2017
@@ -1,48 +1,32 @@
-<!--
- 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.
--->
 
 <table class="displayTable">
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Protocol'))</nobr>
-    </td>
-    <td><nobr>$Encoder.bodyEscape($NUXEO_PROTOCOL)</nobr></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Host'))</nobr>
-    </td>
-    <td><nobr>$Encoder.bodyEscape($NUXEO_HOST)</nobr></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Port'))</nobr>
-    </td>
-    <td><nobr>$Encoder.bodyEscape($NUXEO_PORT)</nobr></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Path'))</nobr>
-    </td>
-    <td><nobr>$Encoder.bodyEscape($NUXEO_PATH)</nobr></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Username'))</nobr>
-    </td>
-    <td><nobr>$Encoder.bodyEscape($NUXEO_USERNAME)</nobr></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Password'))</nobr>
-    </td>
-    <td><nobr>*****</nobr></td>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Protocol'))</nobr>
+		</td>
+		<td><nobr>$Encoder.bodyEscape($NUXEO_PROTOCOL)</nobr></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Host'))</nobr>
+		</td>
+		<td><nobr>$Encoder.bodyEscape($NUXEO_HOST)</nobr></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Port'))</nobr>
+		</td>
+		<td><nobr>$Encoder.bodyEscape($NUXEO_PORT)</nobr></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Path'))</nobr>
+		</td>
+		<td><nobr>$Encoder.bodyEscape($NUXEO_PATH)</nobr></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Username'))</nobr>
+		</td>
+		<td><nobr>$Encoder.bodyEscape($NUXEO_USERNAME)</nobr></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoAuthorityConnector.Password'))</nobr>
+		</td>
+		<td><nobr>*****</nobr></td>
 </table>
\ No newline at end of file

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf.js?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf.js (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf.js Fri Apr 14 21:20:25 2017
@@ -1,19 +1,3 @@
-<!--
- 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.
--->
 
 <script type="text/javascript">
 <!--

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf_server.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf_server.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf_server.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editConfiguration_conf_server.html Fri Apr 14 21:20:25 2017
@@ -1,97 +1,81 @@
-<!--
- 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.
--->
  #if($TABNAME ==
 $ResourceBundle.getString('NuxeoRepositoryConnector.Server'))
 
 <table class="displaytable">
-  <tr>
-    <td class="separator" colspan="2"><hr /></td>
-  </tr>
-
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Protocol'))</nobr>
-    </td>
-    <td class="value">
-      <select size="2" name="nuxeo_protocol" />
-        #if($NUXEO_PROTOCOL == 'https')
-          <option value="http">http</option>
-          <option value="https" selected>https</option>
-        #else
-          <option value="http" selected>http</option>
-          <option value="https" >https</option>
-        #end 
-      </select>
-    </td>
-  </tr>
-
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Host'))</nobr>
-    </td>
-    <td class="value"><input size="32" type="text" id="nuxeo_host"
-      name="nuxeo_host" value="$Encoder.attributeEscape($NUXEO_HOST)" /></td>
-  </tr>
-
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Port'))</nobr>
-    </td>
-    <td class="value"><input size="5" type="text" id="nuxeo_port"
-      name="nuxeo_port" value="$Encoder.attributeEscape($NUXEO_PORT)" /></td>
-  </tr>
-
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Path'))</nobr>
-    </td>
-    <td class="value"><input size="32" type="text" id="nuxeo_path"
-      name="nuxeo_path" value="$Encoder.attributeEscape($NUXEO_PATH)" /></td>
-  </tr>
-
-  <tr>
-    <td class="separator" colspan="2"><hr /></td>
-  </tr>
-
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Username'))</nobr>
-    </td>
-    <td class="value"><input size="16" type="text"
-      id="nuxeo_username" name="nuxeo_username"
-      value="$Encoder.attributeEscape($NUXEO_USERNAME)" /></td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Password'))</nobr>
-    </td>
-    <td class="value"><input size="16" type="password"
-      id="nuxeo_password" name="nuxeo_password"
-      value="" /></td>
-  </tr>
+	<tr>
+		<td class="separator" colspan="2"><hr /></td>
+	</tr>
+
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Protocol'))</nobr>
+		</td>
+		<td class="value">
+			<select size="2" name="nuxeo_protocol" />
+				#if($NUXEO_PROTOCOL == 'https')
+					<option value="http">http</option>
+					<option value="https" selected>https</option>
+				#else
+					<option value="http" selected>http</option>
+					<option value="https" >https</option>
+				#end 
+			</select>
+		</td>
+	</tr>
+
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Host'))</nobr>
+		</td>
+		<td class="value"><input size="32" type="text" id="nuxeo_host"
+			name="nuxeo_host" value="$Encoder.attributeEscape($NUXEO_HOST)" /></td>
+	</tr>
+
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Port'))</nobr>
+		</td>
+		<td class="value"><input size="5" type="text" id="nuxeo_port"
+			name="nuxeo_port" value="$Encoder.attributeEscape($NUXEO_PORT)" /></td>
+	</tr>
+
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Path'))</nobr>
+		</td>
+		<td class="value"><input size="32" type="text" id="nuxeo_path"
+			name="nuxeo_path" value="$Encoder.attributeEscape($NUXEO_PATH)" /></td>
+	</tr>
+
+	<tr>
+		<td class="separator" colspan="2"><hr /></td>
+	</tr>
+
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Username'))</nobr>
+		</td>
+		<td class="value"><input size="16" type="text"
+			id="nuxeo_username" name="nuxeo_username"
+			value="$Encoder.attributeEscape($NUXEO_USERNAME)" /></td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Password'))</nobr>
+		</td>
+		<td class="value"><input size="16" type="password"
+			id="nuxeo_password" name="nuxeo_password"
+			value="" /></td>
+	</tr>
 </table>
 
 #else
 
 <input type="hidden" name="nuxeo_protocol"
-  value="$Encoder.attributeEscape($NUXEO_PROTOCOL)" />
+	value="$Encoder.attributeEscape($NUXEO_PROTOCOL)" />
 <input type="hidden" name="nuxeo_host"
-  value="$Encoder.attributeEscape($NUXEO_HOST)" />
+	value="$Encoder.attributeEscape($NUXEO_HOST)" />
 <input type="hidden" name="nuxeo_port"
-  value="$Encoder.attributeEscape($NUXEO_PORT)" />
+	value="$Encoder.attributeEscape($NUXEO_PORT)" />
 <input type="hidden" name="nuxeo_path"
-  value="$Encoder.attributeEscape($NUXEO_PATH)" />
+	value="$Encoder.attributeEscape($NUXEO_PATH)" />
 <input type="hidden" name="nuxeo_username"
-  value="$Encoder.attributeEscape($NUXEO_USERNAME)" />
+	value="$Encoder.attributeEscape($NUXEO_USERNAME)" />
 <input type="hidden" name="nuxeo_password"
-  value="" />
+	value="" />
 
 #end

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_conf.js
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_conf.js?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_conf.js (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_conf.js Fri Apr 14 21:20:25 2017
@@ -1,24 +1,8 @@
-<!--
- 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.
--->
 
 <script type="text/javascript">
 
 function checkSpecificationForSave(){
-  return true;
+	return true;
 }
 
 function s${SeqNum}_SpecOp(n, opValue, anchorvalue)
@@ -30,7 +14,7 @@ function s${SeqNum}_SpecOp(n, opValue, a
 //Domains
 function s${SeqNum}_SpecDeleteDomain(i)
 {
-  s${SeqNum}_SpecOp("s${SeqNum}_domainop_"+i,"Delete","domain_"+i);
+	s${SeqNum}_SpecOp("s${SeqNum}_domainop_"+i,"Delete","domain_"+i);
 }
 
 function s${SeqNum}_SpecAddDomain(i)
@@ -48,7 +32,7 @@ function s${SeqNum}_SpecAddDomain(i)
 //Documents
 function s${SeqNum}_SpecDeleteDocumentType(i)
 {
-  s${SeqNum}_SpecOp("s${SeqNum}_documentTypeop_"+i,"Delete","documentType_"+i);
+	s${SeqNum}_SpecOp("s${SeqNum}_documentTypeop_"+i,"Delete","documentType_"+i);
 }
 
 function s${SeqNum}_SpecAddDocumentType(i)

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocuments.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocuments.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocuments.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocuments.html Fri Apr 14 21:20:25 2017
@@ -1,53 +1,37 @@
-<!--
- 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.
--->
 #if($TabName ==
 $ResourceBundle.getString('NuxeoRepositoryConnector.Documents') &&
 ${SeqNum} == ${SelectedNum})
 
 <table class="displaytable">
-  <tr>
-    <td class="separator" colspan="2"><hr /></td>
-  </tr>
-
-  <tr>
-    <td class="description" colspan="2">
-      $Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessTags'))
-    </td>
-    <td class="value"><input type="checkbox"
-      name="s${SeqNum}_process_tags" value="true"
-      #if($PROCESS_TAGS) checked 
+	<tr>
+		<td class="separator" colspan="2"><hr /></td>
+	</tr>
+
+	<tr>
+		<td class="description" colspan="2">
+			$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessTags'))
+		</td>
+		<td class="value"><input type="checkbox"
+			name="s${SeqNum}_process_tags" value="true"
+			#if($PROCESS_TAGS) checked 
       #end /></td>
-  </tr>
-  <tr>
-    <td class="description" colspan="2">
-      $Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessAttachments'))
-    </td>
-    <td class="value"><input type="checkbox"
-      name="s${SeqNum}_process_attachments" value="true"
-      #if($PROCESS_ATTACHMENTS) checked 
+	</tr>
+	<tr>
+		<td class="description" colspan="2">
+			$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessAttachments'))
+		</td>
+		<td class="value"><input type="checkbox"
+			name="s${SeqNum}_process_attachments" value="true"
+			#if($PROCESS_ATTACHMENTS) checked 
       #end /></td>
-  </tr>
+	</tr>
 </table>
 
 #else
 
 <input type="hidden" name="s${SeqNum}_process_tags"
-  value="$PROCESS_TAGS" />
+	value="$PROCESS_TAGS" />
 <input type="hidden" name="s${SeqNum}_process_attachments"
-  value="$PROCESS_ATTACHMENTS" />
+	value="$PROCESS_ATTACHMENTS" />
 
 #end

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocumentsType.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocumentsType.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocumentsType.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/editSpecification_confDocumentsType.html Fri Apr 14 21:20:25 2017
@@ -1,19 +1,3 @@
-<!--
- 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.
--->
 
 #if($TabName == $ResourceBundle.getString('NuxeoRepositoryConnector.DocumentsType') && ${SeqNum} == ${SelectedNum})
 

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewConfiguration_conf.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewConfiguration_conf.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewConfiguration_conf.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewConfiguration_conf.html Fri Apr 14 21:20:25 2017
@@ -1,68 +1,52 @@
-<!--
- 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.
--->
 
 <table class="displayTable">
 
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Protocol'))</nobr>
-    </td>
-    <td>
-      <nobr>$Encoder.bodyEscape($NUXEO_PROTOCOL)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Host'))</nobr>
-    </td>
-    <td>
-      <nobr>$Encoder.bodyEscape($NUXEO_HOST)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Port'))</nobr>
-    </td>
-    <td>
-      <nobr>$Encoder.bodyEscape($NUXEO_PORT)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Path'))</nobr>
-    </td>
-    <td>
-      <nobr>$Encoder.bodyEscape($NUXEO_PATH)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Username'))</nobr>
-    </td>
-    <td>
-      <nobr>$Encoder.bodyEscape($NUXEO_USERNAME)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description">
-      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Password'))</nobr>
-    </td>
-    <td>
-      <nobr>*****</nobr>
-    </td>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Protocol'))</nobr>
+		</td>
+		<td>
+			<nobr>$Encoder.bodyEscape($NUXEO_PROTOCOL)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Host'))</nobr>
+		</td>
+		<td>
+			<nobr>$Encoder.bodyEscape($NUXEO_HOST)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Port'))</nobr>
+		</td>
+		<td>
+			<nobr>$Encoder.bodyEscape($NUXEO_PORT)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Path'))</nobr>
+		</td>
+		<td>
+			<nobr>$Encoder.bodyEscape($NUXEO_PATH)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Username'))</nobr>
+		</td>
+		<td>
+			<nobr>$Encoder.bodyEscape($NUXEO_USERNAME)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description">
+			<nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Password'))</nobr>
+		</td>
+		<td>
+			<nobr>*****</nobr>
+		</td>
 
 </table>
\ No newline at end of file

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewSpecification_conf.html
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewSpecification_conf.html?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewSpecification_conf.html (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/nuxeo/viewSpecification_conf.html Fri Apr 14 21:20:25 2017
@@ -1,55 +1,39 @@
-<!--
- 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.
--->
 
 <table class="displaytable">
-  <tr>
-    #if($DOMAINS.size() == 0)
-    <td class="message" colspan="2"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.NoDomainsConfigured'))</nobr>
-    </td> #else
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Domains')):</nobr>
-    </td>
-    <td class="value">#set($domaincounter = 0) #foreach($domain in
-      $DOMAINS) <nobr>$Encoder.bodyEscape($domain)</nobr><br />
-      #set($domaincounter = $domaincounter + 1) #end
-    </td> #end
-  </tr>
-  <tr>
-    #if($DOCUMENTSTYPE.size() == 0)
-    <td class="message" colspan="2"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.NoDocumentsTypeConfigured'))</nobr>
-    </td> #else
-    <td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.DocumentsType')):</nobr>
-    </td>
-    <td class="value">#set($documentTypecounter = 0)
-      #foreach($documentType in $DOCUMENTSTYPE) <nobr>$Encoder.bodyEscape($documentType)</nobr><br />
-      #set($documentTypecounter = $documentTypecounter + 1) #end
-    </td> #end
-  </tr>
-  <tr>
-    <td class="description"><nobr>
-        $Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessTags')):
-      </nobr></td>
-    <td class="value"><nobr>$Encoder.bodyEscape($PROCESS_TAGS)</nobr>
-    </td>
-  </tr>
-  <tr>
-    <td class="description"><nobr>
-        $Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessAttachments')):
-      </nobr></td>
-    <td class="value"><nobr>$Encoder.bodyEscape($PROCESS_ATTACHMENTS)</nobr>
-    </td>
-  </tr>
+	<tr>
+		#if($DOMAINS.size() == 0)
+		<td class="message" colspan="2"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.NoDomainsConfigured'))</nobr>
+		</td> #else
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.Domains')):</nobr>
+		</td>
+		<td class="value">#set($domaincounter = 0) #foreach($domain in
+			$DOMAINS) <nobr>$Encoder.bodyEscape($domain)</nobr><br />
+			#set($domaincounter = $domaincounter + 1) #end
+		</td> #end
+	</tr>
+	<tr>
+		#if($DOCUMENTSTYPE.size() == 0)
+		<td class="message" colspan="2"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.NoDocumentsTypeConfigured'))</nobr>
+		</td> #else
+		<td class="description"><nobr>$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.DocumentsType')):</nobr>
+		</td>
+		<td class="value">#set($documentTypecounter = 0)
+			#foreach($documentType in $DOCUMENTSTYPE) <nobr>$Encoder.bodyEscape($documentType)</nobr><br />
+			#set($documentTypecounter = $documentTypecounter + 1) #end
+		</td> #end
+	</tr>
+	<tr>
+		<td class="description"><nobr>
+				$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessTags')):
+			</nobr></td>
+		<td class="value"><nobr>$Encoder.bodyEscape($PROCESS_TAGS)</nobr>
+		</td>
+	</tr>
+	<tr>
+		<td class="description"><nobr>
+				$Encoder.bodyEscape($ResourceBundle.getString('NuxeoRepositoryConnector.ProcessAttachments')):
+			</nobr></td>
+		<td class="value"><nobr>$Encoder.bodyEscape($PROCESS_ATTACHMENTS)</nobr>
+		</td>
+	</tr>
 </table>
\ No newline at end of file

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/authorities/nuxeo/tests/NuxeoAuthorityTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/authorities/nuxeo/tests/NuxeoAuthorityTest.java?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/authorities/nuxeo/tests/NuxeoAuthorityTest.java (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/authorities/nuxeo/tests/NuxeoAuthorityTest.java Fri Apr 14 21:20:25 2017
@@ -1,38 +1,22 @@
-/* $Id: DefaultAuthenticator.java 1688076 2015-06-28 23:04:30Z kwright $ */
-
 /**
-* 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.
-*/
+ * 
+ */
 package org.apache.manifoldcf.authorities.nuxeo.tests;
 
 import org.apache.manifoldcf.authorities.authorities.nuxeo.NuxeoAuthorityConnector;
 import org.apache.manifoldcf.authorities.interfaces.AuthorizationResponse;
 import org.apache.manifoldcf.authorities.interfaces.IAuthorityConnector;
-import org.apache.manifoldcf.crawler.connectors.nuxeo.client.NuxeoClient;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import static org.junit.Assert.assertEquals;
-
+import org.nuxeo.client.api.NuxeoClient;
+import org.nuxeo.client.api.objects.user.User;
+import org.nuxeo.client.api.objects.user.UserManager;
 import org.mockito.Mock;
+import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
 
-import java.util.ArrayList;
-import java.util.List;
-
 import static org.mockito.Matchers.anyString;
 
 import org.mockito.runners.MockitoJUnitRunner;
@@ -44,44 +28,52 @@ import org.mockito.runners.MockitoJUnitR
 @RunWith(MockitoJUnitRunner.class)
 public class NuxeoAuthorityTest {
 
-  @Mock
-  private NuxeoClient client;
+	@Mock
+	private NuxeoClient client;
 
-  private NuxeoAuthorityConnector authorityConnector;
+	private NuxeoAuthorityConnector authorityConnector;
 
-  @Before
-  public void setup() throws Exception {
-    authorityConnector = new NuxeoAuthorityConnector();
-    authorityConnector.setNuxeoClient(client);
-  }
-
-  @Test
-  public void check() throws Exception {
-    when(client.checkAuth()).thenReturn(true);
-    assertEquals(authorityConnector.check(), "Connection working");
-  }
-
-  @Test
-  public void checkUserNotFound() throws Exception {
-    when(client.getUserAuthorities(anyString())).thenReturn(new ArrayList<String>());
-    AuthorizationResponse response = authorityConnector.getAuthorizationResponse(anyString());
-    String[] tokens = response.getAccessTokens();
-    
-    assertEquals(tokens.length, 1);
-    assertEquals(tokens[0], IAuthorityConnector.GLOBAL_DENY_TOKEN);
-    assertEquals(response.getResponseStatus(), AuthorizationResponse.RESPONSE_USERNOTFOUND);
-  }
-
-  @Test
-  public void checkuserFound() throws Exception {
-    List<String> tokensList = new ArrayList<String>();
-    tokensList.add("token");
-    when(client.getUserAuthorities(anyString())).thenReturn(tokensList);
-    AuthorizationResponse response = authorityConnector.getAuthorizationResponse(anyString());
-    
-    String[] tokens = response.getAccessTokens();
-    assertEquals(tokens.length, 1);
-    assertEquals(tokens[0], tokensList.get(0));
-    assertEquals(response.getResponseStatus(), AuthorizationResponse.RESPONSE_OK);
-  }
+	@Before
+	public void setup() throws Exception {
+		authorityConnector = new NuxeoAuthorityConnector();
+		authorityConnector.setNuxeoClient(client);
+	}
+
+	@Test
+	public void check() throws Exception {
+						
+		when(client.getUserManager()).thenReturn(mock(UserManager.class));
+		when(client.getUserManager().fetchUser(anyString())).thenReturn(mock(User.class));
+		
+		assertEquals(authorityConnector.check(), "Connection working");
+	}
+
+	@Test
+	public void checkUserNotFound() throws Exception {
+		UserManager userManager = mock(UserManager.class);
+		User user = mock(User.class);
+		
+		when(client.getUserManager()).thenReturn(userManager);
+		when(client.getUserManager().fetchUser("")).thenReturn(user);
+		
+		AuthorizationResponse response = authorityConnector.getAuthorizationResponse("NOT_USER_EXIST");
+		String[] tokens = response.getAccessTokens();
+		
+		assertEquals(tokens.length, 1);
+		assertEquals(tokens[0], IAuthorityConnector.GLOBAL_DENY_TOKEN);
+		assertEquals(response.getResponseStatus(), AuthorizationResponse.RESPONSE_USERNOTFOUND);
+	}
+
+	@Test
+	public void checkUserFound() throws Exception {
+		when(client.getUserManager()).thenReturn(mock(UserManager.class));
+		when(client.getUserManager().fetchUser(anyString())).thenReturn(mock(User.class));
+		
+		AuthorizationResponse response = authorityConnector.getAuthorizationResponse("Administrator");
+		
+		String[] tokens = response.getAccessTokens();
+		
+		assertEquals(tokens.length, 1);
+		assertEquals(response.getResponseStatus(), AuthorizationResponse.RESPONSE_OK);
+	}
 }

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/nuxeo/tests/NuxeoConnectorTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/nuxeo/tests/NuxeoConnectorTest.java?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/nuxeo/tests/NuxeoConnectorTest.java (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/nuxeo/tests/NuxeoConnectorTest.java Fri Apr 14 21:20:25 2017
@@ -1,29 +1,11 @@
-/* $Id: DefaultAuthenticator.java 1688076 2015-06-28 23:04:30Z kwright $ */
-
 /**
-* 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.
-*/
+ * 
+ */
 package org.apache.manifoldcf.crawler.connectors.nuxeo.tests;
 
 import static org.junit.Assert.assertEquals;
-import static org.mockito.Matchers.anyInt;
 import static org.mockito.Matchers.anyLong;
-import static org.mockito.Matchers.anyObject;
 import static org.mockito.Matchers.anyString;
-import static org.mockito.Matchers.anyListOf;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.when;
@@ -32,7 +14,6 @@ import static org.mockito.Mockito.verify
 
 import java.text.DateFormat;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
@@ -41,173 +22,194 @@ import java.util.Map;
 import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.interfaces.Specification;
 import org.apache.manifoldcf.crawler.connectors.BaseRepositoryConnector;
-import org.apache.manifoldcf.crawler.connectors.nuxeo.model.Document;
-import org.apache.manifoldcf.crawler.connectors.nuxeo.model.NuxeoResponse;
+import org.apache.manifoldcf.crawler.connectors.nuxeo.NuxeoRepositoryConnector;
+import org.apache.manifoldcf.crawler.connectors.nuxeo.model.DocumentManifold;
 import org.apache.manifoldcf.crawler.interfaces.IExistingVersions;
 import org.apache.manifoldcf.crawler.interfaces.IProcessActivity;
 import org.apache.manifoldcf.crawler.system.SeedingActivity;
+import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentCaptor;
+import org.mockito.Mock;
 import org.mockito.Mockito;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.nuxeo.client.api.NuxeoClient;
+import org.nuxeo.client.api.objects.Document;
+import org.nuxeo.client.api.objects.Documents;
+import org.nuxeo.client.api.objects.Repository;
 
 /**
  * @author David Arroyo Escobar <arroyoescobardavid@gmail.com>
  *
  */
 @RunWith(MockitoJUnitRunner.class)
-public class NuxeoConnectorTest extends AbstractTestBase {
+public class NuxeoConnectorTest {
+
+	@Mock
+	public NuxeoClient client;
+
+	public NuxeoRepositoryConnector repositoryConnector;
+
+	@Before
+	public void setup() throws Exception {
+
+		repositoryConnector = new NuxeoRepositoryConnector();
+		repositoryConnector.setNuxeoClient(client);
+	};
+
+	@Test
+	public void checkMockInjection() throws Exception {
+		Document doc = mock(Document.class);
+		Repository repository = mock(Repository.class);
+		
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().getDocumentRoot()).thenReturn(doc);
+		assertEquals(repositoryConnector.check(), "Connection working");
+	}
+
+	@Test
+	public void mockSeeding() throws Exception {
+		SeedingActivity activities = mock(SeedingActivity.class);
+		Specification spec = new Specification();
+		Repository repository = mock(Repository.class);
+		Document document = mock(Document.class);
+		List<Document> documents = new ArrayList<>();
+		documents.add(document);
+		documents.add(document);
+		Documents docs = mock(Documents.class);
+		long seedTime = 0;
+		
+
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().query(anyString(), anyString(), anyString(), anyString(), anyString(),
+				anyString(), anyString())).thenReturn(docs);
+		when(docs.getIsNextPageAvailable()).thenReturn(false);
+		when(docs.getDocuments()).thenReturn(documents);
+		
+		repositoryConnector.addSeedDocuments(activities, spec, "", seedTime,
+				BaseRepositoryConnector.JOBMODE_CONTINUOUS);
+
+		verify(activities, times(2)).addSeedDocument(anyString());
+		
+	}
+
+	@Test
+	public void mockEmptySeeding() throws Exception {
+		SeedingActivity activities = mock(SeedingActivity.class);
+		Specification spec = new Specification();
+		Repository repository = mock(Repository.class);
+		List<Document> documents = new ArrayList<>();		
+		Documents docs = mock(Documents.class);
+		long seedTime = 0;
+		
+
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().query(anyString(), anyString(), anyString(), anyString(), anyString(),
+				anyString(), anyString())).thenReturn(docs);
+		when(docs.getIsNextPageAvailable()).thenReturn(false);
+		when(docs.getDocuments()).thenReturn(documents);
+		
+		repositoryConnector.addSeedDocuments(activities, spec, "", seedTime,
+				BaseRepositoryConnector.JOBMODE_CONTINUOUS);
+
+		verify(activities, times(0)).addSeedDocument(anyString());
+	}
+
+	@Test
+	public void mockDeleteDocument() throws Exception {
+		DocumentManifold docMa = mock(DocumentManifold.class);
+		Repository repository = mock(Repository.class);
+		Document doc = mock(Document.class);
+		Specification spec = new Specification();
+		IProcessActivity activities = mock(IProcessActivity.class);
+		IExistingVersions statuses = mock(IExistingVersions.class);
+
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().fetchDocumentById(anyString())).thenReturn(doc);
+		when(docMa.getDocument()).thenReturn(doc);
+		when(doc.getState()).thenReturn("deleted");
+
+		repositoryConnector.processDocuments(new String[] { anyString() }, statuses, spec, activities,
+				BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
+
+		verify(activities, times(1)).deleteDocument(anyString());
+	}
+
+	@Test
+	public void mockSimpleIngestion() throws Exception {
+
+		Document doc = mock(Document.class);
+		DocumentManifold docMa = mock(DocumentManifold.class);
+		Date date = new Date();
+		DateFormat df = DateFormat.getDateTimeInstance();
+		String version = df.format(date);
+		Long size = 0L;
+		String id;
+		String uri = "http://localhost:8080/nuxeo/site/api/v1/id/7995ff6d-1eda-41db-b9de-3ea4037fdb81";
+		Map<String, Object> metadata = new HashMap<String, Object>();
+		IProcessActivity activities = mock(IProcessActivity.class);
+		IExistingVersions statuses = mock(IExistingVersions.class);
+		Specification spec = new Specification();
+		Repository repository = mock(Repository.class);
+
+
+		metadata.put("key", "value");
+		id = df.format(date);
+
+		when(doc.get("lenght")).thenReturn(size);
+		when(doc.getLastModified()).thenReturn(version);
+		when(docMa.getMetadata()).thenReturn(metadata);
+		when(doc.getUid()).thenReturn(uri);
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().fetchDocumentById(anyString())).thenReturn(doc);
+
+		when(activities.checkDocumentNeedsReindexing(anyString(), anyString())).thenReturn(true);
+		when(statuses.getIndexedVersionString(id)).thenReturn(null);
+
+
+		repositoryConnector.processDocuments(new String[] { id }, statuses, spec, activities,
+				BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
+		ArgumentCaptor<RepositoryDocument> ac = ArgumentCaptor.forClass(RepositoryDocument.class);
+
+		verify(activities, times(1)).ingestDocumentWithException(eq(id), eq(df.format(date)), eq(uri), ac.capture());
+		verify(activities, times(1)).recordActivity(anyLong(), eq("read document"), eq(size), eq(id), eq("OK"),
+				anyString(), Mockito.isNull(String[].class));
+
+		RepositoryDocument rd = ac.getValue();
+		Long rdSize = rd.getBinaryLength();
+
+		String[] keyValue = rd.getFieldAsStrings("uid");
+		
+		assertEquals(size, rdSize);
+		assertEquals(keyValue.length, 1);
+	}
+
+	@Test
+	public void mockNotNeedReindexing() throws Exception {
+		Document doc = mock(Document.class);
+		Date date = new Date();
+		Repository repository = mock(Repository.class);
+		DateFormat df = DateFormat.getDateTimeInstance();
+		String version = df.format(date);
+		String uid = "297529bf-191a-4c87-8259-28b692394229";
+
+		IProcessActivity activities = mock(IProcessActivity.class);
+		IExistingVersions statuses = mock(IExistingVersions.class);
+		Specification spec = new Specification();
+
+		when(doc.getLastModified()).thenReturn(version);
+		when(statuses.getIndexedVersionString(uid)).thenReturn(version);
+		when(client.repository()).thenReturn(repository);
+		when(client.repository().fetchDocumentById(anyString())).thenReturn(doc);
+
+		repositoryConnector.processDocuments(new String[] { uid }, statuses, spec, activities,
+				BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
+		ArgumentCaptor<RepositoryDocument> ac = ArgumentCaptor.forClass(RepositoryDocument.class);
 
-  @Override
-  public void setup() throws Exception {
-    super.setup();
-
-    when(client.getDocuments(anyListOf(String.class), anyListOf(String.class), anyString(), anyInt(), anyInt(),
-        anyObject())).thenReturn(new NuxeoResponse<Document>(Collections.<Document> emptyList(), 0, 0, true));
-  };
-
-  @Test
-  public void checkMockInjection() throws Exception {
-    when(client.check()).thenReturn(true);
-    assertEquals(repositoryConnector.check(), "Connection working");
-  }
-
-  @Test
-  public void mockSeeding() throws Exception {
-    SeedingActivity activities = mock(SeedingActivity.class);
-    Specification spec = new Specification();
-    List<Document> documents = new ArrayList<Document>();
-    Document document = mock(Document.class);
-    long seedTime = 0;
-
-    documents.add(document);
-    documents.add(document);
-
-    when(client.getDocuments(anyListOf(String.class), anyListOf(String.class), anyString(), anyInt(), anyInt(),
-        anyObject())).thenReturn(new NuxeoResponse<Document>(documents, 0, 0, true))
-            .thenReturn(new NuxeoResponse<Document>(Collections.<Document> emptyList(), 0, 0, true));
-
-    repositoryConnector.addSeedDocuments(activities, spec, "", seedTime,
-        BaseRepositoryConnector.JOBMODE_CONTINUOUS);
-
-    verify(activities, times(2)).addSeedDocument(anyString());
-    verify(client, times(1)).getDocuments(anyListOf(String.class), anyListOf(String.class), anyString(), anyInt(),
-        anyInt(), anyObject());
-
-  }
-
-  @Test
-  public void mockEmptySeeding() throws Exception {
-    SeedingActivity activities = mock(SeedingActivity.class);
-    Specification spec = new Specification();
-    long seedTime = 0;
-
-    when(client.getDocuments(anyListOf(String.class), anyListOf(String.class), anyString(), anyInt(), anyInt(),
-        anyObject())).thenReturn(new NuxeoResponse<Document>(Collections.<Document> emptyList(), 0, 0, true));
-
-    repositoryConnector.addSeedDocuments(activities, spec, "", seedTime,
-        BaseRepositoryConnector.JOBMODE_CONTINUOUS);
-
-    verify(activities, times(0)).addSeedDocument(anyString());
-    verify(client, times(1)).getDocuments(anyListOf(String.class), anyListOf(String.class), anyString(), anyInt(),
-        anyInt(), anyObject());
-
-  }
-
-  @Test
-  public void mockDeleteDocument() throws Exception {
-    Document doc = mock(Document.class);
-    String uid = "297529bf-191a-4c87-8259-28b692394229";
-    Specification spec = new Specification();
-    IProcessActivity activities = mock(IProcessActivity.class);
-    IExistingVersions statuses = mock(IExistingVersions.class);
-
-    when(doc.getState()).thenReturn("deleted");
-    when(client.getDocument(uid)).thenReturn(doc);
-
-    repositoryConnector.processDocuments(new String[] { uid }, statuses, spec, activities,
-        BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
-
-    verify(client, times(1)).getDocument(anyString());
-    verify(activities, times(1)).deleteDocument(uid);
-  }
-
-  @Test
-  public void mockSimpleIngestion() throws Exception {
-
-    Document doc = mock(Document.class);
-    Date date = new Date();
-    DateFormat df = DateFormat.getDateTimeInstance();
-    Long size = 0L;
-    String id;
-    String uri = "http://localhost:8080/nuxeo/site/api/v1/id/7995ff6d-1eda-41db-b9de-3ea4037fdb81";
-    Map<String, Object> metadata = new HashMap<String, Object>();
-    IProcessActivity activities = mock(IProcessActivity.class);
-    IExistingVersions statuses = mock(IExistingVersions.class);
-    Specification spec = new Specification();
-    String mediaType = "text/html; charset=utf-8";
-
-    metadata.put("key", "value");
-    id = df.format(date);
-
-    when(doc.getLenght()).thenReturn(size);
-    when(doc.getLastModified()).thenReturn(date);
-    when(doc.getMediatype()).thenReturn(mediaType);
-    when(doc.getMetadataAsMap()).thenReturn(metadata);
-    when(doc.getUid()).thenReturn(uri);
-
-    when(activities.checkDocumentNeedsReindexing(anyString(), anyString())).thenReturn(true);
-
-    when(statuses.getIndexedVersionString(id)).thenReturn(null);
-
-    when(client.getDocument(anyString())).thenReturn(doc);
-
-    when(client.getPathDocument(anyString())).thenReturn(uri);
-
-    repositoryConnector.processDocuments(new String[] { id }, statuses, spec, activities,
-        BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
-    ArgumentCaptor<RepositoryDocument> ac = ArgumentCaptor.forClass(RepositoryDocument.class);
-
-    verify(client, times(1)).getDocument(id);
-    verify(activities, times(1)).ingestDocumentWithException(eq(id), eq(df.format(date)), eq(uri), ac.capture());
-    verify(activities, times(1)).recordActivity(anyLong(), eq("read document"), eq(size), eq(id), eq("OK"),
-        anyString(), Mockito.isNull(String[].class));
-
-    RepositoryDocument rd = ac.getValue();
-    Long rdSize = rd.getBinaryLength();
-
-    String[] keyValue = rd.getFieldAsStrings("key");
-    assertEquals(size, rdSize);
-
-    assertEquals(keyValue.length, 1);
-    assertEquals(keyValue[0], "value");
-  }
-
-  @Test
-  public void mockNotNeedReindexing() throws Exception {
-    Document doc = mock(Document.class);
-    Date date = new Date();
-    DateFormat df = DateFormat.getDateTimeInstance();
-    String version = df.format(date);
-    String uid = "297529bf-191a-4c87-8259-28b692394229";
-
-    IProcessActivity activities = mock(IProcessActivity.class);
-    IExistingVersions statuses = mock(IExistingVersions.class);
-    Specification spec = new Specification();
-
-    when(doc.getLastModified()).thenReturn(df.parse(version));
-    when(statuses.getIndexedVersionString(uid)).thenReturn(version);
-    when(client.getDocument(anyString())).thenReturn(doc);
-
-    repositoryConnector.processDocuments(new String[] { uid }, statuses, spec, activities,
-        BaseRepositoryConnector.JOBMODE_CONTINUOUS, true);
-    ArgumentCaptor<RepositoryDocument> ac = ArgumentCaptor.forClass(RepositoryDocument.class);
-
-    verify(client, times(1)).getDocument(uid);
-    verify(activities, times(1)).checkDocumentNeedsReindexing(uid, version);
-    verify(activities, times(0)).ingestDocumentWithException(anyString(), anyString(), anyString(), ac.capture());
+		verify(activities, times(1)).checkDocumentNeedsReindexing(uid, version);
+		verify(activities, times(0)).ingestDocumentWithException(anyString(), anyString(), anyString(), ac.capture());
 
-  }
+	}
 
 }

Modified: manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/pom.xml?rev=1791418&r1=1791417&r2=1791418&view=diff
==============================================================================
--- manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/pom.xml (original)
+++ manifoldcf/branches/CONNECTORS-1290-2/connectors/nuxeo/pom.xml Fri Apr 14 21:20:25 2017
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.manifoldcf</groupId>
     <artifactId>mcf-connectors</artifactId>
-    <version>2.6-SNAPSHOT</version>
+    <version>2.7-SNAPSHOT</version>
   </parent>
 
   <name>ManifoldCF - Connectors - Nuxeo Connector</name>
@@ -43,6 +43,19 @@
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
   </properties>
 
+  <!-- Nuxeo repositories -->
+  <repositories>
+    <repository>
+	  <id>public-releases</id>
+	  <url>http://maven.nuxeo.com/nexus/content/repositories/public-releases/</url>
+    </repository>
+    <repository>
+	  <id>public-snapshots</id>
+	  <url>http://maven.nuxeo.com/nexus/content/repositories/public-snapshots/</url>
+    </repository>
+  </repositories>
+  <!-- Nuxeo repositories -->
+	
   <build>
     <defaultGoal>integration-test</defaultGoal>
     <sourceDirectory>${basedir}/connector/src/main/java</sourceDirectory>
@@ -301,7 +314,7 @@
     <dependency>
       <groupId>com.google.guava</groupId>
       <artifactId>guava</artifactId>
-      <version>${guava.version}</version>
+      <version>15.0</version>
     </dependency>
     
     <!-- Testing dependencies -->
@@ -346,27 +359,35 @@
     <dependency>
       <groupId>commons-logging</groupId>
       <artifactId>commons-logging</artifactId>
-      <version>${commons-logging.version}</version>
+      <version>1.1.1</version>
       <scope>test</scope>
     </dependency>
 
     <dependency>
       <groupId>log4j</groupId>
       <artifactId>log4j</artifactId>
-      <version>${log4j.version}</version>
+      <version>1.2.16</version>
       <scope>provided</scope>
       <type>jar</type>
     </dependency>
     <dependency>
       <groupId>com.googlecode.json-simple</groupId>
       <artifactId>json-simple</artifactId>
-      <version>${json-simple.version}</version>
+      <version>1.1</version>
     </dependency>
     <dependency>
       <groupId>commons-codec</groupId>
       <artifactId>commons-codec</artifactId>
-      <version>${commons-codec.version}</version>
+      <version>1.8</version>
     </dependency>
+    
+    <!-- Nuxeo client -->
+    <dependency>
+	  <groupId>org.nuxeo.client</groupId>
+	  <artifactId>nuxeo-java-client</artifactId>
+	  <version>2.5-SNAPSHOT</version>
+	</dependency>
+	<!-- End nuxeo client -->
   </dependencies>
 
 </project>



Mime
View raw message