Thursday, 21 January 2016

Updating DFF in PFR:



 package xxigfmis.oracle.apps.irc.vacancy.webui;

 import java.io.Serializable;

 import java.sql.CallableStatement;

import java.sql.SQLException;
import java.sql.Types;

 import oracle.jdbc.OracleCallableStatement;
 import java.util.Enumeration;
 import java.util.Hashtable;
 import oracle.apps.fnd.common.VersionInfo;
 import oracle.apps.fnd.framework.OAApplicationModule;
 import oracle.apps.fnd.framework.server.OADBTransaction;
 import oracle.apps.fnd.framework.webui.OAPageContext;
 import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
 import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean;
 import oracle.apps.fnd.framework.webui.beans.OAWebBean;
 import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
 import oracle.apps.fnd.framework.webui.beans.message.OAMessageTextInputBean;
 import oracle.apps.irc.vacancy.server.IrcEditVacancyVOImpl;
 import oracle.apps.irc.vacancy.server.VacancyAMImpl;
 import oracle.jbo.Row;
 import oracle.apps.irc.vacancy.webui.VacNewDetsPageCO;

 // Referenced classes of package oracle.apps.irc.vacancy.webui:
 //            VacancyCO

 public class xxVacNewDetsPageCO extends VacNewDetsPageCO
 {

     public xxVacNewDetsPageCO()
     {
     }

   

     public void processFormRequest(OAPageContext oapagecontext, OAWebBean oawebbean)
     {
           
       
         super.processFormRequest(oapagecontext, oawebbean);
               
                  VacancyAMImpl vacancyamimpl = (VacancyAMImpl)oapagecontext.getRootApplicationModule();
         IrcEditVacancyVOImpl cvo = vacancyamimpl.getIrcEditVacancyVO();
     String outParamValue1 = null;
     String outParamValue2 = null;
     String outParamValue3 = null;
          String outParamValue4 = null;
          String outParamValue5 = null;
          String outParamValue6 = null;
          String outParamValue7 = null;
          String outParamValue8 = null;
          String outParamValue9 = null;
          String outParamValue10 = null;
          String outParamValue11= null;    
   
                 Row row=cvo.first();
                 if(row !=null){
               
               
                 }else{
               
                 row=cvo.getCurrentRow();
               
                 }
                 //row.setAttribute("Attribute1", "1");
                 //row.setAttribute("Attribute2", "2");
                 //row.setAttribute("Attribute3", "3");
                 //row.setAttribute("Attribute4", "4");
                 oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",row.getAttribute("BudgetMeasurementValue")+"Raju",2);  
   

   
     oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",oapagecontext.getLovInputSourceId()+"Raju",2);  
     if("FndLocation".equals(oapagecontext.getLovInputSourceId())){
       
      OADBTransaction txn = vacancyamimpl.getOADBTransaction();
 
      CallableStatement callableStatement =
 
        txn.createCallableStatement("begin xxigfmis_irec_pkg.xxigfmis_vac_reservation(:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11,:12); end;",OADBTransaction.DEFAULT);
 
      try {
 
        callableStatement.registerOutParameter(2, Types.VARCHAR);
 callableStatement.registerOutParameter(3, Types.VARCHAR);
 callableStatement.registerOutParameter(4, Types.VARCHAR);
 callableStatement.registerOutParameter(5, Types.VARCHAR);
 callableStatement.registerOutParameter(6, Types.VARCHAR);
 callableStatement.registerOutParameter(7, Types.VARCHAR);
 callableStatement.registerOutParameter(8, Types.VARCHAR);
 callableStatement.registerOutParameter(9, Types.VARCHAR);
 callableStatement.registerOutParameter(10, Types.VARCHAR);
 callableStatement.registerOutParameter(11, Types.VARCHAR);    
 callableStatement.registerOutParameter(12, Types.VARCHAR);  
 
        callableStatement.setString(1, row.getAttribute("BudgetMeasurementValue").toString());
 
     
         
 
        callableStatement.execute();
 
        outParamValue1 = callableStatement.getString(2);
 outParamValue2 = callableStatement.getString(3);
 outParamValue3 = callableStatement.getString(4);
 outParamValue4 = callableStatement.getString(5);
 outParamValue5 = callableStatement.getString(6);
 outParamValue6 = callableStatement.getString(7);
 outParamValue7 = callableStatement.getString(8);
 outParamValue8 = callableStatement.getString(9);
 outParamValue9 = callableStatement.getString(10);
 outParamValue10 = callableStatement.getString(11);
 outParamValue11 = callableStatement.getString(12);

          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue1+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue2+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue3+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue4+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue5+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue6+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue7+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue8+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue9+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue10+"raju",2);
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",outParamValue11+"raju",2);
        callableStatement.close();
 
      } catch (SQLException sqle) {
          oapagecontext.writeDiagnostics("xxVacNewDetsPageCO",sqle.getMessage()+"raju",2);
        //callableStatement.close();
 
      }
     OADescriptiveFlexBean oaDFF = (OADescriptiveFlexBean)oawebbean.findChildRecursive("FndFlexField"); // put your dff web bean name here
   
     OAMessageTextInputBean msg0=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField0");
     msg0.setText(outParamValue1);
     OAMessageTextInputBean msg1=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField1");
     msg1.setText(outParamValue2);
     OAMessageTextInputBean msg2=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField2");
     msg2.setText(outParamValue3);
     OAMessageTextInputBean msg3=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField3");
     msg3.setText(outParamValue4);
     OAMessageTextInputBean msg4=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField4");
     msg4.setText(outParamValue5);
     OAMessageTextInputBean msg5=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField5");
     msg5.setText(outParamValue6);
     OAMessageTextInputBean msg6=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField6");
     msg6.setText(outParamValue7);
     OAMessageTextInputBean msg7=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField7");
     msg7.setText(outParamValue8);
     OAMessageTextInputBean msg8=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField8");
     msg8.setText(outParamValue9);
     OAMessageTextInputBean msg9=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField9");
     msg9.setText(outParamValue10);
     OAMessageTextInputBean msg10=(OAMessageTextInputBean)oaDFF.findChildRecursive("FndFlexField10");
     msg10.setText(outParamValue11);
 }//end lov event


 }

 }
    OADescriptiveFlexBean oaDFF =(OADescriptiveFlexBean)dffCol.findIndexedChildRecursive("SiteUseDFF");
         
    {
 
    oaDFF.processFlex(pagecontext);

    OAWebBean dffbeans0 = (OAWebBean)oaDFF.findChildRecursive("SiteUseDFF0");

      if (dffbeans0 != null)
      {

      dffbeans0.setAttributeValue(OAWebBeanConstants.READ_ONLY_SET, true);
        dffbeans0.setAttributeValue(OAWebBeanConstants.READ_ONLY_ATTR, true);
      }


      OAWebBean dffbeans1 = (OAWebBean)oaDFF.findChildRecursive("SiteUseDFF1");

      if (dffbeans1 != null)
      {

        dffbeans1.setAttributeValue(OAWebBeanConstants.READ_ONLY_SET, true);
        dffbeans1.setAttributeValue(OAWebBeanConstants.READ_ONLY_ATTR, true);
      }
}


