1 PACKAGE BODY JTF_DIAG_REPORT_FACTORY AS
2 /* $Header: jtf_diag_report_factory_b.pls 120.3.12010000.6 2009/08/05 13:33:35 rudas ship $*/
3
4
5 PROCEDURE VALIDATE_REPORT_CONTEXT(report_context JTF_DIAG_REPORT_CONTEXT)
6 IS
7 BEGIN
8 IF report_context IS NULL THEN
9 RAISE_APPLICATION_ERROR(-20100,'ReportContext provided to instantiate the component is null');
10 END IF;
11 END VALIDATE_REPORT_CONTEXT;
12
13 FUNCTION CREATE_FOOTER(footer VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_FOOTER
14 IS
15 footer_component JTF_DIAG_FOOTER;
16 exec_id NUMBER;
17 ui_node_id NUMBER;
18 footer_content VARCHAR2(2000);
19 footer_note_id NUMBER;
20 note_component JTF_DIAG_NOTE;
21 link_component JTF_DIAG_LINK;
22 temp number := 1;
23 diag_com_url varchar2(2000);
24 BEGIN
25 VALIDATE_REPORT_CONTEXT(report_context);
26 IF footer IS NOT NULL THEN
27 footer_content := DBMS_XMLGEN.CONVERT(footer,0) || ' If you are experiencing any issues regarding this diagnostic test, please ' ||
28 'use My Oracle Support to log an iTAR (Service Request) for product "Oracle E-Business' ||
29 'Suite Diagnostics" (ID=1332). If you have any question related to E-Business Suite Diagnostics (installation, execution, usage or availability), you can ask us using the' ||
30 '''Diagnosibility'' ? available on My Oracle Support (or classic' ||
31 'Metalink). We would also appreciate your feedback regarding the usefulness of this ' ||
32 'test,however, there will be no replies to feedback emails. ';
33 exec_id := report_context.EXEC_ID;
34 BEGIN
35 diag_com_url := FND_PROFILE.value('OAM_DIAG_COMMUNITY_URL');
36 EXCEPTION
37 WHEN OTHERS THEN
38 diag_com_url := 'https://communities.oracle.com/portal/server.pt/community/Diagnosibility/242';
39 END;
40 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
41 note_component := CREATE_NOTE(footer_content, report_context);
42 link_component := CREATE_LINK('Community', diag_com_url, report_context);
43 note_component.set_link(temp, link_component);
44 footer_component := JTF_DIAG_FOOTER(exec_id,ui_node_id,footer_content,footer_note_id, 0);
45 footer_component.set_Note(note_component);
46 ELSE
47 RAISE_APPLICATION_ERROR(-20100,'The content provided for the footer is null');
48 END IF;
49 RETURN footer_component;
50 END CREATE_FOOTER;
51 FUNCTION CREATE_HEADER(header VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_HEADER
52 IS
53 header_component JTF_DIAG_HEADER;
54 exec_id NUMBER;
55 ui_node_id NUMBER;
56 header_content VARCHAR2(2000);
57 BEGIN
58 VALIDATE_REPORT_CONTEXT(report_context);
59 IF header IS NOT NULL THEN
60 header_content := DBMS_XMLGEN.CONVERT(header,0);
61 exec_id := report_context.EXEC_ID;
62 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
63 header_component := JTF_DIAG_HEADER(exec_id,ui_node_id,header_content,0);
64 ELSE
65 RAISE_APPLICATION_ERROR(-20100,'The content provided for the header is null');
66 END IF;
67 RETURN header_component;
68 END CREATE_HEADER;
69 FUNCTION CREATE_SECTION(heading VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_SECTION
70 IS
71 section_component JTF_DIAG_SECTION;
72 exec_id NUMBER;
73 ui_node_id NUMBER;
74 section_heading VARCHAR2(2000);
75 BEGIN
76 VALIDATE_REPORT_CONTEXT(report_context);
77 IF heading IS NOT NULL THEN
78 section_heading := DBMS_XMLGEN.CONVERT(heading,0);
79 exec_id := report_context.EXEC_ID;
80 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
81 section_component := JTF_DIAG_SECTION(exec_id,ui_node_id,section_heading,0);
82 ELSE
83 RAISE_APPLICATION_ERROR(-20100,'Heading of the Section is null');
84 END IF;
85 RETURN section_component;
86 END CREATE_SECTION;
87 FUNCTION CREATE_MESSAGE(message VARCHAR2,message_type VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_MESSAGE
88 IS
89 message_component JTF_DIAG_MESSAGE;
90 exec_id NUMBER;
91 ui_node_id NUMBER;
92 message_content VARCHAR2(2000);
93 BEGIN
94 VALIDATE_REPORT_CONTEXT(report_context);
95 IF message IS NOT NULL THEN
96 message_content := DBMS_XMLGEN.CONVERT(message,0);
97 exec_id := report_context.EXEC_ID;
98 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
99 IF message_type IS NOT NULL AND (message_type = 'info' OR message_type = 'warning' OR message_type = 'error' OR message_type = 'attention') THEN
100 message_component := JTF_DIAG_MESSAGE(exec_id,ui_node_id,message_content,message_type,null,0,0,0);
101 ELSE
102 RAISE_APPLICATION_ERROR(-20100,'The message type '|| message_type||' is wrong: It can only be info, warning or error');
103 END IF;
104 ELSE
105 RAISE_APPLICATION_ERROR(-20100,'The content provided for the message is null');
106 END IF;
107 RETURN message_component;
108 END CREATE_MESSAGE;
109
110 FUNCTION CREATE_MESSAGE(note in out nocopy JTF_DIAG_NOTE,message_type VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_MESSAGE
111 IS
112 message_component JTF_DIAG_MESSAGE;
113 exec_id NUMBER;
114 ui_node_id NUMBER;
115 message_note_id NUMBER;
116 str VARCHAR2(4000);
117 message_content VARCHAR2(2000);
118 BEGIN
119 VALIDATE_REPORT_CONTEXT(report_context);
120 IF note IS NOT NULL THEN
121 message_note_id := note.UI_NODE_ID;
122 exec_id := report_context.EXEC_ID;
123 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
124 IF message_type IS NOT NULL AND (message_type = 'info' OR message_type = 'warning' OR message_type = 'error' OR message_type = 'attention') THEN
125 message_component := JTF_DIAG_MESSAGE(exec_id,ui_node_id,message_content,message_type,null,message_note_id,0,0);
126 IF NOTE.ADDED_TO_PARENT <> 1 THEN
127 str := note.CONSTRUCT_NODE;
128 INSERT INTO JTF_DIAGNOSTIC_REPORT
129 (Execution_ID,UI_Node_ID,type,xmldata,parent_node_id)
130 VALUES(exec_id
131 ,note.UI_Node_ID
132 ,'note'
133 ,xmltype(str)
134 ,ui_node_id);
135 NOTE.SET_ADDED_TO_PARENT;
136 ELSE
137 RAISE_APPLICATION_ERROR(-20100,'The Note component cannot be added
138 to the parent component again');
139 END IF;
140 ELSE
141 RAISE_APPLICATION_ERROR(-20100,'The message type '|| message_type||' is wrong: It can only be info, warning or error');
142 END IF;
143 ELSE
144 RAISE_APPLICATION_ERROR(-20100,'The Note component provided for the message is null');
145 END IF;
146 RETURN message_component;
147 END CREATE_MESSAGE;
148
149 FUNCTION CREATE_HIDE_SHOW(content VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_HIDE_SHOW
150 IS
151 hide_show_component JTF_DIAG_HIDE_SHOW;
152 exec_id NUMBER;
153 ui_node_id NUMBER;
154 hide_show_content VARCHAR2(20000);
155 BEGIN
156 VALIDATE_REPORT_CONTEXT(report_context);
157 IF content IS NOT NULL THEN
158 hide_show_content := DBMS_XMLGEN.CONVERT(content,0);
159 exec_id := report_context.EXEC_ID;
160 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
161 hide_show_component := JTF_DIAG_HIDE_SHOW(exec_id,ui_node_id,hide_show_content,'Hide','Show',0);
162 ELSE
163 RAISE_APPLICATION_ERROR(-20100,'The content provided for the hide show is null');
164 END IF;
165 RETURN hide_show_component;
166 END CREATE_HIDE_SHOW;
167 FUNCTION CREATE_RAW_TEXT(content VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_RAW_TEXT
168 IS
169 raw_text_component JTF_DIAG_RAW_TEXT;
170 exec_id NUMBER;
171 ui_node_id NUMBER;
172 raw_text_content VARCHAR2(20000);
173 BEGIN
174 VALIDATE_REPORT_CONTEXT(report_context);
175 IF content IS NOT NULL THEN
176 raw_text_content := content;
177 exec_id := report_context.EXEC_ID;
178 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
179 raw_text_component := JTF_DIAG_RAW_TEXT(exec_id,ui_node_id,raw_text_content,0);
180 ELSE
181 RAISE_APPLICATION_ERROR(-20100,'The content provided for the raw text is null');
182 END IF;
183 RETURN raw_text_component;
184 END CREATE_RAW_TEXT;
185 FUNCTION CREATE_LINK(linkText VARCHAR2, linkURL VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_LINK
186 IS
187 link_component JTF_DIAG_LINK;
188 exec_id NUMBER;
189 ui_node_id NUMBER;
190 link_text_content VARCHAR2(20000);
191 link_url_content VARCHAR2(20000);
192 BEGIN
193 VALIDATE_REPORT_CONTEXT(report_context);
194 IF linkText IS NOT NULL AND linkURL IS NOT NULL THEN
195 link_text_content := DBMS_XMLGEN.CONVERT(linkText,0);
196 link_url_content := DBMS_XMLGEN.CONVERT(linkURL,0);
197 exec_id := report_context.EXEC_ID;
198 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
199 link_component := JTF_DIAG_LINK(exec_id,ui_node_id,link_text_content,link_url_content,0);
200 ELSE
201 RAISE_APPLICATION_ERROR(-20100,'The content provided for the link is null');
202 END IF;
203 RETURN link_component;
204 END CREATE_LINK;
205 FUNCTION CREATE_FORM(heading VARCHAR2,form_keys JTF_VARCHAR2_TABLE_4000, form_values JTF_VARCHAR2_TABLE_4000,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_FORM
206 IS
207 form_component JTF_DIAG_FORM;
208 form_data_component JTF_DIAG_FORMDATA;
209 exec_id NUMBER;
210 form_ui_node_id NUMBER;
211 form_data_ui_node_id NUMBER;
212 form_heading VARCHAR2(2000);
213 BEGIN
214 VALIDATE_REPORT_CONTEXT(report_context);
215 IF heading IS NOT NULL THEN
216 form_heading := DBMS_XMLGEN.CONVERT(heading,0);
217 exec_id := report_context.EXEC_ID;
218 select JTF_DIAGNOSTIC_REPORT_S.nextval into form_ui_node_id from dual;
219 select JTF_DIAGNOSTIC_REPORT_S.nextval into form_data_ui_node_id from dual;
220 form_data_component := JTF_DIAG_FORMDATA(exec_id,form_data_ui_node_id,form_values,0);
221 form_component := JTF_DIAG_FORM(exec_id,form_ui_node_id,form_heading,form_keys,form_values,form_data_component,0);
222 ELSE
223 RAISE_APPLICATION_ERROR(-20100,'The content provided for the form is null');
224 END IF;
225 RETURN form_component;
226 END CREATE_FORM;
227 FUNCTION CREATE_TABLE(heading VARCHAR2, column_headers JTF_VARCHAR2_TABLE_4000,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE
228 IS
229 table_component JTF_DIAG_TABLE;
230 exec_id NUMBER;
231 ui_node_id NUMBER;
232 no_of_cols NUMBER :=0;
233 table_heading VARCHAR2(4000);
234 BEGIN
235 VALIDATE_REPORT_CONTEXT(report_context);
236 IF heading IS NULL THEN
237 table_heading := ' ';
238 ELSE
239 table_heading := DBMS_XMLGEN.CONVERT(heading,0);
240 END IF;
241 IF column_headers IS NOT NULL THEN
242 exec_id := report_context.EXEC_ID;
243 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
244 FOR x IN column_headers.FIRST .. column_headers.LAST
245 LOOP
246 no_of_cols := no_of_cols + 1;
247 END LOOP;
248 table_component := JTF_DIAG_TABLE(exec_id,ui_node_id,column_headers,table_heading,null,0,no_of_cols,0,0,null);
249 ELSE
250 RAISE_APPLICATION_ERROR(-20100,'The content provided for the column header in table is null');
251 END IF;
252 RETURN table_component;
253 END CREATE_TABLE;
254
255 FUNCTION GET_COLUMN_NAMES(sql_query VARCHAR2) RETURN JTF_VARCHAR2_TABLE_4000
256 IS
257 cursor_id number;
258 columns_describe dbms_sql.desc_tab;
259 column_count number;
260 loop_counter number;
261 column_headers JTF_VARCHAR2_TABLE_4000;
262 BEGIN
263 column_headers := JTF_VARCHAR2_TABLE_4000();
264 cursor_id := DBMS_SQL.OPEN_CURSOR;
265 DBMS_SQL.PARSE(cursor_id, sql_query, DBMS_SQL.V7);
266 DBMS_SQL.DESCRIBE_COLUMNS(cursor_id, column_count, columns_describe);
267 FOR loop_counter in 1..column_count
268 LOOP
269 column_headers.extend(1);
270 column_headers(column_headers.count) := columns_describe(loop_counter).col_name;
271 END LOOP;
272 DBMS_SQL.CLOSE_CURSOR(cursor_id);
273 RETURN column_headers;
274 END GET_COLUMN_NAMES;
275
276
277 FUNCTION CREATE_TABLE(heading VARCHAR2, column_headers JTF_VARCHAR2_TABLE_4000, sql_query VARCHAR2, report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE
278 IS
279 table_component JTF_DIAG_TABLE;
283 table_heading VARCHAR2(4000);
280 exec_id NUMBER;
281 ui_node_id NUMBER;
282 no_of_cols NUMBER :=0;
284 table_column_headers JTF_VARCHAR2_TABLE_4000;
285 BEGIN
286 VALIDATE_REPORT_CONTEXT(report_context);
287 IF sql_query IS NULL THEN
288 RAISE_APPLICATION_ERROR(-20100,'The sql query provided for the table is null');
289 END IF;
290 IF heading IS NULL THEN
291 table_heading := ' ';
292 ELSE
293 table_heading := DBMS_XMLGEN.CONVERT(heading,0);
294 END IF;
295 table_column_headers := GET_COLUMN_NAMES(sql_query);
296 --Check if the column_headers provided by the user is consistent with the query
297 IF column_headers IS NOT NULL THEN
298 IF table_column_headers.last = column_headers.last THEN
299 table_column_headers := column_headers;
300 ELSE
301 RAISE_APPLICATION_ERROR(-20100,'The number of columns/header is inconsistent in table' || table_heading);
302 END IF;
303 ELSE
304 RAISE_APPLICATION_ERROR(-20100,'The content provided for the column header in table is null');
305 END IF;
306 exec_id := report_context.EXEC_ID;
307 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
308 FOR x IN table_column_headers.FIRST .. table_column_headers.LAST
309 LOOP
310 no_of_cols := no_of_cols + 1;
311 END LOOP;
312 table_component := JTF_DIAG_TABLE(exec_id,ui_node_id,table_column_headers,table_heading,sql_query,1,no_of_cols,0,0,null);
313 RETURN table_component;
314 END CREATE_TABLE;
315
316 FUNCTION CREATE_TABLE(heading VARCHAR2, sql_query VARCHAR2, report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE
317 IS
318 table_component JTF_DIAG_TABLE;
319 exec_id NUMBER;
320 ui_node_id NUMBER;
321 no_of_cols NUMBER :=0;
322 table_heading VARCHAR2(4000);
323 table_column_headers JTF_VARCHAR2_TABLE_4000;
324 BEGIN
325 VALIDATE_REPORT_CONTEXT(report_context);
326 IF sql_query IS NULL THEN
327 RAISE_APPLICATION_ERROR(-20100,'The sql query provided for the table is null');
328 END IF;
329 IF heading IS NULL THEN
330 table_heading := ' ';
331 ELSE
332 table_heading := DBMS_XMLGEN.CONVERT(heading,0);
333 END IF;
334 table_column_headers := GET_COLUMN_NAMES(sql_query);
335
336 exec_id := report_context.EXEC_ID;
337 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
338 FOR x IN table_column_headers.FIRST .. table_column_headers.LAST
339 LOOP
340 no_of_cols := no_of_cols + 1;
341 END LOOP;
342 table_component := JTF_DIAG_TABLE(exec_id,ui_node_id,table_column_headers,table_heading,sql_query,1,no_of_cols,0,0,null);
343 RETURN table_component;
344 END CREATE_TABLE;
345
346 FUNCTION CREATE_TABLE(column_headers JTF_VARCHAR2_TABLE_4000,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE IS
347 table_component JTF_DIAG_TABLE;
348 BEGIN
349 table_component := CREATE_TABLE(null,column_headers,report_context);
350 RETURN table_component;
351 END CREATE_TABLE;
352
353 FUNCTION CREATE_TABLE(column_headers JTF_VARCHAR2_TABLE_4000, sql_query VARCHAR2, report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE IS
354 table_component JTF_DIAG_TABLE;
355 BEGIN
356 table_component := CREATE_TABLE(null,column_headers,sql_query,report_context);
357 RETURN table_component;
358 END CREATE_TABLE;
359
360 FUNCTION CREATE_TABLE(sql_query VARCHAR2, report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TABLE IS
361 table_component JTF_DIAG_TABLE;
362 BEGIN
363 table_component := CREATE_TABLE(' ',sql_query,report_context);
364 RETURN table_component;
365 END CREATE_TABLE;
366
367 FUNCTION CREATE_ROW(report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_ROW IS
368 row_component JTF_DIAG_ROW;
369 exec_id NUMBER;
370 ui_node_id NUMBER;
371 --cols JTF_VARCHAR2_TABLE_4000;
372 BEGIN
373 VALIDATE_REPORT_CONTEXT(report_context);
374 exec_id := report_context.EXEC_ID;
375 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
376 --cols := JTF_VARCHAR2_TABLE_4000('');
377 row_component := JTF_DIAG_ROW(exec_id,ui_node_id,NULL,0);
378 RETURN row_component;
379 END CREATE_ROW;
380 FUNCTION CREATE_TREE(heading VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TREE IS
381 tree_component JTF_DIAG_TREE;
382 exec_id NUMBER;
383 ui_node_id NUMBER;
384 tree_heading VARCHAR2(20000);
385 BEGIN
386 VALIDATE_REPORT_CONTEXT(report_context);
387 IF heading IS NOT NULL THEN
388 tree_heading := DBMS_XMLGEN.CONVERT(heading,0);
389 exec_id := report_context.EXEC_ID;
390 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
391 tree_component := JTF_DIAG_TREE(exec_id,ui_node_id,tree_heading,0);
392 ELSE
393 RAISE_APPLICATION_ERROR(-20100,'The content provided for the tree is null');
394 END IF;
395 RETURN tree_component;
396 END CREATE_TREE;
397 FUNCTION CREATE_TREE_NODE(content VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_TREE_NODE IS
398 tree_node_component JTF_DIAG_TREE_NODE;
399 exec_id NUMBER;
400 ui_node_id NUMBER;
401 tree_content VARCHAR2(20000);
402 BEGIN
403 VALIDATE_REPORT_CONTEXT(report_context);
404 IF content IS NOT NULL THEN
405 tree_content := DBMS_XMLGEN.CONVERT(content,0);
406 exec_id := report_context.EXEC_ID;
407 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
408 tree_node_component := JTF_DIAG_TREE_NODE(exec_id,ui_node_id,tree_content,0);
409 ELSE
410 RAISE_APPLICATION_ERROR(-20100,'The content provided for the tree node is null');
411 END IF;
412 RETURN tree_node_component;
413 END CREATE_TREE_NODE;
414 FUNCTION CREATE_NOTE(content VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_NOTE IS
415 note_component JTF_DIAG_NOTE;
416 exec_id NUMBER;
417 ui_node_id NUMBER;
418 no_of_links NUMBER;
419 link_ids JTF_VARCHAR2_TABLE_4000;
420 note_content VARCHAR2(20000);
421 content_lenght NUMBER;
422 BEGIN
423 VALIDATE_REPORT_CONTEXT(report_context);
424 IF content IS NOT NULL THEN
425 note_content := DBMS_XMLGEN.CONVERT(content,0);
426 exec_id := report_context.EXEC_ID;
427 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
428 no_of_links := length(content)-length(replace(content,'?',''));
429 IF no_of_links > 0 THEN
430 link_ids := JTF_VARCHAR2_TABLE_4000();
431 FOR x IN 1 .. no_of_links
432 LOOP
433 link_ids.EXTEND;
434 link_ids(x) := '0';
435 END LOOP;
436 END IF;
437
438 note_component := JTF_DIAG_NOTE(exec_id,ui_node_id,note_content,no_of_links,link_ids,0,null);
439 ELSE
440 RAISE_APPLICATION_ERROR(-20100,'The content provided for the note is null');
441 END IF;
442 RETURN note_component;
443 END CREATE_NOTE;
444
445 FUNCTION CREATE_METALINK(linkText VARCHAR2, note_id VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_LINK
446 IS
447 link_component JTF_DIAG_LINK;
448 exec_id NUMBER;
449 ui_node_id NUMBER;
450 link_text_content VARCHAR2(20000);
451 link_url_content VARCHAR2(20000);
452 metalink_url VARCHAR2(20000);
453 BEGIN
454 VALIDATE_REPORT_CONTEXT(report_context);
455 IF linkText IS NOT NULL AND note_id IS NOT NULL THEN
456 link_text_content := DBMS_XMLGEN.CONVERT(linkText,0);
457 metalink_url := FND_PROFILE.value('OAM_DIAG_METALINK_URL');
458 metalink_url := metalink_url || note_id;
459 link_url_content := DBMS_XMLGEN.CONVERT(metalink_url,0);
460 exec_id := report_context.EXEC_ID;
461 select JTF_DIAGNOSTIC_REPORT_S.nextval into ui_node_id from dual;
462 link_component := JTF_DIAG_LINK(exec_id,ui_node_id,link_text_content,link_url_content,0);
463 ELSE
464 RAISE_APPLICATION_ERROR(-20100,'The content provided for the link is null');
465 END IF;
466 RETURN link_component;
467 END CREATE_METALINK;
468
469 FUNCTION CREATE_METALINK(note_id VARCHAR2,report_context JTF_DIAG_REPORT_CONTEXT) RETURN JTF_DIAG_LINK
470 IS
471 link_component JTF_DIAG_LINK;
472 BEGIN
473 link_component := CREATE_METALINK(note_id,note_id,report_context);
474 RETURN link_component;
475 END CREATE_METALINK;
476
477 END JTF_DIAG_REPORT_FACTORY;
478