manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From piergior...@apache.org
Subject svn commit: r1705809 - in /manifoldcf/trunk: ./ connectors/alfresco-webscript/ connectors/cmis/ connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler...
Date Tue, 29 Sep 2015 08:05:41 GMT
Author: piergiorgio
Date: Tue Sep 29 08:05:40 2015
New Revision: 1705809

URL: http://svn.apache.org/viewvc?rev=1705809&view=rev
Log:
Indexing all properties fetched with the cmis query (CONNECTORS-1235)
Upgrade the CMIS Connector to OpenCMIS 0.13.0 (CONNECTORS-1237)

Added:
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java   (with props)
    manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java   (with props)
Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/build.xml
    manifoldcf/trunk/connectors/alfresco-webscript/pom.xml
    manifoldcf/trunk/connectors/cmis/build.xml
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
    manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnectorUtils.java
    manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseITHSQLDB.java
    manifoldcf/trunk/connectors/cmis/pom.xml
    manifoldcf/trunk/framework/jetty-runner/src/main/resources/connectors.xml

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Tue Sep 29 08:05:40 2015
@@ -3,6 +3,12 @@ $Id$
 
 ======================= 2.3-dev =====================
 
+CONNECTORS-1237: Upgrade the CMIS Connector to OpenCMIS 0.13.0
+(Piergiorgio Lucidi)
+
+CONNECTORS-1235: Indexing all properties fetched with the cmis query
+(Piergiorgio Lucidi, Christian Tiralosi, Deanna Delapasse, Elisa Croci)
+
 CONNECTORS-1244: Add support for LDAPS and TLS to LDAP
 authority connector.
 (Karl Wright)

Modified: manifoldcf/trunk/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/build.xml?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/build.xml (original)
+++ manifoldcf/trunk/build.xml Tue Sep 29 08:05:40 2015
@@ -1710,7 +1710,7 @@ Use Apache Forrest version forrest-0.9-d
             <param name="artifact-type" value="jar"/>
         </antcall>
     </target>
-	
+  
     <target name="download-jira-client">
         <mkdir dir="lib"/>
         <antcall target="download-via-maven">
@@ -2297,7 +2297,7 @@ Use Apache Forrest version forrest-0.9-d
             <param name="artifact-type" value="jar"/>
         </antcall>
     </target>
-	
+  
     <target name="make-core-deps" depends="download-joda-time,download-aws-sdk,download-resteasy,download-jsoup,download-mockito,download-alfresco-webscript-plugin,download-alfresco-indexer-client,download-mongo-java-driver,download-jira-client,download-google-api-client,download-dropbox-client,download-solrj,download-zookeeper,download-httpcomponents,download-json,download-hsqldb,download-xerces,download-commons,download-elasticsearch-plugin,download-solr-plugins,download-sharepoint-plugins,download-jstl,download-xmlgraphics-commons,download-woodstox,download-xmlsec,download-xml-apis,download-wss4j,download-velocity,download-streambuffer,download-stax,download-servlet-api,download-xml-resolver,download-osgi,download-opensaml,download-mimepull,download-mail,download-log4j,download-junit,download-jaxws,download-glassfish,download-jaxb,download-tomcat,download-h2,download-h2-support,download-geronimo-specs,download-fop,download-postgresql,download-axis,download-saaj,download-wsdl4j,do
 wnload-castor,download-jetty,download-slf4j,download-xalan,download-activation,download-avalon-framework,download-poi,download-chemistry,download-ecj,download-hadoop,download-htrace,download-protobuf,download-tika,download-jackson">
         <copy todir="lib">
             <fileset dir="lib-license" includes="*.txt"/>

Modified: manifoldcf/trunk/connectors/alfresco-webscript/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/alfresco-webscript/pom.xml?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/alfresco-webscript/pom.xml (original)
+++ manifoldcf/trunk/connectors/alfresco-webscript/pom.xml Tue Sep 29 08:05:40 2015
@@ -247,7 +247,7 @@
         <dependency>
             <groupId>org.apache.chemistry.opencmis</groupId>
             <artifactId>chemistry-opencmis-client-impl</artifactId>
-            <version>0.10.0</version>
+            <version>0.13.0</version>
             <scope>test</scope>
         </dependency>
         <dependency>

Modified: manifoldcf/trunk/connectors/cmis/build.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/build.xml?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/build.xml (original)
+++ manifoldcf/trunk/connectors/cmis/build.xml Tue Sep 29 08:05:40 2015
@@ -30,7 +30,7 @@
 
     <import file="${mcf-dist}/connector-build.xml"/>
     
-    <property name="chemistry.version" value="0.11.0"/>
+    <property name="chemistry.version" value="0.13.0"/>
     
     <target name="download-dependencies">
         <property name="chemistry-package" value="org/apache/chemistry/opencmis"/>
@@ -67,6 +67,7 @@
             <include name="resolver*.jar"/>
             <include name="org.osgi.core*.jar"/>
             <include name="commons-lang*.jar"/>
+        	  <include name="joda*.jar"/>
         </fileset>
     </path>
 
@@ -83,6 +84,7 @@
                 <include name="mimepull*.jar"/>
                 <include name="resolver*.jar"/>
                 <include name="org.osgi.core*.jar"/>
+            	  <include name="joda*.jar"/>
             </fileset>
         </copy>
     </target>

