如何在XPage中显示富文本图像(保存在Notes文档中)

时间:2013-10-24 23:13:50

标签: image xpages

每个人都在谈论打开附件。它不是附件!图像粘贴在Notes文档中的富文本字段中。当我使用图像查看这些Notes文档的属性时(不幸的是我无法将图像粘贴到此文件中),为此富文本字段创建了内部字段,即MIME_Version,以及富文本的名称字段列出四(4)次,如下所示:

Field Name: myImage
Data Type: MIME Part
Data Length: 141 bytes
Seq Num: 3
Dup Item ID: 1
Field Flags: SIGN SEAL 

"Content-Type: multipart/related; boundary="=_related 006391B688257C0D_="

This is a multipart message in MIME format.
"
___________________________________________________
Field Name: myImage
Data Type: MIME Part
Data Length: 150 bytes
Seq Num: 3
Dup Item ID: 2
Field Flags: SIGN SEAL 

"--=_related 006391B688257C0D_=
Content-Type: text/html; charset="US-ASCII"

<img src=cid:_2_0BCE1D8C0BCE1ACC006391B688257C0D>
"
____________________________________________________
Field Name: myImage
Data Type: MIME Part
Data Length: 14064 bytes
Seq Num: 3
Dup Item ID: 3
Field Flags: SIGN SEAL 

"--=_related 006391B688257C0D_=
Content-Type: image/jpeg
Content-ID: <_2_0BCE1D8C0BCE1ACC006391B688257C0D>
Content-Transfer-Encoding: base64

/9j/4AAQSkZJRgABAQEBLAEsAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK
CwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU
FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBT/wAARCACtALUDASIA
AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA
AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3
ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eX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Pxfr/i7QhaXWsieAoGdJYwOPqF
r4w8A+Gx5tyJSB5iFFDdB/tfhX3h8BLC38IeHEWeePdMAkUBfLk+pFTGojRxZ8L69qN5ZfF3xMtt
eT2y/wBq3IPkyMmfnPoa6n9pLU5bz9muKKa5muGGq2pXzZC3c9M1VTwS/ir4sa5KNQtrGefWbkLD
O3JBkOD+Ndd+1t4OGjfs8aZGtzDeM2qwljbHdjrSvFu4JSPEfh3ezQarAI7qaFRgARyFR+hr1b49
X9wNM8GTx3U5mUODL5h3jjpnrXJ/CP4Zt4ivLdYdUgicIhcPG52Eg8Eqp9K9W+PngBjfeFfD41K2
aeOKT94iMQHUnIIxnPHpRzxW4+STPO ..."

_________________________________________________
Field Name: myImage
Data Type: MIME Part
Data Length: 54 bytes
Seq Num: 3
Dup Item ID: 4
Field Flags: SIGN SEAL 

"--=_related 006391B688257C0D_=--
"

有人可以告诉我如何在Xpages中显示保存在Notes文档中的此图像。应该使用什么类型的XPage控件?提前谢谢。

2 个答案:

答案 0 :(得分:1)

您可以使用简单数据绑定绑定到当前文档中的Rich Text字段。

在我绑定到document1的情况下,一个名为OverviewPicsChildparts的字段包含粘贴的图像。

但是我试图将一个粘贴的图像显示到一个重复控件中,该控件的源文件是document1的响应文档的DocumentCollection,这似乎不是那么直接。

但是我通过添加此代码解决了这个问题......

<xp:this.data>                  
  <xp:dominoDocument var="doc"
      action="openDocument"
      documentId="#{javascript:AllResponseDocs.getNoteID()}"            ignoreRequestParams="true">
  </xp:dominoDocument>
</xp:this.data>

进入重复控件内的一个面板,然后能够使用Simple Data Binding绑定到doc我想要的字段......

<xp:inputRichText 
  id="inputRichText1" 
  value="#{doc.ProPicture}" 
  readonly="true"
  style="width:198.0px;height:141.0px">
</xp:inputRichText>

它对我有用。

答案 1 :(得分:0)

正如史蒂夫所说,要显示RichText数据,您需要RichText控件。很简单。

如果RichText数据包含图像和其他数据,如文本或表格,则情况会有所不同,而且要复杂得多。在这种情况下,您需要NotesMIME类来获取RichText数据的HTML表示,解析它,提取对所需图像的引用,然后运行所有MIME项以查找包含图像数据的项。

简而言之:当RichText单独包含图像时,它很容易,Steve给出了一个很好的例子。否则它很复杂。