Author: kwright
Date: Sun Jan 25 12:15:14 2015
New Revision: 1654654
URL: http://svn.apache.org/r1654654
Log:
Pull up fix for CONNECTORS-1151 from dev_1x branch
Modified:
manifoldcf/branches/release-1.8-branch/ (props changed)
manifoldcf/branches/release-1.8-branch/CHANGES.txt
manifoldcf/branches/release-1.8-branch/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
Propchange: manifoldcf/branches/release-1.8-branch/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sun Jan 25 12:15:14 2015
@@ -118,5 +118,5 @@
/manifoldcf/branches/CONNECTORS-981:1605049-1605773
/manifoldcf/branches/CONNECTORS-989:1611600-1612101
/manifoldcf/branches/CONNECTORS-990:1610284-1610707
-/manifoldcf/branches/dev_1x:1646136,1646323,1646399,1646405,1646641,1646948,1647576,1647609,1650352,1651922
-/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,1634155,1634188,163
4202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646640,1646947,1647574,1647608,1650351,1651921
+/manifoldcf/branches/dev_1x:1646136,1646323,1646399,1646405,1646641,1646948,1647576,1647609,1650352,1651922,1654652
+/manifoldcf/trunk:1620703,1620748,1620812,1620862,1621449,1621613,1621855,1622213,1622740,1622850,1622853-1622854,1623249,1623251,1623314,1623599,1623951,1623953-1623954,1623956,1623972,1624058,1624085,1624174,1624236,1624377,1624384,1624399,1624449,1624464,1624504,1624729-1624731,1624906,1624909-1624910,1625023,1625095,1625103,1625108,1625264,1625270,1625394,1625400,1625910,1626090,1626097,1626102,1626638-1626639,1626973,1627687,1627690,1627959,1628066,1628106,1628168,1628188,1628699,1628798,1628808,1628845,1628905,1629122,1629374-1629375,1629379,1629541,1629994,1630188,1630535,1630623,1630671,1630812,1630885,1631039,1631162,1631164,1631252,1631750,1631953,1632013,1632225,1632289,1632562,1632844,1632847,1632854,1633062-1633063,1633108,1633193,1633202,1633282,1633284,1633295,1633336,1633339,1633345,1633348,1633364,1633378,1633383,1633432,1633546,1633590,1633634,1633668,1633727,1633760,1633764,1633786,1633910,1633923,1634021,1634028,1634067,1634132,1634145,1634148,1634155,1634188,163
4202,1634264,1634373,1634530,1634688,1634850,1634857,1635103,1635116,1635421,1635438,1635478,1635481,1635484,1635490,1635809,1635939,1636146,1636167,1636180,1636207,1636215,1636232,1636334,1636519,1636570,1636684,1636940,1637011,1637310,1637350,1637364,1637373,1637378,1639259,1639593,1639600,1640018,1640101,1640199,1640204,1640208,1640314,1640319,1640749,1640772,1640805,1640888,1640925,1640941-1640942,1641222,1641328,1641557,1641559,1641629,1641633,1641724,1641754,1641911,1642163,1642255,1642318,1642531,1642650,1642658,1642673,1642716,1644197,1644399,1644538,1644920,1644931,1646317,1646397,1646403,1646640,1646947,1647574,1647608,1650351,1651921,1654651
Modified: manifoldcf/branches/release-1.8-branch/CHANGES.txt
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/release-1.8-branch/CHANGES.txt?rev=1654654&r1=1654653&r2=1654654&view=diff
==============================================================================
--- manifoldcf/branches/release-1.8-branch/CHANGES.txt (original)
+++ manifoldcf/branches/release-1.8-branch/CHANGES.txt Sun Jan 25 12:15:14 2015
@@ -4,6 +4,10 @@ $Id$
======================= Release 1.8.1 =====================
+CONNECTORS-1151: FileNet connector completely broken, due to
+MCF 1.8 reorganization.
+(Guy Sperry, Karl Wright)
+
CONNECTORS-1145: File locking hangs when saving output connection.
(Andreas Baumann, Michael Wilken, Karl Wright)
Modified:
manifoldcf/branches/release-1.8-branch/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
URL:
http://svn.apache.org/viewvc/manifoldcf/branches/release-1.8-branch/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java?rev=1654654&r1=1654653&r2=1654654&view=diff
==============================================================================
---
manifoldcf/branches/release-1.8-branch/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
(original)
+++
manifoldcf/branches/release-1.8-branch/connectors/filenet/connector/src/main/java/org/apache/manifoldcf/crawler/connectors/filenet/FilenetConnector.java
Sun Jan 25 12:15:14 2015
@@ -948,21 +948,30 @@ public class FilenetConnector extends or
if (Logging.connectors.isDebugEnabled())
Logging.connectors.debug("Filenet: Getting version for identifier
'"+documentIdentifier+"'");
- // Calculate the version id and the element number
- String versionString;
- String[] aclValues = null;
- String[] denyAclValues = null;
- String docClass = null;
- String[] metadataFieldNames = null;
- String[] metadataFieldValues = null;
int cIndex = documentIdentifier.indexOf(",");
if (cIndex != -1)
{
String vId = documentIdentifier.substring(0,cIndex);
+ int elementNumber;
+ try
+ {
+ elementNumber =
Integer.parseInt(documentIdentifier.substring(cIndex+1));
+ }
+ catch (NumberFormatException e)
+ {
+ throw new ManifoldCFException("Bad number in identifier:
"+documentIdentifier,e);
+ }
+
+ // Calculate the version id and the element number
+ String versionString;
+ String[] aclValues = null;
+ String[] denyAclValues = null;
+ String docClass = null;
+ String[] metadataFieldNames = null;
+ String[] metadataFieldValues = null;
FileInfo fileInfo;
- Integer count;
try
{
fileInfo = doGetDocumentInformation(vId, dSpec.getMetadataFields());
@@ -973,15 +982,6 @@ public class FilenetConnector extends or
activities.deleteDocument(documentIdentifier);
continue;
}
-
- count = doGetDocumentContentCount(documentIdentifier);
- if (count == null)
- {
- if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("FileNet: Removing version
'"+documentIdentifier+"' because it seems to no longer exist");
- activities.deleteDocument(documentIdentifier);
- continue;
- }
}
catch (FilenetException e)
{
@@ -1113,192 +1113,210 @@ public class FilenetConnector extends or
pack(versionBuffer,docURIPrefix,'+');
versionString = versionBuffer.toString();
-
+
if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("FileNet: There are "+count.toString()+"
content values for '"+documentIdentifier+"'");
+ Logging.connectors.debug("FileNet: Document identifier
'"+documentIdentifier+"' is a document attachment");
- // Loop through all document content identifiers and add a child
identifier for each
- for (int q = 0; q < count.intValue(); q++)
- {
- if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("Filenet: Adding document identifier
'"+documentIdentifier+","+Integer.toString(q)+"'");
-
- activities.addDocumentReference(documentIdentifier + "," +
Integer.toString(q));
- }
+ String errorCode = null;
+ String errorDesc = null;
+ long startTime = System.currentTimeMillis();
+ Long fileLengthLong = null;
- // No more processing is necessary for document identifiers.
- activities.noDocument(documentIdentifier,versionString);
- continue;
- }
-
- // It's a version identifier.
- String vId = documentIdentifier.substring(0,cIndex);
- int elementNumber;
- try
- {
- elementNumber =
Integer.parseInt(documentIdentifier.substring(cIndex+1));
- }
- catch (NumberFormatException e)
- {
- throw new ManifoldCFException("Bad number in identifier:
"+documentIdentifier,e);
- }
-
- versionString = "";
-
- if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("FileNet: Document identifier
'"+documentIdentifier+"' is a document attachment");
-
- String errorCode = null;
- String errorDesc = null;
- long startTime = System.currentTimeMillis();
- Long fileLengthLong = null;
-
- try
- {
- String uri = convertToURI(docURIPrefix,vId,elementNumber,docClass);
- if (!activities.checkURLIndexable(uri))
- {
- errorCode = activities.EXCLUDED_URL;
- errorDesc = "Excluded because of url ('"+uri+"')";
- activities.noDocument(documentIdentifier,versionString);
- continue;
- }
-
- File objFileTemp = null;
- try
- {
- objFileTemp = File.createTempFile("_mc_fln_", null);
- }
- catch (IOException e)
- {
- errorCode = e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
- errorDesc = e.getMessage();
- handleIOException(e,documentIdentifier,"creating temporary file");
- }
try
{
+ String uri = convertToURI(docURIPrefix,vId,elementNumber,docClass);
+ if (!activities.checkURLIndexable(uri))
+ {
+ errorCode = activities.EXCLUDED_URL;
+ errorDesc = "Excluded because of url ('"+uri+"')";
+ activities.noDocument(documentIdentifier,versionString);
+ continue;
+ }
+
+ File objFileTemp = null;
try
{
-
doGetDocumentContents(vId,elementNumber,objFileTemp.getCanonicalPath());
+ objFileTemp = File.createTempFile("_mc_fln_", null);
}
catch (IOException e)
{
errorCode = e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
errorDesc = e.getMessage();
- handleIOException(e,documentIdentifier,"reading document");
+ handleIOException(e,documentIdentifier,"creating temporary file");
}
- catch (FilenetException e)
+ try
{
- errorCode = e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
- errorDesc = e.getMessage();
- // Base our treatment on the kind of error it is.
- long currentTime = System.currentTimeMillis();
- if (e.getType() == FilenetException.TYPE_SERVICEINTERRUPTION)
+ try
{
- throw new
ServiceInterruption(e.getMessage(),e,currentTime+300000L,currentTime+12*60*60000L,-1,true);
+
doGetDocumentContents(vId,elementNumber,objFileTemp.getCanonicalPath());
}
- else if (e.getType() == FilenetException.TYPE_NOTALLOWED)
+ catch (IOException e)
{
- if (Logging.connectors.isDebugEnabled())
- Logging.connectors.debug("FileNet: Removing file
'"+documentIdentifier+"' because: "+e.getMessage(),e);
- activities.noDocument(documentIdentifier,versionString);
- continue;
+ errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
+ errorDesc = e.getMessage();
+ handleIOException(e,documentIdentifier,"reading document");
}
- else
+ catch (FilenetException e)
{
- throw new ManifoldCFException(e.getMessage(),e);
+ errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
+ errorDesc = e.getMessage();
+ // Base our treatment on the kind of error it is.
+ long currentTime = System.currentTimeMillis();
+ if (e.getType() == FilenetException.TYPE_SERVICEINTERRUPTION)
+ {
+ throw new
ServiceInterruption(e.getMessage(),e,currentTime+300000L,currentTime+12*60*60000L,-1,true);
+ }
+ else if (e.getType() == FilenetException.TYPE_NOTALLOWED)
+ {
+ if (Logging.connectors.isDebugEnabled())
+ Logging.connectors.debug("FileNet: Removing file
'"+documentIdentifier+"' because: "+e.getMessage(),e);
+ activities.noDocument(documentIdentifier,versionString);
+ continue;
+ }
+ else
+ {
+ throw new ManifoldCFException(e.getMessage(),e);
+ }
}
- }
- // Document fetch completed
- long fileLength = objFileTemp.length();
- if (!activities.checkLengthIndexable(fileLength))
- {
- errorCode = activities.EXCLUDED_LENGTH;
- errorDesc = "Excluded document because of length ("+fileLength+")";
- activities.noDocument(documentIdentifier,versionString);
- continue;
- }
-
- RepositoryDocument rd = new RepositoryDocument();
- // Apply metadata
- for (int j = 0; j < metadataFieldNames.length; j++)
- {
- String metadataName = metadataFieldNames[j];
- String metadataValue = metadataFieldValues[j];
- rd.addField(metadataName,metadataValue);
- }
+ // Document fetch completed
+ long fileLength = objFileTemp.length();
+ if (!activities.checkLengthIndexable(fileLength))
+ {
+ errorCode = activities.EXCLUDED_LENGTH;
+ errorDesc = "Excluded document because of length
("+fileLength+")";
+ activities.noDocument(documentIdentifier,versionString);
+ continue;
+ }
- // Apply acls
- if (aclValues != null)
- {
-
rd.setSecurityACL(RepositoryDocument.SECURITY_TYPE_DOCUMENT,aclValues);
- }
- if (denyAclValues != null)
- {
-
rd.setSecurityDenyACL(RepositoryDocument.SECURITY_TYPE_DOCUMENT,denyAclValues);
- }
+ RepositoryDocument rd = new RepositoryDocument();
+ // Apply metadata
+ for (int k = 0; k < metadataFieldNames.length; k++)
+ {
+ String metadataName = metadataFieldNames[k];
+ String metadataValue = metadataFieldValues[k];
+ rd.addField(metadataName,metadataValue);
+ }
- InputStream is = null;
- try
- {
- is = new FileInputStream(objFileTemp);
- }
- catch (IOException e)
- {
- errorCode = e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
- errorDesc = e.getMessage();
- handleIOException(e,documentIdentifier,"Opening temporary file");
- }
- try
- {
- rd.setBinary(is, fileLength);
+ // Apply acls
+ if (aclValues != null)
+ {
+
rd.setSecurityACL(RepositoryDocument.SECURITY_TYPE_DOCUMENT,aclValues);
+ }
+ if (denyAclValues != null)
+ {
+
rd.setSecurityDenyACL(RepositoryDocument.SECURITY_TYPE_DOCUMENT,denyAclValues);
+ }
+ InputStream is = null;
try
{
- // Ingest
-
activities.ingestDocumentWithException(documentIdentifier,versionString,uri,rd);
- errorCode = "OK";
- fileLengthLong = new Long(fileLength);
+ is = new FileInputStream(objFileTemp);
}
catch (IOException e)
{
errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
errorDesc = e.getMessage();
- handleIOException(e,documentIdentifier,"ingesting document");
+ handleIOException(e,documentIdentifier,"Opening temporary file");
}
- }
- finally
- {
try
{
- is.close();
+ rd.setBinary(is, fileLength);
+
+ try
+ {
+ // Ingest
+
activities.ingestDocumentWithException(documentIdentifier,versionString,uri,rd);
+ errorCode = "OK";
+ fileLengthLong = new Long(fileLength);
+ }
+ catch (IOException e)
+ {
+ errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
+ errorDesc = e.getMessage();
+ handleIOException(e,documentIdentifier,"ingesting document");
+ }
}
- catch (IOException e)
+ finally
{
- errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
- errorDesc = e.getMessage();
- handleIOException(e,documentIdentifier,"closing input stream");
+ try
+ {
+ is.close();
+ }
+ catch (IOException e)
+ {
+ errorCode =
e.getClass().getSimpleName().toUpperCase(Locale.ROOT);
+ errorDesc = e.getMessage();
+ handleIOException(e,documentIdentifier,"closing input stream");
+ }
}
}
+ finally
+ {
+ // Delete temp file
+ objFileTemp.delete();
+ }
+ }
+ catch (ManifoldCFException e)
+ {
+ if (e.getErrorCode() == ManifoldCFException.INTERRUPTED)
+ errorCode = null;
+ throw e;
}
finally
{
- // Delete temp file
- objFileTemp.delete();
+ if (errorCode != null)
+ activities.recordActivity(new Long(startTime),ACTIVITY_FETCH,
+ fileLengthLong,documentIdentifier,errorCode,errorDesc,null);
}
}
- catch (ManifoldCFException e)
- {
- if (e.getErrorCode() == ManifoldCFException.INTERRUPTED)
- errorCode = null;
- throw e;
- }
- finally
+ else
{
- if (errorCode != null)
- activities.recordActivity(new Long(startTime),ACTIVITY_FETCH,
- fileLengthLong,documentIdentifier,errorCode,errorDesc,null);
+ Integer count;
+ try
+ {
+ count = doGetDocumentContentCount(documentIdentifier);
+ if (count == null)
+ {
+ if (Logging.connectors.isDebugEnabled())
+ Logging.connectors.debug("FileNet: Removing version
'"+documentIdentifier+"' because it seems to no longer exist");
+ activities.deleteDocument(documentIdentifier);
+ continue;
+ }
+ }
+ catch (FilenetException e)
+ {
+ // Base our treatment on the kind of error it is.
+ long currentTime = System.currentTimeMillis();
+ if (e.getType() == FilenetException.TYPE_SERVICEINTERRUPTION)
+ throw new
ServiceInterruption(e.getMessage(),e,currentTime+300000L,currentTime+12*60*60000L,-1,true);
+ else if (e.getType() == FilenetException.TYPE_NOTALLOWED)
+ {
+ if (Logging.connectors.isDebugEnabled())
+ Logging.connectors.debug("FileNet: Skipping file
'"+documentIdentifier+"' because: "+e.getMessage(),e);
+ activities.deleteDocument(documentIdentifier);
+ continue;
+ }
+ else
+ throw new ManifoldCFException(e.getMessage(),e);
+ }
+
+ if (Logging.connectors.isDebugEnabled())
+ Logging.connectors.debug("FileNet: There are "+count.toString()+"
content values for '"+documentIdentifier+"'");
+
+ // Loop through all document content identifiers and add a child
identifier for each
+ for (int q = 0; q < count.intValue(); q++)
+ {
+ if (Logging.connectors.isDebugEnabled())
+ Logging.connectors.debug("Filenet: Adding document identifier
'"+documentIdentifier+","+Integer.toString(q)+"'");
+
+ activities.addDocumentReference(documentIdentifier + "," +
Integer.toString(q));
+ }
+
+ // No more processing is necessary for document identifiers.
+ activities.noDocument(documentIdentifier,"");
+ continue;
+
}
}
}