附件功能的实现(详见ewell.webclient.beans.warranty.WarrantysDateBean ,ewell.webclient.beans.doclinks.custom.AddDocLinksCustomBean , ewell.webclient.beans.doclinks.custom.ViewAttachmentsCustomBean)
附件浏览需在weblogic中配置附件服务在C盘doclinks文件夹内新建WEB-INF文件夹把C:\ibm\SMP\maximo\deployment路径下的web.xml文件复制进去然后到weblogic中安装部署,附件上传:如果在主表中使用只需要在数主表中添加一个doclinks的关系即可,
如果在字表中使用附件控件,要把library.xml中上传附件dialog和查看附件的dialog复制到自己的应用程序中并把savemode="ONLOAD"删除,
然后绑定自己写的DdataBean,不然在新建一行中上传附件就会发生绑定doclinks表失败和附件查看不到。
以下是自己结合经验写的步骤:
1、子表对象中创建 DOCLINKS 关联;
2、应用程序中须在选择操作中增加 关联文件、管理库等(建议参照采购单应用程序);
3、将应用程序中的 LIBRARY.XML中的 上传附件dialog 和 查看附件dialog 复制到 当前应用程序的 xml中,具体复制的dialo如下所示(根据id在 library.xml中查找相应的dialog):
<dialog beanclass="psdi.webclient.beans.emailstner.CreateInbCommBean" id="CREATEINBCOMM" label="创建通信" relationship="COMMLOG">
<helpgrid id="inbcreatecomm_help" innerhtml="要创建通信,请选择模板或直接输入消息和详细信息。"/>
<section border="true" id="inbcreatecomm_grid1">
<sectionrow id="inbcreatecomm_row1">
<sectioncol id="inbcreatecomm_col1">
<section id="inbcreatecomm_grid2">
<textbox applink="commtmplt" dataattribute="TEMPLATEID" id="inbcreatecomm_grid1_1" lookup="commtmplt" menutype="COMMLOGTMPLTID" ondatachange="resetchildren"/>
<textbox dataattribute="sendto" id="inbcreatecomm_grid1_3" lookup="SELECTRECIPIENTS"/>
<textbox dataattribute="cc" id="inbcreatecomm_grid1_4"/>
<textbox dataattribute="bcc" id="inbcreatecomm_grid1_5"/>
</section>
</sectioncol>
<sectioncol id="inbcreatecomm_col2">
<section border="false" id="inbcreatecomm_grid5">
<blankline id="inbcreatecomm_grid1_0"/>
<textbox dataattribute="sendfrom" id="inbcreatecomm_grid1_2"/>
<textbox dataattribute="replyto" id="inbcreatecomm_grid1_6"/>
</section>
</sectioncol>
</sectionrow>
</section>
<section id="inbcreatecomm_row2_col1_sec1">
<textbox dataattribute="subject" id="inbcreatecomm_grid1_7"/>
<richtexteditor columns="60" dataattribute="message" id="inbcreatecomm_grid1_8" rows="8"/>
<buttongroup id="inbcreatecomm_msg_btngrp">
<pushbutton id="inbcreatecomm_gride1_10" label="重置" mxevent="resetvalue" targetid="createcomm_grid1_8"/>
<pushbutton id="inbcreatecomm_gride1_11" label="清除" mxevent="clearvalue"/>
</buttongroup>
</section>
<datasrc beanclass="psdi.webclient.beans.doclinks.DocLinksBean" id="inbcreatecomm_attachments_src" parentdatasrc="CREATECOMM" relationship="DOCLINKS"/>
<table beanclass="psdi.webclient.beans.doclinks.DocLinksBean" datasrc="commlog_attachments_src" description="单击下面按钮之一可将附件添加到您的通信中。" id="inbattachments" inputmode="readonly" label="附件" orderby="ownertable, doctype" relationship="DOCLINKS">
<tablebody displayrowsperpage="5" filterable="false" filterexpanded="false" id="inbattachments_tablebody">
<tablecol dataattribute="document" id="inbattachments_tablebody_2" type="openurl" urlattribute="weburl"/>
<tablecol dataattribute="docinfo.description" id="inbattachments_tablebody_3"/>
<tablecol filterable="false" id="inbattachments_tablebody_5" mxevent="toggledeleterow" mxevent_desc="标记要删除的行" mxevent_icon="btn_garbage.gif" sortable="false" type="event"/>
</tablebody>
<buttongroup id="inbattachments_grid7">
<pushbutton id="inbattachments_grid7_2" label="附加文件" mxevent="ssaddnewattachmentfile"/>
<pushbutton id="inbattachments_grid7_3" label="附加 Web 页" mxevent="ssaddnewattachmentwww"/>
</buttongroup>
</table>
<buttongroup id="inbcreatecomm_grid3">
<pushbutton default="true" id="inbcreatecomm_grid3_1" label="发送" mxevent="sendmessage"/>
<pushbutton id="inbcreatecomm_grid3_2" label="取消" mxevent="docancel"/>
</buttongroup>
</dialog>
<dialog beanclass="psdi.webclient.beans.doclinks.AddDocLinksBean" id="addnewattachmentfile" label="创建文件附件" relationship="DOCLINKS" >
<helpgrid id="addnewattachmentfile_help" innerhtml="只能打印以下格式的文件:.pdf、.xls、.csv、.txt、.doc、.gif、.jpg、.ppt。如果所附的文件不属于这些格式,请清除“打印报告和所附文档(如为可打印类型)”选项(高级选项)旁的复选框。"/>
<defaultvalue dataattribute="urltype" id="addnewattachments_file_d1" value="!FILE!"/>
<section id="addnewattachments_file_1">
<combobox dataattribute="doctype" displayattribute="doctype" id="addnewattachments_file_1_2" label="选择文件夹"/>
<attachdoc id="addnewattachments_file_1_8" label="指定文件"/>
<multiparttextbox dataattribute="document" descdataattribute="description" id="addnewattachments_file_1_4" label="命名文档"/>
</section>
<section id="addnewattachments_file_2" label="高级选项">
<checkbox dataattribute="upload" id="addnewattachments_file_2_row2_col1_1_1" label="将文档复制到管理员设置的缺省位置(建议的位置)。"/>
<checkbox dataattribute="show" id="addnewattachments_file_2_row3_col1_1_1" label="将文档添加至文档库,以供他人使用"/>
<checkbox dataattribute="printthrulink" id="addnewattachments_file_2_1" label="打印报告和所附文档(如为可打印类型)"/>
</section>
<buttongroup id="addnewattachments_file_3">
<doclinkuploadbutton default="true" id="addnewattachments_file_3_1" label="确定"/>
<pushbutton id="addnewattachments_file_3_2" label="取消" mxevent="dialogcancel"/>
</buttongroup>
</dialog>
<dialog beanclass="psdi.webclient.beans.doclinks.AddAttachmentsBean" id="ssaddnewattachmentfile" label="创建文件附件" relationship="DOCLINKS">
<defaultvalue dataattribute="urltype" id="ssaddnewattachments_file_d1" value="!FILE!"/>
<section id="ssaddnewattachments_file_1">
<multiparttextbox dataattribute="document" descdataattribute="description" id="ssaddnewattachments_file_1_4" label="名称"/>
<attachdoc id="ssaddnewattachments_file_1_8" label="指定文件:"/>
</section>
<buttongroup id="ssaddnewattachments_file_2">
<doclinkuploadbutton default="true" id="ssaddnewattachments_file_2_1" label="确定"/>
<pushbutton id="ssaddnewattachments_file_2_2" label="取消" mxevent="dialogcancel"/>
</buttongroup>
</dialog>
<dialog beanclass="psdi.webclient.beans.doclinks.AddDocLinksDrBean" id="draddnewattachmentfile" label="创建文件附件" relationship="DOCLINKS">
<helpgrid id="draddnewattachmentfile_help" innerhtml="只能打印以下格式的文件:.pdf、.xls、.csv、.txt、.doc、.gif、.jpg、.ppt。如果所附的文件不属于这些格式,请清除“打印报告和所附文档(如为可打印类型)”(高级选项)旁的复选框。"/>
<defaultvalue dataattribute="urltype" id="draddnewattachments_file_d1" value="!FILE!"/>
<section id="draddnewattachments_file_1">
<combobox dataattribute="doctype" displayattribute="doctype" id="draddnewattachments_file_1_2" label="选择文件夹"/>
<attachdoc id="draddnewattachments_file_1_8" label="指定文件"/>
<multiparttextbox dataattribute="document" descdataattribute="description" id="draddnewattachments_file_1_4" label="命名文档"/>
</section>
<section id="draddnewattachments_file_2" label="高级选项">
<checkbox dataattribute="upload" id="draddnewattachments_file_2_row2_col1_1_1" label="将文档复制到管理员设置的缺省位置(建议的位置)。"/>
<checkbox dataattribute="show" id="draddnewattachments_file_2_row3_col1_1_1" label="将文档添加至文档库,以供他人使用"/>
<checkbox dataattribute="printthrulink" id="draddnewattachments_file_2_1" label="打印报告和所附文档(如为可打印类型)"/>
</section>
<buttongroup id="draddnewattachments_file_3">
<doclinkuploadbutton default="true" id="draddnewattachments_file_3_1" label="确定"/>
<pushbutton id="draddnewattachments_file_3_2" label="取消" mxevent="dialogcancel"/>
</buttongroup>
</dialog>
4、效果图: