manifoldcf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kwri...@apache.org
Subject svn commit: r1452375 - in /manifoldcf/trunk: CHANGES.txt connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Date Mon, 04 Mar 2013 16:35:42 GMT
Author: kwright
Date: Mon Mar  4 16:35:41 2013
New Revision: 1452375

URL: http://svn.apache.org/r1452375
Log:
Fix for CONNECTORS-658.  Add common metadata support to LiveLink connector.

Modified:
    manifoldcf/trunk/CHANGES.txt
    manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java

Modified: manifoldcf/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/CHANGES.txt?rev=1452375&r1=1452374&r2=1452375&view=diff
==============================================================================
--- manifoldcf/trunk/CHANGES.txt (original)
+++ manifoldcf/trunk/CHANGES.txt Mon Mar  4 16:35:41 2013
@@ -3,6 +3,10 @@ $Id$
 
 ======================= 1.2-dev =====================
 
+CONNECTORS-658: Add common metadata support (mimetype etc)
+to Livelink connector.
+(David Morana, Karl Wright)
+
 CONNECTORS-654: Move extension to mimetype mapping to a 
 central location.
 (Mark Lugert, Karl Wright)

Modified: manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
URL: http://svn.apache.org/viewvc/manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java?rev=1452375&r1=1452374&r2=1452375&view=diff
==============================================================================
--- manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
(original)
+++ manifoldcf/trunk/connectors/livelink/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/livelink/LivelinkConnector.java
Mon Mar  4 16:35:41 2013
@@ -3758,10 +3758,26 @@ public class LivelinkConnector extends o
       return;
     }
     
+    // Add general data we need for the output connector
+    String mimeType = versInfo.getMimeType();
+    if (mimeType != null)
+      rd.setMimeType(mimeType);
+    String fileName = versInfo.getFileName();
+    if (fileName != null)
+      rd.setFileName(fileName);
+    Date creationDate = objInfo.getCreationDate();
+    if (creationDate != null)
+      rd.setCreatedDate(creationDate);
+    Date modifyDate = versInfo.getModifyDate();
+    if (modifyDate != null)
+      rd.setModifiedDate(modifyDate);
+    
     rd.addField(GENERAL_NAME_FIELD,objInfo.getName());
     rd.addField(GENERAL_DESCRIPTION_FIELD,objInfo.getComments());
-    rd.addField(GENERAL_CREATIONDATE_FIELD,objInfo.getCreationDate().toString());
-    rd.addField(GENERAL_MODIFYDATE_FIELD,versInfo.getModifyDate().toString());
+    if (creationDate != null)
+      rd.addField(GENERAL_CREATIONDATE_FIELD,creationDate.toString());
+    if (modifyDate != null)
+      rd.addField(GENERAL_MODIFYDATE_FIELD,modifyDate.toString());
     UserInformation owner = llc.getUserInformation(objInfo.getOwnerId().intValue());
     UserInformation creator = llc.getUserInformation(objInfo.getCreatorId().intValue());
     UserInformation modifier = llc.getUserInformation(versInfo.getOwnerId().intValue());
@@ -4950,6 +4966,28 @@ public class LivelinkConnector extends o
       return getVersionValue() != null;
     }
     
+    /** Get file name.
+    */
+    public String getFileName()
+      throws ServiceInterruption, ManifoldCFException
+    {
+      LLValue elem = getVersionValue();
+      if (elem == null)
+        return null;
+      return elem.toString("FILENAME");
+    }
+
+    /** Get mime type.
+    */
+    public String getMimeType()
+      throws ServiceInterruption, ManifoldCFException
+    {
+      LLValue elem = getVersionValue();
+      if (elem == null)
+        return null;
+      return elem.toString("MIMETYPE");
+    }
+
     /** Get modify date.
     */
     public Date getModifyDate()



Mime
View raw message