Friday, September 28, 2018

Oracle Workflow Notification Translation

Hi,

Update row in below tables for translation.
WF_ACTIVITY_ATTRIBUTES_TL
WF_ITEM_ATTRIBUTES_TL
WF_MESSAGE_ATTRIBUTES_TL

examples :
select *
  from WF_ITEM_ATTRIBUTES_TL
   where Language = 'AR'
     and NAME like '%INVOICE%'
 where
 DISPLAY_NAME = 'Supplier Name'
   and Language = 'AR'
 
select *
  from WF_MESSAGE_ATTRIBUTES_TL
 where MESSAGE_NAME = 'DOCUMENT_APPROVAL_MSG1'
 -- DISPLAY_NAME = 'Supplier Name'
 and Language = 'AR'
   and MESSAGE_TYPE = 'APINVAPR'


Sunday, May 22, 2016

OA Framework display concurrent program output without downloading file from server


Some times we face requirement to display the concurrent request output on click of Button or Image.

There are many ways to display PDF report output on OAF page such as,

1) Using XML Publisher data template and by passing XML data through View Object.
   In this case we face difficulty if the report is complex and required multiple queries and calculations for report. And if large number of data is there.

2)  Using submit request from PL/SQL to generate PDF/XLS output on file server and then downloading file using ServletOutputStream byte by byte and displaying it by DesktopApi.open(). As you can see in my previous blogs.
   In this also we face access problems because normally user does not has access to the directory on file server where output file is generated. And in some cases Concurrent Request output file is read only etc.

There is one more way to display concurrent output without downloading the file, by generating the session specific URL for Concurrent Output file. This method is used by Oracle itself to show request output.

Below code can be used in Controller, AM and PL/SQL.


Controller Class code ...

/*
 * Handles functionality of Print button / image
 */
     if("printRpt".equals(pageContext.getParameter(EVENT_PARAM))) {

        String P_Seq = pageContext.getParameter("P_Seq");
        String P_USER_ID = pageContext.getUserId()+"";
        String P_RESP_ID = pageContext.getResponsibilityId()+"";
        String P_RESP_APPL_ID = pageContext.getResponsibilityApplicationId()+"";
 
        if (P_Seq != null) {
 
        // generate output URL
             Serializable[] param = { P_Seq, P_USER_ID, P_RESP_ID, P_RESP_APPL_ID};
             am.invokeMethod("getOutputURL", param);
            
             String OutputURL = (String)pageContext.getTransactionValue("OutputURL");
           
             if ("ERROR".equals(OutputURL)) {
               throw new OAException(" Error in report generation ");
             } else {
               try {
               // redirects to URL
                 pageContext.sendRedirect((String)OutputURL);
                 return;
               } catch (Exception localException1) {

                 throw new OAException(" Error in report generation ");
               }
             }
        }
    }




Application Module code       


  /** To generate output URL for CP.
   */
  public void getOutputURL(String P_Seq, String P_USER_ID, String P_RESP_ID, String P_RESP_APPL_ID)
  {
    OADBTransactionImpl localOADBTransactionImpl = (OADBTransactionImpl)getDBTransaction();
    String P_TWO_TASK = localOADBTransactionImpl.getAppsContext().getEnvStore().getEnv("TWO_TASK");
    String P_GWYUID = localOADBTransactionImpl.getAppsContext().getEnvStore().getEnv("GWYUID");
 
    String str3 = "BEGIN XX_SUBMIT_REQUEST_PKG.SUBMIT_HR_ORDERS_RPT (P_SEQ => "+P_Seq+", P_USER_ID => "+P_USER_ID+", P_RESP_ID => "+P_RESP_ID+", P_RESP_APPL_ID => "+P_RESP_APPL_ID+", P_GWYUID => '"+ P_GWYUID +"', P_TWO_TASK => '"+ P_TWO_TASK +"', P_OUTPUT_URL => :1); END;";

    CallableStatement localCallableStatement = getOADBTransaction().createCallableStatement(str3, 1);
 
      if (P_Seq != null)
        try
        {
          localCallableStatement.registerOutParameter(1, Types.VARCHAR);
          localCallableStatement.execute();
   
          String str4 = localCallableStatement.getString(1);
   
          if ((str4 == null) || (str4.equals(""))) {
            throw new OAException(retrivePLSQLError());
          }
          localOADBTransactionImpl.putValue("OutputURL", str4);
        }
        catch (Exception localException2)
        {
          throw OAException.wrapperException(localException2);
        }
        finally
        {
          try {
            localCallableStatement.close();
          }
          catch (Exception localException3)
          {
            throw OAException.wrapperException(localException3);
          }
      }
}



  /** To retrieve PLSQL Error that might occur.
   */
  private String retrivePLSQLError()
    throws Exception
    {
      String str1 = "BEGIN :1 := FND_MESSAGE.GET; END;";
      String str2 = "";
 
      CallableStatement localCallableStatement = null;
      try
      {
        localCallableStatement = getOADBTransaction().createCallableStatement(str1, 1);
        localCallableStatement.registerOutParameter(1, 12);
        localCallableStatement.execute();
        str2 = localCallableStatement.getString(1);
        localCallableStatement.close();
      }
      catch (Exception localException2) {
        str2 = localException2.getMessage();
        throw new Exception(str2);
      }
      finally
      {
        try
        {
          if (localCallableStatement != null) localCallableStatement.close();
        }
        catch (Exception localException3) {
          throw new OAException(" Error in report generation ");
        }
      }
      return str2;
    }


 

PL/SQL Code          

Here in PL/SQL code create one package XX_SUBMIT_REQUEST_PKG, inside it create one procedure SUBMIT_HR_ORDERS_RPT. In our AM code we are calling this procedure, 

    XX_SUBMIT_REQUEST_PKG.SUBMIT_HR_ORDERS_RPT


Now in this procedure use,

APPS.FND_REQUEST.ADD_LAYOUT(); 
-- To define the Concurrent request Layout i.e. PDF/XLS

APPS.FND_REQUEST.SUBMIT_REQUEST(); 
-- To Submit the Concrrent request

FND_CONCURRENT.WAIT_FOR_REQUEST();
-- To wait until concurrent request finishes generating output file.

And finally you can use fnd_webfile.get_url under same procedure to get the Output URL like,

OutputURL := fnd_webfile.get_url(file_type => fnd_webfile.request_out,
                                    id => P_Request_ID,
                                    gwyuid => P_gwyuid,
                                    two_task => P_two_task,
                                    expire_time => 1);




Thanks,
Abbas Qureshi

Concurrent Program parameter translation in multiple languages


Normally for translations we are updating the translation tables (table that are ending with _TL).

But if there is a scenario where we have to update translation for parameters of concurrent program. Then in this case only updation of translation table is not sufficient.

Actually, Concurrent Program parameter is based on Descriptive Flexfield. A descriptive flexfield must be compiled after a new concurrent program is created, or some changes are done in parameters or parameter translations.
So, after changes are done, we have to compile the descriptive Flexfield.

Compilation can be done using script or by submitting Concurrent request,

1) Using script :

To compile specific DFF

fdfcmp <Oracle Username/Password> 0 Y D[escriptive] <appl_short_name> <desc_flex_name>

To compile ALL Flexfields

fdfcmp <Oracle Username/Password> 0 Y A

2) Concurrent Request to compile Flexfield is "Compile All Flexfields"

Thursday, December 31, 2015

Deployment Steps for OA Framework on R 12.2.x or R 12.2.4


Steps to deploy custom OA Framework page on R 12.2.4

1) Copy class files on server
2) Create ZIP file
3) Make Jar file from the ZIP file created before
4) Bounce the services

1) Copy class files on server
==================================
Copy files to custom folder path on server.

2) To Make .ZIP file
==================================
A) Create a temporary custom.zip file which contains all the custom application's directories/files at non-standard location. Please follow the following steps:

    1) cd $JAVA_TOP

    2) zip -r customprod.zip. Where the list of all directory paths are present, relative to $JAVA_TOP, for custom application's java files at non-standard location.

    Command: zip -r xxtest.zip xxtest

    3) Generate & sign 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 -storePass -keyPass

3) To Make .JAR file
==================================
example : adjava oracle.apps.ad.jri.adjmx -areas $JAVA_TOP/customprod.zip -outputFile $JAVA_TOP/customprod.jar -jar $CONTEXT_NAME 1 CUST jarsigner -storePass <KeyStore Password> -keyPass <Key Password>

Command:     adjava oracle.apps.ad.jri.adjmx -areas $JAVA_TOP/xxtest.zip -outputFile $JAVA_TOP/xxtest.jar -jar $CONTEXT_NAME 1 CUST jarsigner


4) Bounce the Apache and mid-tier service by using the following commands.
==================================
adapcctl.sh stop

adapcctl.sh start

admanagedsrvctl.sh stop oacore_server1

EnterWeblogic Password: <pwd>

admanagedsrvctl.sh start oacore_server1

EnterWeblogic Password: <pwd>

Wednesday, December 23, 2015

FNDLOAD for multi-language OR Multilingual

Some time we are facing situation where we have to move AOL objects in Oracle EBS Multilingual/Territory environment.
For example we want to move Lookups, Concurrent Programs, Messages etc with their translation also for Multilingual/Territory like English and Arabic.

In such scenario we have to download and upload LDTs for both languages.
Lets suppose we have to move Concurrent Program with both English and Arabic translations.

==============
DOWNLOAD
==============
Before downloading we have to set the export language style like,

For English           
-------------------------------------------------------------------------------
export NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXTST_CONCURRENT_PRG_US.ldt PROGRAM APPLICATION_SHORT_NAME="XXTST" CONCURRENT_PROGRAM_NAME="XXTST_CONCURRENT_PRG"

For Arabic           
-------------------------------------------------------------------------------
export NLS_LANG=ARABIC_AMERICA.AR8MSWIN1256

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XXTST_CONCURRENT_PRG_AR.ldt PROGRAM APPLICATION_SHORT_NAME="XXTST" CONCURRENT_PROGRAM_NAME="XXTST_CONCURRENT_PRG"

==============
UPLOAD
==============
Similarly for Upload LDTs we have to set the language style.

For English           
-------------------------------------------------------------------------------
set NLS_LANG=AMERICAN_AMERICA.AR8MSWIN1256

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXTST_CONCURRENT_PRG_US.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE


For Arabic           
-------------------------------------------------------------------------------
set NLS_LANG=ARABIC_AMERICA.AR8MSWIN1256

FNDLOAD apps/apps O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XXTST_CONCURRENT_PRG_AR.ldt UPLOAD_MODE=REPLACE CUSTOM_MODE=FORCE



Sunday, December 6, 2015

Download file from Server in OA Framework

To download a file from server location.

In controller class call downloadFileFromServer method on any event.

//on button click in process form request
//call this method
            downloadFileFromServer(
                        pageContext,--pagecontext
                        "/xx/xxx/ssss/120devg.pdf",--full file path with file name and ext
                        "120devg.pdf" --file name with extension
            );


After process form request copy below methods in controller class,

/**
* @param pageContext the current OA page context
* @param file_name_with_path - this is fully qualified file name with its path on unix application
* server. eg "/xxcrp/xxapplcrp/mukul/abc.pdf"
* @param file_name_with_ext - this is file name with extension, you wanna display user
* for download. eg- i wanna display the abc.pdf file download with name five_point_someone.pdf
* then I can pass this as "five_point_someone.pdf"
*/
public void downloadFileFromServer(OAPageContext pageContext,
                                  String file_name_with_path,
                                  String file_name_with_ext) {
  HttpServletResponse response = (HttpServletResponse) pageContext.getRenderingContext().getServletResponse();
  if (((file_name_with_path == null) || ("".equals(file_name_with_path)))){
    throw new OAException("File path is invalid.");
  }

  File fileToDownload = null;
  try{
    fileToDownload = new File(file_name_with_path);
  }catch (Exception e){
    throw new OAException("Invalid File Path or file does not exist.");
  }

  if (!fileToDownload.exists()){
    throw new OAException("File does not exist.");
  }

  if (!fileToDownload.canRead()){
    throw new OAException("Not Able to read the file.");
  }

  String fileType = "application/pdf";
  response.setContentType(fileType);
  response.setContentLength((int)fileToDownload.length());
  response.setHeader("Content-Disposition", "attachment; filename=\"" + file_name_with_ext + "\"");

  InputStream in = null;
  ServletOutputStream outs = null;

  try{
    outs = response.getOutputStream();
    in = new BufferedInputStream(new FileInputStream(fileToDownload));
    int ch;
    while ((ch = in.read()) != -1){
      outs.write(ch);
    }
  }catch (IOException e){
    // TODO
    e.printStackTrace();
  }finally{
    try{
      outs.flush();
      outs.close();
      if (in != null){
        in.close();
      }
    }catch (Exception e){
      e.printStackTrace();
    }
  }
}




Source: http://mukx.blogspot.com/search?q=downloadFileFromServer

Oracle E-Business Suite | How to deploy cutom JAR file and use in OA Framework

There are two ways to deploy custom JAR file on Server.

Deploying on Custom path.


Steps :
1. Deploy your JAR file at some custom location in R12 server
i.e. –
/u01/app/apnac03r12/XX_TEST/

2. Open “orion-application.xml” file present at path –
$ORA_CONFIG_HOME/10.1.3/j2ee/oacore/application-deployments/oacore/

3. Edit “orion-application.xml” file to add JAR file path

i.e. –
<library path="/u01/app/apnac03r12/XX_TEST/jxl.jar" />


4. Bounce Apache Server




Deploying with Standard libraries.
 
Steps :
1. Place jxl.jar into

    $OA_HTML/WEB-INF/lib/


2. Bounce Apache Server