OAF与XML Pulisher集成.doc_第1页
OAF与XML Pulisher集成.doc_第2页
OAF与XML Pulisher集成.doc_第3页
OAF与XML Pulisher集成.doc_第4页
OAF与XML Pulisher集成.doc_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

OAF多语言实现 六月 22, 2013AIMMD070 Programer TrainingeGrid ConsultingOAF与XML Publisher集成Author:梁贤院Creation Date:December 1, 2012Last Updated:六月 22, 2013Document Ref: Version:V1.0Note: Title, Subject, Last Updated Date, Reference Number, and Version are marked by a Word Bookmark so that they can be easily reproduced in the header and footer of documents. When you change any of these values, be careful not to accidentally delete the bookmark. You can make bookmarks visible by selecting Tools-OptionsView and checking the Bookmarks option in the Show region.Approvals:Note: To add additional approval lines, press Tab from the last cell in the table above.Copy Number_Note: You can delete any elements of this cover page that you do not need for your document. For example, Copy Number is only required if this is a controlled document and you need to track each copy that you distribute.Document ControlChange Record4DateAuthorVersionChange Reference1-Dec-12SandyLiang1.0No Previous DocumentReviewersNamePositionDistributionCopy No.NameLocation1234Note: The copy numbers referenced above should be written into the Copy Number space on the cover of each distributed copy. If the document is not controlled, you can delete this table, the Note To Holders, and the Copy Number label from the cover page.Note To Holders:If you receive an electronic copy of this document and print it out, please write your name on the equivalent of the cover page, for document control purposes.If you receive a hard copy of this document, please write your name on the front cover, for document control purposes.ContentsDocument Controlii环境ivEBS 环境iv本地环境iv用VO与XML Publisher集成5用VO生成数据.AM里调用5用CO调用方法5用PL/SQL与XML Publisher集成7用PL/SQL方法实例7AM调用方法7CO调用方法7Open and Closed Issues for this Deliverable9Open Issues9Closed Issues9环境EBS 环境Operating system platform:UNIXOracle RDBMS Version: .0Oracle Applications Version:Oracle Forms Version:5.2本地环境Jdeveloper安装在 D:JdeveloperOpen and Closed Issues for this Deliverable Error! Reference source not found.File Ref: Ca0f923103f2d26ccad6f522355aa5f7.pdf (V1.0 )Company Confidential - For internal use only用VO与XML Publisher集成用VO生成数据.AM里调用在application module调用方法:import oracle.jbo.XMLInterface;import oracle.xml.parser.v2.XMLNode;public XMLNode getReportXMLNode(String keyId) ChgDisPrintTmpVOImpl vo = getChgDisPrintTmpVO1(); vo.executeQuery(); XMLNode xmlNode = (XMLNode) vo.writeXML(4, XMLInterface.XML_OPT_ALL_ROWS); return xmlNode;用CO调用方法增加一个funciton public void PrintPDF(OAPageContext pageContext, OAWebBean webBean, XMLNode xmlNode, String keyId) HttpServletResponse response = (HttpServletResponse) pageContext.getRenderingContext().getServletResponse(); String changeOrderType = pageContext.getParameter(ChangeOrderType); / Set the Output Report File Name and Content Type String contentDisposition = attachment;filename=Distribution + keyId + .pdf; response.setHeader(Content-Disposition, contentDisposition); response.setContentType(application/pdf); try ByteArrayOutputStream outputStream = new ByteArrayOutputStream(); xmlNode.print(outputStream); /xmlNode.print(System.out); ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray(); OADBTransactionImpl oaTrans = (OADBTransactionImpl) pageContext.getApplicationModule(webBean).getOADBTransaction(); String templateName = XVK_CHANGEMEMO_TEMPLATE_ENG; TemplateHcessTemplate(oaTrans.getAppsContext(), XVK, templateName, zh, CN, inputStream, TemplateHelper.OUTPUT_TYPE_PDF, null, response.getOutputStream(); response.getOutputStream().flush(); response.getOutputStream().close(); catch (Exception e) response.setContentType(text/html); throw new OAException(e.getMessage(), OAException.ERROR); pageContext.setDocumentRendered(false); 修改CO processFormRequest事件public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) String event = pageContext.getParameter(EVENT_PARAM);if(print.equals(event) String KeyId = pageContext.getParameter(KeyId); parameters = new Serializable KeyId ; XMLNode xmlNode = (XMLNode) am.invokeMethod(getReportXMLNode , parameters); PrintDisPDF(pageContext, webBean, xmlNode, KeyId); 用PL/SQL与XML Publisher集成用PL/SQL方法实例PROCEDURE print_payment_request ( p_payment_request_id IN NUMBER ,x_out_xml OUT CLOB ) ISBEGINdbms_lob.createtemporary(x_out_xml, TRUE);l_temp_str := | CHR(10) | | CHR(10);dbms_lob.writeappend(lob_loc = x_out_xml, amount = length(l_temp_str), buffer = l_temp_str);l_temp_str := l_temp_str | | r_h.materials | | CHR(10);l_temp_str := ;dbms_lob.writeappend(lob_loc = x_out_xml, amount = length(l_temp_str), buffer = l_temp_str);END;AM调用方法public CLOB getPaymentRequestXMLClob(String paymentRequestId) Number reqId = null; CLOB tempClob = null; OADBTransaction oaDbTrans = getOADBTransaction(); OracleCallableStatement stmt = null; try reqId = new Number(paymentRequestId); String strSQL = BEGIN xvk_contract_reports_pkg.print_payment_request(p_payment_request_id= :1,x_out_xml=:2); END; stmt = (OracleCallableStatement) oaDbTrans.createCallableStatement(strSQL, 1); stmt.setNUMBER(1, reqId); stmt.registerOutParameter(2, Types.CLOB); stmt.execute(); tempClob = stmt.getCLOB(2); stmt.close(); catch (Exception exception1) throw OAException.wrapperException(exception1); return tempClob;CO调用方法public void PrintPDF(OAPageContext pageContext, OAWebBean webBean, CLOB xmlClob) HttpServletResponse response = (HttpServletResponse) pageContext.getRenderingContext().getServletResponse(); / Set the Output Report File Name and Content Type String contentDisposition = attachment;filename=PaymentRequest.pdf; response.setHeader(Content-Disposition, contentDisposition); response.setContentType(application/pdf); try Reader inputReader = xmlClob.getCharacterStream(); OADBTransactionImpl oaTrans = (OADBTransactionImpl) pageContext.getApplicationModule(webBean).getOADBTransaction(); String templateName = XVK_CONTRACT_PAYMENT_REQUEST; TemplateHcessTemplate(oaTrans.getAppsContext(), XVK, templateName, zh, CN, inputReader, TemplateHelper.OUTPUT_TYPE_PDF, null, response.getOutputStream(); response.getOutputStream().flush(); response.getOutputStream().close(); catch (Exception e) response.setContentType(text/html); throw new OAException(e.getMessage(), OAException.ERROR); pageContext.setDocumentRendered(false);修改CO事件 processFormRequestString event = pageContext.getParameter(EVENT_PARAM);if(print.equals(event) String paymentRequestId = pageContext.getParameter(paymentRequestId); Serializable param = paymentRequestId; CLOB tempClob = (CLOB) am.invokeMethod(getPaymentRequestXMLClob,param); PrintPDF(pageContext, webBean ,tempClob); Open and Closed Issues for this

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论