manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1844778 - in /manifoldcf/trunk: ./ connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/...
Date Wed, 24 Oct 2018 14:27:28 GMT
Author: kwright
Date: Wed Oct 24 14:27:28 2018
New Revision: 1844778

URL: http://svn.apache.org/viewvc?rev=1844778&view=rev
Log:
Fix for CONNECTORS-1551.  Thanks to Shirai Takashi for this submission.

Added:
    manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/authorities/confluence/common_ja_JP.properties
    manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_ja_JP.properties
Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceConfiguration.java
    manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceRepositoryConnector.java
    manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/ConfluenceClient.java
    manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_en_US.properties
    manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_es_ES.properties
    manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/confluence/editConfiguration_conf.js
    manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editConfiguration_conf.js
    manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editSpecification_confPages.html
    manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/viewSpecification_conf.html
    manifoldcf/trunk/connectors/confluence/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/confluence/tests/ConfluenceConnectorTest.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Wed Oct 24 14:27:28 2018
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 2.12-dev =====================
 
+CONNECTORS-1551: Various changes and improvements for the
+Confluence connector.
+(Shirai Takashi)
+
 CONNECTORS-1549: Problem with API output JSON: losing order in child records.
 (Julien Massiera, Karl Wright)
 

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceConfiguration.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceConfiguration.java?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceConfiguration.java
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceConfiguration.java
Wed Oct 24 14:27:28 2018
@@ -52,6 +52,7 @@ public class ConfluenceConfiguration {
     public static final String SPACE_KEY_ATTRIBUTE = "key";
     public static final String PAGES = "pages";
     public static final String PROCESS_ATTACHMENTS_ATTRIBUTE_KEY = "process_attachments";
+    public static final String PAGETYPE = "pagetype";
     
   }
   

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceRepositoryConnector.java?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceRepositoryConnector.java
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/ConfluenceRepositoryConnector.java
Wed Oct 24 14:27:28 2018
@@ -537,7 +537,10 @@ public class ConfluenceRepositoryConnect
 
     newMap.put(
         ConfluenceConfiguration.Specification.PROCESS_ATTACHMENTS_ATTRIBUTE_KEY
-            .toUpperCase(Locale.ROOT), cs.isProcessAttachments());
+            .toUpperCase(Locale.ROOT), cs.isProcessAttachments().toString());
+    newMap.put(
+        ConfluenceConfiguration.Specification.PAGETYPE
+            .toUpperCase(Locale.ROOT), cs.getPageType());
     return;
 
   }
@@ -651,6 +654,14 @@ public class ConfluenceRepositoryConnect
           String.valueOf(procAttachments));
     }
 
+    String pageType = variableContext
+        .getParameter(seqPrefix
+            + ConfluenceConfiguration.Specification.PAGETYPE);
+    if (pageType != null && !pageType.isEmpty()) {
+      pages.setAttribute(
+          ConfluenceConfiguration.Specification.PAGETYPE, pageType);
+    }
+
     return null;
   }
 
@@ -746,16 +757,19 @@ public class ConfluenceRepositoryConnect
       ConfluenceSpecification confluenceSpecification = ConfluenceSpecification
           .from(spec);
       List<String> spaceKeys = confluenceSpecification.getSpaces();