https://community.oracle.com/thread/2263077?tstart=0 


package xxclt.oracle.apps.irc.vacancy.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAException;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.OAWebBeanConstants;
import oracle.apps.fnd.framework.webui.OAWebBeanUtils;
import oracle.apps.fnd.framework.webui.beans.OADescriptiveFlexBean;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageCheckBoxBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovChoiceBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
import oracle.apps.irc.vacancy.webui.VacNewDetsPageCO;
import oracle.cabo.ui.action.FireAction;
import oracle.jbo.ViewObject;


public class XXVacNewDetsPageCO extends VacNewDetsPageCO {
public XXVacNewDetsPageCO() {
}

public void processRequest(OAPageContext pageContext, OAWebBean webBean) {
super.processRequest(pageContext, webBean);
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean segment1 =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
segment1.setRequired("yes");
segment1.setFireActionForSubmit ("selectBCN",null, null,true, true);

}

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

if ("selectBCN".equals(pageContext.getParameter(OAWebBeanConstants.EVENT_PARAM))) {
// The Position poplist PPR change event has fired.
OAApplicationModule am = pageContext.getRootApplicationModule();
String vStatus;
OADescriptiveFlexBean dffBean =
(OADescriptiveFlexBean)webBean.findIndexedChildRecursive("FndFlexField");
dffBean.processFlex(pageContext);
OAMessageChoiceBean bcnSegment =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField0");
String vBCNValue = bcnSegment.getSelectionValue(pageContext) ;
pageContext.writeDiagnostics("XXCLIENT",vBCNValue,1);
String vacancyInfoQuery =
"SELECT bcn, grade, job_title, vacancy_type, ORGANIZATION FROM xxclt_mbd_bcn_info_v";

//Specify the Where Clause for the same
vacancyInfoQuery = vacancyInfoQuery + " WHERE bcn = :1 ";

//First see if this VO is already attached to view object
ViewObject vacancyInfoVO = am.findViewObject("XXVvacancyInfoVO");
if (vacancyInfoVO == null)
vacancyInfoVO =
am.createViewObjectFromQueryStmt("XXVvacancyInfoVO",
vacancyInfoQuery);
//By now we are sure that the view object exists
vacancyInfoVO.setWhereClauseParams(null);
//Set the where clause
vacancyInfoVO.setWhereClauseParam(0, vBCNValue);
vacancyInfoVO.executeQuery();
oracle.jbo.Row row = vacancyInfoVO.first();
//get the value of description column from View Object record returned
String vGrade = "";
String vJobTitle = "";
String vVacancyType = "";
String vOrganization = "";

if (row != null) {
vGrade = row.getAttribute(1).toString();
vJobTitle = row.getAttribute(2).toString();
vVacancyType = row.getAttribute(3).toString();
vOrganization = row.getAttribute(4).toString();
}

OAMessageLovInputBean vGradeBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndGrade");
OAMessageLovInputBean vJobTitleBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndJobTitle");
OAMessageChoiceBean vVacancyTypeBean =
(OAMessageChoiceBean)dffBean.findChildRecursive("FndFlexField1");
OAMessageLovInputBean vOrgBean =
(OAMessageLovInputBean)webBean.findChildRecursive("FndOrganization");

vVacancyTypeBean.setSelectedValue(vVacancyType);
vGradeBean.setText( vGrade);
vJobTitleBean.setText(vJobTitle);
vOrgBean.setText(vOrganization);
// vOrgBean.set
OAMessageCheckBoxBean vEmpChkBox;
OAMessageCheckBoxBean vCntrChkBox;
vEmpChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndEmployee");
vCntrChkBox =
(OAMessageCheckBoxBean)webBean.findChildRecursive("FndContractor");

if (vVacancyType.equals("PMR") ) {
vEmpChkBox.setChecked(true);
vCntrChkBox.setChecked(false);
}else if(vVacancyType.equals("TMR") ) {
vCntrChkBox.setChecked(true);
vEmpChkBox.setChecked(false);
}
//Remove the view object, as this is no longer required
vacancyInfoVO.remove();
}
}

}



