2014-03-14 21 views
0

我有一个使用Java的工作代码,使用这种方法在使用CMIS的户外创建文档和文件夹。如何使用DotCMIS添加方面/扩展到Alfresco文件夹和文档?

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; 
    } 
} 

在上面的代码,对象类型参数会有两种cmis:foldercmis: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:文件夹还是cmis:文档)
和名称。


请帮助我解决这个问题。这是一个使用.NET 3.5和C#的Windows应用程序。 Alfresco版本是4.2.3

+1

我不认为在dotcmis中支持添加方面。 – billerby

+0

但是,我可以获取扩展/方面吗? –

回答

相关问题