Saturday, November 08, 2014

OAF : Reading the data form the csv file and loading the data to table


PFR Logic :



    if(pageContext.getParameter("save")!=null)
      {
     
        DataObject fileUploadData =    (DataObject)pageContext.getNamedDataObject("FileUploadItem");
              String fileName = null;
              String contentType = null;
              Long fileSize = null;
              Integer fileType = new Integer(6);
              BlobDomain uploadedByteStream = null;
              BufferedReader in = null;

              try
              {
                fileName =  (String)fileUploadData.selectValue(null, "UPLOAD_FILE_NAME");
                contentType =  (String)fileUploadData.selectValue(null, "UPLOAD_FILE_MIME_TYPE");
                uploadedByteStream =  (BlobDomain)fileUploadData.selectValue(null, fileName);
                in =  new BufferedReader(new InputStreamReader(uploadedByteStream.getBinaryStream()));

                fileSize = new Long(uploadedByteStream.getLength());
                System.out.println("fileSize  : " + fileSize);
                System.out.println("fileName :"+fileName);
                System.out.println("contentType :"+contentType);
               
              } catch (NullPointerException ex)
              {
                throw new OAException("Please Select a File to Upload",      OAException.ERROR);
              }
             
            writeLinesToVO(pageContext,webBean, in);
      }


-----------------------


   public void writeLinesToVO(OAPageContext pageContext, OAWebBean webBean , BufferedReader  in )
    {

    xxlearn.oracle.apps.fnd.server.LearnAMImpl am = (xxlearn.oracle.apps.fnd.server.LearnAMImpl)pageContext.getApplicationModule(webBean);
    XxcusCsvFileBlobEOVOImpl vo = am.getXxcusCsvFileBlobEOVO1() ;
    XxcusCsvFileBlobEOVORowImpl row = null;
   
    try
    {
      //Open the CSV file for reading
      String lineReader = "";
      long t = 0;
      String[] linetext;
          while (((lineReader = in.readLine()) != null))
          {
                //Split the deliminated data and
                if (lineReader.trim().length() > 0)
                {
                  System.out.println("lineReader" + lineReader.length());
                  linetext = lineReader.split(",");
                  t++;
                  int lineLength = linetext.length;
                  System.out.println("line text length is : " + lineLength);
                  if(lineLength ==3)
                   {
                                        row = (XxcusCsvFileBlobEOVORowImpl)vo.createRow();
                                        Number fileID = am.getOADBTransaction().getSequenceValue("XXCUS_CSV_FILE_ID_S");
                                        row.setFileId(fileID);
                                        row.setOrgcode(linetext[0]);
                                       row.setSegment(linetext[1]);
                                       row.setStatus(linetext[2]);
                                       
                   }                  
                 
                    for (int k = 0; k < lineLength; k++)
                    {  

                      System.out.println(linetext[k]);
                     
                    } //for
       
                }//if
   
          } //while
 
    am.getOADBTransaction().commit();
    }//try

    catch (IOException e)
    {
    }
   
    throw new OAException("Data Saved Successfully", OAException.INFORMATION) ;
  }



Database Table Structure
-----------------------------------------------------------------------------------------

  CREATE TABLE xxcus_csv_file_blob
(
 file_id INTEGER
 , status varchar2(100)
 ,segment varchar2(100)
 ,orgcode varchar2(10)
,creation_date DATE
,created_by    NUMBER
,last_update_date DATE
,last_updated_by INTEGER
,last_update_login INTEGER
,CONSTRAINT xxcus_csv_file_id PRIMARY KEY (file_id)
) ;

create sequence XXCUS_CSV_FILE_ID_S ;

-----------------------------------------------------------------------------------------


PS: Above coding is  not totally mine, i copied from the below blog

http://rajubandam.blogspot.in/2014/01/uploading-csv-file-into-data-base-table.html




Friday, November 07, 2014

PLSQL API to validate  Oracle E-business Suite Login Credentials.



1. Call the below API to validate user/password details of  Oracle E-Business Suite
FND_WEB_SEC.VALIDATE_LOGIN( '<userName>','<password>')

Ex : select FND_WEB_SEC.VALIDATE_LOGIN( 'OPERATIONS','welcome') from dual ;

Returns 'Y' -- if valid , else returns 'N'
How to Invoke ADF Page From Oracle E-Business Suite.  The following gives the step by step information about how to register.  ( I have Used : Oracle E-Business Suite : R12.2.4)

Ebiz Login Screen


