1 Package HR_CAL_ENTRY_VALUE_API as
2 /* $Header: peenvapi.pkh 120.0 2005/05/31 08:10:16 appldev noship $ */
3 --
4 --
5 -- ----------------------------------------------------------------------------
6 -- |-----------------------< create_entry_value >---------------------------|
7 -- ----------------------------------------------------------------------------
8 -- {Start Of Comments}
9 --
10 -- Description:
11 -- This API creates a calendar entry value.
12 --
13 -- Prerequisites:
14 --
15 -- In Parameters:
16 -- Name Reqd Type Description
17 -- p_validate boolean If true, the database
18 -- remains unchanged. If false,
19 -- the calendar entry value is created.
20 -- p_effective_date Yes date Application effective date.
21 -- p_calendar_entry_id Yes number The FK of the parent calendar entry.
22 -- p_usage_flag Yes varchar2 Flag value indicating the type of record to be created.
23 -- (i.e. entry value, entry value exception, entry value override)
24 -- p_hierarchy_node_id number The FK of the parent generic hierarchy record.
25 -- (Only populated when the value is obtained from
26 -- a generic hierarchy record, otherwise null).
27 -- p_value varchar2 The idvalue of the entry (corresponds to the id of the
28 -- selected valueset value, for a stand-alone entry coverage).
29 -- (Only populated if parent calendar entry uses a value set)
30 -- p_org_structure_element_id number The FK to parent Org Structure Element link record
31 -- (Only populated if parent entry uses Org Hierarchy coverage).
32 -- p_organization_id number The id of the organization within the Org Structure Element link.
33 -- p_override_name varchar2 The name overriding the parent entry name for this record.
34 -- p_override_type varchar2 The type overriding the parent entry type for this record.
35 -- p_parent_entry_value_id number The id of the parent entry value record (indicates that
36 -- this entry value is an exception to the identified parent
37 -- entry value).
38 -- p_identifier_key varchar2 Seed data identifier - Internal Development Use Only.
39
40 --
41 -- Post Success:
42 -- The calendar entry record is created and the API sets the following out
43 -- parameters.
44 --
45 -- Name Type Description
46 -- p_cal_entry_value_id number If p_validate is false, uniquely
47 -- identifies the calendar entry value created.
48 -- If p_validate is true, set to
49 -- null.
50 -- p_object_version_number number If p_validate is false, set to
51 -- the version number of this calendar entry value.
52 -- If p_validate is true, set to null.
53 --
54 -- Post Failure:
55 -- The API does not create the calendar entry value record and raises an error.
56 --
57 -- Access Status:
58 -- Public
59 --
60 -- {End Of Comments}
61 --
62
63 procedure create_entry_value
64 (p_validate in boolean default false
65 ,p_effective_date in date
66 ,p_calendar_entry_id in number
67 ,p_usage_flag in varchar2
68 ,p_hierarchy_node_id in number default null
69 ,p_value in varchar2 default null
70 ,p_org_structure_element_id in number default null
71 ,p_organization_id in number default null
72 ,p_override_name in varchar2 default null
73 ,p_override_type in varchar2 default null
74 ,p_parent_entry_value_id in number default null
75 ,p_identifier_key in varchar2 default null
76 ,p_cal_entry_value_id out nocopy number
77 ,p_object_version_number out nocopy number
78 );
79
80 --
81 -- ----------------------------------------------------------------------------
82 -- |------------------------< update_entry_value >-------------------------|
83 -- ----------------------------------------------------------------------------
84 -- {Start Of Comments}
85 --
86 -- Description:
87 -- This API updates a calendar entry value as identified by p_cal_entry_value_id.
88 --
89 -- Prerequisites:
90 -- The calendar entry record value identified by p_cal_entry_value_id and
91 -- p_object_version_number must exist.
92 --
93 -- In Parameters:
94 -- Name Reqd Type Description
95 -- p_validate boolean If true, the database
96 -- remains unchanged. If false,
97 -- the calendar entry value is updated.
98 -- p_effective_date Yes date Application effective date.
99 -- p_cal_entry_value_id Yes number Surrogate id of the calendar entry value record.
100 -- p_object_version_number Yes number Version number of the calendar entry value record.
101 -- p_override_name varchar2 The name overriding entry name for this record.
102 -- p_override_type varchar2 The type overriding entry type for this record.
103 -- p_parent_entry_value_id number The id of the parent entry value record (indicates that
104 -- this entry value is an exception to the identified parent
105 -- entry value).
106 -- p_usage_flag varchar2 Flag value indicating the type of record to be created.
107 -- (i.e. entry value, entry value exception, entry value override)
108 --
109 -- Post Success:
110 -- The calendar entry value record is updated and the API sets the following out
111 -- parameters.
112 --
113 -- Name Type Description
114 -- p_object_version_number number If p_validate is false, set to
115 -- the new version number of this
116 -- calendar entry value.
117 -- If p_validate is true, set to
118 -- null same value passed in.
119 --
120 -- Post Failure:
121 -- The API does not update the calendar entry value and raises an error.
122 --
123 -- Access Status:
124 -- Public
125 --
126 -- {End Of Comments}
127 --
128 procedure update_entry_value
129 (p_validate in boolean default false
130 ,p_effective_date in date
131 ,p_cal_entry_value_id in number
132 ,p_object_version_number in out nocopy number
133 ,p_override_name in varchar2 default hr_api.g_varchar2
134 ,p_override_type in varchar2 default hr_api.g_varchar2
135 ,p_parent_entry_value_id in number default hr_api.g_number
136 ,p_usage_flag in varchar2 default hr_api.g_varchar2
137 );
138
139 -- ----------------------------------------------------------------------------
140 -- |-------------------------< delete_entry_value >------------------------|
141 -- ----------------------------------------------------------------------------
142 -- {Start Of Comments}
143 --
144 -- Description:
145 -- This API deletes a calendar entry value record as identified by the in parameter
146 -- p_cal_entry_value_id and p_object_version_number.
147 --
148 -- Prerequisites:
149 -- The calendar entry value as identified by the in parameter p_cal_entry_value_id and the
150 -- in parameter p_object_version_number must already exist.
151 --
152 -- In Parameters:
153 -- Name Reqd Type Description
154 -- p_validate boolean If true, the database
155 -- remains unchanged. If false,
156 -- the calendar entry is deleted.
157 -- p_cal_entry_value_id Yes number Primary key of the calendar entry value.
158 -- p_object_version_number Yes number Current version of the
159 -- calendar entry value record.
160 --
161 -- Post Success:
162 -- The calendar entry is deleted.
163 --
164 -- Post Failure:
165 -- The API does not delete the calendar entry value and raises an error.
166 --
167 -- Access Status:
168 -- Public
169 --
170 --
171 -- {End Of Comments}
172 --
173 procedure delete_entry_value
174 (p_validate in boolean default false
175 ,p_cal_entry_value_id in number
176 ,p_object_version_number in number
177 );
178 --
179 --
180 -- ----------------------------------------------------------------------------
181 -- |---------------------------< get_display_value >--------------------------|
182 -- ----------------------------------------------------------------------------
183 -- {Start Of Comments}
184 --
185 -- Description:
186 -- This function returns a decoded value from the valueset specified by either the
187 -- the combination of p_entity_id and p_node_type (gen hier node VS) or
188 -- p_calendar_entry_id and p_vs_value_id (stand-alone valueset). It is used by the
189 -- view PER_CAL_ENTRY_VALUES_V to populate display_value field.
190 --
191 -- Access Status:
192 -- Private - Internal development use only.
193 --
194 -- {End Of Comments}
195 --
196 FUNCTION get_display_value(p_entity_id IN varchar2,
197 p_node_type IN varchar2,
198 p_calendar_entry_id IN NUMBER,
199 p_vs_value_id IN VARCHAR2) RETURN VARCHAR2;
200
201 --
202 --
203 -- ----------------------------------------------------------------------------
204 -- |-----------------------< get_g_current_entry_id >--------------------------|
205 -- ----------------------------------------------------------------------------
206 -- {Start Of Comments}
207 --
208 -- Description:
209 -- This function returns the value of the current calendar entry id
210 -- as stored in the package global g_current_entry_id.
211 -- The current entry id is used by per_cal_entry_values_v view
212 -- and is set from HRMS Calendar module prior to querying the view.
213 --
214 -- Access Status:
215 -- Private - Internal Development use only.
216 --
217 -- {End Of Comments}
218 --
219 FUNCTION get_g_current_entry_id RETURN NUMBER;
220 --
221 --
222 -- ----------------------------------------------------------------------------
223 -- |-----------------------< set_g_current_entry_id >--------------------------|
224 -- ----------------------------------------------------------------------------
225 -- {Start Of Comments}
226 --
227 -- Description:
228 -- This function sets the value of the current calendar entry id
229 -- in the package global g_current_entry_id.
230 -- The current entry id is used by per_cal_entry_values_v view
231 -- and is set from HRMS Calendar module prior to querying the view.
232 --
233 -- Access Status:
234 -- Private - Internal Development use only.
235 --
236 -- {End Of Comments}
237 --
238 PROCEDURE set_g_current_entry_id (p_entry_id NUMBER);
239 --
240 --
241 -- ----------------------------------------------------------------------------
242 -- |-----------------------< get_g_current_osv_id >--------------------------|
243 -- ----------------------------------------------------------------------------
244 -- {Start Of Comments}
245 --
246 -- Description:
247 -- This function returns the value of the current calendar OSV id
248 -- as stored in the package global g_current_osv_id.
249 -- The current OSV id is used to restrict the PER_CAL_ORG_HIER_VALUES_V view
250 -- to a particular Org Structure Version (and therefore its elements) and is
251 -- set from HRMS Calendar module prior to querying the view (along with
252 -- entry_id).
253 --
254 -- Access Status:
255 -- Private - Internal Development use only.
256 --
257 -- {End Of Comments}
258 --
259 FUNCTION get_g_current_osv_id RETURN NUMBER;
260 --
261 --
262 -- ----------------------------------------------------------------------------
263 -- |-----------------------< set_g_current_osv_id >--------------------------|
264 -- ----------------------------------------------------------------------------
265 -- {Start Of Comments}
266 --
267 -- Description:
268 -- This function sets the value of the current calendar OSV id
269 -- in the package global g_current_osv_id.
270 -- The current OSV id is used to restrict the PER_CAL_ORG_HIER_VALUES_V view
271 -- to a particular Org Structure Version (and therefore its elements) and is
272 -- set from HRMS Calendar module prior to querying the view (along with
273 -- entry_id).
274 --
275 -- Access Status:
276 -- Private - Internal Development use only.
277 --
278 -- {End Of Comments}
279 --
280 PROCEDURE set_g_current_osv_id (p_osv_id NUMBER);
281 --
282 --
283 -- ----------------------------------------------------------------------------
284 -- |------------------------------< get_node_level >--------------------------|
285 -- ----------------------------------------------------------------------------
286 -- {Start Of Comments}
287 --
288 -- Description:
289 -- This function gets the arbitrary level of the supplied hierarchy node id
290 -- within the generic hierarchy of nodes. It also returns the path of the
291 -- node as the second part of the . delimited varchar return value.
292 --
293 -- e.g 3.10010.11188 - 3rd level, having nodes 10010 and 11188 as
294 -- grandparent and parent respectively.
295 --
296 -- Access Status:
297 -- Private - Internal Development use only.
298 --
299 -- {End Of Comments}
300 Function get_node_level (P_HIERARCHY_NODE_ID in NUMBER
301 ,P_HIERARCHY_VERSION_ID in NUMBER) RETURN VARCHAR2;
302 --
303 --
304 -- ----------------------------------------------------------------------------
305 -- |------------------------------< get_ele_level >--------------------------|
306 -- ----------------------------------------------------------------------------
307 -- {Start Of Comments}
308 --
309 -- Description:
310 -- This function gets the arbitrary level of the supplied org link (element)
311 -- within the org hierarchy structure version. It also returns the path of the
312 -- link as the second part of the . delimited varchar return value.
313 --
314 -- e.g 3.10010.11188 - 3rd level, having links 10010 and 11188 as
315 -- grandparent and parent respectively.
316 --
317 -- Access Status:
318 -- Private - Internal Development use only.
319 --
320 -- {End Of Comments}
321 Function get_ele_level (P_ORG_STRUCTURE_ELEMENT_ID in NUMBER
322 ,P_ORG_STRUCTURE_VERSION_ID in NUMBER) RETURN VARCHAR2;
323 --
324 --
325 -- ----------------------------------------------------------------------------
326 -- |--------------------------< get_sql_from_vset_id >------------------------|
327 -- ----------------------------------------------------------------------------
328 --
329 -- Description:
330 -- Returns the sql from the valueset id supplied (assuming it is a sql VS)
331 --
332 -- Access Status:
333 -- Private - Internal Development use only.
334 --
335 FUNCTION get_sql_from_vset_id(p_vset_id IN NUMBER) RETURN VARCHAR2;
336
337 end HR_CAL_ENTRY_VALUE_API;