DBA Data[Home] [Help]

PACKAGE: APPS.HXC_TRANS_DISPLAY_KEY_UTILS

Source


1 PACKAGE hxc_trans_display_key_utils AS
2 /* $Header: hxctdkut.pkh 120.2 2007/12/14 06:52:04 bbayragi noship $ */
3 --
4 -- This type is used to store whether a row index is used when retrieving
5 -- a timecard for use in the middle tier.  Usually it is indexed by
6 -- the row index, and is given value 1 if the row is used., 0 otherwise.
7 -- i.e.
8 -- Index   Value
9 --     1       1
10 --     2       <Index does not exist>
11 --     3       1
12 --
13 -- Would indicate that for this particular timecard, rows 1 and 3 are used
14 -- for this particular timecard, but that no details appeared on row 2
15 -- according to the display translation key.  I.e. action must be taken
16 -- to ensure the timecard appears properly.
17 --
18    TYPE translation_row_used is table of pls_integer index by binary_integer;
19 --
20 -- This constant is used to specify the token between the components of the
21 -- the translation display key.
22 --
23    c_key_separator CONSTANT varchar2(1) := '|';
24 --
25 -- ----------------------------------------------------------------------------
26 -- |------------------------<     missing_rows     >--------------------------|
27 -- ----------------------------------------------------------------------------
28 -- {Start Of Comments}
29 --
30 -- Description:
31 --   This function returns true if there are any missing rows as
32 --   specified by the display translation key - i.e. if the index
33 --   is not sequential.
34 --
35 -- Prerequisites:
36 --   The function must be passed a valid translation row used object
37 --   which can be empty.  The object, if containing data, must start
38 --   the rows at index 1, not 0.
39 --
40 -- In Parameters:
41 --   Name                           Reqd Type     Description
42 --   p_row_data                        N varchar2 Row data object, as built
43 --                                                when retrieving the
44 --                                                timecard.
45 --
46 -- Post Success:
47 --   True is there are gaps in the row data index, i.e. there are missing rows
48 --   false otherwise.  If the row data structure is empty, false is returned.
49 --
50 -- Post Failure:
51 --   This function can not fail.
52 --
53 -- Access Status:
54 --   Internal Development Use Only.
55 --
56 -- {End Of Comments}
57 --
58    FUNCTION missing_rows
59       (p_row_data in translation_row_used)
60       return boolean;
61 --
62 -- ----------------------------------------------------------------------------
63 -- |-----------------------<     new_display_key     >------------------------|
64 -- ----------------------------------------------------------------------------
65 -- {Start Of Comments}
66 --
67 -- Description:
68 --   This function is used when appending a template.  If the template has two
69 --   rows with translation display row indices 1 and 2, and the timecard
70 --   already has rows 1 and 2 used, then the appended detail blocks can not
71 --   be placed on rows 1 and 2.  Instead, the row index of the appended
72 --   is incremented by the number of rows in the timecard, becoming
73 --   3 and 4 in the example above.  So this function returns a display key
74 --   with the row index incremented by the number of rows specified.
75 --
76 -- Prerequisites:
77 --   The function should be sent a valid translation display key, and a valid
78 --   number of rows.
79 --
80 -- In Parameters:
81 --   Name                           Reqd Type     Description
82 --   p_existing_display_key            Y varchar2 Display key e.g. from
83 --                                                template.
84 --   p_existing_row_count              Y number   The number of rows to
85 --                                                increment the row
86 --                                                index in the display key
87 --
88 -- Post Success:
89 --   The new display key is constructed.
90 --
91 -- Post Failure:
92 --   An invalid display key will be returned, and the detail building block
93 --   will not appear on the self service timecard screen.
94 --
95 -- Access Status:
96 --   Internal Development Use Only.
97 --
98 -- {End Of Comments}
99 --
100    FUNCTION new_display_key
101              (p_existing_display_key in varchar2,
102               p_existing_row_count in number)
103     return varchar2;
104 --
105 -- ----------------------------------------------------------------------------
106 -- |----------------------<     remove_empty_rows     >-----------------------|
107 -- ----------------------------------------------------------------------------
108 -- {Start Of Comments}
109 --
110 -- Description:
111 --   This function removes any empty rows, as defined by the translation
112 --   display keys on the detail building blocks, by adjusting the display
113 --   keys for details that appear after an empty row such that they all
114 --   shuffle up the matrix to fill in the empty rows.
115 --
116 -- Prerequisites:
117 --   The row data object must be valid, and have been set properly by
118 --   the set_row_data procedure in this package, as the detail building
119 --   blocks have been retrieved from the database.
120 --
121 -- In Parameters:
122 --   Name                           Reqd Type     Description
123 --   p_row_data                        Y varchar2 Row data object, as built
124 --                                                when retrieving the
125 --                                                timecard.
126 --   p_blocks                          Y BLOCKS   The timecard blocks
127 --
128 -- Post Success:
129 --   The new display keys replace the old ones and there are no empty rows
130 --   in the timecard display key structure.
131 --
132 -- Post Failure:
133 --   If an invalid row data object is specified, then the display key
134 --   on the detail building blocks may be corrupted.
135 --
136 -- Access Status:
137 --   Internal Development Use Only.
138 --
139 -- {End Of Comments}
140 --
141    PROCEDURE remove_empty_rows
142       (p_row_data in            translation_row_used,
143        p_blocks   in out NOCOPY hxc_block_table_type);
144 --
145 -- +--------------------------------------------------------------------------+
146 -- |-------------------<     reset_column_index_to_zero     >-----------------|
147 -- +--------------------------------------------------------------------------+
148 -- {Start Of Comments}
149 --
150 -- Description:
151 --   This function takes a translation display key and changes the column
152 --   index to zero, namely, xxxx|r|c, is transformed to xxxx|r|0.  This is
153 --   used by the zero hours template functionality.
154 --
155 -- Prerequisites:
156 --   A vaild translation display key.
157 --
158 -- In Parameters:
159 --   Name                           Reqd Type     Description
160 --   p_key                             Y varchar2 A tranlsation display key
161 --
162 -- Post Success:
163 --   The new display key, with a column index of zero is returned.
164 --
165 -- Post Failure:
166 --   Return value is undefined if sent an invalid translation display key.
167 --
168 -- Access Status:
169 --   Internal Development Use Only.
170 --
171 -- {End Of Comments}
172 --
173    FUNCTION reset_column_index_to_zero
174       (p_key in varchar2)
175       return varchar2;
176 --
177 -- ----------------------------------------------------------------------------
178 -- |------------------------<     set_row_data     >--------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start Of Comments}
181 --
182 -- Description:
183 --   This function maintains the row data for a timecard, while the its
184 --   corresponding detail building blocks are being retrieved.  If the
185 --   passed display translation key contains a valid row index, and the
186 --   row data object does not yet contain that index, it is created.
187 --
188 -- Prerequisites:
189 --   The function should be passed a valid translation display key, of the
190 --   form defined above.
191 --
192 -- In Parameters:
193 --   Name                           Reqd Type     Description
194 --   p_key                             Y varchar2 Translation display key
195 --   p_row_data                        Y varchar2 Row data object, as built
196 --                                                when retrieving the
197 --                                                timecard.
198 --
199 -- Post Success:
200 --   The row data (row use) structure is updated appropriately.
201 --
202 -- Post Failure:
203 --   This function can not fail.
204 --
205 -- Access Status:
206 --   Internal Development Use Only.
207 --
208 -- {End Of Comments}
209 --
210    PROCEDURE set_row_data
211       (p_key      in     varchar2,
212        p_row_data in out NOCOPY translation_row_used);
213 --
214 -- ----------------------------------------------------------------------------
215 -- |---------------------<     timecard_row_count     >-----------------------|
216 -- ----------------------------------------------------------------------------
217 -- {Start Of Comments}
218 --
219 -- Description:
220 --   This function counts the number of rows used in a timecard, based on the
221 --   translation display keys.  I.e. this function will return the number of
222 --   rows used by the self service timecard matrix when displaying this
223 --   timecard.  This function is typically called when applying a template
224 --   to a timecard in append mode, and the template detail block translation
225 --   keys must be adjusted.
226 --
227 -- Prerequisites:
228 --   The function should be sent a valid timecard block table type.
229 --
230 -- In Parameters:
231 --   Name                           Reqd Type     Description
232 --   p_blocks                          Y BLOCKS   Usual timecard block table
233 --
234 -- Post Success:
235 --   The number of rows, as specified by the translation display key in
236 --   structure, 0 if no rows or unable to determine the number of rows.
237 --
238 -- Post Failure:
239 --   This procedure can not fail.  If the translation display key is
240 --   invalid, it will not be counted to the row count.
241 --
242 -- Access Status:
243 --   Internal Development Use Only.
244 --
245 -- {End Of Comments}
246 --
247    FUNCTION timecard_row_count
248               (p_blocks in hxc_block_table_type)
249     return NUMBER;
250 
251 -- Added for DA Enhancement
252 -- +--------------------------------------------------------------------------+
253 -- |---------------------<     alter_translation_key     >-----------------------|
254 -- +--------------------------------------------------------------------------+
255 --
256 
257  PROCEDURE alter_translation_key
258    	    (p_g_deposit_blocks in out nocopy hxc_block_table_type,
259    	     p_actual_blocks in hxc_block_table_type
260    	    );
261 
262 
263 END hxc_trans_display_key_utils;