Wednesday, 20 January 2016

USER LOGIN PAGE USING UNBOUNDED TASK FLOW


1.Click on adfc-config.xml and create one unbounded task flow.
2.Go to componentsà select 3 View drag&drop on task flow.

Deployment of Custom OAF Pages in R12.2.4



Deployment of Custom OAF Pages in R12.2.4
------------------------------------------------------------------------------------------------------------------------
Open Putty
Run Cd $JAVA_TOP
Pwd
Check the file path whether it is fs1 or fs2 .

Copy <Your custom Folder>.zip to server java top.
Ex:XXIPR.Zip






Give your <custom folder>.zip name after $JAVA_TOP
EX:
Here I am taken XXIPR.zip
Run Below Command it will Generate XXIPR.jar
adjava oracle.apps.ad.jri.adjmx -areas $JAVA_TOP/XXIPR.zip -outputFile $JAVA_TOP/XXIPR.jar -jar $CONTEXT_NAME 1 CUST jarsigner -storePass -keyPass

Run Below Command it will Generate Custompll.jar

Run adcgnjar

Make sure that after running this Command check whether both Custompll.jar and XXIPR.jar is created or not.







Next Modify the Below Template .
ebsProductManifest_xml.tmp in cd $ADMIN_TOP/templates
Add <library>XXIPR.jar</library> under <library>Custompll.jar</library>



Copy The Custompll.jar folder in local desktop

And open with JD-GUi java Compllier.

Check all the structure is created or not.
















Controller Extensions in R12.2.4
------------------------------------------------------------------------------------------------------------------------




Open putyy and run Below commands

Running Autoconfig on R12 environment Database Tier
It will configure all the tops .
./adautocfg.sh
Give apps pwd

cd $ADMIN_SCRIPTS_HOME
Bouncing Web Logic Server
---------------------------------------
./admanagedsrvctl.sh stop oacore_server1
Give weblogic pwd
./admanagedsrvctl.sh start oacore_server1
Give weblogic pwd



Restarting Apache :
---------------------------------------
./adapcctl.sh stop

./adapcctl.sh start





Copy The modified class files in server folder


Run adcgnjar
Give username
Password
It will generate jar files and update the Custompll.jar folder

Bounce the weblogic server and bounce apche server

Thursday, 11 December 2014

CALLING  XML REPOERTS    FROM  OAF PAGE THROUGH CONCURRENT PROGRAM



if("generatereport".equals(pageContext.getParameter("event"))){
    OADBTransactionImpl txn=(OADBTransactionImpl)am.getOADBTransaction();
             OAViewObject   vo = (OAViewObject)pageContext.getApplicationModule(webBean).findViewObject("AuctionHeadersAllVO"); //getting view object for AuctionHeadersAllVO
             String  DocumentNumber=(String)vo.getCurrentRow().getAttribute("DocumentNumber"); //getting document number from current row
             int DocumentNumber1=Integer.parseInt(DocumentNumber);
             pageContext.writeDiagnostics(this,"DocumentNumber in co:"+DocumentNumber,1); //display document number
             /* call the method which runs the concurrent program and returns request id*/
                 int req_id= submitCPRequest(DocumentNumber,txn);
                 if(pageContext.isLoggingEnabled(1))
                 {
                         pageContext.writeDiagnostics(this,"req_id in CO:"+req_id,1); //display request id
                 }

                  //Make application sleep for 15 seconds to finish the concurrent program
                 try
                             {
                              CallableStatement cal=txn.createCallableStatement("begin dbms_lock.sleep(20); end;",1);
                            
                               cal.execute();
                              cal.close();
                                   
                             }
                             catch(Exception e)
                             {
                               throw OAException.wrapperException(e);
                             }
             //Get the output file name from the backend table
                 String file_name=null;
                             try
                             {
                              CallableStatement cal=txn.createCallableStatement("begin select file_name into :1 from FND_CONC_REQ_OUTPUTS where concurrent_request_id=:2; end;",1);
                             cal.setInt(2,req_id);
                                
                               cal.registerOutParameter(1,Types.VARCHAR);
                               cal.execute();
                              file_name= cal.getString(1);
                              cal.close();
                               if(pageContext.isLoggingEnabled(1))
                               {
                              pageContext.writeDiagnostics(this,"file_name:"+file_name,1);
                               }
                             
                                    
                             }
                             catch(Exception e)
                             {
                               //throw OAException.wrapperException(e);
                               System.out.println("no data found");
                             }

             //Read data from output file and display

                 DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
                                 HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
                 String contentDisposition = "attachment;filename="+DocumentNumber+".xls";
                             response.setHeader("Content-Disposition",contentDisposition);
                             response.setContentType("application/vnd.ms-excel");
                 
                 File f=new File(file_name);
                
                // File f=new File("/u02/PROD/inst/apps/MPPMCL_bb02/logs/appl/conc/out/XXMPP_SCM_NIT_PUB_TEMP_878237_1.PDF");
                 if(pageContext.isLoggingEnabled(1))
                 {
                 pageContext.writeDiagnostics(this,"output file:"+f,1);
                }
               try {
                     if(pageContext.isLoggingEnabled(1))
                     {
                     pageContext.writeDiagnostics(this,"in try block:",1);
                     }
                       OutputStream os = response.getOutputStream();
                       byte[] buf = new byte[8192];
                       InputStream is = new FileInputStream(f);
                       int c = 0;
                       while ((c = is.read(buf, 0, buf.length)) > 0) {
                           os.write(buf, 0, c);
                           os.flush();
                       }
                       os.close();
                       is.close();
                   } catch (IOException e) {
                       e.printStackTrace();
             }



}
    }
    public int submitCPRequest(String Rfq_num,OADBTransaction tx) {
    try {

    java.sql.Connection pConncection = tx.getJdbcConnection(); //get JDBC connection object

    ConcurrentRequest cr = new ConcurrentRequest(pConncection); // get the concurrentrequest object
    String applnName = "XXMPP"; //Application that contains the concurrent program

    String cpName = "XXMPPTEQTRPT"; //Concurrent program name

    String cpDesc = null; // concurrent Program description
    Vector cpArgs = new Vector(); //create an object for vector

    cpArgs.addElement(Rfq_num); //pass parameters by using vector
    try
    {
    cr.addLayout("XXMPP","XXMPPTEQTRPT","EN","US","EXCEL",null); //addlayout to the concurrent program
    }
    catch(Exception e)
    {
      throw OAException.wrapperException(e);
    }
   
    int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs); //call submitRequest method in ConcurrentRequest class
    tx.commit(); //commit
    return requestId; //return request id

    } catch (RequestSubmissionException e) {
    OAException oe = new OAException(e.getMessage());
    throw oe;
    }
    }

Tuesday, 2 December 2014

 HIDING DFF ATTRIBUTES  DYNAMICALLY






Processrequest
        OADescriptiveFlexBean dff=(OADescriptiveFlexBean)webBean.findChildRecursive("ActFlexField");
        dff.processFlex(pageContext);
        dff.mergeSegmentsWithParent(pageContext);


ppr

        OADescriptiveFlexBean dff=(OADescriptiveFlexBean)webBean.findChildRecursive("ActFlexField");

        dff.processFlex(pageContext);
        //OAMessageLovInputBean dff1=(OAMessageLovInputBean)dff.findChildRecursive("ActFlexField0");
       
        String strdff1=pageContext.getParameter("ActFlexField0");
        OAMessageLovInputBean dff2=(OAMessageLovInputBean)dff.findChildRecursive("ActFlexField1");
       
        if(pageContext.isLovEvent()){
        if("ActFlexField0".equals(pageContext.getParameter(SOURCE_PARAM))){
        if("No".equals(strdff1))
            dff2.setAttributeValue(RENDERED_ATTR,Boolean.TRUE);
           
            else
            dff2.setAttributeValue(RENDERED_ATTR,Boolean.FALSE);
        }
       
        }
    
HOW TO CRATE    VO   WITH   BOOLEAN TRANSIENT ATTRIBUTE



   OAViewDef viewdef=(OAViewDef)am.getOADBTransaction().createViewDef();
             
                viewdef.addTransientAttrDef(
        "TextDisable",               //Attr name
        "java.lang.Boolean",         //Java type
        null,                       //Default value
        false,                      //Not null
        AttributeDef.UPDATEABLE);   //Updateable
         OAViewObject vo=null;
             ViewObject  v=null;
             if(am!=null){
            v=am.findViewObject("xxBidFeeAmountVO1");
           
  
             }
            try{
              if(v==null){
                   vo=(OAViewObject)amImpl.createViewObject("xxBidFeeAmountVO1",viewdef);
                vo.setMaxFetchSize(0);
                        Row row = vo.createRow(); 
                        vo.insertRow(row);
                        Row row1=vo.first();
                        row1.setAttribute("TextDisable",Boolean.TRUE);
                    vo.executeQuery(); 
              }
           
            else
            {
            v.reset();
                v.setMaxFetchSize(0);
                        Row row = v.createRow(); 
                        v.insertRow(row);
                        Row row1=v.first();
                        row1.setAttribute("TextDisable",Boolean.TRUE);
                    v.executeQuery();
            }
            }
            catch(Exception e){
                throw new OAException("firse",OAException.ERROR);       
            }