1 Package hr_pft_shd as
2 /* $Header: hrpftrhi.pkh 120.0 2005/05/31 02:07:51 appldev noship $ */
3 --
4 -- ----------------------------------------------------------------------------
5 -- | Global Record Type Specification |
6 -- ----------------------------------------------------------------------------
7 --
8 Type g_rec_type Is Record
9 (position_id number(15)
10 ,language varchar2(9) -- Increased length
11 ,source_lang varchar2(9) -- Increased length
12 ,name varchar2(240)
13 );
14 --
15 -- ----------------------------------------------------------------------------
16 -- | Global Definitions - Internal Development Use Only |
17 -- ----------------------------------------------------------------------------
18 --
19 g_old_rec g_rec_type; -- Global record definition
20 -- Global table name
21 g_tab_nam constant varchar2(30) := 'HR_ALL_POSITIONS_F_TL';
22 --
23 g_app_code varchar2(3) := 'PER';
24 g_flex_code varchar2(3) := 'POS';
25 --
26 -- ----------------------------------------------------------------------------
27 -- |---------------------------< constraint_error >---------------------------|
28 -- ----------------------------------------------------------------------------
29 -- {Start Of Comments}
30 --
31 -- Description:
32 -- This procedure is called when a constraint has been violated (i.e.
33 -- The exception hr_api.check_integrity_violated,
34 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
35 -- hr_api.unique_integrity_violated has been raised).
36 -- The exceptions can only be raised as follows:
37 -- 1) A check constraint can only be violated during an INSERT or UPDATE
38 -- dml operation.
39 -- 2) A parent integrity constraint can only be violated during an
40 -- INSERT or UPDATE dml operation.
41 -- 3) A child integrity constraint can only be violated during an
42 -- DELETE dml operation.
43 -- 4) A unique integrity constraint can only be violated during INSERT or
44 -- UPDATE dml operation.
45 --
46 -- Prerequisites:
47 -- 1) Either hr_api.check_integrity_violated,
48 -- hr_api.parent_integrity_violated, hr_api.child_integrity_violated or
49 -- hr_api.unique_integrity_violated has been raised with the subsequent
50 -- stripping of the constraint name from the generated error message
51 -- text.
52 -- 2) Standalone validation test which corresponds with a constraint error.
53 --
54 -- In Parameter:
55 -- p_constraint_name is in upper format and is just the constraint name
56 -- (e.g. not prefixed by brackets, schema owner etc).
57 --
58 -- Post Success:
59 -- Development dependant.
60 --
61 -- Post Failure:
62 -- Developement dependant.
63 --
64 -- Developer Implementation Notes:
65 -- For each constraint being checked the hr system package failure message
66 -- has been generated as a template only. These system error messages should
67 -- be modified as required (i.e. change the system failure message to a user
68 -- friendly defined error message).
69 --
70 -- Access Status:
71 -- Internal Development Use Only.
72 --
73 -- {End Of Comments}
74 -- ----------------------------------------------------------------------------
75 Procedure constraint_error
76 (p_constraint_name in all_constraints.constraint_name%TYPE);
77 --
78 -- ----------------------------------------------------------------------------
79 -- |-----------------------------< api_updating >-----------------------------|
80 -- ----------------------------------------------------------------------------
81 -- {Start Of Comments}
82 --
83 -- Description:
84 -- This function is used to populate the g_old_rec record with the
85 -- current row from the database for the specified primary key
86 -- provided that the primary key exists and is valid and does not
87 -- already match the current g_old_rec. The function will always return
88 -- a TRUE value if the g_old_rec is populated with the current row.
89 -- A FALSE value will be returned if all of the primary key arguments
90 -- are null.
91 --
92 -- Prerequisites:
93 -- None.
94 --
95 -- In Parameters:
96 --
97 -- Post Success:
98 -- A value of TRUE will be returned indiciating that the g_old_rec
99 -- is current.
100 -- A value of FALSE will be returned if all of the primary key arguments
101 -- have a null value (this indicates that the row has not be inserted into
102 -- the Schema), and therefore could never have a corresponding row.
103 --
104 -- Post Failure:
105 -- A failure can only occur under two circumstances:
106 -- 1) The primary key is invalid (i.e. a row does not exist for the
107 -- specified primary key values).
108 -- 2) If an object_version_number exists but is NOT the same as the current
109 -- g_old_rec value.
110 --
111 -- Developer Implementation Notes:
112 -- None.
113 --
114 -- Access Status:
115 -- Internal Development Use Only.
116 --
117 -- {End Of Comments}
118 -- ----------------------------------------------------------------------------
119 Function api_updating
120 (p_position_id in number
121 ,p_language in varchar2
122 ) Return Boolean;
123 --
124 -- ----------------------------------------------------------------------------
125 -- |---------------------------------< lck >----------------------------------|
126 -- ----------------------------------------------------------------------------
127 -- {Start of comments}
128 --
129 -- Description:
130 -- The Lck process has two main functions to perform. Firstly, the row to be
131 -- updated or deleted must be locked. The locking of the row will only be
132 -- successful if the row is not currently locked by another user.
133 -- Secondly, during the locking of the row, the row is selected into
134 -- the g_old_rec data structure which enables the current row values from
135 -- the server to be available to the api.
136 --
137 -- Prerequisites:
138 -- When attempting to call the lock the object version number (if defined)
139 -- is mandatory.
140 --
141 -- In Parameters:
142 -- The arguments to the Lck process are the primary key(s) which uniquely
143 -- identify the row and the object version number of row.
144 --
145 -- Post Success:
146 -- On successful completion of the Lck process the row to be updated or
147 -- deleted will be locked and selected into the global data structure
148 -- g_old_rec.
149 --
150 -- Post Failure:
151 -- The Lck process can fail for three reasons:
152 -- 1) When attempting to lock the row the row could already be locked by
153 -- another user. This will raise the HR_Api.Object_Locked exception.
154 -- 2) The row which is required to be locked doesn't exist in the HR Schema.
155 -- This error is trapped and reported using the message name
156 -- 'HR_7220_INVALID_PRIMARY_KEY'.
157 -- 3) The row although existing in the HR Schema has a different object
158 -- version number than the object version number specified.
159 -- This error is trapped and reported using the message name
160 -- 'HR_7155_OBJECT_INVALID'.
161 --
162 -- Developer Implementation Notes:
163 -- For each primary key and the object version number arguments add a
164 -- call to hr_api.mandatory_arg_error procedure to ensure that these
165 -- argument values are not null.
166 --
167 -- Access Status:
168 -- Internal Development Use Only.
169 --
170 -- {End of comments}
171 -- ----------------------------------------------------------------------------
172 Procedure lck
173 (p_position_id in number
174 ,p_language in varchar2
175 );
176 --
177 -- ----------------------------------------------------------------------------
178 -- |----------------------------< add_language >------------------------------|
179 -- ----------------------------------------------------------------------------
180 -- {Start of Comments}
181 --
182 -- Description:
183 -- Maintains the _TL table. Ensures there is a translation for every
184 -- installed language, removes any orphaned translation rows and
185 -- corrects and translations which have got out of synchronisation.
186 --
187 -- Pre-requisites:
188 --
189 -- In Parameters:
190 --
191 -- Post Success:
192 -- A translation row exists for every installed language.
193 --
194 -- Post Failure:
195 -- Maintenance is aborted.
196 --
197 -- Developer Implementation Notes:
198 -- None.
199 --
200 -- Access Status:
201 -- Internal Development Use Only.
202 --
203 -- {End of Comments}
204 -- ----------------------------------------------------------------------------
205 Procedure add_language;
206 --
207 -- ----------------------------------------------------------------------------
208 -- |-----------------------------< convert_args >-----------------------------|
209 -- ----------------------------------------------------------------------------
210 -- {Start Of Comments}
211 --
212 -- Description:
213 -- This function is used to turn attribute parameters into the record
214 -- structure parameter g_rec_type.
215 --
216 -- Prerequisites:
217 -- This is a private function and can only be called from the ins or upd
218 -- attribute processes.
219 --
220 -- In Parameters:
221 --
222 -- Post Success:
223 -- A returning record structure will be returned.
224 --
225 -- Post Failure:
226 -- No direct error handling is required within this function. Any possible
227 -- errors within this function will be a PL/SQL value error due to
228 -- conversion of datatypes or data lengths.
229 --
230 -- Developer Implementation Notes:
231 -- None.
232 --
233 -- Access Status:
234 -- Internal Row Handler Use Only.
235 --
236 -- {End Of Comments}
237 -- ----------------------------------------------------------------------------
238 Function convert_args
239 (p_position_id in number
240 ,p_language in varchar2
241 ,p_source_lang in varchar2
242 ,p_name in varchar2
243 )
244 Return g_rec_type;
245 --
246 end hr_pft_shd;