Tuesday, 8 May 2018

How to remove personalization in OAF

Now we are goin to learn how to remove the personalization in OAF.

Step1:- Login to oracle application.
Step2:- Switch to Functional Administrator responsibility.
Step3:- Click on personalization tab.
Step4:- For application, Enter the respective application name.
Step5:- Click on the Personalized Checkbox.
Step6:- Click Go.
Step7:- Remove or De-activate your personalization by selecting the personalization level at
             which you made a particular personalization.

OR

Step1:- Login to oracle application.
Step2:- Switch to Functional Administrator responsibility.
Step3:- Click on personalization tab.
Step4:- Click on import/export sub tab menu.
Step5:- For application, Enter the respective application name.
Step6:- Provide the document path.
             To get the path
            Go to sql developer run the following it will give the path.          


DECLARE
BEGIN
jdr_utils.listcustomizations
(p_document => '/oracle/apps/per/talentprofile/webui/TMEmployeePG');
END;

 DECLARE
BEGIN
jdr_utils.printdocument
(p_document => '/oracle/apps/per/talentprofile/webui/TMEmployeePG');
END;


DECLARE
BEGIN
jdr_utils.deletedocument(p_document => ‘/oracle/apps/icx/por/wf/webui/customizations/site/0/ReqLinesNotificationsRN’);
END;

Step7:- Click on Go.

Step8:- select the personalization and delete it.

Find the Customization's in Back End.


SELECT path_name,
       path_type,
       last_update_date,
       att_value,
       att_comp_seq,
       att_seq,
       att_name
  FROM jdr_attributes ja, jdr_components jc, jdr_paths jp
 WHERE att_comp_docid = comp_docid AND comp_element = 'customization' --and att_name = 'controllerClass'
       AND path_docid = comp_docid AND att_value LIKE '%xxchr%'

Flex Field calling in OAF

Now we are going to learn about how to call the KFF in OAF.

The below query will give the required information about flex field.

SELECT  fif.application_id, 
                fif.id_flex_code, 
                fif.id_flex_name, 
                fif.application_table_name,  
                fif.description, 
                fifs.id_flex_num, 
                fifs.id_flex_structure_code, 
                fifse.segment_name, 
                fifse.segment_num, 
                fifse.flex_value_set_id 
FROM     fnd_id_flexs                    fif, 
                fnd_id_flex_structures   fifs,  
                fnd_id_flex_segments    fifse 
WHERE  fif.application_id      = fifs.application_id 
AND       fif.id_flex_code         = fifs.id_flex_code 
AND       fifse.application_id   = fif.application_id 
AND       fifse.id_flex_code      = fif.id_flex_code 
AND       fifse.id_flex_num      = fifs.id_flex_num 
AND       fif.id_flex_code         LIKE 'GL#'
AND       fif.id_flex_name       LIKE 'Accounting Flexfield';


Step1: - Create a work space and project with the package
            sangu.oracle.apps.po.KFFPrj

Step2: - Create an Application Module.

                        Name: - KFFAM
                        Package: - sangu.oracle.apps.po.KFFPrj.server

Step3:- Create a view object.

                        Name: - KFFVO
                        Package: - sangu.oracle.apps.po.KFFPrj.server
                        Query: - SELECT  code_combination_id
                        FROM    gl_code_combinations_kfv

Note: - Generate the java files.

Step4: - Attach the VO to AM.

Step5: - Create new page.

                        Name: - KFFPG
                        Package: - sangu.oracle.apps.po.KFFPrj.webui

Step6:- Attach the AM to the Page Layout Region of a page.
            Give the window title and title.

Step7: - Create new Stack Layout Region Under Page Layout Region

Step8: - Create new item of type Flex under Stack Layout Region.
               And set the below properties.

                        ID: - KffItem
                        Prompt: - KFF
                        View Instance: - KFFVO1
                        Application Short Name: - SQLGL
                        Name: - GL#
                        Type: - Key

Step9:- Create a controller for the page.
             Right click on pageLayout region== > set new controller.

                        Name: - KFFCO
                        Package: - sangu.oracle.apps.po.KFFPrj.webui
Step10: - Write Following Code in KFFCO processRequest

                

/* For Copy Paste */



        public void processRequest(OAPageContext pageContext, OAWebBean webBean)
          {
             super.processRequest(pageContext, webBean);
   
       OAKeyFlexBean kffBean = (OAKeyFlexBean)webBean.findIndexedChildRecursive("KffItem");
       
               if(kffBean != null)
               {
                    // Set the code combination lov
                    kffBean.useCodeCombinationLOV(true);
                    //set the structure code for the item key flex
                    kffBean.setStructureCode("FED_AFF");
                    //Set the attribute name to the item
                    kffBean.setCCIDAttributeName("CodeCombinationId");
                    //Execute the Query
                    KFFAMImpl am = (KFFAMImpl)pageContext.getApplicationModule(webBean);
                    KFFVOImpl vo = (KFFVOImpl)am.findViewObject("KFFVO1");
           
                    if(!vo.isPreparedForExecution())
                    {
                        vo.executeQuery();
                    }
               }
          }

Step11:- This finishes the calling kff in OAF run the page to see the output.

                       
             

Friday, 4 May 2018

Unable to open JDeveloper jvm.dll missing .


In one of my project, in one machine we were not able to open the Jdeveloper  (Version 10.1.3.5 - Patch 19170592 ) which we downloaded from the Metalink Note. This post is to help those who face this issue and don't know what to do to fix this.

