c# – 使用DotCMIS for Alfresco时出现错误“属性’cm:标题’不
我通过dotCMIS与使用Visual Studio 2010 C#via的本地Alfresco-Server建立了会话
Dictionary<string,string> parameters = new Dictionary<string,string>(); parameters[DotCMIS.SessionParameter.BindingType] = BindingType.AtomPub; parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://127.0.0.1:8888/alfresco/api/-default-/public/cmis/versions/1.1/atom"; parameters[DotCMIS.SessionParameter.User] = "admin"; parameters[DotCMIS.SessionParameter.Password] = "admin"; SessionFactory factory = SessionFactory.NewInstance(); IList<IRepository> repos = factory.GetRepositories(parameters); ISession session = repos.ElementAt(0).CreateSession(); 但是当我试图获得一个根文件夹时 IFolder root = session.GetRootFolder(); 或运行查询 string queryGetDoc = "SELECT * FROM cmis:document WHERE cmis:name='Bug101.png'"; IItemEnumerable<IQueryResult> docResults = session.Query(queryGetDoc,false); IQueryResult docHit = docResults.FirstOrDefault(); string docId = docHit["cmis:objectId"].FirstValue.ToString(); IDocument document = session.GetObject(docId) as IDocument; IList<IProperty> listOfProperties = document.Properties; foreach (IProperty p in listOfProperties) { Console.WriteLine(p.QueryName); } 我收到一条错误消息:
我可以猜测,我在这里缺少一些基础知识,但我在网上搜索,只找到了https://github.com/wk-j/alfresco-cmis/issues/1. 但是我不知道如何应用它,或者它是否是正确的. 解决方法
正如Gagravarr建议的那样简单:将连接端点更改为CMIS 1.0,查询工作正常.如果我找到一个使用PortCMIS和CMIS 1.1的propper解决方案,我稍后会发布.
parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://127.0.0.1:8888/alfresco/api/-default-/public/cmis/versions/1.0/atom"; (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |