1 PACKAGE BODY wf_item_types_vl_pub AS
2 /* $Header: wfdefb.pls 120.1 2005/07/02 03:43:48 appldev ship $ */
3
4 /*===========================================================================
5 PACKAGE NAME: wf_item_types_vl_pub
6
7 DESCRIPTION:
8
9 OWNER: GKELLNER
10
11 TABLES/RECORDS:
12
13 PROCEDURES/FUNCTIONS:
14
15 MODIFICATION LOG:
16 06 JUN 2001 JWSMITH BUG 1819232 ADA Enhancement
17 - Added ID attr for TD tags
18 - Added summary for table tags
19 - Added labels for input tags
20 01 JAN 2002 JWSMITH BUG 2001012 - Increase l_username,l_admin_role
21 to varchar2(320)
22
23 ============================================================================*/
24
25 /*===========================================================================
26 PROCEDURE NAME: fetch_item_type
27
28 DESCRIPTION: Fetches all the properties of a given item type
29 into a wf_item_types_vl_tbl_type table based on the
30 item type internal eight character name.
31
32 ============================================================================*/
33 PROCEDURE fetch_item_type
34 (p_name IN VARCHAR2,
35 p_wf_item_types_vl_tbl OUT NOCOPY wf_item_types_vl_pub.wf_item_types_vl_tbl_type) IS
36
37 l_record_num NUMBER := 0;
38
39 BEGIN
40
41 /*
42 ** Make sure all the required parameters are set
43 */
44 IF (p_name IS NULL) THEN
45
46 return;
47
48 END IF;
49
50 /*
51 ** Get the item type definition
52 */
53 SELECT rowid,
54 name,
55 protect_level,
56 custom_level,
57 wf_selector,
58 read_role,
59 write_role,
60 execute_role,
61 display_name,
62 description
63 INTO p_wf_item_types_vl_tbl(1)
64 FROM wf_item_types_vl
65 WHERE name = p_name;
66
67 EXCEPTION
68 WHEN OTHERS THEN
69 Wf_Core.Context('wf_item_types_vl_pub', 'fetch_item_type', p_name);
70 wf_item_definition.Error;
71
72 END fetch_item_type;
73
74 /*===========================================================================
75 PROCEDURE NAME: draw_item_type_list
76
77 DESCRIPTION: Shows the display name of an item type as a
78 html view as a part of a hierical summary list of
79 an item type. This function uses the htp to
80 generate its html output.
81
82 ============================================================================*/
83 PROCEDURE draw_item_type_list
84 (p_wf_item_types_vl_tbl
85 IN wf_item_types_vl_pub.wf_item_types_vl_tbl_type,
86 p_effective_date IN DATE,
87 p_indent_level IN NUMBER) IS
88
89 l_record_num NUMBER;
90 ii NUMBER := 0;
91
92 BEGIN
93
94 /*
95 ** Print out all item type names in the pl*sql table
96 */
97 FOR l_record_num IN 1..p_wf_item_types_vl_tbl.count LOOP
98
99 /*
100 ** The creation of the anchor from the summary frame to the detail
101 ** frame was very complex so I've extracted the function into its
102 ** own routine.
103 */
104 wf_item_definition_util_pub.create_hotlink_to_details (
105 p_wf_item_types_vl_tbl(l_record_num).name,
106 p_effective_date,
107 'ITEM_TYPE',
108 p_wf_item_types_vl_tbl(l_record_num).name,
109 p_wf_item_types_vl_tbl(l_record_num).display_name,
110 NULL,
111 p_indent_level);
112
113 END LOOP;
114
115 EXCEPTION
116 WHEN OTHERS THEN
117 Wf_Core.Context('wf_item_types_vl_pub', 'draw_item_type_list');
118 wf_item_definition.Error;
119
120 END draw_item_type_list;
121
122 /*===========================================================================
123 PROCEDURE NAME: draw_item_type_details
124
125 DESCRIPTION: Shows all the details of an item type as a
126 html view. This function uses the htp to
127 generate its html output.
128
129 MODIFICATION LOG:
130 06-JUN-2001 JWSMITH BUG 1819232 - added summary attr for table tag for ADA
131
132 ============================================================================*/
133 PROCEDURE draw_item_type_details
134 (p_wf_item_types_vl_tbl IN wf_item_types_vl_pub.wf_item_types_vl_tbl_type,
135 p_indent_level IN NUMBER) IS
136
137 l_record_num NUMBER;
138 ii NUMBER := 0;
139
140 BEGIN
141
142 /*
143 ** Draw the section title for the item type detail section
144 */
145 wf_item_definition_util_pub.draw_detail_section_title (
146 wf_core.translate('WFITD_ITEM_TYPE_DETAILS'),
147 0);
148
149 /*
150 ** Print out all item attribute display names in the pl*sql table
151 */
152 FOR l_record_num IN 1..p_wf_item_types_vl_tbl.count LOOP
153
154 /*
155 ** Open a new table for each item_type so you can control the spacing
156 ** between each attribute
157 */
158 htp.tableOpen(cattributes=>'border=0 cellpadding=2 cellspacing=0
159 summary="' || wf_core.translate('WFITD_ITEM_TYPE_DETAILS') || '"');
160
161 /*
162 ** Create the target for the hotlink from the summary view. Also
163 ** create the first row in the table which is always the display
164 ** name for the object.
165 */
166 wf_item_definition_util_pub.create_details_hotlink_target (
167 'ITEM_TYPE',
168 p_wf_item_types_vl_tbl(l_record_num).name,
169 p_wf_item_types_vl_tbl(l_record_num).display_name,
170 wf_core.translate('WFITD_ITEM_TYPE_NAME'),
171 0);
172
173 /*
174 ** Create the internal name row in the table.
175 */
176 wf_item_definition_util_pub.draw_detail_prompt_value_pair (
177 wf_core.translate('WFITD_INTERNAL_NAME'),
178 p_wf_item_types_vl_tbl(l_record_num).name);
179
180 /*
181 ** Create the description row in the table
182 */
183 wf_item_definition_util_pub.draw_detail_prompt_value_pair (
184 wf_core.translate('DESCRIPTION'),
185 p_wf_item_types_vl_tbl(l_record_num).description);
186
187 /*
188 ** Create the selector row in the table
189 */
190 wf_item_definition_util_pub.draw_detail_prompt_value_pair (
191 wf_core.translate('WFITD_SELECTOR'),
192 p_wf_item_types_vl_tbl(l_record_num).wf_selector);
193
194 /*
195 ** Call function to print the read/write/execute roles
196 */
197 wf_item_definition_util_pub.draw_read_write_exe_details(
198 p_wf_item_types_vl_tbl(l_record_num).read_role,
199 p_wf_item_types_vl_tbl(l_record_num).write_role,
200 p_wf_item_types_vl_tbl(l_record_num).execute_role,
201 TRUE);
202
203 /*
204 ** Call function to print the customization/protection levels
205 */
206 wf_item_definition_util_pub.draw_custom_protect_details(
207 p_wf_item_types_vl_tbl(l_record_num).custom_level,
208 p_wf_item_types_vl_tbl(l_record_num).protect_level);
209
210 /*
211 ** Table is created so close it out
212 */
213 htp.tableClose;
214
215 /*
216 ** Draw a line between each attribute definition
217 ** if this is not the last item in the list
218 */
219 IF (l_record_num <> p_wf_item_types_vl_tbl.count) THEN
220
221 htp.p ('<HR noshade size="1">');
222
223 END IF;
224
225 END LOOP;
226
227 EXCEPTION
228 WHEN OTHERS THEN
229 Wf_Core.Context('wf_item_types_vl_pub', 'draw_item_type_details');
230 wf_item_definition.Error;
231
232 END draw_item_type_details;
233
234 END wf_item_types_vl_pub;