首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在使用DotCMIS进行Alfresco时,错误“属性‘cm:标题’不存在”

在使用DotCMIS进行Alfresco时,错误“属性‘cm:标题’不存在”
EN

Stack Overflow用户
提问于 2016-05-18 12:49:27
回答 1查看 1.2K关注 0票数 4

我使用VisualStudio2010Via通过dotCMIS与本地Al新鲜C# Server建立了一个会话

代码语言:javascript
复制
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();    

但是当我试图获得一个根文件夹时,比如

代码语言:javascript
复制
IFolder root = session.GetRootFolder(); 

或者运行如下的查询

代码语言:javascript
复制
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

然而,我不知道该如何应用,也不知道它是否是正确的。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2016-05-19 08:35:50

正如Gagravarr所建议的那样,它非常简单:将连接端点更改为CMIS 1.0,并且查询工作良好。如果我在PortCMIS和CMIS1.1中找到了一个更好的解决方案,我将在稍后发布。

代码语言:javascript
复制
parameters[DotCMIS.SessionParameter.AtomPubUrl] = "http://127.0.0.1:8888/alfresco/api/-default-/public/cmis/versions/1.0/atom";           
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37300149

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档