我们正在将库内容从Filenet Content Services迁移到Filenet P8。
所以我们编写了一个提取器,它以 XML 格式输出文件夹树和文档列表,每个文档都有版本、属性和父文件夹。该提取器依赖于虚拟化 FileNet 对象的自制 dll。
以这种方式检索文档(巨大的 sql 请求):
Public Function getAllDocumentIds() As ADODB.Recordset
Dim cmdProperties As New Dictionary
cmdProperties.Item("Maximum Rows") = 0
cmdProperties.Item("Page Size") = 0
Set getAllDocumentIds = _
executeADOQuery("SELECT idmId, idmVerFileName, " & vbNewLine & _
" idmVerCreateDate, idmAddedByUser" & vbNewLine & _
" FROM FNDOCUMENT ORDER BY idmId ASC", & _
cmdProperties)
End Function
但是当我们以这种方式检索父文件夹时会遇到问题(稍作修改以用作示例):
Public Function getFolders(document As IDMObjects.document) As Collection
Dim f As IDMObjects.Folder
' [...]
For Each f In document.FoldersFiledIn '
' folders retrieval
Next
End Function
对于少量文档,报告了一些“错误”的父文件夹(“文件夹[文档]归档”)。
“错误”,因为以下方式未报告文档已在其中归档(代码也略有修改):
Public Function getDocumentIds(folder As IDMObjects.Folder) As Collection
Dim rs As ADODB.Recordset
Dim cmdProperties As New Dictionary
' Actually there is a control here, to prevent Filenet crashing.
' Indeed, setting "Page Size" to 0 crashes if no results are returned.
' *Maybe* a product bug.
cmdProperties.Add "SearchFolderName", internalObject.id ' Folder parent
cmdProperties.Item("Maximum Rows") = 0 ' No limits
cmdProperties.Item("Page Size") = 0 ' No limits. Crashes if Recordset is empty
' Here, the cmdProperties entries are copied to an
' ADODB.Command object, into the "properties" member.
' The query are copied to this object, into the "CommandText" member.
' Then ADODB.Command.Execute is invoked and returs an ADODB.RecordSet.
' So this Recordset contains all documents filled in this folder.
Set rs = executeADOQuery("SELECT * from FnDocument", cmdProperties)
Exit Function
End Function
我们正在研究一种解决方法,这可能需要更多资源(对于每个文档,请仔细检查...)。但是了解为什么我们没有得到相同的结果可能与检查我们的库有关。