Friday, June 23, 2017

Exporting OAF Personalizations using SQL

Exporting OAF Personalizations using SQL 

In this article we shall see the query which will return all OAF personalizations done along with XML file.

Following query returns OAF personalizations along with a CLOB column which is the personalized page XML, this can be used for analyzing OAF personalizations done in any given instance:-

SQL query to export OAF personalizations along with personalization XML

SELECT   jpath.path_docid perz_doc_id,
         jdr_mds_internal.getdocumentname (jpath.path_docid) perz_doc_path,
         xxcust_getpern_doc_pkg.get_persn_doc
                 (jdr_mds_internal.getdocumentname (jpath.path_docid)
                 ) persn_doc
    FROM jdr_paths jpath
   WHERE jpath.path_docid IN (
            SELECT DISTINCT comp_docid
                       FROM jdr_components
                      WHERE comp_seq = 0
                        AND comp_element = 'customization'
                        AND comp_id IS NULL)
ORDER BY perz_doc_path;

We have used custom package xxcust_getpern_doc_pkg..get_persn_doc for getting personalization XML file in a CLOB. This custom package internally uses jdr_mds_internal.exportDocumentAsXML for getting personalization XML in 32k chunks.

Custom package code is given below:-

CREATE OR REPLACE PACKAGE BODY APPS.xxcust_getPern_doc_pkg AS

   -- function to get personalization document
   FUNCTION get_persn_doc(p_document_name IN VARCHAR2
                )
   RETURN CLOB
   IS
      isDone INTEGER;
      l_pern_clob clob := '';
      l_pern_info  VARCHAR2(32000);
   BEGIN
           dbms_lob.createtemporary(lob_loc => l_pern_clob, cache => true, dur => dbms_lob.call);
           l_pern_info := jdr_mds_internal.exportDocumentAsXML(isDone,p_document_name);
           dbms_lob.writeappend( l_pern_clob, length(l_pern_info), l_pern_info );
           WHILE (isDone = 0) LOOP
             l_pern_info := jdr_mds_internal.exportDocumentAsXML(isDone, NULL);
             dbms_lob.writeappend( l_pern_clob, length(l_pern_info), l_pern_info );
           END LOOP;
          
           RETURN l_pern_clob;
   END get_persn_doc;

END xxcust_getPern_doc_pkg;
/


Monday, June 19, 2017

Embedding Custom Region into Standard OAF Page

Embedding Custom Region into Standard OAF Page

In this article, we shall see how to insert custom OAF region into standard page using personalization.

Make sure that you enable following profile options for enabling the “Personalization” link on OAF page
1.       Personalize Self-Service Defn” to “Yes”
2.       FND: Personalization Region Link Enabled” for displaying region level personalization links

Create an item on standard page by clicking on “Personalize” link for ex:- “Personalize Stack Layout” as shown in below screenshot:-





Click on “Create Item” icon as shown in below screenshot:-



Enter details for “Create Item” as follows:-

Level
Site
Item Style
Stack Layout
ID
Unique Id for ex:- customRegion
Extends
Custom region path for ex:- /xxcust/oracle/apps/per/irc/webui/MyCustomRN

Same is shown in below screenshot:-


Tuesday, June 13, 2017

OAF Interview Questions

OAF Interview Questions

1.       What architecture Oracle Application Framework(here onwards referred as OAF) uses?
ANS: MVC

2.       What is meant by MVC, explain in brief?
    ANS: Please google.

3.       What corresponds to “View” w.r.t OAF in MVC architecture?
ANS: UIX pages

4.       Does “View Object” in OAF, really correspond to “View” in MVC architecture?
ANS: No, “View Object” is part of BC4J objects which is core of “Model” in MVC architecture.

5.       What is the significance of having “Application Module” in BC4J in OAF in brief?
ANS: Application Module acts as container of View objects and entity objects and takes care of transaction handling and session management.

6.       Consider you have oracle standard OAF page,  which you would like to customize by adding an extra database field to it, what is the approach you would follow in below cases:-
a.       If Existing page already has a view objects which is fetching required database column
ANS: Will personalize the standard page to add a field to show already fetched database column
b.       If existing page doesn’t fetch required database column.
ANS: This will require customization which can be further explained in 3 sub steps
                                                                                 I.            Existing view object has to be extended to fetch required database column
                                                                               II.            JpxImport command has to be run to make the server pick newly created custom view object
                                                                             III.            Mid tier bounce is required to tell the server that new view object is to be picked up instead of standard one.
                                                                            IV.            personalization has to be done to show the newly added database column.

7.       Considering the requirement mentioned in Qn No. 6, how would you revert the customization done to show the newly added column?
ANS: This consists of below steps:
                                                                                 I.            Remove personalization to not to show the newly added column.
                                                                               II.            Delete the substitution by executing below pl/sql command jdr_utils.deletedocument
                                                                             III.            Bounce the mid-tier to make the server pick standard view object.

8.       Can you tell some of utility packages available in jdr_utils and brief description of the need of the function/procedure name
a.       Jdr_utils.deletedocument
b.       Jdr_utils.printdocument
c.       Jdr_utils.listcustomizations
d.       Jdr_utils.listdocuments

9.       Oracle recommends not to extend standard view object which is query based, do you know the reason why?
ANS: Yes, as standard view object is query based, when we extend standard view object, we actually copy paste the query from standard view object and modify the query accordingly. In case if Oracle modifies the standard view object for any patches, our custom view object will have old standard code.  There is also a possibility of page getting errored out after patch is applied.

10.   If you do not want to extend query based VO, do you find any alternative of achieving the same?
ANS: Yes, if custom view object just needs new database field to be added, we can add new transient attribute dynamically to the existing standard view object from extended custom controller. Value can be set to the transient view attribute after fetching from new custom view object (which can be created dynamically or statically).

11.   What is the profile you need to set before exporting personalizations form an instance?
ANS: FND: Personalization Document Root Path, this is the path on the server where exported personalization files get saved.

12.   Why do you define Database connection settings twice in Jdeveloper?
ANS:      Connections which we create in JDeveloper is design time connection, which is used when we create entity objects or view objects.
                Connection details which we mentione when we select DBC file, is used at runtime, when OAF pages run from local system.

13.   What are the 3 methods available in any OAF controller, what is the purpose of each method
a.       ProcessRequest
b.       ProcessFormRequest
c.       ProcessFormData

14.   Tell in brief steps for creating a pop up lov.
a.       Create a region for lov page
b.       In the page which acts as base page, define an lov item and mention external URL to region that you defined in step a.
c.       Define LOV mappings for passing the values between base page and lov page.

15.   What are the steps for debugging the custom code ?
ANS:   Write “writediagnostics” method calls from custom code which gets printed on the screens when “Diagnostics” is turned on.

More to come in next post….

Monday, June 12, 2017

Sub Ledger xla_ae_lines links to Various Tables

Sub Ledger xla_ae_lines links to various tables

Below diagram clearly gives subledger(xla_ae_lines xal) link to various tables like Cost Distribution table(pa_cost_distribution_lines_all), revenue distribution table(pa_cust_rev_dist_lines_all), invoice distribution table(ap_invoice_distributions_all), pa_draft_revenues_all, ap_payment_hist_dists, ra_cust_trx_line_gl_dist_all, pa_cust_event_rdl_all,pa_events 

Download image from here for clear view.