DBA Data[Home] [Help]

PACKAGE BODY: APPS.ADI_DISPLAY_REPORT

Source


1 PACKAGE BODY ADI_display_report AS
2 /* $Header: frmdispb.pls 120.0.12000000.3 2007/03/01 20:11:57 ghooker ship $ */
3 --------------------------------------------------------------------------------
4 --  PROCEDURE:    ADI_Display_Report                                          --
5 --                                                                            --
6 --  DESCRIPTION:  Displays and HTML report/form to the screen.  The HTML      --
7 --                output may a report published from the Request Center, or   --
8 --                a stand alone file which was unloaded (also from the        --
9 --                Request Center).                                            --
10 --                                                                            --
11 --  MODIFICATIONS                                                             --
12 --  DATE       DEVELOPER  COMMENTS                                            --
13 --             CCLYDE     Initial Creation                                    --
14 --  08 AUG 99  CCLYDE     Modified DisplayApprovalForm procedure so that      --
15 --                        the user must enter a date in the correct format.   --
16 --                        Now using package owa_util.choose_date, rather than --
17 --                        free text string.  The form looks a little funny,   --
18 --                        but this is necessary because of the date           --
19 --                        validation.  It looks even more wierd because the   --
20 --                        time is also included in the Approval form.         --
21 --                        Modified UpdatePreviewerDetails to accept the new   --
22 --                        date format and to convert the date to the          --
23 --                        following format: YYYY/MM/DD HH24:MI.  Phew!        --
24 --                        Talk about complex.                                 --
25 --                        Modified DisplayPublishedReport to convert the      --
26 --                        Availability Date to the following format:          --
27 --                        YYYY/MM/DD HH24:MI.                                 --
28 --  09-AUG-99  CCLYDE     Added DisplayBanner parameter.                      --
29 --                        Added functionality behind the DisplayBanner        --
30 --                        parameter.  Preceeded all messages with ADI_        --
31 --  23-AUG-99  BHOOKER    For timeframe parameter, changed the index of 1 to  --
32 --                        LAST because Timeframe drop list displayed in       --
33 --                        descending order.                                   --
34 --  23-AUG-99  CCLYDE     Changed the way in which the kiosk banner is called.--
35 --                        New procedure have been created for more            --
36 --                        flexibility.                                        --
37 --                        (DisplayHTMLFile / BuildParameterFrake).            --
38 --  23-AUG-99  CCLYDE     Added 'NOSCROLL' as a parameter to the Parameter    --
39 --                        Drop List frame (Task: 3286)   (Show)               --
40 --  26-AUG-99  CCLYDE     Added Exception clauses to all procedures which     --
41 --                        contained a SQL statement.   (Task: 3275)           --
42 --  28-AUG-99  CCLYDE     Broke the IF Banner condition into two steps and    --
43 --                        corrected the Timeframe/ExpandedValue condition.    --
44 --                        (Task: 3377)                                        --
45 --                        (DisplayHTMLFile).                                  --
46 --  28-AUG-99  CCLYDE     Created new procedure ReportNotFound which displays --
47 --                        a dummy page informing the user that their report   --
48 --                        was not found.  The page is called if the requested --
49 --                        report cannot be retrieved from the database.       --
50 --                        (Task:  3344)                                       --
51 --                        (DisplayHTMLFile).                                  --
52 --  10-SEP-99  CCLYDE     Added SQL Statement to retrieve user names from     --
53 --                        FND_WEB_ users within a 10.7 environment.           --
54 --                        (DisplayPreviewAccess)                              --
55 --  13-SEP-99  BHOOKER    Changed ExtractString to support the additional     --
56 --                        parameter P_DISPLAYBANNER appearing in the          --
57 --                        parameter list for form functions (after Security   --
58 --                        ID).                              --
59 --  13-SEP-99  BHOOKER    Added constant c_ADIDisplayBanner to support        --
60 --                        extracting security information when                --
61 --                        P_DISPLAYBANNER exists in the parameter list for    --
62 --                        parameter list for a form function.                 --
63 --  13-SEP-99  BHOOKER    Added debug messages to the ON_HOLD logic           --
64 --  13-SEP-99  BHOOKER    Added code to retrieve g_SessionID if it is NULL    --
65 --                        at the start of DisplayPublishedReport, as          --
66 --                        g_SessionID is required to check the Reviewer       --
67 --                        access rights to ON_HOLD reports.                   --
68 --  13-SEP-99  BHOOKER    Moved the code to retrieve g_SessionID so that it   --
69 --                        ONLY gets executed when we are displaying a secured --
70 --                        secured document.                                   --
71 --  14-SEP-99  BHOOKER    Change format masks to correctly display future     --
72 --                        availability date/time for reports.                 --
73 --                        (DisplayPreviewAccess)                              --
74 --  14-SEP-99  BHOOKER    Fixed call to owa_util.choose_date to pass the      --
75 --                        availability date so that the previewer can see     --
76 --                        when this report will be made available             --
77 --                        (DisplayApprovalForm)                               --
78 --  14-SEP-99  BHOOKER    Enhanced Hour and Minute Select Lists to display    --
79 --                        the availability date so that the previewer can see --
80 --                        when this  report will be made available.           --
81 --                        (DisplayApprovalForm)                               --
82 --  01-NOV-99  CCLYDE     Added an extra IF statement to check the value of   --
83 --                        p_Security.  If a security model has been chosen,   --
84 --                        then we need to check that the user also selected   --
85 --                        a Security Set Id, or a custom package.  Also       --
86 --                        introduced a new variable, v_Security, so the       --
87 --                        security model can be changed on the fly.  If the   --
88 --                        user has selected a security model, but no Set or   --
89 --                        Custom Package, then security is switched off       --
90 --                        completed and all expansion values will be          --
91 --                        available to all users. CreateParameterFrame        --
92 --                                                                            --
93 --                        Added a check for the Security model when the type  --
94 --                        is either SECURITY or PACKAGE.  This ensures that   --
95 --                        when either the Custom Security, or ADI's Security  --
96 --                        model is choosen, a Package, or Security Set is     --
97 --                        also choosen.  (ExtractString)                      --
98 --                        (Task: 3596).                                       --
99 --  16-FEB-00  CCLYDE     Added Package_Revision procedure to see if we can   --
100 --                        capture the revision number of the package during   --
101 --                        runtime.                                            --
102 --                                  (Task:  3858)                             --
103 --  12-MAR-00  DJANCIS    Modified DisplayFile to be able to handle           --
104 --                        retrieving data from either the FND_LOBS or the     --
105 --                        FND_DOCUMENTS_LONG_TEXT to conform to new AOL       --
106 --                        schema changes.  (Task: 3769 )                      --
107 --  20-MAR-00  DJANCIS    Modified Build_Security_Table to call new flex      --
108 --                        routinue which will build the access list from all  --
109 --                        valid flexfield segment values based on flexfield   --
110 --                        value security (Task: 3121)                         --
111 --  30-MAR-00  DJANCIS    Modified Build Time Frame Parameter to intialize    --
112 --                        g_TimeFrame_List (Task 4110 )                       --
113 --  03-APR-00  DJANCIS    modified Built Time Frame Parameter to initialize   --
114 --                        g_ExpandedValue_List as the list was not being      --
115 --                        refreshed properly                                  --
116 --  15-MAY-00  GSANAP     Replaced all the != occurances with <> for PKM      --
117 --                        Moved the $Header comment from the top              --
118 --  17-MAY-00  CCLYDE     Created a second HTML frame so that the banner      --
119 --                        is displayed in one frame and the actual report     --
120 --                        output is displayed in the second frame.  Since the --
121 --                        introduction of the AOL URL redirect, the redirect  --
122 --                        was failing if the 'image' being redirected wasn't  --
123 --                        being directed to a new, empty page/frame.          --
124 --                        Also, created new procedure DisplayBannerFrame,     --
125 --                        which displays the Banner in a separate frame.      --
126 --                            (Show)     Task:  4179                          --
127 --  17-MAY-00  CCLYDE     Modified DisplayHTMLFile so that if a report is     --
128 --                        published with a status of ON HOLD, the Approval    --
129 --                        form is displayed in a separate frame from the      --
130 --                        actual report itself.  Moved DisplayFile out from   --
131 --                        under DisplayHTMLFile so that I could declare it    --
132 --                        publicly within the package spec.   (Task: 4192)    --
133 --  19-MAY-00  DJANCIS    Removed calls to chr and replaced with              --
134 --                        fnd_global.local_chr as per adchkdrv standards      --
135 --  29-JUN-00  GSANAP     Modified debug stmts. to include package names      --
136 --                        Task 4425                                           --
137 --  07-DEC-00  CCLYDE     Help Tag is now rptmgr1007762.                      --
138 --                        (Build_ExpandedValue_Parameter, DisplayBannerFrame) --
139 --  02-AUG-02  JRICHARD   Changeover to using the APPS_SERVLET_AGENT profile  --
140 --                        instead of the BNE_SERVLET_LINK profile             --
141 --  02-AUG-02  JRICHARD   Changed show procedure to support the removal of    --
142 --                        servlet aliases in the zone.properties file.        --
143 --  14-NOV-02  GHOOKER    Bugs 2279439, 2618782 Images not displayed RM8      --
144 --                        added for documentation purposes.                   --
145 --  09-MAY-02  GHOOKER   SQL Bind Compliance - update DisplayFile Procedure   --
146 --  06-JUL-06  GHOOKER   Bug 5127461 Sec Updates in 11.5.10                   --
147 --  26-FEB-07  GHOOKER   Bug 5873313                                          --
148 --------------------------------------------------------------------------------
149 g_SessionId      NUMBER;
150 g_AppsRelease    NUMBER;
151 g_UserId         INTEGER;
152 g_Language       VARCHAR2(100);
153 
154 g_ServerAddress FND_PROFILE_OPTION_VALUES.PROFILE_OPTION_VALUE%TYPE;
155 
156 TYPE TimeFrameTable IS TABLE OF GL_Periods.Period_Name%TYPE
157      INDEX BY BINARY_INTEGER;
158 TYPE ExpandedTable IS TABLE OF FND_FLEX_VALUES.Parent_Flex_Value_High%TYPE
159      INDEX BY BINARY_INTEGER;
160 g_imgSpacer        VARCHAR2(50)   := 'ADI_Binary_File.Show?p_file=ADISPACE.gif';
161 g_imgSplash        VARCHAR2(50)   := 'ADI_Binary_File.Show?p_file=ADISPLSH.gif';
162 c_ADISecurity         CONSTANT VARCHAR2(5)  DEFAULT 'ADIK:';
163 c_CustomSecurity      CONSTANT VARCHAR2(5)  DEFAULT 'CUST:';
164 c_FlexSecurity        CONSTANT VARCHAR2(5)  DEFAULT 'FLEX:';
165 c_ADISecurityPackage  CONSTANT VARCHAR2(25) DEFAULT 'ADI_Secured_Value_Access';
166 c_ADIDisplayBanner    CONSTANT VARCHAR2(25) DEFAULT '&P_DISPLAYBANNER';
167 c_HTML_MimeType       CONSTANT VARCHAR2(10) DEFAULT 'text/html';
168 c_OnHold              CONSTANT VARCHAR2(7)  DEFAULT 'ON_HOLD';
169 
170 --  Removed call to chr and replaced with fnd_global.local_chr as per adchkdrv
171 --  standards
172 -- c_NewLine             CONSTANT VARCHAR2(2)  DEFAULT convert(
173 --                                                   fnd_global.local_chr(10),
174 --                                                   substr(userenv('LANGUAGE'),
175 --                                                   instr(userenv('LANGUAGE'),
176 --                                                         '.') + 1),
177 --                                                            'US7ASCII');
178 c_ChunkSize           CONSTANT INTEGER      DEFAULT 1000;
179 -- g_Security_List       ADI_Kiosk_Global.AccessTable;
180 g_TimeFrame_List      TimeFrameTable;
181 g_ExpandedValue_List  ExpandedTable;
182 g_ParameterFrame      VARCHAR2(32767) DEFAULT '';
183 g_ReleaseName         FND_PRODUCT_GROUPS.release_name%TYPE DEFAULT '';
184 g_CategoryId          FND_DOCUMENT_CATEGORIES.category_id%TYPE;
185 -----------------------------------------------------------------------------
186 --  PROCEDURE:    DisplayFile                                              --
187 --                                                                         --
188 --  DESCRIPTION:  Procedure extracts the file from FND_DOCUMENTS_LONG_TEXT --
189 --                and displays it to the browser.  The file to print is    --
190 --                already known before this procedure is called.           --
191 --                                                                         --
192 --  PARAMETERS:   p_ReportTitle  Report name from FND_FORM_FUNCTIONS       --
193 --                p_Media_Id     Unique identifier in                      --
194 --                               FND_DOCUMENTS_LONG_TEXT                   --
195 --                p_Description  Passed to check that the description      --
196 --                               field in FND_DOCUMENTS_VL is correct      --
197 --                               and that the user has not modified the    --
198 --                               URL before calling the Display process.   --
199 --                                                                         --
200 --  MODIFICATIONS                                                          --
201 --  DATE       DEVELOPER  COMMENTS                                         --
202 --  14-JUN-99  CCLYDE     Initial creation                                 --
203 --  12-MAR-00  DJANCIS    Modified DisplayFile to be able to handle        --
204 --                        retrieving data from either the FND_LOBS or the  --
205 --                        FND_DOCUMENTS_LONG_TEXT to conform to new AOL    --
206 --                        schema changes. (TASK: 3769 )                    --
207 --  29-JUN-00  GSANAP     Modified debug stmts. to include package names   --
208 --                        Task 4425                                        --
209 --  27-JUN-06  GHOOKER   Bug 5127461 Sec Updates in 11.5.10                --
210 --  26-FEB-07  GHOOKER   Bug 5873313                                       --
211 -----------------------------------------------------------------------------
212 PROCEDURE DisplayFile (p_docId IN NUMBER) AS
213   v_cursor        NUMBER;
214   v_query         VARCHAR2(2000);
215   v_dummy         NUMBER;
216   v_image         RAW(32767);
217   v_document      LONG;
218   v_value_length  NUMBER;
219   v_offset        NUMBER;
220   o_cursor        NUMBER;
221   o_query         VARCHAR2(2000);
222   o_datatype_id   NUMBER;
223   o_media_id      NUMBER;
224   o_dummy         NUMBER;
225   url             VARCHAR2(2000);
226   -- ghooker 06-Jul-06 Bug 5127461
227   o_display_flag  BOOLEAN;
228   o_access        NUMBER;
229   o_file_name     VARCHAR2(2048);
230 
231 BEGIN
232 
233   -- ghooker 26-FEB-07 bug 5873313
234   -- Always ensure we go through ADI_Binary_File.Show we are no longer using
235   -- the 10.7 and 11.0 technology
236   ADI_Binary_File.Show (p_docId);
237 
238 EXCEPTION
239   WHEN OTHERS THEN
240             ICX_UTIL.Add_Error ('ADI_display_report.DisplayFile - ' || SQLERRM);
241      ICX_ADMIN_SIG.Error_Screen ('ADI_display_report.DisplayFile - ' || SQLERRM);
242 END DisplayFile;
243 ----------------------------------------------------------------------------------------
244 --  PROCEDURE:    Display HTML File                                                   --
245 --                                                                                    --
246 --  DESCRIPTION:  Retrieves the static, point in time report from the database and    --
247 --                displays it through a browser.  When ADI (Request Center) publishes --
248 --                to the database, the file is uploaded into FND_DOCUMENTS_LONG_TEXT  --
249 --                (this follows the Apps standards).                                  --
250 --                                                                                    --
251 --  PARAMETERS:   ReportTitle      Unique identifier for this report                  --
252 --                TimeFrame        TimeFrame selected by the user.  This is only      --
253 --                                 relevant if the report is a periodic report.       --
254 --                ExpandedValue    Expansion value selected by the user.  This is     --
255 --                                 only relevant if the report has been generated     --
256 --                                 using an Expansion Value Set.                      --
257 --                                                                                    --
258 --  MODIFICATIONS                                                                     --
259 --  DATE       DEVELOPER  COMMENTS                                                    --
260 --  05-MAY-99  CCLYDE     Initial creation                                            --
261 --  27-MAY-99  CCLYDE     Check to see if the user is logged into the system before   --
262 --                        displaying the report.                                      --
263 --                        Check to see if the user has access to the requested        --
264 --                        expansion value.                                            --
265 --  23-AUG-99  CCLYDE     Changed the way in which the kiosk banner is called.  New   --
266 --                        procedure have been created for more flexibility.           --
267 --  28-AUG-99  CCLYDE     Broke the IF Banner condition into two steps and corrected  --
268 --                        the Timeframe/ExpandedValue condition.   (Task: 3377)       --
269 --  14-MAY-03  GHOOKER    Bug 2948978 Re-instated this procedure.                     --
270 --                        removed parts of original procedure that were not used      --
271 --                        within RM8.                                                 --
272 ----------------------------------------------------------------------------------------
273 PROCEDURE DisplayHTMLFile (p_ReportTitle   IN VARCHAR2 default '',
274                            p_TimeFrame     IN VARCHAR2 default '',
275                            p_ExpandedValue IN VARCHAR2 default '',
276                            p_StaticFile    IN VARCHAR2 default '',
277                            p_PageType      IN VARCHAR2 default '',
278                            p_displayBanner IN VARCHAR2 default 'N') AS
279    ----------------------------------------------------------------------------------------
280    --  PROCEDURE:    DisplayStaticFile                                                   --
281    --                                                                                    --
282    --  DESCRIPTION:  This procedure is used if the user tries to display a static html   --
283    --                file which was previously uploaded (using the Menu Maintenance      --
284    --                form).  It does not get called if the user is displaying a report   --
285    --                previously published into the database (using the Request Center    --
286    --                functionality); see DisplayPublishedReport.                         --
287    --                                                                                    --
288    --                If the Mime Type = text/html, the file is retrieved from FND_       --
289    --                DOCUMENTS_LONG_TEXT (in text format).  Any other file types are     --
290    --                stored as binary objects in FND_DOCUMENTS_LONG_RAW and need to be   --
291    --                retrieved differently.                                              --
292    --                                                                                    --
293    --  PARAMETERS:   p_MediaId      Unique identifier for the file (HTML or other file). --
294    --                p_PageType     P    - Public Home Page                              --
295    --                               S    - Secured Home Page                             --
296    --                               null - Either Public or Secured page, but not home   --
297    --                                      page.                                         --
298    --                                                                                    --
299    --  MODIFICATIONS                                                                     --
300    --  DATE       DEVELOPER  COMMENTS                                                    --
301    --  14-JUN-99  CCLYDE     Initial creation                                            --
302    --  15-JUL-99  CCLYDE     Added p_PageType to differentiate between the different     --
303    --                        document categories.                                        --
304    --  29-JUN-00  GSANAP     Modified debug stmts. to include package names              --
305    --                        Task 4425                                                   --
306    --  14-MAY-03  GHOOKER    Bug 2948978 Re-instated this procedure.                     --
307    --                        removed parts of original procedure that were not used      --
308    --                        within RM8.                                                 --
309    ----------------------------------------------------------------------------------------
310    PROCEDURE DisplayStaticFile (p_FileName IN VARCHAR2 default '',
311                                 p_PageType IN VARCHAR2 default '') AS
312       v_query           VARCHAR2(500);
313       v_cursor          INTEGER;
314       v_dummy           INTEGER;
315       v_category_name   FND_DOCUMENT_CATEGORIES.name%TYPE;
316       v_DocumentId      FND_DOCUMENTS_VL.Document_Id%TYPE;
317       v_mimeType        FND_DOCUMENTS_VL.Description%TYPE;
318    BEGIN
319       v_query := '';
320       v_query := v_query || 'SELECT CAT.NAME, ';
321       v_query := v_query || '       DOCS.DOCUMENT_ID, ';
322       v_query := v_query || '       DOCS.DESCRIPTION ';
323       v_query := v_query || 'FROM   FND_DOCUMENT_CATEGORIES CAT, ';
324       v_query := v_query || '       FND_DOCUMENTS_VL DOCS ';
325       v_query := v_query || 'WHERE  CAT.CATEGORY_ID = DOCS.CATEGORY_ID ';
326       -- GHOOKER 14-May-2003 SQL Bind Compliance.
327       -- v_query := v_query || 'AND    LOWER (DOCS.FILE_NAME) = LOWER (''' || P_FILENAME || ''') ';
328       v_query := v_query || 'AND    LOWER (DOCS.FILE_NAME) = LOWER ( :pfilename ) ';
329       IF (p_PageType = 'PUBLIC') THEN
330          v_query := v_query || 'AND CAT.NAME = ''ADI_KIOSK_DEFAULT_PUBLIC'' ';
331       ELSIF (p_PageType = 'SECURED') THEN
332          v_query := v_query || 'AND CAT.NAME = ''ADI_KIOSK_DEFAULT_SECURED'' ';
333       END IF;
334       v_cursor := DBMS_SQL.OPEN_CURSOR;
335       DBMS_SQL.PARSE (v_cursor, v_query, DBMS_SQL.NATIVE);
336       -- GHOOKER 14-May-2003 SQL Bind Compliance.
337       DBMS_SQL.BIND_VARIABLE (v_cursor, ':pfilename', P_FILENAME);
338       DBMS_SQL.DEFINE_COLUMN (v_cursor, 1, v_Category_Name, 30);
339       DBMS_SQL.DEFINE_COLUMN (v_cursor, 2, v_DocumentId);
340       DBMS_SQL.DEFINE_COLUMN (v_cursor, 3, v_MimeType, 255);
341       v_dummy := DBMS_SQL.EXECUTE (v_cursor);
342       v_dummy := DBMS_SQL.FETCH_ROWS (v_cursor);
343       DBMS_SQL.COLUMN_VALUE (v_cursor, 1, v_Category_Name);
344       DBMS_SQL.COLUMN_VALUE (v_cursor, 2, v_DocumentId);
345       DBMS_SQL.COLUMN_VALUE (v_cursor, 3, v_MimeType);
346       DBMS_SQL.Close_Cursor (v_cursor);
347       IF (v_Category_Name IN ('ADI_KIOSK_REPORT', 'ADI_KIOSK_DEFAULT_SECURED')) THEN
348          IF (NOT ICX_SEC.ValidateSession) THEN
349             GOTO EndOfStaticDisplay;
350          END IF;
351       END IF;
352       IF (v_MimeType = c_HTML_MimeType) THEN
353          DisplayFile (v_DocumentId);
354       ELSE
355          ADI_Binary_File.Show (v_DocumentId);
356       END IF;
357       <<EndOfStaticDisplay>>
358       null;
359    EXCEPTION
360       WHEN OTHERS THEN
361          ICX_UTIL.Add_Error ('ADI_display_report.DisplayStaticFile - ' || SQLERRM);
362          ICX_ADMIN_SIG.Error_Screen ('ADI_display_report.DisplayStaticFile - ' || SQLERRM);
363    END DisplayStaticFile;
364 --------------------------------------------------------------------------------
365 --   DisplayHTMLFile                                                          --
366 --------------------------------------------------------------------------------
367 BEGIN
368 
369    DisplayStaticFile (p_StaticFile, p_PageType);
370 END DisplayHTMLFile;
371 ------------------------------------------------------------------------------------
372 --  FUNCTION:    getServerAddress                                                 --
373 --                                                                                --
374 --  DESCRIPTION: Retrieves the leading URL location to call BneApplicationService --
375 --               from.                                                            --
376 --                                                                                --
377 --  PARAMETERS:                                                                   --
378 --                                                                                --
379 --  MODIFICATION HISTORY                                                          --
380 --  Date       Username  Description                                              --
381 --  11-NOV-01  MWISE    Initial Creation                                          --
382 ------------------------------------------------------------------------------------
383 FUNCTION getServerAddress RETURN VARCHAR2 IS
384    l_query          VARCHAR2(1000);
385    l_cursor         NUMBER;
386    l_dummy          NUMBER;
387 BEGIN
388    IF (g_ServerAddress IS NULL) THEN
389       l_query := '';
390       l_query := l_query || 'SELECT V.PROFILE_OPTION_VALUE ';
391       l_query := l_query || 'FROM   FND_PROFILE_OPTIONS O, ';
392       l_query := l_query || '       FND_PROFILE_OPTION_VALUES V ';
393       l_query := l_query || 'WHERE  O.PROFILE_OPTION_NAME = ''APPS_SERVLET_AGENT'' ';
394       l_query := l_query || 'AND    O.START_DATE_ACTIVE <= SYSDATE ';
395       l_query := l_query || 'AND   (NVL(O.END_DATE_ACTIVE,SYSDATE) >= SYSDATE) ';
396       l_query := l_query || 'AND   (V.LEVEL_ID (+) = 10001 AND V.LEVEL_VALUE (+) = 0) ';
397       l_query := l_query || 'AND    O.PROFILE_OPTION_ID = V.PROFILE_OPTION_ID (+) ';
398       l_query := l_query || 'AND    O.APPLICATION_ID = V.APPLICATION_ID (+) ';
399       l_cursor := DBMS_SQL.OPEN_CURSOR;
400       DBMS_SQL.parse (l_cursor, l_query, DBMS_SQL.native);
401       DBMS_SQL.Define_Column (l_cursor, 1, g_ServerAddress, 240);
402       l_dummy := DBMS_SQL.execute (l_cursor);
403       l_dummy := DBMS_SQL.Fetch_Rows (l_cursor);
404       DBMS_SQL.Column_Value (l_cursor, 1, g_ServerAddress);
405       DBMS_SQL.CLOSE_CURSOR (l_cursor);
406    END IF;
407 
408    -- Check for trailing slash.
409    IF (SUBSTR (g_ServerAddress, LENGTH (g_ServerAddress), 1) <> '/') THEN
410       g_ServerAddress := g_ServerAddress || '/';
411    END IF;
412 
413    RETURN (g_ServerAddress);
414 
415 EXCEPTION
416    WHEN OTHERS THEN
417       ICX_UTIL.Add_Error ('getServerAddress - ' || SQLERRM);
418       ICX_ADMIN_SIG.Error_Screen ('getServerAddress - ' || SQLERRM);
419 END getServerAddress;
420 
421 ----------------------------------------------------------------------------------------
422 --  PROCEDURE:    Show                                                                --
423 --                                                                                    --
424 --  DESCRIPTION:  Main procedure for the package.  Checks to see what type of report  --
425 --                is being displayed and then displays the relevant frames:           --
426 --                    Parameters                                                      --
427 --                    Report Contents                                                 --
428 --                                                                                    --
429 --                This procedure displays reports available through a secured menu    --
430 --                ONLY.                                                               --
431 --                                                                                    --
432 --  PARAMETERS:   Report Title     Report identifier                                  --
433 --                Security         Identifies the security model to use               --
434 --                Display Banner   Display BIS standard banner  Y/N                   --
435 --                                                                                    --
436 --  MODIFICATIONS                                                                     --
437 --  DATE       DEVELOPER  COMMENTS                                                    --
438 --  16-MAY-99  CCLYDE     Initial creation                                            --
439 --  09-AUG-99  CCLYDE     Added DisplayBanner parameter.                              --
440 --  23-AUG-99  CCLYDE     Added 'NOSCROLL' as a parameter to the Parameter Drop List  --
441 --                        frame.   (Task: 3286)                                       --
442 --  17-MAY-00  CCLYDE     Created a second HTML frame so that the banner is displayed --
443 --                        in one frame and the actual report output is displayed in   --
444 --                        the second frame.  Since the introduction of the AOL URL    --
445 --                        redirect, the redirect was failing if the 'image' being     --
446 --                        redirected wasn't being directed to a new, empty page/frame.--
447 --                            (Task:  4179)                                           --
448 --  27-JUN-06  GHOOKER    Bug 5127461 Sec Updates in 11.5.10                          --
449 ----------------------------------------------------------------------------------------
450 PROCEDURE Show (p_ReportTitle    IN  VARCHAR2,
451           p_security       IN  VARCHAR2 default '',
452                 p_displayBanner  IN  VARCHAR2 default 'N') IS
453 
454    v_top_frame          VARCHAR2(5000);
455    v_bottom_frame       VARCHAR2(100);
456    v_MediaId            NUMBER default 0;
457    v_periodicReport     INTEGER default 0;
458    v_expansionReport    INTEGER default 0;
459    v_URL_Params         VARCHAR2(1000);
460    v_URL_Contents       VARCHAR2(1000);
461    v_ReportType         FND_DOCUMENT_CATEGORIES.name%TYPE;
462    v_dummy              BOOLEAN;
463    v_frameHeight        NUMBER;
464    v_serverAddress      VARCHAR2(255);
465 
466 BEGIN
467    --
468    -- Redirect to the RM8.
469    --
470    v_serverAddress := getServerAddress;
471    owa_util.redirect_url( v_serverAddress || 'oracle.apps.bne.webui.BneApplicationService?bne:page=RMDocuments&event=none&frm:filename=' || p_ReportTitle || '&frm:security=' || p_security );
472 END Show;
473 
474 END ADI_display_report;