Thursday, 14 January 2016

package xxx.oracle.apps.ota.lov.webui;

import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.ota.lov.webui.ResBookingNamesLovCO;
import oracle.apps.ota.lov.server.LovAMImpl;
import oracle.apps.ota.lov.server.ResBookingNamesVOImpl;

public class xxResBookingNamesLovCO extends ResBookingNamesLovCO {
    public xxResBookingNamesLovCO() {
    }
   
    public void processRequest(OAPageContext pageContext, OAWebBean webBean)
   {
     
      String ClassStartTime1 = null;
      if(pageContext.getParameter("ClassStartTime1")!=null){
         ClassStartTime1= pageContext.getParameter("ClassStartTime1").toString();
          pageContext.writeDiagnostics("BANDAM"+ClassStartTime1,"xxResBookingNamesLovCO",2);
      }
               
      pageContext.writeDiagnostics("BANDAM is null "+ClassStartTime1,"xxResBookingNamesLovCO",2);              
      String ClassEndDate1 = null;
      if(pageContext.getParameter("ClassEndDate1")!=null){
         ClassEndDate1= pageContext.getParameter("ClassEndDate1").toString();
          pageContext.writeDiagnostics("BANDAM"+ClassEndDate1,"xxResBookingNamesLovCO",2);
      }
     
      pageContext.writeDiagnostics("BANDAM is null "+ClassEndDate1,"xxResBookingNamesLovCO",2);
      if(ClassEndDate1!=null && ClassStartTime1 !=null){
     
     
     
      LovAMImpl localLovAMImpl = (LovAMImpl)pageContext.getApplicationModule(webBean);
      ResBookingNamesVOImpl resvo=(ResBookingNamesVOImpl)localLovAMImpl.getResBookingNamesVO1();
      if(resvo !=null){
     
                   String condSql =null;      
                               
                                       try{
                                   condSql="";
                               resvo.setFullSqlMode(resvo.FULLSQL_MODE_AUGMENTATION);
         
                               resvo.setQuery(condSql);
                           }
                           catch(Exception e){
                         
                           }
     
      }
     
      }
     
  }
}

package xxx.oracle.apps.ota.admin.resource.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.fnd.framework.webui.beans.layout.OAListOfValuesBean;
import oracle.apps.fnd.framework.webui.beans.message.OAMessageLovInputBean;
import oracle.apps.ota.admin.resource.webui.MaintainResourceBookingsCO;
import oracle.apps.ota.lov.server.ResBookingNamesVOImpl;
import oracle.apps.ota.lov.server.LovAMImpl;

