确定莲花多米诺骨牌中哑剧附件的图标(determine the icon for mime attachments in lotus domino)
我正在使用Lotus Domino的Java-API。 Domino的当前版本是8.5。 我通过DIIOP / CORBA连接到Domino。 我想创建一个带附件的文档(电子邮件)。 该电子邮件是一个多部分MIME文档。 附加文件非常简单,工作完美。 但是,附件会获得一般文档图标(空灰色页面)。 我想为实际内容类型设置一个合适的图标 - 例如.doc文件的单词图标。 这有可能吗? 我试图修改setContentFromBytes方法的内容类型参数,但无济于事。
这是一个示例代码:
session.setConvertMIME(false); File file = new File("c:\\temp\\file.docx"); MIMEEntity child = document.createChildEntity(); MIMEHeader header = child.createHeader("Content-Disposition"); header.setHeaderVal("attachment; filename=" + file.getName()); header = child.createHeader("Content-ID"); header.setHeaderVal(file.getName()); Stream stream = session.createStream(); stream.open(file.getAbsolutePath(), "binary"); child.setContentFromBytes(stream,"application/vnd.openxmlformats-officedocument.wordprocessingml.document", MIMEEntity.ENC_IDENTITY_BINARY); child.encodeContent(MIMEEntity.ENC_BASE64); stream.close(); stream.truncate(); // other code here... session.setConvertMIME(true);
我也尝试过较旧的“application / msword”内容类型,但它也不起作用。
任何想法如何设置附件的图标?
谢谢!
I am using the Java-API for Lotus Domino. Current version of Domino is 8.5. I connect to Domino over DIIOP/CORBA. I want to create a document (email) with attachments. The email is a multipart MIME document. Attaching a file ist quite easy and works perfectly. However the attachment gets a generic document icon (empty gray page). I would like to set an appropriate icon for the actual content type - e.g. a word-icon for a .doc-file. Is this possible in any way? I have tried to modify the content type parameter of the setContentFromBytes-method but to no avail.
here's a sample code:
session.setConvertMIME(false); File file = new File("c:\\temp\\file.docx"); MIMEEntity child = document.createChildEntity(); MIMEHeader header = child.createHeader("Content-Disposition"); header.setHeaderVal("attachment; filename=" + file.getName()); header = child.createHeader("Content-ID"); header.setHeaderVal(file.getName()); Stream stream = session.createStream(); stream.open(file.getAbsolutePath(), "binary"); child.setContentFromBytes(stream,"application/vnd.openxmlformats-officedocument.wordprocessingml.document", MIMEEntity.ENC_IDENTITY_BINARY); child.encodeContent(MIMEEntity.ENC_BASE64); stream.close(); stream.truncate(); // other code here... session.setConvertMIME(true);
I have also tried the older "application/msword" content type but it also dont work.
Any ideas how to set the icon for the attachment?
Thanks!
原文:https://stackoverflow.com/questions/35839959
最满意答案
对于阵列,您有两种选择
使用脚本引擎注册C ++序列容器,请参阅
qScriptRegisterSequenceMetaType()
。 函数的文档有一个int向量的例子。使用
QScriptValue
作为函数的参数。 然后可以检查传递的对象是否是数组(QScriptValue::isArray()
)并使用QScriptValue::property()
通过索引访问选项(2)也适用于字典(JavaScript中的对象)。
For arrays you have two options
Registering the C++ sequence container with the script engine, see
qScriptRegisterSequenceMetaType()
. The function's documentation has an example for an int vector.Use
QScriptValue
as the function's argument. The passed object can then be checked if it is an array (QScriptValue::isArray()
) and accessed by index usingQScriptValue::property()
Option (2) also works for dictionaries (objects in JavaScript).
相关问答
更多-
为什么不能将数组作为函数参数传递? 他们能: void foo(const int (&myArray)[5]) { // `myArray` is the original array of five integers } 用技术术语来说, foo的参数类型是“引用5个const int数组”。 通过引用,我们可以传递实际对象( 免责声明 :术语因抽象级别而异) 。 你不能做的是传递价值 ,因为历史原因,我们不应该复制数组。 相反,试图通过值传递一个数组到一个函数(或者,传递一个数组的副本 )会导 ...
-
数组是否通过值传递或通过Java引用传递?(Are arrays passed by value or passed by reference in Java? [duplicate])[2022-01-25]
在技术上,它是通过值传递的,但值是对数组的引用。 通过引用的真实传递涉及传递变量的地址,以便可以更新变量。 当您在Java中传递数组时,不会发生什么。 (这个Java文档页面可以帮助您理解这一点: 陷阱:将变量视为对象 。) 以下是一些链接,说明“pass-by-reference”和“pass-by-value”的区别: http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/topic/com.ibm.xlcpp8a.doc/language/r ... -
对于您的问题的第二部分,请参阅手册的数组页面 ,其中指出(引用) : 数组赋值始终涉及值复制。 使用引用运算符通过引用复制数组。 和给定的例子:如果我理解正确,每个单元格都由包含其属性的字典表示。 每个部分都由这些字典的数组表示。 现在您只需要另一个包含节数组的数组。 NSMutableArray *allData; // just one NSMutableArray *sectionArray; // one per section NSMutableDictionary *cellDictionary; // one per row ... - (NSI ...对数组的引用按值传递。 这是混乱的根源:-) The reference to the array is passed by value. This is the source of the confusion :-)我不确定这是否是某种错误或内存泄漏,但事实是这是一种非常无记忆存储数据的方式。 因此,我编辑了代码以使用具有单独字典的3维数组来将数组的索引与文本字符串相关联,这非常有效。 我能够存储8个不同的3D阵列(150k乘8乘13)和7个不同的2D阵列(150k 13),两个双打。 开销似乎不太高。 给定每个双字节8字节的大小,理论内存使用量为1.11GB,这也不算太糟糕。 I'm not sure if this is some sort of bug or memory leak, but the fact i ...什么导致这种不一致? 数组的名称作为指向其第一个元素的指针衰减。 当你将一个数组传递给函数时,会发生这种衰减,因此传递给sizeof的表达式是一个指针,因此返回指针大小。 但是,传递给sizeof的数组总是返回数组的大小,因为在这种情况下不会有指针衰减。 当它作为参数传递时获取数组大小的最佳方式是什么? 不要按价值传递它们,通过引用或传递它们 将大小作为函数的单独参数传递。 What causes this inconsistency? The name of the array decays as an ...使用numpy.concatenate dictkeys = ('A', 'B') dicts = dict1, dict2 {key: np.concatenate([d[key] for d in dicts]) for key in dictkeys} using numpy.concatenate dictkeys = ('A', 'B') dicts = dict1, dict2 {key: np.concatenate([d[key] for d in dicts]) for key in d ...如果你想根据字典id获得最高版本,那么你可以像这样使用itertools.groupby方法: sdata = sorted(data1 + data2, key=lambda x:x['id']) res = [] for _,v in itertools.groupby(sdata, key=lambda x:x['id']): v = list(v) if len(v) > 1: # happened that the same id was in both datas ...
问:如何从qscriptengine传递数组或词典?(Qt: How are arrays or dictionaries passed from qscriptengine?)[2023-01-16]
对于阵列,您有两种选择 使用脚本引擎注册C ++序列容器,请参阅qScriptRegisterSequenceMetaType() 。 函数的文档有一个int向量的例子。 使用QScriptValue作为函数的参数。 然后可以检查传递的对象是否是数组( QScriptValue::isArray() )并使用QScriptValue::property()通过索引访问 选项(2)也适用于字典(JavaScript中的对象)。 For arrays you have two options Registeri ...相关文章
更多- 应用多个icon的对比
- Ext grid 出现checkbox和图标移位的问题(在IE)
- 第六章 注解式控制器详解(SpringMVC3.1新特性:生产者、消费者请求限定)——跟着开涛学SpringMVC
- 【原创】小白学jquery Mobile《构建跨平台APP:jQuery Mobile移动应用实战》连载五(给按钮加图标)
- 微信中QQ表情的解析(php)
- 微信中QQ表情的解析(php)
- google weather 图标
- EXT日期控件如何屏蔽后面的图标
- Android弹出浮窗对话框
- Android弹出浮窗对话框
最新问答
更多- 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
- 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
- OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
- 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
- codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
- 在计算机拍照在哪里进入
- 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
- No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
- 单页应用程序:页面重新加载(Single Page Application: page reload)
- 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
- System.StackOverflow错误(System.StackOverflow error)
- KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
- 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
- android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
- TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
- 企业安全培训的各项内容
- 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
- C#类名中允许哪些字符?(What characters are allowed in C# class name?)
- NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
- 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
- 将多个行和可变行移动到列(moving multiple and variable rows to columns)
- 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
- 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
- Angular $资源不会改变方法(Angular $resource doesn't change method)
- 在Angular 5中不是一个函数(is not a function in Angular 5)
- 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
- 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
- 常见的python rpc和cli接口(Common python rpc and cli interface)
- Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
- 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)