OAF的CLASS文件通过 JAD反编译后处理
JAVA类文件:CommonUploadAMImpl.class 反编译后文件:CommonUploadAMImpl.java
将 OAF 类文件反编译后,需要修改一下才能使用
CommonUploadCO.java
import java.io.Serializable; import oracle.apps.fnd.common.VersionInfo; import oracle.apps.fnd.framework.OAApplicationModule; import oracle.apps.fnd.framework.OAException; import oracle.apps.fnd.framework.webui.OAControllerImpl; import oracle.apps.fnd.framework.webui.OAPageContext; import oracle.apps.fnd.framework.webui.beans.OAStaticStyledTextBean; import oracle.apps.fnd.framework.webui.beans.OAWebBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageDownloadBean; import oracle.apps.fnd.framework.webui.beans.message.OAMessageStyledTextBean; import oracle.cabo.ui.data.DataObject; import oracle.jbo.domain.BlobDomain; public class CommonUploadCO extends OAControllerImpl { public void processRequest(OAPageContext pageContext, OAWebBean webBean) { super.processRequest(pageContext, webBean); OAApplicationModule am = pageContext.getApplicationModule(webBean); am.invokeMethod("handleComImportPPRAction"); String importCode = pageContext.getParameter("ImportCode"); Serializable paramFlag[] = { importCode }; Class aclassFlag[] = { // java/lang/String String.class }; am.invokeMethod("queryCommonSetup", paramFlag, aclassFlag); OAMessageStyledTextBean templateFileBean = (OAMessageStyledTextBean)webBean.findChildRecursive("TemplateFileName"); OAMessageDownloadBean downloadBean = (OAMessageDownloadBean)webBean.findChildRecursive("TemplateFile"); OAStaticStyledTextBean noTemplateHint = (OAStaticStyledTextBean)webBean.findChildRecursive("NoTemplateHint"); String templateFileName = (String)templateFileBean.getValue(pageContext); if(templateFileName != null && !templateFileName.trim().equals("")) { String fileSuffix = templateFileName.substring(templateFileName.lastIndexOf(".") + 1).toLowerCase(); if(fileSuffix.equals("xls") || fileSuffix.equals("xlsx")) downloadBean.setFileContentType("application/vnd.ms-excel"); else downloadBean.setFileContentType("text/html"); } else { downloadBean.setRendered(false); noTemplateHint.setRendered(true); } } public void processFormRequest(OAPageContext pageContext, OAWebBean webBean) { super.processFormRequest(pageContext, webBean); OAApplicationModule am = pageContext.getApplicationModule(webBean); String commonImportsId = pageContext.getParameter("CommonImportsId"); String importCode = pageContext.getParameter("ImportCode"); DataObject fileUploadData = pageContext.getNamedDataObject("FileUpload"); String importFlag = "N"; OAException message = null; if(pageContext.getParameter("Upload") != null) { String uploadFileName = null; try { uploadFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME"); } catch(NullPointerException ex) { throw new OAException("CUX", "CUX_FND_FILE_UPLOAD_ERROR", null, (byte)0, null); } String fileSuffix = uploadFileName.substring(uploadFileName.lastIndexOf(".") + 1).toLowerCase(); if(fileSuffix.equals("xls") || fileSuffix.equals("xlsx") || fileSuffix.equals("csv") || fileSuffix.equals("txt")) { BlobDomain uploadFileBlob = (BlobDomain)fileUploadData.selectValue(null, uploadFileName); Serializable param[] = { uploadFileBlob, uploadFileName, commonImportsId, importCode }; Class aclass[] = { // oracle/jbo/domain/BlobDomain, java/lang/String, java/lang/String, java/lang/String BlobDomain.class,String.class,String.class,String.class }; importFlag = (String)am.invokeMethod("importFileData", param, aclass); if(importFlag.equals("Y")) { String disabledFlag = "Y"; Serializable paramFlag[] = { disabledFlag }; Class aclassFlag[] = { // java/lang/String String.class }; am.invokeMethod("setButtonEnabled", paramFlag, aclassFlag); message = new OAException("CUX", "CUX_FND_FILE_UPLOAD_CONFIRM", null, (byte)3, null); } } else { message = new OAException("CUX", "CUX_FND_FILE_UPLOAD_TYPE", null, (byte)0, null); } } else if(pageContext.getParameter("Cancel") != null) { String jScript = "window.close()"; pageContext.putJavaScriptFunction("FunctionName", jScript); } if(message != null) pageContext.putDialogMessage(message); } public CommonUploadCO() { } public static final String RCS_ID = "$Header$"; public static final boolean RCS_ID_RECORDED = VersionInfo.recordClassVersion("$Header$", "%packagename%"); }
修改以后代码段:
Class aclassFlag[] = {
java/lang/String
};
修改为:
Class aclassFlag[] = {
// java/lang/String
String.class
};
优质生活从拆开始