我有一个使用 Java 的工作代码,使用这种方法在露天使用 CMIS 创建文档和文件夹。
Folder.createFolder(
Map<string, ?> properties,
List<Policy> policies, List<Ace> addAce, List<Ace> removeAce,
OperationContext context);
我使用 Folder.createDocument 来创建文档(它们具有相同的参数)并按如下方式使用它:
AlfrescoFolder.java
parentFolder.createFolder(
AlfrescoUtilities.mapAlfrescoObjectProperties("cmis:folder",
folderName, title, description, tags),
null, null, null,
AlfrescoSession.getSession().getDefaultContext()
);
// AlfrescoSession.getSession() a custom method that we created to
// create a Session variable
AlfrescoUtilities.java
public static Map<String, Object> mapAlfrescoObjectProperties(
String objectType, String name, String title, String description,
List<String> tags)
{
Map<String, Object> properties = new HashMap<>();
properties.put(PropertyIds.OBJECT_TYPE_ID,
objectType + ",P:cm:titled,P:cm:taggable");
properties.put(PropertyIds.NAME, name);
if (title != null) properties.put("cm:title", title);
if (description != null) properties.put("cm:description", description);
if (tags != null) properties.put("cm:taggable", tags);
return properties;
}
}
在上面的代码中,objectType 参数会有cmis:folder
or cmis:document
,我们发现添加方面添加描述就是添加P:cm:titled
添加描述和标题并P:cm:taggable
附加标签。
现在,我正在使用 C# 开发一个 .NET 应用程序。当我翻译它并使用相同的方法时,唯一的问题是它只有在我删除时才有效P:cm:tittled; P:cm:taggable
这是创建属性的当前代码:
AlfrescoUtilities.cs
public static Dictionary<string, object> mapAlfrescoObjectProperties(
string objectType, string name, string title, string description,
List<string> tags)
{
Dictionary<string, object> properties = new Dictionary<string, object>();
properties[PropertyIds.ObjectTypeId] = objectType;
// +",P:cm:titled,P:cm:taggable";
properties[PropertyIds.Name] = name; /*
if (title != null) properties["cm:title"] = title;
if (description != null) properties["cm:description"] = description;
if (tags != null) properties["cm:taggable"] = tags;
*/
return properties;
}
正如你所注意到的,我评论了其他代码。
唯一的工作是objecttypeid
(无论是 cmis:folder 还是 cmis:document)
和名称。
请帮助我解决这个问题。这是一个使用 .NET 3.5 和 C# 的 Windows 应用程序。露天版本是 4.2.3