+      String pageType = confluenceSpecification.getPageType();
 
       if (spaceKeys.isEmpty()) {
         logger.info("No spaces configured. Processing all spaces");
         addSeedDocumentsForSpace(Optional.<String> absent(),
+            Optional.<String> of(pageType),
             activities, confluenceSpecification, lastSeedVersion,
             seedTime, jobMode);
       } else {
         for (String space : spaceKeys) {
           logger.info("Processing configured space {}", space);
           addSeedDocumentsForSpace(Optional.<String> of(space),
+              Optional.<String> of(pageType),
               activities, confluenceSpecification,
               lastSeedVersion, seedTime, jobMode);
         }
@@ -777,6 +791,7 @@ public class ConfluenceRepositoryConnect
    * @throws ManifoldCFException
    */
   private void addSeedDocumentsForSpace(Optional<String> space,
+      Optional<String> pageType,
       ISeedingActivity activities,
       ConfluenceSpecification confluenceSpec, String lastSeedVersion,
       long seedTime, int jobMode) throws ManifoldCFException,
@@ -796,7 +811,7 @@ public class ConfluenceRepositoryConnect
       Boolean isLast = true;
       do {
         final ConfluenceResponse<Page> response = confluenceClient.getPages(
-            (int) lastStart, (int) defaultSize, space);
+            (int) lastStart, (int) defaultSize, space, pageType);
 
         int count = 0;
         for (Page page : response.getResults()) {
@@ -915,6 +930,7 @@ public class ConfluenceRepositoryConnect
       String version = statuses.getIndexedVersionString(pageId);
 
       long startTime = System.currentTimeMillis();
+      long fileSize = 0L;
       String errorCode = "OK";
       String errorDesc = StringUtils.EMPTY;
       ProcessResult pResult = null;
@@ -953,8 +969,9 @@ public class ConfluenceRepositoryConnect
                 ACTIVITY_READ, pResult.fileSize, pageId, pResult.errorCode,
                   pResult.errorDescription, null);
           }else{
+            if(pResult != null) fileSize = pResult.fileSize;
             activities.recordActivity(new Long(startTime),
-                ACTIVITY_READ, pResult.fileSize, pageId, errorCode,
+                ACTIVITY_READ, fileSize, pageId, errorCode,
                   errorDesc, null);
           }
         }
@@ -1110,7 +1127,7 @@ public class ConfluenceRepositoryConnect
         List<?> list = (List<?>)entry.getValue();
         rd.addField(entry.getKey(), list.toArray(new String[list.size()]));
       }
-      else {
+      else if(entry.getValue() != null) {
         rd.addField(entry.getKey(), entry.getValue().toString());
       }
     }
