2

我正在做内容迁移活动。因为我可以将实际内容从一个存储库迁移到其他存储库。但我也想为它迁移meta-date。如何使用Open CMIS获得宽高比特性

我有一些方面与我的内容相关联,每个方面都有一些属性。所以我想从旧版本库中获取这些方面特定的属性。但我没有找到任何有用的代码来获得方面的属性。我能够在新的存储库中添加纵横比和属性 AlfrescoDocument alfDoc =(AlfrescoDocument)dc; alfDoc.addAspect(“P:test:publishDate”);

if (alfDoc.hasAspect("P:test:publishDate")) { 
     Map<String, GregorianCalendar> properties1 = new HashMap<String, GregorianCalendar>(); 
     properties1.put("test:pubDate", dc.getCreationDate()); 
     alfDoc.updateProperties(properties1); 
    } 

但以同样的方式,我想从旧的存储库中获取方面特定的属性。谁能帮帮我吗。

在此先感谢。

+0

任何一个可以请回复,是否可以使用CMIS来获取方面的性能或不? –

+0

您是否看到过这两篇文章[Link1](http://docs.alfresco.com/5.1/pra/1/concepts/opencmis-ext-creating-aspects.html)和[Link 2](https:// gist .github.com/jpotts/7242070) –

+0

@YagamiLight是的,我看到这些帖子。但在我的情况下,我能够在新的存储库中添加新的方面。现在我只想从旧版本库中获取所有方面的属性。我已经有了那个文档对象。但使用我无法获取其类型和方面的属性。 –

回答

2

这里有个答案,这可能与你的问题有关?

https://community.alfresco.com/thread/201527-not-able-to-read-aspect-properties-using-cmis

基本上,请务必使用正确的CMIS 1.1服务URL http://localhost:8080/alfresco/api/-default-/public/cmis/versions/1.1/browser 然后是这样的:

ItemIterable<QueryResult> queryResults = cmisSession.query(cmisQuery, false); 
for (QueryResult queryResult:queryResults) { 
    PropertyData<?> abcProperty = queryResult.getPropertyById("abc"); 
    String abcValue = abcProperty.getFirstValue().toString() 
    //… 
} 
+0

感谢您的答复 –

相关问题