在FileNet中搜索特定文件夹的文件夹层次结构 [英] Search folder hierarchy in FileNet for a particular folder

查看:166
本文介绍了在FileNet中搜索特定文件夹的文件夹层次结构的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是从Java访问FileNet CE的新手.

I am new to accessing FileNet CE from Java.

通过测试程序,我可以连接,创建文件夹,上传文件并检索列表.

From my test program, I can connect, create folders, upload files and retrieve the list.

现在,我需要在ObjectStore中找到一个文件夹.也就是说,给定文件夹内的文件夹层次结构: 资料夹1 -文件夹1a -文件夹1b ---- Folder1b1 ---- Folder1b2 -Folder1c ---- Folder1c1 ---- Folder1c2 资料夹2 ...

Now, I need to find a folder within the ObjectStore. That is to say, given a hierarchy of folders within folders: Folder1 -- Folder1a -- Folder1b ---- Folder1b1 ---- Folder1b2 -- Folder1c ---- Folder1c1 ---- Folder1c2 Folder2 ...

如何搜索具有给定名称的文件夹?可能是N级深.

How do I search for a folder given its name? It could be N levels deep.

类似地,如何使用名称中的通配符进行搜索?

Similarly, how do I search using wildcards in the name?

类似地,我创建了文件夹的子类(PersonnelFolder),并为其提供了一些属性(人员ID,部门等).如何搜索人员ID?即在给定类的对象中搜索属性?

Similarly, I created a sub-class of a folder (PersonnelFolder) and gave it some attributes (Personnel ID, Department, etc.). How do I search for a Personnel ID? i.e. Search in properties within objects of a given class?

推荐答案

Searching on the Documentation, there are no examples about it, just snippet of code that address specific paths. Like this:

获取子路径的父文件夹:

String childFolderPath = "/Loans/MyLoans";
Folder currentFolder = Factory.Folder.fetchInstance(os, childFolderPath, null);
Folder parent = currentFolder.get_Parent();

获取直接包含在路径中的文件夹

String folderPath = "/Loans";
Folder currentFolder = Factory.Folder.fetchInstance(os, folderPath, null);
FolderSet childFolders = currentFolder.get_SubFolders();

顺便说一下,通过FEM进行研究,可以很容易地构建只处理部分名称的sql.像这样:

By the way, doing a research via FEM, it's easy to build a sql that addresses only part of the name. Like this:

SELECT * FROM [Folder] WHERE ([FolderName] like '%Folder1a%')

类似于自定义元数据:

SELECT * FROM [YourFolderSubType] WHERE ([YourCustomAttribute] = 'yourValue')

然后,访问属性PathName将为您提供完整的路径.或者,您也可以检索其ID以便从中获取Folder对象.

Then, accessing the attribute PathName gives you the complete path. Or, alternatively, you could just retrieve its ID in order to fetch the Folder object from it.

您可以尝试从API执行类似的查询,然后将每个结果转换为Folder对象,以便对其进行处理.

You could try to execute a query like these from the APIs, then cast each result as a Folder object in order to work on it.

示例(未经测试):

SearchSQL sqlObject = new SearchSQL(sqlStatement);
RepositoryRowSet rowSet = searchScope.fetchRows(sqlObject, null, null, new Boolean(true));
Iterator iter = myRows.iterator();
while (iter.hasNext()) {
    RepositoryRow row = (RepositoryRow) iter.next();
    row.getProperties().getStringValue("ID");
    com.filenet.api.core.Folder folder = Factory.Folder.fetchInstance(os, id, null);
}

希望这会有所帮助.

这篇关于在FileNet中搜索特定文件夹的文件夹层次结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