1 PACKAGE BODY JTF_DIAG_HELPER_UTILS AS
2 /* $Header: jtf_diag_helper_utils_b.pls 120.1.12010000.2 2008/08/29 07:11:05 sramados ship $*/
3
4 FUNCTION initialise_Input_Collection RETURN JTF_DIAG_TEST_INPUTS IS
5 temp JTF_DIAG_TEST_INPUTS;
6 BEGIN
7 temp := JTF_DIAG_TEST_INPUTS(JTF_DIAG_TEST_INPUT('','','','','','','',''));
8 temp.trim;
9 return temp;
10 EXCEPTION
11 WHEN others THEN
12 return null;
13 END initialise_Input_Collection;
14
15
16 FUNCTION addInput(inputs IN JTF_DIAG_TEST_INPUTS,
17 name IN VARCHAR2,
18 value IN VARCHAR2,
19 isConfidential IN VARCHAR2 default 'FALSE',
20 defaultValue IN VARCHAR2 default null,
21 tip IN VARCHAR2 default null,
22 isMandatory IN VARCHAR2 default 'FALSE',
23 isDate IN VARCHAR2 default 'FALSE',
24 isNumber IN VARCHAR2 default 'FALSE') RETURN JTF_DIAG_TEST_INPUTS IS
25 tempInput JTF_DIAG_TEST_INPUT;
26 tempInputTable JTF_DIAG_TEST_INPUTS;
27 temp_confdential VARCHAR2(6) := isConfidential;
28 temp_mandatory VARCHAR2(6) := isMandatory;
29 temp_date VARCHAR2(6) := isDate;
30 temp_number VARCHAR2(6) := isNumber;
31 BEGIN
32 IF isConfidential IS NULL THEN
33 temp_confdential := 'FALSE';
34 END IF;
35 IF isMandatory IS NULL THEN
36 temp_mandatory := 'FALSE';
37 END IF;
38 IF isDate IS NULL THEN
39 temp_date := 'FALSE';
40 END IF;
41 IF isNumber IS NULL THEN
42 temp_number := 'FALSE';
43 END IF;
44 tempInputTable := inputs;
45 tempInput := JTF_DIAG_TEST_INPUT(name, value, temp_confdential, defaultValue, tip, temp_mandatory, temp_date, temp_number);
46 tempInputTable.extend(1);
47 tempInputTable(tempInputTable.COUNT) := tempInput;
48 return tempInputTable;
49 EXCEPTION
50 WHEN others THEN
51 -- logging here...
52 return inputs;
53 END addInput;
54
55 ----------------------------------------------------------------------
56 -- getInputValue takes the argument name that we want the associated
57 -- value for, and the JTF_DIAG_INPUTTBL of objects (table of JTF_DIAG_INPUTS)
58 -- the associated value is extracted from the JTF_DIAG_INPUTTBL and returned
59 -- for the passed in argument name.
60 ----------------------------------------------------------------------
61
62 FUNCTION GET_INPUT_VALUE(argName IN VARCHAR2,
63 inputs IN JTF_DIAG_INPUTTBL) RETURN VARCHAR2 IS
64 input JTF_DIAG_INPUTS;
65 BEGIN
66 FOR v_counter IN 1..inputs.COUNT LOOP
67 input := inputs(v_counter);
68 IF UPPER(inputs(v_counter).name) = UPPER(argName) THEN
69 return UPPER(inputs(v_counter).value);
70 END IF;
71 END LOOP;
72 return NULL;
73 END;
74 END JTF_DIAG_HELPER_UTILS;
75