Sunday 9 November 2014

Deploy OAF pages in EBS R 12.2.3


    1)Move the class files to JAVA_TOP

    2) Run XML Import script   ffollow below steps to  Generate Jar file.


  1. Create a temporary custom.zip file which contains all the custom application's directories/files at the non-standard location. The commands are:
    1. cd $JAVA_TOP
    2. zip -r customprod.zip <directory list> where the <directory list> is the list of all the directory paths, relative to $JAVA_TOP, for custom application's java files at the non-standard location.
  2. Generate and sign the customprod.jar file. Command: adjava oracle.apps.ad.jri.adjmx -areas $JAVA_TOP/customprod.zip -outputFile $JAVA_TOP/customprod.jar -jar $CONTEXT_NAME 1 CUST jarsigner
  3. Follow the steps below to make the custom jar file available for WebLogic Server:
    1. Back up the existing <FND_TOP>/admin/template/ebsProductManifest_xml.tmp
    2. Modify <FND_TOP>/admin/template/ebsProductManifest_xml.tmp to add the entry below for customprod.jar (after customall.jar):
      <library>customprod.jar</library>
    3. Run AutoConfig.
    4. Bounce the middle-tier services.
    5. NOTE: These changes will be lost if ebsProductManifest_xml.tmp is patched in future; changes will need to be done again.
  4. In order to to synchronize the changes (during the next prepare phase) between both the file systems fs1 and fs2, follow the steps below. Note that the custom synchronization driver file, located at <APPL_TOP_NE>/ad/custom/adop_sync.drv, should be used in these steps. This file has the required documentation on how to put an entry in for a file that needs to be synchronized between the two file systems.
    1. If there are custom java class files under <JAVA_TOP>/oracle/<cust_prod>/* directory and if the files under this directory needs to be synchronized between fs1 and fs2 , then put the following entry in the custom synchronization driver file as below:
      cp -r %s_current_base%/EBSapps/comn/java/classes/oracle/<cust_prod> %s_other_base%/EBSapps/comn/java/classes/oracle
    2. To copy the custom jar file, add the following entry:
      cp %s_current_base%/EBSapps/comn/java/classes/customprod.jar %s_other_base%/EBSapps/comn/java/classes
    3. To synchronize the custom changes done to the template, add the entry below:
      cp %s_current_base%/EBSapps/appl/fnd/12.0.0/admin/template/ebsProductManifest_xml.tmp %s_other_base%/EBSapps/appl/fnd/12.0.0/admin/template
    4. After changes are synchonized, ensure Autoconfig is run for the latest template changes to take effect.

    Note:Refer DOC ID:1577661.1 from meta link for more Info

Bounce Command for EBS


Use below commands to Bounce the server for OAF from putty.

1) set Environment variable if any .

2) cd $ADMIN_SCRIPTS_HOME

11i:
adapcctl.sh stop;
adapcctl.sh start;

R12:
adoacorectl.sh stop
adapcctl.sh stop
adapcctl.sh start
adoacorestl.sh start

Below are the commands to bounce server in R12.2.3

adapcctl.sh stop
admanagedsrvctl.sh stop oacore_server1
Eneter Weblogic Password:********
admanagedsrvctl.sh start oacore_server1
Eneter Weblogic Password:********
adapcctl.sh start

OAF Page to Upload Files into Server

1. Create a New Workspace and Project
File > New > General > Workspace Configured for Oracle Applications
File Name – FileUploadDemo
 
Automatically a new OA Project will also be created
 
Project Name -- FileUploadDemo
Default Package -- xxupload.oracle.apps.fnd.fileuploaddemo
 
2. Create a New Application Module (AM)
Right Click on FileUploadDemo > New > ADF Business Components > Application Module
Name -- FileUploadAM
Package -- xxupload.oracle.apps.fnd.fileuploaddemo.server
Check Application Module Class: FileUploadAMImpl Generate JavaFile(s)
 
3. Create a New Page
Right click on FileUploadDemo > New > Web Tier > OA Components > Page
Name -- FileUploadPG
Package -- xxupload.oracle.apps.fnd.fileuploaddemo.webui

4. Create a New Item messageFileUpload Bean under MainRN 
  
Right click on MainRN > New > messageFileUpload
Set Following Properties for New Item -- 
ID:MessageFileUpload
Item type:MessageFileUpload 



Write Following Code in FileUploadCO processFormRequest
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;
import oracle.apps.fnd.framework.OAException;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processFormRequest(pageContext, webBean);  

 if(pageContext.getParameter("Submit")!=null)
 {
  upLoadFile(pageContext,webBean);    
 }
}





Write Following Code in FileUploadCO processFormRequest
 
import oracle.cabo.ui.data.DataObject;
import java.io.FileOutputStream;
import java.io.InputStream;
import oracle.jbo.domain.BlobDomain;
import java.io.File;
import oracle.apps.fnd.framework.OAException;

public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
{ super.processFormRequest(pageContext, webBean);  

 if(pageContext.getParameter("Submit")!=null)
 {
  upLoadFile(pageContext,webBean);    
 }
}


public void upLoadFile(OAPageContext pageContext,OAWebBean webBean)
{ String filePath = "/u01/app/apnac03r12/";
 System.out.println("Default File Path---->"+filePath);

 String fileUrl = null;
 try
 {
  DataObject fileUploadData =  pageContext.getNamedDataObject("MessageFileUpload");

//FileUploading is my MessageFileUpload Bean Id
  if(fileUploadData!=null)
  {
   String uFileName = (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");  
   String contentType = (String) fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");  
   System.out.println("User File Name---->"+uFileName);

   FileOutputStream output = null;
   InputStream input = null;

   BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, uFileName);
   System.out.println("uploadedByteStream---->"+uploadedByteStream);
                          
   File file = new File("/u01/app/apnac03r12/PRajkumar", uFileName);  
   System.out.println("File output---->"+file);

   output = new FileOutputStream(file);
   System.out.println("output----->"+output);
   input = uploadedByteStream.getInputStream();

   System.out.println("input---->"+input);
   byte abyte0[] = new byte[0x19000];
   int i;
    
   while((i = input.read(abyte0)) > 0)
   output.write(abyte0, 0, i);

   output.close();
   input.close();
  }
 }
 catch(Exception ex)
 {
  throw new OAException(ex.getMessage(), OAException.ERROR);
 }    
}