【发布时间】:2013-02-07 15:08:01
【问题描述】:
已尝试几乎“无处不在”搜索此功能,但找不到有关如何实现此功能的指针。请查看我的代码并提供有关如何使用 OpenCMIS 在 SharePoint 中设置/更新所有文档属性的建议。已使用 CMIS 成功创建了文档,但是我无法为不同的文档填充不同的值。
例如,a.pdf、b.pdf 有不同的属性。因此,当我更新它们时,我希望从分配给它们的值数组映射该值,但目前,相同的值被附加到所有文档...
请看下面我的代码,希望它能让事情更清楚:
try {
String [] nextLine =null;
CSVReader reader = new CSVReader(new FileReader(indexFileLocation));
List content = reader.readAll();
for (Object o : content) {
nextLine = (String[]) o;
System.out.println("\n"+ nextLine[2] + "\n"+nextLine[7] + "\n"+ nextLine[6]);
}
//reader.close();
Map <String, Object> newDocProps = new HashMap<String, Object>();
newDocProps.put(PropertyIds.OBJECT_TYPE_ID, "cmis:document");
newDocProps.put(PropertyIds.NAME, ff.getName());
Document doc = newFolder.createDocument(newDocProps, contentStream, VersioningState.NONE);
CmisObject cmisobject = (Document) session.getObject(doc.getId());
Map<String, Object> pp = new HashMap<String, Object>();
//pp.put(PropertyIds.OBJECT_ID, "Name");
pp.put("WorkflowNumber", nextLine[7]);
pp.put("InvoiceDate", nextLine[2]);
cmisobject.updateProperties(pp);
感谢任何帮助。
【问题讨论】:
标签: java sharepoint metadata cmis opencmis