2015-04-20 41 views
2

我們正在使用FileNet 5.1和其他團隊不小心刪除了一個組,並從prod中指出'ABC'。現在申請'ABC'的文件現在有SID。我們現在創建了一個名稱相同的組&,標識了受影響的GUID。我想知道如何使用Java代碼去除文檔上的SID?我已經有一個代碼將新創建的組「ABC」應用於受影響的文檔。請幫助從文檔中刪除SID - FileNet

回答

2

在嘗試了幾件事情之後,我使用Java代碼從文檔中刪除SID並在其上添加了新創建的組。這裏是代碼:

Document document = Factory.Document.fetchInstance(<Object Store>, <Document ID>, null); 
AccessPermissionList apl = document.get_Permissions(); 
Iterator ite = apl.iterator(); 
while (ite.hasNext()) { 
    Permission permission = (Permission) ite.next(); 
    if (permission.get_GranteeName().equals(<SID goes here>)) { 
     permission.set_GranteeName("Newly Created Group goes here"); 
     document.save(RefreshMode.REFRESH); 
     break; 
    } 
}