DBA Data[Home] [Help]

PACKAGE: APPS.OTA_FTU_SHD

Source


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