2014-03-14 22 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

但是,我可以獲取擴展/方面嗎? –

回答

相關問題