@@ -1202,6 +1219,7 @@ public class ConfluenceRepositoryConnect
   private static class ConfluenceSpecification {
     private List<String> spaces;
     private Boolean processAttachments = false;
+    private String pageType = null;
 
     /**
      * <p>
@@ -1227,6 +1245,19 @@ public class ConfluenceRepositoryConnect
       return this.spaces;
     }
 
+    /**
+     * <p>
+     * Returns configured page type
+     * </p>
+     * 
+     * @return a {@code String} of configured page type
+     */
+    public String getPageType() {
+      if (this.pageType == null || this.pageType.isEmpty()) return "page";
+
+      return this.pageType;
+    }
+
     public static ConfluenceSpecification from(Specification spec) {
       ConfluenceSpecification cs = new ConfluenceSpecification();
       cs.spaces = Lists.newArrayList();
@@ -1250,6 +1281,8 @@ public class ConfluenceRepositoryConnect
           String s = sn
               .getAttributeValue(ConfluenceConfiguration.Specification.PROCESS_ATTACHMENTS_ATTRIBUTE_KEY);
           cs.processAttachments = Boolean.valueOf(s);
+          cs.pageType = sn
+              .getAttributeValue(ConfluenceConfiguration.Specification.PAGETYPE);
         }
       }
 

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/ConfluenceClient.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/ConfluenceClient.java?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/ConfluenceClient.java
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/confluence/client/ConfluenceClient.java
Wed Oct 24 14:27:28 2018
@@ -281,7 +281,7 @@ public class ConfluenceClient {
    * @throws Exception
    */
   public ConfluenceResponse<Page> getPages() throws Exception {
-    return getPages(0, 50, Optional.<String> absent());
+    return getPages(0, 50, Optional.<String> absent(), Optional.<String> absent());
   }
 
   /**
@@ -297,12 +297,15 @@ public class ConfluenceClient {
    */
   @SuppressWarnings("unchecked")
   public ConfluenceResponse<Page> getPages(int start, int limit,
-      Optional<String> space) throws Exception {
+      Optional<String> space, Optional<String> pageType) throws Exception {
     String url = String.format(Locale.ROOT, "%s://%s:%s%s%s?limit=%s&start=%s", protocol,
         host, port, path, CONTENT_PATH, limit, start);
     if (space.isPresent()) {
       url = String.format(Locale.ROOT, "%s&spaceKey=%s", url, space.get());
     }
+    if (pageType.isPresent()) {
+      url = String.format(Locale.ROOT, "%s&type=%s", url, pageType.get());
+    }
     return (ConfluenceResponse<Page>) getConfluenceResources(url, Page.builder());
   }
 

Added: manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/authorities/confluence/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/authorities/confluence/common_ja_JP.properties?rev=1844778&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/authorities/confluence/common_ja_JP.properties
(added)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/authorities/authorities/confluence/common_ja_JP.properties
Wed Oct 24 14:27:28 2018
@@ -0,0 +1,29 @@
+# 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.
+
+ConfluenceAuthorityConnector.Server=サーバ
+
+ConfluenceAuthorityConnector.ProtocolColon=プロトコル:
+ConfluenceAuthorityConnector.HostColon=ホスト名:
+ConfluenceAuthorityConnector.PortColon=ポート番号:
+ConfluenceAuthorityConnector.PathColon=パス名:
+ConfluenceAuthorityConnector.UsernameColon=ユーザ名:
+ConfluenceAuthorityConnector.PasswordColon=パスワード:
+
+ConfluenceAuthorityConnector.HostMustNotBeNull=Confluence ホスト名が未指定です
+ConfluenceAuthorityConnector.HostMustNotIncludeSlash=Confluence ホスト名に文字「/」を含めてはいけません
+ConfluenceAuthorityConnector.PortMustBeAnInteger=Confluence ポート番号は数値でなくてはいけません
+ConfluenceAuthorityConnector.PathMustNotBeNull=Confluence パス名が未指定です
+ConfluenceAuthorityConnector.PathMustBeginWithASlash=Confluence パス名は文字「/」で始まらなくてはいけません

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_en_US.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_en_US.properties?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_en_US.properties
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_en_US.properties
Wed Oct 24 14:27:28 2018
@@ -39,4 +39,7 @@ ConfluenceRepositoryConnector.Delete=Del
 ConfluenceRepositoryConnector.DeleteSpace=Delete space #
 ConfluenceRepositoryConnector.TypeInASpace=Type in a space
 
+ConfluenceRepositoryConnector.TypeSpec=Type Specification
+ConfluenceRepositoryConnector.TypePage=Page
+ConfluenceRepositoryConnector.TypeBlog=Blog
 ConfluenceRepositoryConnector.ProcessAttachments=Process Attachments
\ No newline at end of file

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_es_ES.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_es_ES.properties?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_es_ES.properties
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_es_ES.properties
Wed Oct 24 14:27:28 2018
@@ -39,4 +39,7 @@ ConfluenceRepositoryConnector.Delete=bor
 ConfluenceRepositoryConnector.DeleteSpace=eliminar el espacio #
 ConfluenceRepositoryConnector.TypeInASpace=Escriba un espacio
 
+ConfluenceRepositoryConnector.TypeSpec=Especificación de tipo
+ConfluenceRepositoryConnector.TypePage=Página
+ConfluenceRepositoryConnector.TypeBlog=Blog
 ConfluenceRepositoryConnector.ProcessAttachments=Accesorios de Proceso
\ No newline at end of file

Added: manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_ja_JP.properties
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_ja_JP.properties?rev=1844778&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_ja_JP.properties
(added)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/confluence/common_ja_JP.properties
Wed Oct 24 14:27:28 2018
@@ -0,0 +1,45 @@
+# 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.
+
+ConfluenceRepositoryConnector.Server=サーバ
+ConfluenceRepositoryConnector.Spaces=スペース
+ConfluenceRepositoryConnector.Pages=ページ
+
+
+ConfluenceRepositoryConnector.ProtocolColon=プロトコル:
+ConfluenceRepositoryConnector.HostColon=ホスト名:
+ConfluenceRepositoryConnector.PortColon=ポート番号:
+ConfluenceRepositoryConnector.PathColon=パス名:
+ConfluenceRepositoryConnector.UsernameColon=ユーザ名:
+ConfluenceRepositoryConnector.PasswordColon=パスワード:
+
+ConfluenceRepositoryConnector.HostMustNotBeNull=Confluence ホスト名が未指定です
+ConfluenceRepositoryConnector.HostMustNotIncludeSlash=Confluence ホスト名に文字「/」を含めてはいけません
+ConfluenceRepositoryConnector.PortMustBeAnInteger=Confluence ポート番号は数値でなくてはいけません
+ConfluenceRepositoryConnector.PathMustNotBeNull=Confluence パス名が未指定です
+ConfluenceRepositoryConnector.PathMustBeginWithASlash=Confluence パス名は文字「/」で始まらなくてはいけません
+
+ConfluenceRepositoryConnector.NoSpacesConfigured=スペース名が指定されていないので全スペースが対象となります
+
+ConfluenceRepositoryConnector.Add=追加
+ConfluenceRepositoryConnector.AddSpace=スペース追加
+ConfluenceRepositoryConnector.Delete=削除
+ConfluenceRepositoryConnector.DeleteSpace=スペース削除 #
+ConfluenceRepositoryConnector.TypeInASpace=スペース名が空欄です
+
+ConfluenceRepositoryConnector.TypeSpec=ページ型の指定
+ConfluenceRepositoryConnector.TypePage=ページ
+ConfluenceRepositoryConnector.TypeBlog=ブログ
+ConfluenceRepositoryConnector.ProcessAttachments=添付ファイルを含む
\ No newline at end of file

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/confluence/editConfiguration_conf.js
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/confluence/editConfiguration_conf.js?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/confluence/editConfiguration_conf.js
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/authorities/authorities/confluence/editConfiguration_conf.js
Wed Oct 24 14:27:28 2018
@@ -21,7 +21,7 @@ function checkConfig()
 {
   if (editconnection.confluence_port.value != "" && !isInteger(editconnection.confluence_port.value))
   {
-    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ConfluenceAuthorityConnector.ConfPortMustBeAnInteger'))");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ConfluenceAuthorityConnector.PortMustBeAnInteger'))");
     editconnection.confluence_port.focus();
     return false;
   }

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editConfiguration_conf.js
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editConfiguration_conf.js?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editConfiguration_conf.js
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editConfiguration_conf.js
Wed Oct 24 14:27:28 2018
@@ -21,7 +21,7 @@ function checkConfig()
 {
   if (editconnection.confluence_port.value != "" && !isInteger(editconnection.confluence_port.value))
   {
-    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.ConfPortMustBeAnInteger'))");
+    alert("$Encoder.bodyJavascriptEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.PortMustBeAnInteger'))");
     editconnection.confluence_port.focus();
     return false;
   }

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editSpecification_confPages.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editSpecification_confPages.html?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editSpecification_confPages.html
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/editSpecification_confPages.html
Wed Oct 24 14:27:28 2018
@@ -27,15 +27,32 @@
     </td>
     <td class="value">
       <input type="checkbox" name="s${SeqNum}_process_attachments" value="true"
-      #if($PROCESS_ATTACHMENTS) checked 
+      #if($PROCESS_ATTACHMENTS == 'true') checked
       #end 
       />
     </td>
   </tr>
+
+  <tr>
+    <td class="description" colspan="2">
+        $Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypeSpec'))
+    </td>
+    <td class="value">
+      <input type="radio" name="s${SeqNum}_pagetype" value="page"
+      #if($PAGETYPE == 'page') checked
+      #end
+      ><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypePage'))</nobr></input>
+      <input type="radio" name="s${SeqNum}_pagetype" value="blogpost"
+      #if($PAGETYPE == 'blogpost') checked
+      #end
+      ><nobr>$Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypeBlog'))</nobr></input>
+    </td>
+  </tr>
 </table>
 
 #else
 
 <input type="hidden" name="s${SeqNum}_process_attachments" value="$PROCESS_ATTACHMENTS"/>
+<input type="hidden" name="s${SeqNum}_pagetype" value="$PAGETYPE"/>
 
 #end

Modified: manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/viewSpecification_conf.html
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/viewSpecification_conf.html?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/viewSpecification_conf.html
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/main/resources/org/apache/manifoldcf/crawler/connectors/confluence/viewSpecification_conf.html
Wed Oct 24 14:27:28 2018
@@ -43,4 +43,17 @@
       <nobr>$Encoder.bodyEscape($PROCESS_ATTACHMENTS)</nobr>
     </td>
   </tr>
+
+  <tr>
+    <td class="message" colspan="2">
+        $Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypeSpec'))
+    </td>
+    <td class="description">
+#if($PAGETYPE == 'blogpost')
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypeBlog'))</nobr>
+#else
+      <nobr>$Encoder.bodyEscape($ResourceBundle.getString('ConfluenceRepositoryConnector.TypePage'))</nobr>
+#end
+    </td>
+  </tr>
 </table>
\ No newline at end of file

Modified: manifoldcf/trunk/connectors/confluence/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/confluence/tests/ConfluenceConnectorTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/confluence/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/confluence/tests/ConfluenceConnectorTest.java?rev=1844778&r1=1844777&r2=1844778&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/confluence/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/confluence/tests/ConfluenceConnectorTest.java
(original)
+++ manifoldcf/trunk/connectors/confluence/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/confluence/tests/ConfluenceConnectorTest.java
Wed Oct 24 14:27:28 2018
@@ -64,7 +64,7 @@ public class ConfluenceConnectorTest {
 	public void setup() throws Exception{
 		connector = new ConfluenceRepositoryConnector();
 		connector.setConfluenceClient(client);
-		when(client.getPages(anyInt(), anyInt(), Mockito.any(Optional.class))).
+		when(client.getPages(anyInt(), anyInt(), Mockito.any(Optional.class), Mockito.any(Optional.class))).
 			thenReturn(new ConfluenceResponse<Page>(Collections.<Page>emptyList(), 0,
0, true));
 	}
 	
@@ -78,7 +78,7 @@ public class ConfluenceConnectorTest {
 
 		connector.addSeedDocuments(activities, spec, "", seedTime, BaseRepositoryConnector.JOBMODE_ONCEONLY);
 		// Verify it starts always at 0. Pagination configurable so anyInt(). Only one call because
isLast must be false
-		verify(client, times(1)).getPages(eq(0), anyInt(), Mockito.any(Optional.class));
+		verify(client, times(1)).getPages(eq(0), anyInt(), Mockito.any(Optional.class), Mockito.any(Optional.class));
 	}
 	
 	@SuppressWarnings("unchecked")
@@ -92,13 +92,13 @@ public class ConfluenceConnectorTest {
 		List<Page> pages = new ArrayList<Page>();
 		Page page = mock(Page.class);
 		pages.add(page);
-		when(client.getPages(anyInt(), anyInt(), Mockito.any(Optional.class))).
+		when(client.getPages(anyInt(), anyInt(), Mockito.any(Optional.class), Mockito.any(Optional.class))).
 			thenReturn(new ConfluenceResponse<Page>(pages, 0, 0, false)).
 			thenReturn(new ConfluenceResponse<Page>(Collections.<Page>emptyList(), 0,
0, true));
 		connector.addSeedDocuments(activities, spec, "", seedTime, BaseRepositoryConnector.JOBMODE_ONCEONLY);
 		verify(activities, times(1)).addSeedDocument(Mockito.anyString());
-		verify(client, times(1)).getPages(eq(0), anyInt(), Mockito.any(Optional.class));
-		verify(client, times(1)).getPages(eq(1), anyInt(), Mockito.any(Optional.class));
+		verify(client, times(1)).getPages(eq(0), anyInt(), Mockito.any(Optional.class), Mockito.any(Optional.class));
+		verify(client, times(1)).getPages(eq(1), anyInt(), Mockito.any(Optional.class), Mockito.any(Optional.class));
 	}
 	
 	@Test



Mime
View raw message