final Map<String, Object> params = new HashMap<String, Object>();
params.put(DocumentDialog.P_TYPE, Type.ATTACHMENT);
params.put(DocumentDialog.P_MODE, Mode.ADD);
params.put(DocumentDialog.P_TEMPLATES, itemModel.getTemplates(folder));
final IAbstractDocumentSource source = folder.getSource();
final boolean isFeatureDoc = (source instanceof IAttachmentSource);
final DocumentDialog docDialog = openDocDialog(new HashMap<String, Object>(), params, isFeatureDoc);
if (docDialog != null) {
addDocument(folder, docDialog.getDocInfo());
}