Target ADF  Page à which is expected to be called

http://localhost:7101/XXHelloADF-ViewController-context-root/faces/HelloWorldPG.jsf



Profile Name: External ADF Application URL

AOL Function Registration
Name                    XXCUS_ADF_HELLO_WORLD
Code                     XXCUS_ADF_HELLO_WORLD     
Description                         ADF Hello World Sample
HTML Call                           GWY.jsp?targetPage=faces/HelloWorldPG.jsf

Menu


Responsibility

Sunday, November 02, 2014

SQL/PLSQL Interview Questions.




  1. Perform SORT without Using ORDER BY Clause

select empno from emp
union
select 1 from dual where 1=10 ;

Friday, October 17, 2014

Logic to throw bundled attribute level validations in OAF

The following logic has to be added in the EOImpl.java

    /**Add Entity validation code in this method.
     */
    protected void validateEntity() {
        super.validateEntity();
 
        ArrayList  errMsg = new ArrayList();
       
      Number orgIDNo = getOrgId();        
        if (orgIDNo == null) // throwing Attribute Level Validation if the endDate is NULL
                  {
                  OAAttrValException ex1=  new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
                        "ItemLinesEOVO1",
                         getPrimaryKey(),
                         "OrgId",
                          getAttribute("OrgId"),
                         "FND",
                         "XXCUS_ICRE_ORGID_NULL");
                       
                      errMsg.add(ex1);
                  }
                 
                  //'XXCUS_ICRE_TEMPLATE_ID_NULL'
      Number templateID = getTemplateId();
        if (templateID == null) // throwing Attribute Level Validation if the endDate is NULL
                  {
                OAAttrValException  ex2=  new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
                        "ItemLinesEOVO1",
                         getPrimaryKey(),
                         "TemplateName",
                          getTemplateId(),
                         "FND",
                         "XXCUS_ICRE_TEMPLATE_ID_NULL");
                       
                      errMsg.add(ex2);
                  }
             
        OAAttrValException.raiseBundledOAAttrValException(errMsg);
 
    }

Friday, September 19, 2014

User Empowerment Framework  -- An OAF Based Solution For : Oracle Ebiz

Friends,

I was one of the core developer of the OAF based solution for : Oracle Ebiz.


Regards

Sridhar

Saturday, September 13, 2014


OAF - Oracle Application Framework - Frequently Used Items For User Action.

Following is the way you can catch the event for an item based on its item style.


SNO
Component Name(Item Style)
How to Catch the event in CO
1
submitButton
You can catch the submit button in two ways :
1.       Here : save is item id
 if(pageContext.getParameter("save")!=null)
2.       Here  requestTypeAction   is the action event name mentioned on the item in client Action (Action Type) if("requestTypeAction".equals(pageContext.getParameter(EVENT_PARAM)))
2
messageLovInput
if (pageContext.isLovEvent())  
            { 
            String lovInputSourceId = pageContext.getLovInputSourceId(); 
      //checking which lov event is fired. 
      //Below countryID is the ID of messageLovInput 
         if ("countryID".equals(lovInputSourceId)) 
             { 
               //Invokes AM Method  
                 OAMessageLovInputBean countryIDBean = (OAMessageLovInputBean)webBean.findIndexedChildRecursive("countryID");
                 String countryID = countryIDBean.getText(pageContext);
                 System.out.println("Country ID Value-->"+ countryID);
             }
}
3
messageChoice
Here  requestTypeAction   is the action event name mentioned on the item in client Action (Action Type) if("requestTypeAction".equals(pageContext.getParameter(EVENT_PARAM)))
4
link(Hyperlink)
Here  requestTypeAction   is the action event name mentioned on the item in client Action (Action Type) if("requestTypeAction".equals(pageContext.getParameter(EVENT_PARAM)))
5
Passing Parameters From One Page To Another
if(pageContext.getParameter("submit1")!=null)
           {
                 HashMap hmap = new HashMap();
              OAMessageStyledTextBean headerBean = (OAMessageStyledTextBean)webBean.findIndexedChildRecursive("headerID");
              String reqHeaderID = headerBean.getText(pageContext);
              hmap.put("p_headerID", reqHeaderID);
              hmap.put("p_submit_msg","Y") ;
               pageContext.setForwardURL(
                     "OA.jsp?page=/xxcus/oracle/apps/fnd/ear/webui/EmpCreateUpdateReqPG",
                     null,                            
                     OAWebBeanConstants.KEEP_MENU_CONTEXT,                                                    
                     null,                                                   
                     hmap,                            
                     true,
                     OAWebBeanConstants.ADD_BREAD_CRUMB_NO,
                     OAWebBeanConstants.IGNORE_MESSAGES); 
            
           }