Modified: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java (original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnector.java Tue Sep 29 08:05:40 2015
@@ -72,7 +72,7 @@ import org.apache.manifoldcf.crawler.sys
 
 /**
  * This is the "repository connector" for a CMIS-compliant repository.
- * 
+ *
  * @author Piergiorgio Lucidi
  */
 public class CmisRepositoryConnector extends BaseRepositoryConnector {
@@ -88,11 +88,11 @@ public class CmisRepositoryConnector ext
       "yyyy-MM-dd'T'HH:mm:ssZ");
 
   // Tab name properties
-  
+
   private static final String CMIS_SERVER_TAB_PROPERTY = "CmisRepositoryConnector.Server";
   private static final String CMIS_QUERY_TAB_PROPERTY = "CmisRepositoryConnector.CMISQuery";
 
-  
+
   // Template names
 
     /** Forward to the javascript to check the configuration parameters */
@@ -103,17 +103,17 @@ public class CmisRepositoryConnector ext
 
   /** Forward to the javascript to check the specification parameters for the job */
   private static final String EDIT_SPEC_HEADER_FORWARD = "editSpecification.js";
-  
+
   /** Forward to the template to edit the configuration parameters for the job */
   private static final String EDIT_SPEC_FORWARD_CMISQUERY = "editSpecification_CMISQuery.html";
-  
+
   /** Forward to the HTML template to view the configuration parameters */
   private static final String VIEW_CONFIG_FORWARD = "viewConfiguration.html";
-  
+
   /** Forward to the template to view the specification parameters for the job */
   private static final String VIEW_SPEC_FORWARD = "viewSpecification.html";
-  
-  
+
+
   /**
    * CMIS Session handle
    */
@@ -121,19 +121,19 @@ public class CmisRepositoryConnector ext
 
   protected String username = null;
   protected String password = null;
-  
+
   /** Endpoint protocol */
   protected String protocol = null;
-  
+
   /** Endpoint server name */
   protected String server = null;
-  
+
   /** Endpoint port */
   protected String port = null;
-  
+
   /** Endpoint context path of the Alfresco webapp */
   protected String path = null;
-  
+
   protected String repositoryId = null;
   protected String binding = null;
 
@@ -144,7 +144,7 @@ public class CmisRepositoryConnector ext
 
   protected static final long timeToRelease = 300000L;
   protected long lastSessionFetch = -1L;
-  
+
   /**
    * Constructor
    */
@@ -162,7 +162,7 @@ public class CmisRepositoryConnector ext
     return MODEL_CHAINED_ADD_CHANGE;
   }
 
-  /** 
+  /**
    * Return the list of activities that this connector supports (i.e. writes into the log).
    * @return the list.
    */
@@ -204,7 +204,7 @@ public class CmisRepositoryConnector ext
         parameters.put(SessionParameter.PASSWORD, password);
 
         String endpoint = protocol+"://"+server+":"+port+path;
-        
+
         // connection settings
         if(CmisConfig.BINDING_ATOM_VALUE.equals(binding)){
           //AtomPub protocol
@@ -237,20 +237,20 @@ public class CmisRepositoryConnector ext
             Logging.connectors.error("CMIS: Error during getting CMIS repositories. Please check the endpoint parameters: " + e.getMessage(), e);
             this.exception = e;
           }
-          
+
         } else {
 
           // get a session from the repository specified in the
           // configuration with its own ID
           parameters.put(SessionParameter.REPOSITORY_ID, repositoryId);
-          
+
           try {
             session = factory.createSession(parameters);
           } catch (Exception e) {
             Logging.connectors.error("CMIS: Error during the creation of the new session. Please check the endpoint parameters: " + e.getMessage(), e);
             this.exception = e;
           }
-        
+
         }
 
       } catch (Throwable e) {
@@ -308,7 +308,7 @@ public class CmisRepositoryConnector ext
 
   }
 
-  /** 
+  /**
    * Close the connection.  Call this before discarding the connection.
    */
   @Override
@@ -376,7 +376,7 @@ public class CmisRepositoryConnector ext
     server = params.getParameter(CmisConfig.SERVER_PARAM);
     port = params.getParameter(CmisConfig.PORT_PARAM);
     path = params.getParameter(CmisConfig.PATH_PARAM);
-    
+
     binding = params.getParameter(CmisConfig.BINDING_PARAM);
     if (StringUtils.isNotEmpty(params.getParameter(CmisConfig.REPOSITORY_ID_PARAM)))
       repositoryId = params.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
@@ -401,11 +401,11 @@ public class CmisRepositoryConnector ext
   protected void getSession() throws ManifoldCFException, ServiceInterruption {
     if (session == null) {
       // Check for parameter validity
-      
+
       if (StringUtils.isEmpty(binding))
         throw new ManifoldCFException("Parameter " + CmisConfig.BINDING_PARAM
             + " required but not set");
-      
+
       if (StringUtils.isEmpty(username))
         throw new ManifoldCFException("Parameter " + CmisConfig.USERNAME_PARAM
             + " required but not set");
@@ -422,15 +422,15 @@ public class CmisRepositoryConnector ext
       if (StringUtils.isEmpty(protocol))
         throw new ManifoldCFException("Parameter " + CmisConfig.PROTOCOL_PARAM
             + " required but not set");
-      
+
       if (StringUtils.isEmpty(server))
         throw new ManifoldCFException("Parameter " + CmisConfig.SERVER_PARAM
             + " required but not set");
-      
+
       if (StringUtils.isEmpty(port))
         throw new ManifoldCFException("Parameter " + CmisConfig.PORT_PARAM
             + " required but not set");
-      
+
       if (StringUtils.isEmpty(path))
         throw new ManifoldCFException("Parameter " + CmisConfig.PATH_PARAM
             + " required but not set");
@@ -572,7 +572,7 @@ public class CmisRepositoryConnector ext
     }
   }
 
-  /** 
+  /**
    * This method is periodically called for all connectors that are connected but not
    * in active use.
    */
@@ -689,10 +689,10 @@ public class CmisRepositoryConnector ext
 
     return "";
   }
-  
-  
 
-  /** 
+
+
+  /**
    * Get the maximum number of documents to amalgamate together into one batch, for this connector.
    * @return the maximum number. 0 indicates "unlimited".
    */
@@ -703,7 +703,7 @@ public class CmisRepositoryConnector ext
 
   /**
    * Return the list of relationship types that this connector recognizes.
-   * 
+   *
    * @return the list.
    */
   @Override
