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