public class xxMaintainResourceBookingsCO extends MaintainResourceBookingsCO {
    public xxMaintainResourceBookingsCO() {
    }

    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
      {
       

          String ClassStartTime1 =
                          pageContext.getParameter("ClassStartTime1");
              pageContext.putSessionValue("ssClassStartTime1",ClassStartTime1);          
                         
          String ClassEndDate1 =
                          pageContext.getParameter("ClassEndDate1");
          pageContext.putSessionValue("ssClassEndDate1",ClassEndDate1);              

       
        super.processFormRequest(pageContext, webBean);

     
      }

}

Wednesday, 13 January 2016

package xxota.oracle.apps.ota.admin.resource.webui;

import oracle.apps.fnd.framework.OAApplicationModule;
import oracle.apps.fnd.framework.OAViewObject;
import oracle.apps.fnd.framework.webui.OAPageContext;
import oracle.apps.fnd.framework.webui.beans.OAWebBean;
import oracle.apps.ota.admin.resource.webui.MaintainResourceBookingsCO;
import oracle.apps.ota.lov.server.ResBookingNamesVOImpl;
import oracle.apps.ota.lov.server.LovAMImpl;

public class xxMaintainResourceBookingsCO extends MaintainResourceBookingsCO {
    public xxMaintainResourceBookingsCO() {
    }

    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
      {
     
          OAApplicationModule am = pageContext.getApplicationModule(webBean);
       
          LovAMImpl lam=(LovAMImpl)am.findApplicationModule("LovAM");
       
         ResBookingNamesVOImpl shipvo =(ResBookingNamesVOImpl)lam.getResourceNamesVO();
          String ClassStartTime1 =
                          pageContext.getParameter("ClassStartTime1");
          String ClassEndDate1 =
                          pageContext.getParameter("ClassEndDate1");                          
         String condSql =null;    
                      if ("ClassName".equals(pageContext.getLovInputSourceId())) {
                             try{
                         condSql="SELECT      distinct                    SRL.name,                    TSR.supplied_resource_id,                    PER.full_name,                    TSR.vendor_id,                    ven.vendor_name,                    TSR.training_center_id,                    ota_general.get_org_name (TSR.training_center_id)                       Training_center_name,                    TSR.location_id,                    ota_general.get_location_code (TSR.location_id) Location,                    TSR.resource_type,                    TSR.start_date,                    TSR.end_date,                    TSR.cost,                    TSR.currency_code,                    TSR.cost_unit,                    TSR.consumable_flag,                    TSR.special_instruction,                    CASE                    WHEN (to_char("+ClassStartTime1+",'DD-MON-YYYY') between REQUIRED_DATE_FROM and REQUIRED_DATE_TO                         OR to_char("+ClassEndDate1+",'DD-MON-YYYY') between REQUIRED_DATE_FROM and REQUIRED_DATE_TO)                    AND  TIMEZONE_CODE= 'Asia/Calcutta'                    THEN 'Not Allowed'                    ELSE 'Allowed'                    END Status                    FROM   OTA_SUPPLIABLE_RESOURCES TSR,                    OTA_SUPPLIABLE_RESOURCES_TL SRL,                    per_all_people_f per,                    po_vendors ven,                    ota_resource_bookings orb            WHERE       SRL.SUPPLIED_RESOURCE_ID = TSR.SUPPLIED_RESOURCE_ID                    AND tsr.SUPPLIED_RESOURCE_ID = orb.SUPPLIED_RESOURCE_ID(+)                    AND SRL.LANGUAGE = USERENV ('LANG')                    AND TSR.BUSINESS_GROUP_ID =                          ota_general.get_business_group_id                    AND per.person_id(+) = tsr.trainer_id                    AND tsr.start_date BETWEEN per.effective_start_date(+)                                           AND  per.effective_end_date(+)                    AND ven.vendor_id(+) = TSR.vendor_id";
                     shipvo.setFullSqlMode(shipvo.FULLSQL_MODE_AUGMENTATION);

                     shipvo.setQuery(condSql);
                 }
                 catch(Exception e){
             
                 }
                  }
     
        super.processFormRequest(pageContext, webBean);

   
      }

}

Tuesday, 12 January 2016

String ClassStartTime1 =
                pageContext.getParameter("ClassStartTime1");
String ClassEndDate1 =
                pageContext.getParameter("ClassEndDate1");
 
   if ("ClassName".equals(pageContext.getLovInputSourceId())) {
  try{
      condSql="";
           shipvo.setFullSqlMode(shipvo.FULLSQL_MODE_AUGMENTATION);

           shipvo.setQuery(condSql);
       }
       catch(Exception e){
     
       }
}