@@ -714,7 +714,7 @@ public class CmisRepositoryConnector ext
   /**
    * Read the content of a resource, replace the variable ${PARAMNAME} with the
    * value and copy it to the out.
-   * 
+   *
    * @param resName
    * @param out
    * @throws ManifoldCFException
@@ -738,7 +738,7 @@ public class CmisRepositoryConnector ext
     String path = parameters.getParameter(CmisConfig.PATH_PARAM);
     String repositoryId = parameters.getParameter(CmisConfig.REPOSITORY_ID_PARAM);
     String binding = parameters.getParameter(CmisConfig.BINDING_PARAM);
-      
+
     if(username == null)
       username = StringUtils.EMPTY;
     if(password == null)
@@ -757,7 +757,7 @@ public class CmisRepositoryConnector ext
       repositoryId = StringUtils.EMPTY;
     if(binding == null)
       binding = CmisConfig.BINDING_ATOM_VALUE;
-      
+
     newMap.put(CmisConfig.USERNAME_PARAM, username);
     newMap.put(CmisConfig.PASSWORD_PARAM, password);
     newMap.put(CmisConfig.PROTOCOL_PARAM, protocol);
@@ -767,14 +767,14 @@ public class CmisRepositoryConnector ext
     newMap.put(CmisConfig.REPOSITORY_ID_PARAM, repositoryId);
     newMap.put(CmisConfig.BINDING_PARAM, binding);
   }
-  
+
   /**
    * View configuration. This method is called in the body section of the
    * connector's view configuration page. Its purpose is to present the
    * connection information to the user. The coder can presume that the HTML that
    * is output from this configuration will be within appropriate <html> and
    * <body> tags.
-   * 
+   *
    * @param threadContext
    *          is the local thread context.
    * @param out
@@ -787,7 +787,7 @@ public class CmisRepositoryConnector ext
   public void viewConfiguration(IThreadContext threadContext, IHTTPOutput out,
       Locale locale, ConfigParams parameters) throws ManifoldCFException, IOException {
     Map<String,String> paramMap = new HashMap<String,String>();
-  
+
     // Fill in map from each tab
     fillInServerConfigurationMap(paramMap, out, parameters);
 
@@ -800,7 +800,7 @@ public class CmisRepositoryConnector ext
    * section of the connector's configuration page. Its purpose is to add the
    * required tabs to the list, and to output any javascript methods that might
    * be needed by the configuration editing HTML.
-   * 
+   *
    * @param threadContext
    *          is the local thread context.
    * @param out
@@ -842,7 +842,7 @@ public class CmisRepositoryConnector ext
     // Fill in the parameters
     fillInServerConfigurationMap(paramMap, out, parameters);
     outputResource(EDIT_CONFIG_FORWARD_SERVER, out, locale, paramMap);
-  
+
   }
 
   /**
@@ -851,7 +851,7 @@ public class CmisRepositoryConnector ext
    * data for a connection has been posted. Its purpose is to gather form
    * information and modify the configuration parameters accordingly. The name
    * of the posted form is "editconnection".
-   * 
+   *
    * @param threadContext
    *          is the local thread context.
    * @param variableContext
@@ -868,11 +868,11 @@ public class CmisRepositoryConnector ext
   public String processConfigurationPost(IThreadContext threadContext,
       IPostParameters variableContext, ConfigParams parameters)
       throws ManifoldCFException {
-    
+
     String binding = variableContext.getParameter(CmisConfig.BINDING_PARAM);
     if (binding != null)
       parameters.setParameter(CmisConfig.BINDING_PARAM, binding);
-    
+
     String username = variableContext.getParameter(CmisConfig.USERNAME_PARAM);
     if (username != null)
       parameters.setParameter(CmisConfig.USERNAME_PARAM, username);
@@ -885,22 +885,22 @@ public class CmisRepositoryConnector ext
     if (protocol != null) {
       parameters.setParameter(CmisConfig.PROTOCOL_PARAM, protocol);
     }
-    
+
     String server = variableContext.getParameter(CmisConfig.SERVER_PARAM);
     if (server != null && !StringUtils.contains(server, '/')) {
       parameters.setParameter(CmisConfig.SERVER_PARAM, server);
     }
-    
+
     String port = variableContext.getParameter(CmisConfig.PORT_PARAM);
     if (port != null){
       try {
         Integer.parseInt(port);
         parameters.setParameter(CmisConfig.PORT_PARAM, port);
       } catch (NumberFormatException e) {
-        
+
       }
     }
-    
+
     String path = variableContext.getParameter(CmisConfig.PATH_PARAM);
     if (path != null) {
       parameters.setParameter(CmisConfig.PATH_PARAM, path);
@@ -944,13 +944,13 @@ public class CmisRepositoryConnector ext
   public void viewSpecification(IHTTPOutput out, Locale locale, Specification ds,
     int connectionSequenceNumber)
     throws ManifoldCFException, IOException {
-  
+
     Map<String,String> paramMap = new HashMap<String,String>();
     paramMap.put("SeqNum", Integer.toString(connectionSequenceNumber));
 
     // Fill in the map with data from all tabs
     fillInCMISQuerySpecificationMap(paramMap, ds);
-  
+
     outputResource(VIEW_SPEC_FORWARD, out, locale, paramMap);
   }
 
@@ -1036,7 +1036,7 @@ public class CmisRepositoryConnector ext
     int connectionSequenceNumber, List<String> tabsArray)
     throws ManifoldCFException, IOException {
     tabsArray.add(Messages.getString(locale,CMIS_QUERY_TAB_PROPERTY));
-  
+
     Map<String,String> paramMap = new HashMap<String,String>();
     paramMap.put("SeqNum", Integer.toString(connectionSequenceNumber));
 
@@ -1077,17 +1077,17 @@ public class CmisRepositoryConnector ext
 
 
     for (String documentIdentifier : documentIdentifiers) {
-      
+
       if (Logging.connectors.isDebugEnabled())
         Logging.connectors.debug("CMIS: Processing document identifier '"
             + documentIdentifier + "'");
 
       getSession();
-      
+
       // Load the object.  If this fails, it has been deleted.
       CmisObject cmisObject;
       try {
-        cmisObject = session.getObject(documentIdentifier);
+       cmisObject = session.getObject(documentIdentifier);
       } catch (CmisObjectNotFoundException e) {
         cmisObject = null;
       }
@@ -1097,9 +1097,9 @@ public class CmisRepositoryConnector ext
         activities.deleteDocument(documentIdentifier);
         continue;
       }
-      
+
       String versionString;
-      
+
       if (cmisObject.getBaseType().getId().equals(CMIS_DOCUMENT_BASE_TYPE)) {
         Document document = (Document) cmisObject;
 
@@ -1114,7 +1114,10 @@ public class CmisRepositoryConnector ext
         }
         if (isCurrentVersion) {
           //System.out.println(" is latest version");
-          versionString = documentIdentifier + ":" + cmisQuery;
+          //versionString = documentIdentifier + ":" + cmisQuery;
+      // take into account of the last modification date
+            long lmdSeconds = document.getLastModificationDate().getTimeInMillis();
+            versionString = documentIdentifier + lmdSeconds + ":" + cmisQuery;
         } else {
           //System.out.println(" is NOT latest vrersion");
           activities.deleteDocument(documentIdentifier);
@@ -1125,7 +1128,7 @@ public class CmisRepositoryConnector ext
         //System.out.println(" is folder");
         versionString = StringUtils.EMPTY;
       }
-      
+
       if (versionString.length() == 0 || activities.checkDocumentNeedsReindexing(documentIdentifier,versionString)) {
         // Index this document
         String errorCode = null;
@@ -1149,7 +1152,7 @@ public class CmisRepositoryConnector ext
             // content ingestion
 
             Document document = (Document) cmisObject;
-            
+
             Date createdDate = document.getCreationDate().getTime();
             Date modifiedDate = document.getLastModificationDate().getTime();
             long fileLength = document.getContentStreamLength();
@@ -1157,7 +1160,7 @@ public class CmisRepositoryConnector ext
             String mimeType = document.getContentStreamMimeType();
             //documentURI
             String documentURI = CmisRepositoryConnectorUtils.getDocumentURL(document, session);
-            
+
             // Do any filtering (which will save us work)
             if (!activities.checkURLIndexable(documentURI))
             {
@@ -1166,7 +1169,7 @@ public class CmisRepositoryConnector ext
               errorDesc = "Excluding due to URL ('"+documentURI+"')";
               continue;
             }
-            
+
             if (!activities.checkMimeTypeIndexable(mimeType))
             {
               activities.noDocument(documentIdentifier,versionString);
@@ -1182,7 +1185,7 @@ public class CmisRepositoryConnector ext
               errorDesc = "Excluding due to length ("+fileLength+")";
               continue;
             }
-            
+
             if (!activities.checkDateIndexable(modifiedDate))
             {
               activities.noDocument(documentIdentifier,versionString);
@@ -1190,13 +1193,13 @@ public class CmisRepositoryConnector ext
               errorDesc = "Excluding due to date ("+modifiedDate+")";
               continue;
             }
-            
+
             RepositoryDocument rd = new RepositoryDocument();
             rd.setFileName(fileName);
             rd.setMimeType(mimeType);
             rd.setCreatedDate(createdDate);
             rd.setModifiedDate(modifiedDate);
-                
+
             InputStream is;
             try {
               if (fileLength > 0)
@@ -1208,7 +1211,7 @@ public class CmisRepositoryConnector ext
               activities.deleteDocument(documentIdentifier);
               continue;
             }
-              
+
             try {
               //binary
               if(is != null) {
@@ -1217,110 +1220,13 @@ public class CmisRepositoryConnector ext
                 rd.setBinary(new NullInputStream(0),0);
               }
 
-              //properties
-              List<Property<?>> properties = document.getProperties();
-              String id = StringUtils.EMPTY;
-              for (Property<?> property : properties) {
-                String propertyId = property.getId();
-                  
-                if(CmisRepositoryConnectorUtils.existsInSelectClause(cmisQuery, propertyId)){
-                    
-                  if (propertyId.endsWith(Constants.PARAM_OBJECT_ID)) {
-                    id = (String) property.getValue();
-        
-                    if (property.getValue() !=null 
-                        || property.getValues() != null) {
-                      PropertyType propertyType = property.getType();
-          
-                      switch (propertyType) {
-          
-                      case STRING:
-                      case ID:
-                      case URI:
-                      case HTML:
-                        if(property.isMultiValued()){
-                          List<String> htmlPropertyValues = (List<String>) property.getValues();
-                          for (String htmlPropertyValue : htmlPropertyValues) {
-                            rd.addField(propertyId, htmlPropertyValue);
-                          }
-                        } else {
-                          String stringValue = (String) property.getValue();
-                          if(StringUtils.isNotEmpty(stringValue)){
-                            rd.addField(propertyId, stringValue);
-                          }
-                        }
-                        break;
-               
-                      case BOOLEAN:
-                        if(property.isMultiValued()){
-                          List<Boolean> booleanPropertyValues = (List<Boolean>) property.getValues();
-                          for (Boolean booleanPropertyValue : booleanPropertyValues) {
-                            rd.addField(propertyId, booleanPropertyValue.toString());
-                          }
-                        } else {
-                          Boolean booleanValue = (Boolean) property.getValue();
-                          if(booleanValue!=null){
-                            rd.addField(propertyId, booleanValue.toString());
-                          }
-                        }
-                        break;
-          
-                      case INTEGER:
-                        if(property.isMultiValued()){
-                          List<BigInteger> integerPropertyValues = (List<BigInteger>) property.getValues();
-                          for (BigInteger integerPropertyValue : integerPropertyValues) {
-                            rd.addField(propertyId, integerPropertyValue.toString());
-                          }
-                        } else {
-                          BigInteger integerValue = (BigInteger) property.getValue();
-                          if(integerValue!=null){
-                            rd.addField(propertyId, integerValue.toString());
-                          }
-                        }
-                        break;
-          
-                      case DECIMAL:
-                        if(property.isMultiValued()){
-                          List<BigDecimal> decimalPropertyValues = (List<BigDecimal>) property.getValues();
-                          for (BigDecimal decimalPropertyValue : decimalPropertyValues) {
-                            rd.addField(propertyId, decimalPropertyValue.toString());
-                          }
-                        } else {
-                          BigDecimal decimalValue = (BigDecimal) property.getValue();
-                          if(decimalValue!=null){
-                            rd.addField(propertyId, decimalValue.toString());
-                          }
-                        }
-                        break;
-          
-                      case DATETIME:
-                        if(property.isMultiValued()){
-                          List<GregorianCalendar> datePropertyValues = (List<GregorianCalendar>) property.getValues();
-                          for (GregorianCalendar datePropertyValue : datePropertyValues) {
-                            rd.addField(propertyId,
-                                ISO8601_DATE_FORMATTER.format(datePropertyValue.getTime()));
-                          }
-                        } else {
-                          GregorianCalendar dateValue = (GregorianCalendar) property.getValue();
-                          if(dateValue!=null){
-                            rd.addField(propertyId, ISO8601_DATE_FORMATTER.format(dateValue.getTime()));
-                          }
-                        }
-                        break;
-          
-                      default:
-                        break;
-                      }
-                    }
-                      
-                  }
-                  
-                }
-              }
-              
+              //modify the query in order to get the cmis:objectId field
+              String modifiedQuery = CmisRepositoryConnectorUtils.getCmisQueryWithObjectId(cmisQuery);
+
+              //filter the fields selected in the query
+              CmisRepositoryConnectorUtils.addValuesOfProperties(cmisObject.getProperties(), rd, modifiedQuery);
               //ingestion
-                
-                
+
               try {
                 activities.ingestDocumentWithException(documentIdentifier, versionString, documentURI, rd);
                 fileLengthLong = new Long(fileLength);
@@ -1330,7 +1236,9 @@ public class CmisRepositoryConnector ext
                 errorDesc = e.getMessage();
                 handleIOException(e, "reading file input stream");
               }
-            } finally {
+            } catch (Exception ecc) {
+               ecc.printStackTrace();
+              } finally {
               try {
                 if(is!=null){
                   is.close();
@@ -1358,7 +1266,7 @@ public class CmisRepositoryConnector ext
         }
       }
     }
-    
+
   }
 
   protected static void handleIOException(IOException e, String context) throws ManifoldCFException, ServiceInterruption {
@@ -1373,4 +1281,4 @@ public class CmisRepositoryConnector ext
     }
   }
 
-}
+}
\ No newline at end of file

Modified: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnectorUtils.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnectorUtils.java?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnectorUtils.java (original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/CmisRepositoryConnectorUtils.java Tue Sep 29 08:05:40 2015
@@ -19,80 +19,117 @@
 package org.apache.manifoldcf.crawler.connectors.cmis;
 
 import java.lang.reflect.Method;
+import java.math.BigDecimal;
+import java.math.BigInteger;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 import java.util.StringTokenizer;
-
 import org.apache.chemistry.opencmis.client.api.Document;
+import org.apache.chemistry.opencmis.client.api.Property;
 import org.apache.chemistry.opencmis.client.api.Session;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService;
 import org.apache.chemistry.opencmis.client.bindings.spi.atompub.AtomPubParser;
+import org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition;
+import org.apache.chemistry.opencmis.commons.enums.Cardinality;
+import org.apache.chemistry.opencmis.commons.enums.PropertyType;
+import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.StringUtils;
-import org.apache.manifoldcf.crawler.system.Logging;
+import org.apache.manifoldcf.agents.interfaces.RepositoryDocument;
 import org.apache.manifoldcf.core.interfaces.ManifoldCFException;
+import org.apache.manifoldcf.crawler.system.Logging;
+import org.joda.time.format.DateTimeFormatter;
+import org.joda.time.format.ISODateTimeFormat;
 
 /**
- * 
+ *
  * @author Piergiorgio Lucidi
  *
  */
 public class CmisRepositoryConnectorUtils {
 
-  private static final String LOAD_LINK_METHOD_NAME = "loadLink";
-  private static final String FROM_TOKEN = "from";
-  private static final String SEP = " ";
-  private static final String SELECT_STAR_CLAUSE = "select *";
-  private static final String OBJECT_ID_TERM = "cmis:objectId,";
-  private static final String SELECT_CLAUSE_TERM_SEP = ",";
-  
-  public static final String getDocumentURL(final Document document, final Session session)
-    throws ManifoldCFException {
-    String link = null;
-    try {
-        Method loadLink = AbstractAtomPubService.class.getDeclaredMethod(LOAD_LINK_METHOD_NAME, 
-            new Class[] { String.class, String.class, String.class, String.class });
-        
-        loadLink.setAccessible(true);
-        
-        link = (String) loadLink.invoke(session.getBinding().getObjectService(), session.getRepositoryInfo().getId(),
-            document.getId(), AtomPubParser.LINK_REL_CONTENT, null);
-    } catch (Exception e) {
-      Logging.connectors.error(
-          "CMIS: Error during getting the content stream url: "
-              + e.getMessage(), e);
-      throw new ManifoldCFException(e.getMessage(),e);
-    }
-
-    return link;
-  }
-  
-  /**
-   * Utility method to consider the objectId whenever it is not present in the select clause
-   * @param cmisQuery
-   * @return the cmisQuery with the cmis:objectId property added in the select clause
-   */
-  public static String getCmisQueryWithObjectId(String cmisQuery){
-    String cmisQueryResult = StringUtils.EMPTY;
-    String selectClause = getSelectClause(cmisQuery);
-    if(selectClause.equalsIgnoreCase(SELECT_STAR_CLAUSE)){
-      cmisQueryResult = cmisQuery;
-    } else {
-      //get the second term and add the cmis:objectId term
-      StringTokenizer selectClauseTokenized = new StringTokenizer(selectClause.trim());
-      boolean firstTermSelectClause = true;
-      String secondTerm = StringUtils.EMPTY;
-      while(selectClauseTokenized.hasMoreElements()){
-          String term = selectClauseTokenized.nextToken();
-          if(firstTermSelectClause){
-            firstTermSelectClause = false;
-          } else if(!firstTermSelectClause){
-            //this is the second term
-            secondTerm = term;
-            break;
-          }
-      }
-      cmisQueryResult = StringUtils.replaceOnce(cmisQuery, secondTerm, OBJECT_ID_TERM + secondTerm);
+    private static final String LOAD_LINK_METHOD_NAME = "loadLink";
+    private static final String FROM_TOKEN = "from";
+    private static final String SEP = " ";
+    private static final String SELECT_STAR_CLAUSE = "select *";
+    private static final String OBJECT_ID_PROPERTY = "cmis:objectId";
+    private static final String OBJECT_ID_TERM = OBJECT_ID_PROPERTY + ",";
+    private static final String SELECT_CLAUSE_TERM_SEP = ",";
+    private static final String SELECT_PREFIX = "select ";
+    private final static String TOKENIZER_SEP = ",\n\t";
+
+    public static final String getDocumentURL(final Document document, final Session session)
+            throws ManifoldCFException {
+        String link = null;
+        try {
+            Method loadLink = AbstractAtomPubService.class.getDeclaredMethod(LOAD_LINK_METHOD_NAME,
+                    new Class[]{String.class, String.class, String.class, String.class});
+
+            loadLink.setAccessible(true);
+
+            link = (String) loadLink.invoke(session.getBinding().getObjectService(), session.getRepositoryInfo().getId(),
+                    document.getId(), AtomPubParser.LINK_REL_CONTENT, null);
+        } catch (Exception e) {
+            Logging.connectors.error(
+                    "CMIS: Error during getting the content stream url: "
+                    + e.getMessage(), e);
+            throw new ManifoldCFException(e.getMessage(), e);
+        }
+
+        return link;
+    }
+
+    /**
+     * Utility method to consider the objectId whenever it is not present in the select clause
+     * @param cmisQuery
+     * @return the cmisQuery with the cmis:objectId property added in the select clause
+     */
+    public static String getCmisQueryWithObjectId(String cmisQuery) {
+        String cmisQueryResult = StringUtils.EMPTY;
+        String selectClause = getSelectClause(cmisQuery);
+        if (selectClause.equalsIgnoreCase(SELECT_STAR_CLAUSE)) {
+            cmisQueryResult = cmisQuery;
+        } else {
+            //get the select term and add the cmis:objectId term or prefix.cmis:objectId
+            StringTokenizer selectClauseTokenized = new StringTokenizer(selectClause.trim());
+            boolean firstTermSelectClause = true;
+            String selectTerm = StringUtils.EMPTY;
+            String prefix = StringUtils.EMPTY;
+            boolean foundObjIdClause = false;
+            boolean foundPrefixClause = false;
+            while (selectClauseTokenized.hasMoreElements()) {
+                String term = selectClauseTokenized.nextToken();
+                if (firstTermSelectClause) {
+                    selectTerm = term;
+                    firstTermSelectClause = false;
+                } else {
+                    if (term.contains(OBJECT_ID_PROPERTY)){
+                        foundObjIdClause = true;
+                        cmisQueryResult = cmisQuery;
+                        break;
+                    }
+                    //if a term use a prefix table, get the prefix
+                    if (!foundPrefixClause && term.contains(".")){
+                        int i = term.indexOf(".");
+                        prefix = term.substring(0,i);
+                        foundPrefixClause = true;
+                    }
+                }
+            }
+            // if the cmis:objectId term is not found, add it
+            if (!foundObjIdClause) {
+                String toReplace = selectTerm + " ";
+                if (foundPrefixClause) {
+                    toReplace += prefix + "." + OBJECT_ID_TERM;
+                } else {
+                    toReplace += OBJECT_ID_TERM;
+                }
+                cmisQueryResult = StringUtils.replaceOnce(cmisQuery, selectTerm, toReplace);
+            }
+        }
+        return cmisQueryResult;
     }
-    return cmisQueryResult;
-  }
 
   /**
    * Utility method to understand if a property must be indexed or not
@@ -101,53 +138,245 @@ public class CmisRepositoryConnectorUtil
    * @return TRUE if the property is included in the select clause of the query, otherwise it will return FALSE
    */
   public static boolean existsInSelectClause(String cmisQuery, String propertyId) {
-    String selectClause = getSelectClause(cmisQuery);
-    if(selectClause.startsWith(SELECT_STAR_CLAUSE)){
-      return true;
-    } else {
-      StringTokenizer cmisQueryTokenized = new StringTokenizer(cmisQuery.trim());
-      while(cmisQueryTokenized.hasMoreElements()){
-          String term = cmisQueryTokenized.nextToken();
-          if(!term.equalsIgnoreCase(FROM_TOKEN)){
-            if(term.equalsIgnoreCase(propertyId)){
-              return true;
-            } else if(StringUtils.contains(term, SELECT_CLAUSE_TERM_SEP)){
-              //in this case means that we have: select cmis:objectId,cmis:name from ...
-              StringTokenizer termsTokenized = new StringTokenizer(term, SELECT_CLAUSE_TERM_SEP);
-              while(termsTokenized.hasMoreElements()){
-                String termTokenized = termsTokenized.nextToken().trim();
-                if(termTokenized.equalsIgnoreCase(propertyId)){
-                  return true;
+        String selectClause = getSelectClause(cmisQuery);
+        if (selectClause.toLowerCase().startsWith(SELECT_STAR_CLAUSE)) {
+            return true;
+        } else {
+            StringTokenizer cmisQueryTokenized = new StringTokenizer(cmisQuery.trim());
+            while (cmisQueryTokenized.hasMoreElements()) {
+                String term = cmisQueryTokenized.nextToken();
+                if (!term.equalsIgnoreCase(FROM_TOKEN)) {
+                    if (term.equalsIgnoreCase(propertyId)) {
+                        return true;
+                    } else if (StringUtils.contains(term, SELECT_CLAUSE_TERM_SEP)) {
+                        //in this case means that we have: select cmis:objectId,cmis:name from ...
+                        StringTokenizer termsTokenized = new StringTokenizer(term, SELECT_CLAUSE_TERM_SEP);
+                        while (termsTokenized.hasMoreElements()) {
+                            String termTokenized = termsTokenized.nextToken().trim();
+                            if (termTokenized.equalsIgnoreCase(propertyId)) {
+                                return true;
+                            }
+                        }
+                    }
+                } else {
+                    break;
                 }
-              }
             }
-          } else {
-            break;
-          }
-      }
-      return false;
-    }
-  }
-
-  private static String getSelectClause(String cmisQuery) {
-    StringTokenizer cmisQueryTokenized = new StringTokenizer(cmisQuery.trim());
-    String selectClause = StringUtils.EMPTY;
-    boolean firstTerm = true;
-    while(cmisQueryTokenized.hasMoreElements()){
-        String term = cmisQueryTokenized.nextToken();
-        if(!term.equalsIgnoreCase(FROM_TOKEN)){
-          if(firstTerm){
-            selectClause+=term;
-            firstTerm = false;
-          } else {
-            selectClause+=SEP+term;
-          }
-          
-        } else {
-          break;
+            return false;
+        }
+    }
+
+    /**
+     * @param props : list properties of a document
+     * @param rd : object that contains the properties to pass to connector
+     * @param cmisQuery : cmis query
+     */
+    public static void addValuesOfProperties(final List<Property<?>> props, RepositoryDocument rd, String cmisQuery) {
+        Map<String, String> cmisQueryColumns = CmisRepositoryConnectorUtils.getSelectMap(cmisQuery);
+        boolean isWildcardQuery = CmisRepositoryConnectorUtils.isWildcardQuery(cmisQuery);
+        addValuesOfProperty(props, isWildcardQuery, cmisQueryColumns, rd);
+    }
+
+    /**
+     * @param props : list properties of a document
+     * @param isWildcardQuery : if the query select is of type '*'
+     * @param cmisQueryColumns : selectors query
+     * @param rd : object that contains the properties to pass to connector
+     */
+    public static void addValuesOfProperty(final List<Property<?>> props, final boolean isWildcardQuery, final Map<String, String> cmisQueryColumns, RepositoryDocument rd) {
+
+        for (Property<?> property : props) {
+            String propertyId = property.getId();
+            if (isWildcardQuery || cmisQueryColumns.containsKey(propertyId)) {
+                try {
+                    addPropertyValue(property, rd);
+                } catch (Exception e) {
+                    Logging.connectors.error("Error when adding property[" + propertyId + "] msg=[" + e.getMessage() + "]", e);
+                }
+
+            }
+        }
+    }
+
+    /**
+     * @param property : the property
+     * @param propertyDefinitionType : definition of the type of property
+     * @param rd : object to which we add the association property -> value
+     * @throws Exception
+     *
+     */
+    private static void addPropertyValue(Property<?> property, RepositoryDocument rd) throws Exception {
+
+        DateTimeFormatter format = ISODateTimeFormat.dateTime();
+        PropertyDefinition<?> propertyDefinitionType = property.getDefinition();
+        PropertyType propertyType = propertyDefinitionType.getPropertyType();
+        boolean isMultiValue = (propertyDefinitionType.getCardinality() == Cardinality.MULTI);
+        String currentProperty = property.getId();
+
+        switch (propertyType) {
+
+            case STRING:
+            case ID:
+            case URI:
+            case HTML:
+                List<String> listValues = (List<String>) property.getValues();
+                if (!CollectionUtils.isEmpty(listValues)) {
+                    if (isMultiValue) {
+                        for (String htmlPropertyValue : listValues) {
+                            rd.addField(currentProperty, htmlPropertyValue);
+                        }
+                    } else {
+                        String stringValue = (String) listValues.get(0);
+                        if (StringUtils.isNotEmpty(stringValue)) {
+                            rd.addField(currentProperty, stringValue);
+                        }
+                    }
+                }
+                break;
+
+            case BOOLEAN:
+                List<Boolean> booleanPropertyValues = (List<Boolean>) property.getValues();
+                if (!CollectionUtils.isEmpty(booleanPropertyValues)) {
+                    if (isMultiValue) {
+                        for (Boolean booleanPropertyValue : booleanPropertyValues) {
+                            rd.addField(currentProperty, booleanPropertyValue.toString());
+                        }
+                    } else {
+                        Boolean booleanValue = (Boolean) booleanPropertyValues.get(0);
+                        if (booleanValue != null) {
+                            rd.addField(currentProperty, booleanValue.toString());
+                        }
+                    }
+                }
+                break;
+
+            case INTEGER:
+                List<BigInteger> integerPropertyValues = (List<BigInteger>) property.getValues();
+                if (!CollectionUtils.isEmpty(integerPropertyValues)) {
+                    if (isMultiValue) {
+                        for (BigInteger integerPropertyValue : integerPropertyValues) {
+                            rd.addField(currentProperty, integerPropertyValue.toString());
+                        }
+                    } else {
+                        BigInteger integerValue = (BigInteger) integerPropertyValues.get(0);
+                        if (integerValue != null) {
+                            rd.addField(currentProperty, integerValue.toString());
+                        }
+                    }
+                }
+                break;
+
+            case DECIMAL:
+                List<BigDecimal> decimalPropertyValues = (List<BigDecimal>) property.getValues();
+                if (!CollectionUtils.isEmpty(decimalPropertyValues)) {
+                    if (isMultiValue) {
+                        for (BigDecimal decimalPropertyValue : decimalPropertyValues) {
+                            rd.addField(currentProperty, decimalPropertyValue.toString());
+                        }
+                    } else {
+                        BigDecimal decimalValue = (BigDecimal) decimalPropertyValues.get(0);
+                        if (decimalValue != null) {
+                            rd.addField(currentProperty, decimalValue.toString());
+                        }
+                    }
+                }
+                break;
+
+            case DATETIME:
+                List<GregorianCalendar> datePropertyValues = (List<GregorianCalendar>) property.getValues();
+                if (!CollectionUtils.isEmpty(datePropertyValues)) {
+                    if (isMultiValue) {
+                        for (GregorianCalendar datePropertyValue : datePropertyValues) {
+                            rd.addField(currentProperty, format.print(datePropertyValue.getTimeInMillis()));
+                        }
+                    } else {
+                        GregorianCalendar dateValue = (GregorianCalendar) datePropertyValues.get(0);
+                        if (dateValue != null) {
+                            rd.addField(currentProperty, format.print(dateValue.getTimeInMillis()));
+                        }
+                    }
+                }
+                break;
+
+            default:
+                break;
         }
     }
-    return selectClause;
-  }
-  
+
+    private static String getSelectClause(String cmisQuery) {
+        StringTokenizer cmisQueryTokenized = new StringTokenizer(cmisQuery.trim());
+        String selectClause = StringUtils.EMPTY;
+        boolean firstTerm = true;
+        while (cmisQueryTokenized.hasMoreElements()) {
+            String term = cmisQueryTokenized.nextToken();
+            if (!term.equalsIgnoreCase(FROM_TOKEN)) {
+                if (firstTerm) {
+                    selectClause += term;
+                    firstTerm = false;
+                } else {
+                    selectClause += SEP + term;
+                }
+
+            } else {
+                break;
+            }
+        }
+        return selectClause;
+    }
+
+
+    //create a map with the field term and the alias (if present)
+    public static Map<String, String> getSelectMap(String cmisQuery) {
+        Map<String, String> cmisQueryColumns = new HashMap<>();
+        String selectClause = getSelectClause(cmisQuery.trim());
+
+        StringTokenizer cmisQueryTokenized = new StringTokenizer(selectClause.substring(SELECT_PREFIX.length()), TOKENIZER_SEP);
+        while (cmisQueryTokenized.hasMoreElements()) {
+            String term = cmisQueryTokenized.nextToken();
+            ColumnSet column = getColumnName(term);
+            cmisQueryColumns.put(column.getName(), column.getAlias());
+        }
+        return cmisQueryColumns;
+    }
+
+    //get a columset object given a term of the select clause
+    private static ColumnSet getColumnName(String orig) {
+        final String sep = " as ";
+        final int sepLen = sep.length();
+        String justColumnName = null;
+        String alias = null;
+
+        if (orig == null) {
+            return null;
+        }
+
+        justColumnName = orig.trim();
+
+        int idx = orig.indexOf(sep);
+        if (idx < 0) {
+            idx = orig.indexOf(sep.toUpperCase());
+        }
+
+        if (idx > 1) {
+            alias = orig.substring(idx + sepLen).trim();
+            justColumnName = orig.substring(0, idx).trim();
+        }
+
+        // Now we identify the column name and the prefix as alias if it's null,
+        idx = justColumnName.indexOf(".");
+        if(idx > 0){
+            justColumnName = justColumnName.substring(idx + 1);
+        }
+
+        if (alias == null) {
+            alias = justColumnName;
+        }
+
+        return new ColumnSet(justColumnName, alias);
+    }
+
+    //check if the query is a select *
+    public static boolean isWildcardQuery(String selectClause) {
+        return selectClause.toLowerCase().startsWith(SELECT_STAR_CLAUSE);
+    }
 }
\ No newline at end of file

Added: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java?rev=1705809&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java (added)
+++ manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java Tue Sep 29 08:05:40 2015
@@ -0,0 +1,61 @@
+/* $Id$ */
+
+/**
+ * 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.cmis;
+
+import org.apache.commons.lang.StringUtils;
+
+/**
+ * 
+ * @author Piergiorgio Lucidi
+ *
+ */
+public class ColumnSet {
+
+    private String name = StringUtils.EMPTY;
+    private String alias = StringUtils.EMPTY;
+
+    public ColumnSet() {}
+
+    public ColumnSet(String name, String alias) {
+        this.name = name;
+        this.alias = alias;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getAlias() {
+        return alias;
+    }
+
+    public void setAlias(String alias) {
+        this.alias = alias;
+    }
+
+    @Override
+    public String toString() {
+        return "ColumnSet{name=" + name + ", alias=" + alias + '}';
+    }
+
+}

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/cmis/ColumnSet.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseITHSQLDB.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseITHSQLDB.java?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseITHSQLDB.java (original)
+++ manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/BaseITHSQLDB.java Tue Sep 29 08:05:40 2015
@@ -18,7 +18,6 @@
 */
 package org.apache.manifoldcf.crawler.connectors.cmis.tests;
 
-import org.apache.manifoldcf.crawler.system.ManifoldCF;
 import org.junit.After;
 import org.junit.Before;
 

Added: manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java?rev=1705809&view=auto
==============================================================================
--- manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java (added)
+++ manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java Tue Sep 29 08:05:40 2015
@@ -0,0 +1,14 @@
+package org.apache.manifoldcf.crawler.connectors.cmis.tests;
+
+import org.apache.manifoldcf.crawler.connectors.cmis.CmisRepositoryConnectorUtils;
+
+public class CheckObjectIDTest {
+
+  public static void main(String[] args) {
+    String cmisQuery = " select cmis:name from cmis:folder where cmis:name='Colacem'";
+    cmisQuery = CmisRepositoryConnectorUtils.getCmisQueryWithObjectId(cmisQuery);
+    System.out.println(cmisQuery);
+    System.exit(0);
+  }
+  
+}

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java
------------------------------------------------------------------------------
    svn:keywords = Date Author Id Revision HeadURL

Propchange: manifoldcf/trunk/connectors/cmis/connector/src/test/java/org/apache/manifoldcf/crawler/connectors/cmis/tests/CheckObjectIDTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: manifoldcf/trunk/connectors/cmis/pom.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/cmis/pom.xml?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/cmis/pom.xml (original)
+++ manifoldcf/trunk/connectors/cmis/pom.xml Tue Sep 29 08:05:40 2015
@@ -131,7 +131,7 @@
                 <artifactItem>
                   <groupId>org.apache.chemistry.opencmis</groupId>
                   <artifactId>chemistry-opencmis-server-inmemory</artifactId>
-                  <version>0.11.0</version>
+                  <version>0.13.0</version>
                   <type>war</type>
                   <overWrite>false</overWrite>
                   <destFileName>chemistry-opencmis-server-inmemory.war</destFileName>
@@ -193,6 +193,39 @@
       </plugin>
 
     </plugins>
+    <pluginManagement>
+    	<plugins>
+    		<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
+    		<plugin>
+    			<groupId>org.eclipse.m2e</groupId>
+    			<artifactId>lifecycle-mapping</artifactId>
+    			<version>1.0.0</version>
+    			<configuration>
+    				<lifecycleMappingMetadata>
+    					<pluginExecutions>
+    						<pluginExecution>
+    							<pluginExecutionFilter>
+    								<groupId>org.codehaus.mojo</groupId>
+    								<artifactId>
+    									native2ascii-maven-plugin
+    								</artifactId>
+    								<versionRange>
+    									[1.0-beta-1,)
+    								</versionRange>
+    								<goals>
+    									<goal>native2ascii</goal>
+    								</goals>
+    							</pluginExecutionFilter>
+    							<action>
+    								<ignore></ignore>
+    							</action>
+    						</pluginExecution>
+    					</pluginExecutions>
+    				</lifecycleMappingMetadata>
+    			</configuration>
+    		</plugin>
+    	</plugins>
+    </pluginManagement>
   </build>
 
   <dependencies>
@@ -224,7 +257,7 @@
     <dependency>
         <groupId>org.apache.chemistry.opencmis</groupId>
         <artifactId>chemistry-opencmis-client-impl</artifactId>
-        <version>0.11.0</version>
+        <version>0.13.0</version>
      </dependency>
      <dependency>
         <groupId>commons-lang</groupId>
@@ -236,6 +269,11 @@
         <artifactId>commons-io</artifactId>
         <version>${commons-io.version}</version>
     </dependency>
+    <dependency>
+		  <groupId>joda-time</groupId>
+		  <artifactId>joda-time</artifactId>
+		  <version>2.8.1</version>
+    </dependency>
     
     <!-- Test scope -->
     <dependency>
@@ -269,7 +307,7 @@
     <dependency>
       <groupId>org.apache.chemistry.opencmis</groupId>
       <artifactId>chemistry-opencmis-server-inmemory</artifactId>
-      <version>0.11.0</version>
+      <version>0.13.0</version>
       <type>war</type>
       <scope>test</scope>
     </dependency>

Modified: manifoldcf/trunk/framework/jetty-runner/src/main/resources/connectors.xml
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/framework/jetty-runner/src/main/resources/connectors.xml?rev=1705809&r1=1705808&r2=1705809&view=diff
==============================================================================
--- manifoldcf/trunk/framework/jetty-runner/src/main/resources/connectors.xml (original)
+++ manifoldcf/trunk/framework/jetty-runner/src/main/resources/connectors.xml Tue Sep 29 08:05:40 2015
@@ -28,7 +28,7 @@
   <outputconnector name="MetaCarta GTS" class="org.apache.manifoldcf.agents.output.gts.GTSConnector"/>
     <!-- Add your authority connectors here -->
   <authorityconnector name="Null" class="org.apache.manifoldcf.authorities.authorities.nullauthority.NullAuthority"/>
-  <authorityconnector name="CMIS" class="org.apache.manifoldcf.crawler.connectors.cmis.CmisAuthorityConnector"/>
+  <authorityconnector name="CMIS" class="org.apache.manifoldcf.authorities.authorities.cmis.CmisAuthorityConnector"/>
   <authorityconnector name="Active Directory" class="org.apache.manifoldcf.authorities.authorities.activedirectory.ActiveDirectoryAuthority"/>
     <!-- Add your repository connectors here -->
   <repositoryconnector name="Web" class="org.apache.manifoldcf.crawler.connectors.webcrawler.WebcrawlerConnector"/>



Mime
View raw message