From commits-return-9781-archive-asf-public=cust-asf.ponee.io@manifoldcf.apache.org Mon Aug 6 07:40:35 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 543F8180627 for ; Mon, 6 Aug 2018 07:40:34 +0200 (CEST) Received: (qmail 93051 invoked by uid 500); 6 Aug 2018 05:40:33 -0000 Mailing-List: contact commits-help@manifoldcf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@manifoldcf.apache.org Delivered-To: mailing list commits@manifoldcf.apache.org Received: (qmail 93042 invoked by uid 99); 6 Aug 2018 05:40:32 -0000 Received: from Unknown (HELO svn01-us-west.apache.org) (209.188.14.144) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2018 05:40:32 +0000 Received: from svn01-us-west.apache.org (localhost [127.0.0.1]) by svn01-us-west.apache.org (ASF Mail Server at svn01-us-west.apache.org) with ESMTP id 3CF1D3A00A5 for ; Mon, 6 Aug 2018 05:40:32 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: svn commit: r1837476 - in /manifoldcf/trunk: ./ connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/ connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/ Date: Mon, 06 Aug 2018 05:40:31 -0000 To: commits@manifoldcf.apache.org From: kwright@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20180806054032.3CF1D3A00A5@svn01-us-west.apache.org> Author: kwright Date: Mon Aug 6 05:40:31 2018 New Revision: 1837476 URL: http://svn.apache.org/viewvc?rev=1837476&view=rev Log: Fix for CONNECTORS-1517. Modified: manifoldcf/trunk/CHANGES.txt manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_en_US.properties manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_es_ES.properties manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_fr_FR.properties manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_ja_JP.properties manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_zh_CN.properties Modified: manifoldcf/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/CHANGES.txt (original) +++ manifoldcf/trunk/CHANGES.txt Mon Aug 6 05:40:31 2018 @@ -3,6 +3,9 @@ $Id$ ======================= 2.11-dev ===================== +CONNECTORS-1517: Documentum mimetypes form didn't allow for no restrictions +(James Thomas, Karl Wright) + CONNECTORS-1520: Transformation connector registration and de-registration was broken due to early cut/paste error. (Mike Hugo) Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/DCTM/DCTM.java Mon Aug 6 05:40:31 2018 @@ -45,6 +45,7 @@ public class DCTM extends org.apache.man public static String CONFIG_PARAM_ATTRIBUTENAME = "attrname"; public static String CONFIG_PARAM_MAXLENGTH = "maxdoclength"; public static String CONFIG_PARAM_FORMAT = "mimetype"; + public static String CONFIG_PARAM_FORMAT_ALL = "mimetypeall"; public static String CONFIG_PARAM_PATHNAMEATTRIBUTE = "pathnameattribute"; public static String CONFIG_PARAM_PATHMAP = "pathmap"; public static String CONFIG_PARAM_FILTER = "filter"; @@ -1055,6 +1056,8 @@ public class DCTM extends org.apache.man StringBuilder strLocationsClause = new StringBuilder(); Map>>> tokenList = new HashMap>>>(); List contentList = null; + boolean seenAllMimeTypes = false; + boolean allMimeTypes = false; String maxSize = null; for (int i = 0; i < spec.getChildCount(); i++) @@ -1109,6 +1112,15 @@ public class DCTM extends org.apache.man } } } + else if (n.getType().equals(CONFIG_PARAM_FORMAT_ALL)) + { + seenAllMimeTypes = true; + String all = n.getAttributeValue("value"); + if (all.equals("true")) + { + allMimeTypes = true; + } + } else if (n.getType().equals(CONFIG_PARAM_FORMAT)) { String docType = n.getAttributeValue("value"); @@ -1153,27 +1165,28 @@ public class DCTM extends org.apache.man strDQLend.append(" AND r_content_size<=").append(maxSize); } - String[] dctmTypes = convertToDCTMTypes(contentList); - if (dctmTypes != null) + // If we don't even see the allmimetypes record, we emit no restriction + if (seenAllMimeTypes == true && allMimeTypes == false) { - if (dctmTypes.length == 0) - strDQLend.append(" AND 1<0"); - else - { - strDQLend.append(" AND a_content_type IN ("); - boolean commaNeeded = false; - for (String cType : dctmTypes) - { - if (commaNeeded) - strDQLend.append(","); - else - commaNeeded = true; - strDQLend.append(quoteDQLString(cType)); - } - strDQLend.append(")"); - } + String[] dctmTypes = convertToDCTMTypes(contentList); + if (dctmTypes == null || dctmTypes.length == 0) + strDQLend.append(" AND 1<0"); + else + { + strDQLend.append(" AND a_content_type IN ("); + boolean commaNeeded = false; + for (String cType : dctmTypes) + { + if (commaNeeded) + strDQLend.append(","); + else + commaNeeded = true; + strDQLend.append(quoteDQLString(cType)); + } + strDQLend.append(")"); + } } - + // End the clause for non-deleted documents strDQLend.append("))"); @@ -2926,6 +2939,8 @@ public class DCTM extends org.apache.man // First, build a hash map containing all the currently selected document types Set ctMap = null; + boolean seenAll = false; + boolean doAll = false; for (int i = 0; i < ds.getChildCount(); i++) { SpecificationNode sn = ds.getChild(i); @@ -2939,14 +2954,51 @@ public class DCTM extends org.apache.man ctMap.add(token); } } + else if (sn.getType().equals(CONFIG_PARAM_FORMAT_ALL)) + { + seenAll = true; + String value = sn.getAttributeValue("value"); + if (value.equals("true")) { + doAll = true; + } + } } + // Hidden variable so we know that the form was posted + out.print( +"\n" + ); + if (tabName.equals(Messages.getString(locale,"DCTM.ContentTypes")) && connectionSequenceNumber == actualSequenceNumber) { out.print( "\n"+ -" \n" +" \n"+ +" \n"+ +" \n"+ +" \n"+ +" \n"+ +" \n" + ); // Need to catch potential license exception here try { @@ -2959,7 +3011,7 @@ public class DCTM extends org.apache.man " \n"+ "


