DBA Data[Home] [Help]

PACKAGE: APPS.AMS_CAMPAIGN_PVT

Source


1 PACKAGE AMS_Campaign_PVT AUTHID CURRENT_USER AS
2 /* $Header: amsvcpns.pls 115.16 2002/11/22 23:38:22 dbiswas ship $ */
3 
4 
5 TYPE camp_rec_type IS RECORD(
6    campaign_id                      NUMBER,
7    last_update_date                 DATE,
8    last_updated_by                  NUMBER,
9    creation_date                    DATE,
10    created_by                       NUMBER,
11    last_update_login                NUMBER,
12    object_version_number            NUMBER,
13    custom_setup_id                  NUMBER,
14    owner_user_id                    NUMBER,
15    user_status_id                   NUMBER,
16    status_code                      VARCHAR2(30),
17    status_date                      DATE,
18    active_flag                      VARCHAR2(1),
19    private_flag                     VARCHAR2(1),
20    partner_flag                     VARCHAR2(1),
21    template_flag                    VARCHAR2(1),
22    cascade_source_code_flag         VARCHAR2(1),
23    inherit_attributes_flag          VARCHAR2(1),
24    source_code                      VARCHAR2(30),
25    rollup_type                      VARCHAR2(30),
26    campaign_type                    VARCHAR2(30),
27    media_type_code                  VARCHAR2(30),
28    priority                         VARCHAR2(30),
29    fund_source_type                 VARCHAR2(30),
30    fund_source_id                   NUMBER,
31    parent_campaign_id               NUMBER,
32    application_id                   NUMBER,
33    qp_list_header_id                NUMBER,
34    media_id                         NUMBER,
35    channel_id                       NUMBER,
36    event_type                       VARCHAR2(30),
37    arc_channel_from                 VARCHAR2(30),
38    dscript_name                     VARCHAR2(256),
39    transaction_currency_code        VARCHAR2(15),
40    functional_currency_code         VARCHAR2(15),
41    budget_amount_tc                 NUMBER,
42    budget_amount_fc                 NUMBER,
43    forecasted_plan_start_date       DATE,
44    forecasted_plan_end_date         DATE,
45    forecasted_exec_start_date       DATE,
46    forecasted_exec_end_date         DATE,
47    actual_plan_start_date           DATE,
48    actual_plan_end_date             DATE,
49    actual_exec_start_date           DATE,
50    actual_exec_end_date             DATE,
51    inbound_url                      VARCHAR2(120),
52    inbound_email_id                 VARCHAR2(120),
53    inbound_phone_no                 VARCHAR2(25),
54    duration                         NUMBER,
55    duration_uom_code                VARCHAR2(3),
56    ff_priority                      VARCHAR2(30),
57    ff_override_cover_letter         NUMBER,
58    ff_shipping_method               VARCHAR2(30),
59    ff_carrier                       VARCHAR2(120),
60    content_source                   VARCHAR2(120),
61    cc_call_strategy                 VARCHAR2(30),
62    cc_manager_user_id               NUMBER,
63    forecasted_revenue               NUMBER,
64    actual_revenue                   NUMBER,
65    forecasted_cost                  NUMBER,
66    actual_cost                      NUMBER,
67    forecasted_response              NUMBER,
68    actual_response                  NUMBER,
69    target_response                  NUMBER,
70    country_code                     VARCHAR2(30),
71    language_code                    VARCHAR2(30),
72    attribute_category               VARCHAR2(30),
73    attribute1                       VARCHAR2(150),
74    attribute2                       VARCHAR2(150),
75    attribute3                       VARCHAR2(150),
76    attribute4                       VARCHAR2(150),
77    attribute5                       VARCHAR2(150),
78    attribute6                       VARCHAR2(150),
79    attribute7                       VARCHAR2(150),
80    attribute8                       VARCHAR2(150),
81    attribute9                       VARCHAR2(150),
82    attribute10                      VARCHAR2(150),
83    attribute11                      VARCHAR2(150),
84    attribute12                      VARCHAR2(150),
85    attribute13                      VARCHAR2(150),
86    attribute14                      VARCHAR2(150),
87    attribute15                      VARCHAR2(150),
88    campaign_name                    VARCHAR2(240),
89    campaign_theme                   VARCHAR2(4000),
90    description                      VARCHAR2(4000),
91    version_no                       NUMBER,
92    campaign_calendar                VARCHAR2(15),
93    start_period_name                VARCHAR2(15),
94    end_period_name                  VARCHAR2(15),
95    city_id                          NUMBER,
96    global_flag                      VARCHAR2(1),
97    show_campaign_flag               VARCHAR2(1),
98    business_unit_id                 NUMBER,
99    accounts_closed_flag             VARCHAR2(1),
100    task_id                          NUMBER,
101    related_event_from               VARCHAR2(30),
102    related_event_id                 NUMBER,
103    program_attribute_category       VARCHAR2(30),
104    program_attribute1               VARCHAR2(150),
105    program_attribute2               VARCHAR2(150),
106    program_attribute3               VARCHAR2(150),
107    program_attribute4               VARCHAR2(150),
108    program_attribute5               VARCHAR2(150),
109    program_attribute6               VARCHAR2(150),
110    program_attribute7               VARCHAR2(150),
111    program_attribute8               VARCHAR2(150),
112    program_attribute9               VARCHAR2(150),
113    program_attribute10              VARCHAR2(150),
114    program_attribute11              VARCHAR2(150),
115    program_attribute12              VARCHAR2(150),
116    program_attribute13              VARCHAR2(150),
117    program_attribute14              VARCHAR2(150),
118    program_attribute15              VARCHAR2(150)
119 );
120 
121 
122 ---------------------------------------------------------------------
123 -- PROCEDURE
124 --    create_campaign
125 --
126 -- PURPOSE
127 --    Create a new campaign.
128 --
129 -- PARAMETERS
130 --    p_camp_rec: the new record to be inserted
131 --    x_camp_id: return the campaign_id of the new campaign
132 --
133 -- NOTES
134 --    1. Please don't pass in any FND_API.g_mess_char/num/date.
135 --    2. object_version_number will be set to 1.
136 --    3. If campaign_id is passed in, the uniqueness will be checked.
137 --       Raise exception in case of duplicates. If campaign_id is not
138 --       passed in, generate a unique one from the sequence.
139 --    4. If a flag column is passed in, check if it is 'Y' or 'N'.
140 --       Raise exception for invalid flag. If a flag column is not
141 --       passed in, default it to 'Y' or 'N'.
142 --    5. If the source_code is passed in, check if it is unique in
143 --       ams_source_codes table. If source_code is not passed in,
144 --       generate a unique one. After creating the campaign, the
145 --       source_code will be pushed into ams_source_codes table.
146 --    6. The default value for priority is 'STANDARD'.
147 --    7. Since the status_code and inherit_attributes_flag will be
148 --       used internally only, this API will disregard the value
149 --       passed in.
150 ---------------------------------------------------------------------
151 PROCEDURE create_campaign(
152    p_api_version       IN  NUMBER,
153    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
154    p_commit            IN  VARCHAR2  := FND_API.g_false,
155    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
156 
157    x_return_status     OUT NOCOPY VARCHAR2,
158    x_msg_count         OUT NOCOPY NUMBER,
159    x_msg_data          OUT NOCOPY VARCHAR2,
160 
161    p_camp_rec          IN  camp_rec_type,
162    x_camp_id           OUT NOCOPY NUMBER
163 );
164 
165 
166 --------------------------------------------------------------------
167 -- PROCEDURE
168 --    delete_campaign
169 --
170 -- PURPOSE
171 --    Set the campaign to be inactive so that it won't be available
172 --    to users.
173 --
174 -- PARAMETERS
175 --    p_camp_id: the campaign_id
176 --    p_object_version: the object_version_number
177 --
178 -- NOTES
179 --    1. Raise exception if the object_version_number doesn't match.
180 --    2. Will set the campaign to be inactive, instead of remove it
181 --       from database.
182 --------------------------------------------------------------------
183 PROCEDURE delete_campaign(
184    p_api_version       IN  NUMBER,
185    p_init_msg_list     IN  VARCHAR2 := FND_API.g_false,
186    p_commit            IN  VARCHAR2 := FND_API.g_false,
187 
188    x_return_status     OUT NOCOPY VARCHAR2,
189    x_msg_count         OUT NOCOPY NUMBER,
190    x_msg_data          OUT NOCOPY VARCHAR2,
191 
192    p_camp_id           IN  NUMBER,
193    p_object_version    IN  NUMBER
194 );
195 
196 
197 -------------------------------------------------------------------
198 -- PROCEDURE
199 --    lock_campaign
200 --
201 -- PURPOSE
202 --    Lock a campaign.
203 --
204 -- PARAMETERS
205 --    p_camp_id: the campaign_id
206 --    p_object_version: the object_version_number
207 --
208 -- NOTES
209 --    1. Raise exception if the object_version_number doesn't match.
210 --------------------------------------------------------------------
211 PROCEDURE lock_campaign(
212    p_api_version       IN  NUMBER,
213    p_init_msg_list     IN  VARCHAR2 := FND_API.g_false,
214 
215    x_return_status     OUT NOCOPY VARCHAR2,
216    x_msg_count         OUT NOCOPY NUMBER,
217    x_msg_data          OUT NOCOPY VARCHAR2,
218 
219    p_camp_id           IN  NUMBER,
220    p_object_version    IN  NUMBER
221 );
222 
223 
224 ---------------------------------------------------------------------
225 -- PROCEDURE
226 --    update_campaign
227 --
228 -- PURPOSE
229 --    Update a campaign.
230 --
231 -- PARAMETERS
232 --    p_camp_rec: the record with new items
233 --
234 -- NOTES
235 --    1. Raise exception if the object_version_number doesn't match.
236 --    2. If an attribute is passed in as FND_API.g_miss_char/num/date,
237 --       that column won't be updated.
238 ----------------------------------------------------------------------
239 PROCEDURE update_campaign(
240    p_api_version       IN  NUMBER,
241    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
242    p_commit            IN  VARCHAR2  := FND_API.g_false,
243    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
244 
245    x_return_status     OUT NOCOPY VARCHAR2,
246    x_msg_count         OUT NOCOPY NUMBER,
247    x_msg_data          OUT NOCOPY VARCHAR2,
248 
249    p_camp_rec          IN  camp_rec_type
250 );
251 
252 
253 ---------------------------------------------------------------------
254 -- PROCEDURE
255 --    validate_campaign
256 --
257 -- PURPOSE
258 --    Validate a campaign record.
259 --
260 -- PARAMETERS
261 --    p_camp_rec: the record to be validated
262 --
263 -- NOTES
264 --    1. p_camp_rec should be the complete campaign record wothout
265 --       any FND_API.g_miss_char/num/date items.
266 ----------------------------------------------------------------------
267 PROCEDURE validate_campaign(
268    p_api_version       IN  NUMBER,
269    p_init_msg_list     IN  VARCHAR2  := FND_API.g_false,
270    p_validation_level  IN  NUMBER    := FND_API.g_valid_level_full,
271 
272    x_return_status     OUT NOCOPY VARCHAR2,
273    x_msg_count         OUT NOCOPY NUMBER,
274    x_msg_data          OUT NOCOPY VARCHAR2,
275 
276    p_camp_rec          IN  camp_rec_type
277 );
278 
279 
280 ---------------------------------------------------------------------
281 -- PROCEDURE
282 --    check_camp_items
283 --
284 -- PURPOSE
285 --    Perform the item level checking including unique keys,
286 --    required columns, foreign keys, domain constraints.
287 --
288 -- PARAMETERS
289 --    p_camp_rec: the record to be validated
290 --    p_validation_mode: JTF_PLSQL_API.g_create/g_update
291 ---------------------------------------------------------------------
292 PROCEDURE check_camp_items(
293    p_camp_rec        IN  camp_rec_type,
294    p_validation_mode IN  VARCHAR2 := JTF_PLSQL_API.g_create,
295    x_return_status   OUT NOCOPY VARCHAR2
296 );
297 
298 
299 ---------------------------------------------------------------------
300 -- PROCEDURE
301 --    check_camp_record
302 --
303 -- PURPOSE
304 --    Check the record level business rules.
305 --
306 -- PARAMETERS
307 --    p_camp_rec: the record to be validated; may contain attributes
308 --       as FND_API.g_miss_char/num/date
309 --    p_complete_rec: the complete record after all "g_miss" items
310 --       have been replaced by current database values
311 ---------------------------------------------------------------------
312 PROCEDURE check_camp_record(
313    p_camp_rec         IN  camp_rec_type,
314    p_complete_rec     IN  camp_rec_type,
315    x_return_status    OUT NOCOPY VARCHAR2
316 );
317 
318 
319 ---------------------------------------------------------------------
320 -- PROCEDURE
321 --    check_camp_inter_entity
322 --
323 -- PURPOSE
324 --    Check the inter-entity level business rules.
325 --
326 -- PARAMETERS
327 --    p_camp_rec: the record to be validated; may contain attributes
328 --       as FND_API.g_miss_char/num/date
329 --    p_complete_rec: the complete record after all "g_miss" items
330 --       have been replaced by current database values
331 --    p_validation_mode: JTF_PLSQL_API.g_create/g_update
332 ---------------------------------------------------------------------
333 PROCEDURE check_camp_inter_entity(
334    p_camp_rec        IN  camp_rec_type,
335    p_complete_rec    IN  camp_rec_type,
336    p_validation_mode IN  VARCHAR2,
337    x_return_status   OUT NOCOPY VARCHAR2
338 );
339 
340 
341 ---------------------------------------------------------------------
342 -- PROCEDURE
343 --    init_camp_rec
344 --
345 -- PURPOSE
346 --    Initialize all attributes to be FND_API.g_miss_char/num/date.
347 ---------------------------------------------------------------------
348 PROCEDURE init_camp_rec(
349    x_camp_rec         OUT NOCOPY  camp_rec_type
350 );
351 
352 
353 ---------------------------------------------------------------------
354 -- PROCEDURE
355 --    complete_camp_rec
356 --
357 -- PURPOSE
358 --    For update_campaign, some attributes may be passed in as
359 --    FND_API.g_miss_char/num/date if the user doesn't want to
360 --    update those attributes. This procedure will replace the
361 --    "g_miss" attributes with current database values.
362 --
363 -- PARAMETERS
364 --    p_camp_rec: the record which may contain attributes as
365 --       FND_API.g_miss_char/num/date
366 --    x_complete_rec: the complete record after all "g_miss" items
367 --       have been replaced by current database values
368 --
369 -- NOTES
370 --    1. If a valid status_date is provided, use it. If not, set it
371 --       to be the original value or SYSDATE depending on whether
372 --       the user_status_id is changed or not.
373 ---------------------------------------------------------------------
374 PROCEDURE complete_camp_rec(
375    p_camp_rec       IN  camp_rec_type,
376    x_complete_rec   OUT NOCOPY camp_rec_type
377 );
378 
379 
380 END AMS_Campaign_PVT;