Method :   oapagecontext.getParameter("event"); returns the current event name

Friday, September 12, 2014


Oracle Ebusiness Suite R12.2.4 New Look and feel... it no longer uses : SWAN, now the latest.. UI is based on : Skyros skin.



Thursday, September 11, 2014

Oracle Application Framework Developer's Guide (OAF Dev Guide Mos Links)

The Oracle Application Framework Developer's Guide is available in three formats:
  • As a PDF file from My Oracle Support (MOS).
  • As Oracle Help for Java in JDeveloper with OA Extension.
  • As WebHelp, packaged in jdevdoc.zip and shipped with each release of Oracle Application Framework.
To download the PDF file of the Oracle Application Framework Developer's Guide for a given release, select one of the following Document links:




List of File Types in : Oracle E-Business Suite

File Type
IDE Used For Development
Forms (.fmb files)
Oracle Forms Developer
Library (.pll files)
Oracle Forms Developer
Reports (.rdf files)
Oracle Report Builder
Java (.class files)
Jdeveloper
Java Server Pages (.jsp files)
Jdeveloper
Oracle Application Framework (OAF) Pages (.xml files)
Jdeveloper – With OA Extension
Oracle Application Framework (OAF) Personalizations (.xml files)
Oracle Ebusiness Instance
Workflow Definition (.wft files)
Oracle Workflow Builder
Workflow Business Event System Object Definitions (.wfx files)
Oracle Workflow Builder
BI Publisher Reports - Layout template formats
MSWord  with BI Publisher Plugin
XML Style Sheets (.xsl files)

XML Publisher PDF templates (.pdf files)

XML Publisher Excel templates (.xls files)

XML Publisher RTF templates (.rtf files)

BI Publisher Reports - Data Definition formats

XML Publisher (XDO) XML (.xml files)

XML Schema Definition (.xsd files)



Product Family Name
Product Family Abbreviation
Product Short names
Applications Technology
ATG
AD, AK, ALR, AZ, BNE, EC, ECX, FND, FRM, IZU, JTF, JTS, SHT, XDO
Projects
PJ
FPA, GMS, IPA, PA, PN
Financials
FIN
AMW, AP, AR, AX, CE, CUA, FA, FUN, FV, GCS, GHG, GL, IA, IBY, IEX, IGC, IGI, IGW, IMC, IPM, ITA, JA, JE, JG, JL, LNS, OKL, PSA, PSB, QRM, RG, XLA, XLE, XTR, ZX
Procurement
PRC
CHV, ICX, PO, POM, PON, POS
Supply Chain Management
SCM
AHL, BOM, CLN, CMI, CRP, CSD, CSE, CSI, CZ, DDD, DDR, DNA, DOM, EAM, EDR, EGO, ENG, FLM, FTE, GMA, GMD, GME, GMF, GMI, GML, GMO, GMP, GR, INL, INV, ITG, JMF, MFG, MRP, MSC, MSD, MSO, MSR, MST, MTH, MWA, OE, OKC, OKE, OKS, OKX, ONT, PJM, QA, QP, QPR, RLM, RRS, SHT, VEA, WIP, WMS, WPS, WSH, WSM, YMS
Human Resources Suite
HRMS
AME, BEN, DT, FF, GHR, HXC, HXT, IRC, OTA, PAY, PER, PQH, PQP, PSP, SSP
Financial Services Applications
FSA
FEM, FTP, PFT, ZFA, ZPB, ZSA
Customer Relationship Management
CRM
AMS, AMV, AS, ASF, ASG, ASL, ASN, ASP, AST, CCT, CN, CS, CSC, CSF, CSL, CSM, CSP, CSR, CUG, DPP, IBC, IBP, IBU, IEB, IEC, IEM, IEO, IES, IEU, JTM, OZF, PRP, PV, QOT, XDP, XNB, XNP



Following is the information from Oracle MOS About Finding the right version of Jdeveloper for Ebiz.

 How to Find the Correct Version of JDeveloper to Use with E-Business Suite 11i or Release 12.x (Doc ID 416708.1)

Release 11i

