今天我正在寻找一种使用 dotcmis 在 alfresco 中获取包含特定属性的所有文档的好方法。
我在想:
- 使用 Ephesoft ( http://www.ephesoft.com/ ) 捕获文档。
- 使用 cmis 集成将 Ephesoft 与 Alfresco 连接起来。
- 配置文档属性以匹配露天模型(元数据文档)
- 在我的 webApplication(asp.net)中开发一个模块来搜索具有特定属性(元数据)的所有文档;使用 dotcmis ( http://chemistry.apache.org/dotnet/dotcmis.html )
我发现:
- 如何创建会话。
- 如何列出树文件夹
除了...如果设置了特定属性(元数据),如何验证每个文档?
你知道怎么做吗?
谢谢帕布罗昌!在这一刻,我有:
public ISession Connect(string user, string password, string servicesUrl, string repositoryId)
{
IDictionary<string, string> parameter = new Dictionary<string, string>();
parameter.Add(DotCMIS.SessionParameter.User, user);
parameter.Add(DotCMIS.SessionParameter.Password, password);
parameter.Add(DotCMIS.SessionParameter.BindingType, DotCMIS.BindingType.WebServices);
parameter.Add(DotCMIS.SessionParameter.WebServicesAclService, (servicesUrl + "ACLService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesDiscoveryService, (servicesUrl + "DiscoveryService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesMultifilingService, (servicesUrl + "MultiFilingService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesNavigationService, (servicesUrl + "NavigationService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesObjectService, (servicesUrl + "ObjectService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesPolicyService, (servicesUrl + "PolicyService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesRelationshipService, (servicesUrl + "RelationshipService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesRepositoryService, (servicesUrl + "RepositoryService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.WebServicesVersioningService, (servicesUrl + "VersioningService?wsdl").ToString());
parameter.Add(DotCMIS.SessionParameter.RepositoryId, (repositoryId));
ISessionFactory factory = DotCMIS.Client.Impl.SessionFactory.NewInstance();
return factory.CreateSession(parameter);
}
public List<CMISIntegrationResponse> GetFiles(CMISIntegrationRequest request)
{
List<CMISIntegrationResponse> cmisIntegrationResponseList = new List<CMISIntegrationResponse>();
ISession session = Connect(request.UserName, request.Password, request.ServicesUrl, request.RepositoryId);
IItemEnumerable<IQueryResult> result = session.Query(@"SELECT
cmis:name, cmis:objectId, cmis:baseTypeId, cmis:objectTypeId, cmis:createdBy,
cmis:lastModifiedBy, cmis:lastModificationDate,cmis:contentStreamMimeType,
cmis:contentStreamFileName,cmis:contentStreamId,cmis:contentStreamLength
FROM cmis:document
ORDER BY
cmis:name, cmis:createdBy", false);
foreach(QueryResult item in result)
{
if (item.AllowableActions.Actions.Contains(DotCMIS.Actions.CanGetContentStream))
{
foreach (DotCMIS.Data.IPropertyData property in item.Properties)
{
/*AccountNumber will be a property/metadata of any document
In this point i can not see any property/metadata called "AccountNumber"
*/
if (property.DisplayName.Equals("AccountNumber"))
{
CMISIntegrationResponse response = new CMISIntegrationResponse();
response.Name = item.GetPropertyValueByQueryName("cmis:name").ToString();
response.ObjectId = item.GetPropertyValueByQueryName("cmis:objectId").ToString();
response.BaseTypeId = item.GetPropertyValueByQueryName("cmis:baseTypeId").ToString();
response.ObjectTypeId = item.GetPropertyValueByQueryName("cmis:objectTypeId").ToString();
response.CreatedBy = item.GetPropertyValueByQueryName("cmis:createdBy").ToString();
response.LastModifiedBy = item.GetPropertyValueByQueryName("cmis:lastModifiedBy").ToString();
response.LastModificationDate = item.GetPropertyValueByQueryName("cmis:lastModificationDate").ToString();
response.ContentStreamMimeType = item.GetPropertyValueByQueryName("cmis:contentStreamMimeType").ToString();
response.ContentStreamFileName = item.GetPropertyValueByQueryName("cmis:contentStreamFileName").ToString();
response.ContentStreamId = item.GetPropertyValueByQueryName("cmis:contentStreamId").ToString();
response.ContentStreamLength = item.GetPropertyValueByQueryName("cmis:contentStreamLength").ToString();
cmisIntegrationResponseList.Add(response);
}
}
}
}
session.Clear();
return cmisIntegrationResponseList;
}
我在哪里可以看到 CMIS Alfresco 的虚拟表及其列的列表?
谢谢!