\n" ); + + // If _ALL record not even seen, do default thing + if (seenAll == false || doAll) + { + out.print( +" \n" + ); + } + else + { + out.print( +" \n" + ); + } + out.print( +" \n"+ +" "+Messages.getBodyString(locale,"DCTM.AllContentTypes")+"\n"+ +"

\n" ); - if (ctMap == null || ctMap.contains(strMimeType)) + if (ctMap != null && ctMap.contains(strMimeType)) { out.print( " \n" @@ -3007,6 +3059,10 @@ public class DCTM extends org.apache.man } else { + out.print( +"\n" + ); + if (ctMap != null) { for (String strMimeType : ctMap) @@ -3397,28 +3453,36 @@ public class DCTM extends org.apache.man } } - y = variableContext.getParameterValues(seqPrefix+"specmimetype"); - if (y != null) + if (variableContext.getParameter(seqPrefix+"specmimetype_posted") != null) { + String all = variableContext.getParameter(seqPrefix+"specmimetypeall"); + y = variableContext.getParameterValues(seqPrefix+"specmimetype"); // Delete all file specs first int i = 0; while (i < ds.getChildCount()) { SpecificationNode sn = ds.getChild(i); - if (sn.getType().equals(CONFIG_PARAM_FORMAT)) + if (sn.getType().equals(CONFIG_PARAM_FORMAT) || sn.getType().equals(CONFIG_PARAM_FORMAT_ALL)) ds.removeChild(i); else i++; } + + SpecificationNode n2 = new SpecificationNode(CONFIG_PARAM_FORMAT_ALL); + n2.setAttribute("value",(all!=null&&all.equals("true"))?"true":"false"); + ds.addChild(ds.getChildCount(),n2); // Loop through specs - i = 0; - while (i < y.length) + if (y != null) { - String fileType = y[i++]; - SpecificationNode node = new SpecificationNode(CONFIG_PARAM_FORMAT); - node.setAttribute("value",fileType); - ds.addChild(ds.getChildCount(),node); + i = 0; + while (i < y.length) + { + String fileType = y[i++]; + SpecificationNode node = new SpecificationNode(CONFIG_PARAM_FORMAT); + node.setAttribute("value",fileType); + ds.addChild(ds.getChildCount(),node); + } } } Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_en_US.properties URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_en_US.properties?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_en_US.properties (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_en_US.properties Mon Aug 6 05:40:31 2018 @@ -25,6 +25,7 @@ DCTM.WebtopBaseURL=Webtop Base URL DCTM.Parameters=Parameters: DCTM.Paths=Paths DCTM.DocumentTypes=Document Types +DCTM.AllContentTypes=No content type restriction DCTM.ContentTypes=Content Types DCTM.ContentLength=Content Length DCTM.Security=Security Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_es_ES.properties URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_es_ES.properties?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_es_ES.properties (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_es_ES.properties Mon Aug 6 05:40:31 2018 @@ -25,6 +25,7 @@ DCTM.WebtopBaseURL=URL base superior Web DCTM.Parameters=Parámetros: DCTM.Paths=Caminos DCTM.DocumentTypes=Tipos de documentos +DCTM.AllContentTypes=No content type restriction DCTM.ContentTypes=Tipos de contenido DCTM.ContentLength=contenido Longitud DCTM.Security=Seguridad Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_fr_FR.properties URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_fr_FR.properties?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_fr_FR.properties (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_fr_FR.properties Mon Aug 6 05:40:31 2018 @@ -25,6 +25,7 @@ DCTM.WebtopBaseURL=URL de base du Webtop DCTM.Parameters=Paramètres: DCTM.Paths=Chemins (Paths) DCTM.DocumentTypes=Types de Document +DCTM.AllContentTypes=No content type restriction DCTM.ContentTypes=Types de contenu DCTM.ContentLength=Longueur du contenu DCTM.Security=Securité Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_ja_JP.properties URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_ja_JP.properties?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_ja_JP.properties (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_ja_JP.properties Mon Aug 6 05:40:31 2018 @@ -25,6 +25,7 @@ DCTM.WebtopBaseURL=Webtopベーã� DCTM.Parameters=引数: DCTM.Paths=パス DCTM.DocumentTypes=文書タイプ +DCTM.AllContentTypes=No content type restriction DCTM.ContentTypes=コンテンツタイプ DCTM.ContentLength=コンテンツ長 DCTM.Security=セキュリティ Modified: manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_zh_CN.properties URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_zh_CN.properties?rev=1837476&r1=1837475&r2=1837476&view=diff ============================================================================== --- manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_zh_CN.properties (original) +++ manifoldcf/trunk/connectors/documentum/connector/src/main/native2ascii/org/apache/manifoldcf/crawler/connectors/DCTM/common_zh_CN.properties Mon Aug 6 05:40:31 2018 @@ -25,6 +25,7 @@ DCTM.WebtopBaseURL=Webtop基URL DCTM.Parameters=参数: DCTM.Paths=路径 DCTM.DocumentTypes=文档类型 +DCTM.AllContentTypes=No content type restriction DCTM.ContentTypes=内容类型 DCTM.ContentLength=内容长度 DCTM.Security=安全