OA Framework 5.10 patchOracle JDeveloper 9i Patch
ATG.PF.H (patch 3438354 or Oracle Applications 11.5.10)Patch 4045639 9IJDEVELOPER WITH OA EXTENSION ARU FOR FWK.H
ATG PF CU1 (patch 4017300)Patch 4141787 9IJDEVELOPER WITH OA EXTENSION ARU FOR CU1
ATG PF CU2 (patch 4125550)Patch 4573517 Oracle9i JDeveloper with OA Extension for 11.5.10 CU2
11i.ATG_PF.H RUP3 (patch 4334965)Patch 4725670 9IJDEVELOPER WITH OA EXTENSION ARU FOR 11i10 RUP3
11i.ATG_PF.H RUP4 (patch 4676589)Patch 5455514 9IJDEVELOPER WITH OA EXTENSION ARU FOR 11i10 RUP4
11i.ATG_PF.H RUP5 (patch 5473858)Patch 6012619 9IJDeveloper With OA Extension ARU FOR 11i10 RUP5
11i.ATG_PF.H.RUP6 (patch 5903765)Patch 6739235 9IJDeveloper With OA Extension ARU FOR 11i10 RUP6
Patch 6469392 9IJDEVELOPER WITH OA EXTENSION ARU FOR 11I10 RUP6
11i.ATG_PF.H.delta.7 (patch 6241631)Patch 8751878 9I JDEVELOPER WITH OA EXTENSION ARU FOR 11I RUP7

Release 12.0

ATG Release 12 VersionOracle JDeveloper 10g Patch
12.0.0Patch 5856648 10g Jdev with OA Extension
12.0.1  (patch 5907545)Patch 5856648 10g Jdev with OA Extension
12.0.2  (patch 5484000 or 5917344)Patch 6491398 10g Jdev with OA Extension ARU for R12 RUP2 (replaces 6197418)
12.0.3  (patch 6141000 or 6077669)Patch 6509325 10g Jdev with OA Extension ARU for R12 RUP3
12.0.4 (patch 6435000 or 6272680)Patch 6908968 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12 RUP4
12.0.5 (No new ATG code released)No new JDev patch required
12.0.6  (patch 6728000 or patch 7237006)Patch 7523554 10G Jdeveloper With OA Extension ARU for R12 RUP6

Release 12.1

ATG Release 12.1 VersionOracle JDeveloper 10g Patch
12.1 (Controlled Release - only included for completeness)Patch 7315332 10G Jdev with OA Extension ARU for R12.1 (Controlled Release)
12.1.1 (rapidInstall or patch 7303030)Patch 8431482 10G Jdeveloper with OA Extension ARU for R12.1.1
12.1.2 (patch 7303033 or patch 7651091)Patch 9172975 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.2
12.1.3 (patch 9239090 or patch 8919491)Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.1 (patch 11894708)Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3
12.1.3.2 (patch 15880118)Patch 9879989 10G JDEVELOPER WITH OA EXTENSION ARU FOR R12.1.3

Release 12.2


ATG Release 12.2 VersionOracle JDeveloper 10g Patch
12.2Patch 17513160 10G JDeveloper with OA Extension ARU for R12.2, certfied on Windows 7, Windows XP-SP2, and Linux. Preferred web browser is Microsoft Internet Explorer 6.0 or above.
12.2.3Patch 17888411 10G JDeveloper with OA Extension ARU for R12.2.3, certfied on Windows 7, Windows XP-SP2, and Linux. Preferred web browser is Microsoft Internet Explorer 8.0 or above for the Skyros Look-and-Feel and Internet Explorer 6.0 or above for the Swan Look-and-Feel.

Thursday, September 04, 2014

Oracle Apps
How to Enable DFF on Lookup




Monday, August 04, 2014


1.Developing Mobile APps using ADF Mobile is easy... i have been following this link : http://docs.oracle.com/cd/E18941_01/tutorials/buildmobileappscontent/adfmobiletutorial_1.html for the same. But the major issue i faced is the deployment issue. At last i solved it by googling..etc.. Following is for your reference.




Java ME CDC : Connected Device Configuration


Strange Behavior in ADF Mobile
Unable to import custom class created in ApplicationController Project to ViewController Project.

Got to know, settings in ViewController should be changed to access the custom classes created in ApplicaitonModule.

Following is the setting :

Right click your ViewController project > Project properties > Dependencies > Select Model and click the pencil. Here you select 'Build output' and press OK twice. Rebuild your application and you should be able to access classes from your model in your viewcontroller.

Sunday, March 16, 2014

Facebook Login Sample