我使用VisualStudio2010Via通过dotCMIS与本地Al新鲜C# 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);
}我收到一条错误消息:
DotCMIS.Exceptions.CmisRuntimeException:属性‘cm:标题’不存在!贝贝( DotCMIS.Client.Impl.ObjectFactory.ConvertProperty(IObjectType objectType,IPropertyData pd)( DotCMIS.Client.Impl.Session.GetObject(IObjectId DotCMIS.Client.Impl.Session.GetRootFolder(IOperationContext上下文) bei DotCMIS.Client.Impl.Session.GetObject(String objectId,IOperationContext context) bei DotCMIS.Client.Impl.Session.GetObject objectId,IOperationContext上下文) bei DotCMIS.Client.Impl.Session.GetRootFolder() bei DotCMIS.Client.Impl.Session.GetRootFolder() bei ConsoleApplication3.Program.ConnectingUsingAtomPub_CreateFolder()
我只能猜测,我在这里缺少一些基本原理,但我搜索了网页,只找到了https://github.com/wk-j/alfresco-cmis/issues/1。
然而,我不知道该如何应用,也不知道它是否是正确的。
发布于 2016-05-19 08:35:50
正如Gagravarr所建议的那样,它非常简单:将连接端点更改为CMIS 1.0,并且查询工作良好。如果我在PortCMIS和CMIS1.1中找到了一个更好的解决方案,我将在稍后发布。
parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://127.0.0.1:8888/alfresco/api/-default-/public/cmis/versions/1.0/atom"; https://stackoverflow.com/questions/37300149
复制相似问题