OA Framework - How to Find the Correct Version of JDeveloper for OA Extensions to Use with E-Business Suite 11i or Release 12.x (Doc ID 416708.1)
After downloading p22501192_R12_GENERIC.zip, unzipped the contents into C:\OAF\jdevbin. After that when we tried to open the Jdeveloper using C:\OAF\jdevbin\jdeveloper.exe we were getting the below error.

"The program can't start because MSVCR71.dll is missing from your computer. Try reinstalling the program to fix this problem."




Fix:  You just need to copy the msvcr71.dll file from C:\OAF\jdevbin \jdk\bin to into C:\OAF\jdevbin \jdev\bin.

After copying the file, Jdeveloper opened successfully.



OAF Useful scripts


XLIFFExtractor in Unix Environment [Download XLIF file for language change]

java oracle.jrad.tools.trans.extractor.XLIFFExtractor /xxcustom/oracle/apps/xxchr/talentprofile/webui/XXCHRPersonDataRN -root $JAVA_TOP/xxcustom /fr-FR -username $APPS_NAME -password $APPS_PASSWORD -dbconnection $AD_APPS_JDBC_URL -source db -languages en-US,fr-FR -mmd_dir $OA_HTML/jrad -xliff_dir $JAVA_TOP/ xxcustom /fr-FR

XLIFFImporter  in Unix Environment [Upload XLIF file for language change]

java oracle.jrad.tools.trans.imp.XLIFFImporter $JAVA_TOP/xxcustom/Francization/XXCHRPersonDataRN.xlf FR -username $APPS_NAME -password $APPS_PASSWORD -dbconnection $AD_APPS_JDBC_URL

JSP Compilation in Unix Environment


Move your JSP into OA_HTML Directory and run below commands to Compile JSP. Compiled JSP will create respected JSP Class file in $COMMON_TOP/_pages

JPX import in Unix Environment

java oracle.jrad.tools.xml.importer.JPXImporter $JAVA_TOP/TestProject.jpx FR -username $APPS_NAME -password $APPS_PASSWORD -dbconnection $AD_APPS_JDBC_URL


XML Import in Unix Environment


java oracle.jrad.tools.xml.importer.XMLImporter  $JAVA_TOP/xxmhp/oracle/apps/per/loan/webui/TestPG.xml   --rootdir  $JAVA_TOP FR -username $APPS_NAME -password $APPS_PASSWORD -dbconnection $AD_APPS_JDBC_URL

XML Import in Windows Environment


import d:\Jdevloper\jdevhome\jdev\myprojects\xx\oracle\apps\per\webui\EmployeePG.xml -rootdir d:\jdevhome\jdev\myprojects FR -username $APPS_NAME -password $APPS_PASSWORD -dbconnection $AD_APPS_JDBC_URL


JPX import in Windows Environment


jpximport d:\Employee.jpx -userId 1 -username apps -password apps -dbconnection $AD_APPS_JDBC_URL




11i Environment


$JTF_TOP/admin/scripts/ojspCompile.pl --compile -s 'abcd.jsp' --flush

R12 Environment


$FND_TOP/patch/115/bin/ojspCompile.pl --compile -s 'abcd.jsp' --flush


Upload Files into Server in OAF Dynamically


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 -- xxcustom.oracle.apps.fnd.fileuploaddemo
 
2. Create a New Application Module (AM) 

Right Click on FileUploadDemo > New > ADF Business Components > Application Module 
Name -- FileUploadAM
Package -- xxcustom.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 -- XxchrFileUploadPG 
Package -- xxcustom.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 XxchrFileUploadCO 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)
 {
   
XxchrupLoadFile (pageContext,webBean);    
 }
}





Write Following Code in XxchrFileUploadCO  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)
 {
  XxchrupLoadFile (pageContext,webBean);    
 } 

}


public void XxchrupLoadFile(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");  
   FileOutputStream output = null;
   InputStream input = null;

   BlobDomain uploadedByteStream = (BlobDomain)fileUploadData.selectValue(null, uFileName); 
   File file = new File("/u01/app/apnac03r12/srini1034", uFileName);
   output = new FileOutputStream(file);
   input = uploadedByteStream.getInputStream();

   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);
 }    
}
  


Thursday, 3 May 2018

How to Capture LOV Input Event


  1. if (pageContext.isLovEvent())  
  2.       {  
  3.       System.out.println("Inside LOV Event");  
  4.       String lovInputSourceId = pageContext.getLovInputSourceId();  
  5. //checking which lov event is fired.  
  6. //Below EmployeeLovInput is the ID of messageLovInput  
  7.    if ("EmployeeLovInput".equals(lovInputSourceId))  
  8.        {  
  9.          //Invokes AM Method   
  10.             am.invokeMethod("setExtraInfo");  
  11.        }  
  12. }  

The pageContext.isLovEvent method returns true/Fires if the event value is LOV_UPDATE (meaning the user selected a value from the LOV modal window), or LOV_VALIDATE (meaning the user tabbed out of the LOV input field on the base page).

Making Attachment Link Mandatory


Need to make the Attachment Link Bean mandatory. Use the below line of code in Process Form Request .

OAMessageAttachmentLinkBean oamessageattachmentlinkbean = (OAMessageAttachmentLinkBean)oawebbean.findChildRecursive("");

String attachVal = (String)oamessageattachmentlinkbean.getAttributeValue(oapagecontext.getRenderingContext(),TEXT_ATTR);

if("None".equals(attachVal))
{
throw new OAException(“Attachment mandatory”,OAException.ERROR);
}