0
A
回答
0
在自己的Java類試試這個,它應該工作:
import com.ibm.xsp.model.domino.DominoUtils;
@SuppressWarnings("unchecked")
public List<String> getAttachmentsNames(RichTextItem richTextItem) {
List<String> attachmentsNames = new ArrayList<String>();
try {
Vector v = richTextItem.getEmbeddedObjects();
Enumeration e = v.elements();
while (e.hasMoreElements()) {
EmbeddedObject eo = (EmbeddedObject) e.nextElement();
if (eo.getType() == EmbeddedObject.EMBED_ATTACHMENT) attachmentsNames.add(eo.getName());
}
} catch (NotesException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return attachmentsNames;
}
@SuppressWarnings("unchecked")
public List<String> getFileNames(Document document, String richTextFieldName) {
List<String> fileNames = new ArrayList<String>();
try {
if (document.hasEmbedded()) {
Vector<String> docFileNames = DominoUtils.getCurrentSession().evaluate("@AttachmentNames" , document);
RichTextItem rtitem = (RichTextItem) document.getFirstItem(richTextFieldName); // Body
for (int i = 0; i < docFileNames.size(); i++) {
if (!docFileNames.get(i).equals("") && getAttachmentsNames(rtitem).contains(docFileNames.get(i))) {
fileNames.add(fileNames.get(i));
}
}
}
} catch (NotesException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return fileNames;
}
相關問題
- 1. 在IBM Notes文檔中附件的名稱字符集/編碼
- 2. 從文檔中獲取附件
- 3. 從文檔庫中獲取文件名
- 4. Notes文檔中缺少文件名擴展名
- 5. 使用Kentico API獲取文檔附件
- 6. 獲取從附加域文件夾中的文件名在PHP
- 7. 獲取路徑和附加文件名
- 8. Lotus Notes的文檔顯示在瀏覽V2風格附件
- 9. Java - Lotus Notes - 從項目實例獲取附件名稱
- 10. 如何從C#中獲取Word文檔的文件名?
- 11. 如何在Google文檔中獲取文檔的文件擴展名和大小?
- 12. 從Lotus Notes文檔中獲取HTML正文內容
- 13. 在Lotus Notes中的附件?
- 14. 如何在Lotus Notes中獲取郵件文件所有者的全名
- 15. 獲取文檔目錄的文件夾中的文件在iPhone
- 16. 我需要一種方式mailto與附加到Notes文檔的文件
- 17. 獲取文件名
- 18. 獲取文件名
- 19. 在qweb報告中獲取文檔附件列表Odoo
- 20. 獲取文件路徑的文件名
- 21. 獲取加密文件的文件名
- 22. 獲取所有文件的文件名的文件夾中
- 23. C#從郵件附件獲取文件名
- 24. 文件附加在word文檔中
- 25. 如何將XML/JSON文件轉換爲Lotus Notes中的文檔?
- 26. Java:獲取下載附件的文件名(HttpClient,PostMethod)
- 27. 在PDF文件中添加或獲取附件文件
- 28. Lotus Notes從文檔
- 29. 從文件名中獲取文件名和擴展名沒有文件名
- 30. 獲取文件的名稱
已經在幫助文件一看的EmbeddedObject類和使用的getName()這一點。有一個例子完全符合你的需求。 –