1 PACKAGE AMS_SourceCode_PVT AUTHID CURRENT_USER AS
2 /* $Header: amsvscgs.pls 115.17 2002/11/22 23:38:58 dbiswas ship $ */
3
4
5 -----------------------------------------------------------------
6 -- FUNCTION
7 -- is_source_code_unique(p_source_code)
8 --
9 -- PURPOSE
10 -- Check whether the source code is unique or not.
11 --
12 -- NOTES
13 -- 1. Return FND_API.g_true or FND_API.g_false.
14 -----------------------------------------------------------------
15 FUNCTION is_source_code_unique(
16 p_source_code IN VARCHAR2
17 )
18 RETURN VARCHAR2;
19
20
21 -------------------------------------------------------------------
22 -- FUNCTION
23 -- get_new_source_code (p_object_type, p_custsetup_id, p_global_flag)
24 --
25 -- PURPOSE
26 -- Generate a unique source code for a campaign, event offer,
27 -- or offer.
28 --
29 -- PARAMETERS
30 -- p_object_type: any object type which requires a source code.
31 -- p_custsetup_id: the ID of the custom setup.
32 -- p_global_flag: indicates whether the object was created
33 -- for a global audience.
34 --
35 -- NOTES
36 -- 1. Raise FND_API.g_exc_error for invalid profile values.
37 --
38 --------------------------------------------------------------------
39 FUNCTION get_new_source_code (
40 p_object_type IN VARCHAR2,
41 p_custsetup_id IN NUMBER,
42 p_global_flag IN VARCHAR2 := FND_API.g_false
43 )
44 RETURN VARCHAR2;
45
46
47 -------------------------------------------------------------------
48 -- FUNCTION
49 -- get_source_code(p_arc_object, p_type_code)
50 --
51 -- PURPOSE
52 -- Generate a unique source code for a campaign, event offer,
53 -- or offer. The prefix will be based on the type code. If no
54 -- type code passed in, use the p_arc_object as the prefix.
55 --
56 -- PARAMETERS
57 -- p_arc_object: must be one of 'CAMP' / 'EVEH' / 'OFFR'.
58 -- p_type_code: can be either null or a valid lookup_code from
59 -- AMS_CAMPAIGN_TYPE / AMS_EVENT_TYPE / AMS_OFFER_TYPE.
60 --
61 -- NOTES
62 -- 1. Raise FND_API.g_exc_error for invalid input parameters.
63 --
64 -- EXAMPLE
65 -- get_source_code('CAMP', 'PRODUCT_LAUNCH') --> PROD10032
66 --------------------------------------------------------------------
67 FUNCTION get_source_code(
68 p_arc_object IN VARCHAR2,
69 p_type_code IN VARCHAR2
70 )
71 RETURN VARCHAR2;
72
73
74 --------------------------------------------------------------------
75 -- FUNCTION
76 -- get_source_code(p_category_id, p_arc_object)
77 --
78 -- PURPOSE
79 -- Generate a unique source code for a fund
80 -- The category id should be valid for a fund
81 -- PARAMAETERS
82 -- p_arc_object: must be one of 'FUND'.
83 -- p_category_id: -- The category id should be valid for a fund
84 --
85 -- NOTES
86 -- 1. Raise FND_API.g_exc_error for invalid input parameters.
87 --
88 -- EXAMPLE
89 -- get_source_code(10021, 'FUND') --> MDF10034
90 --------------------------------------------------------------------
91 FUNCTION get_source_code(
92 p_category_id IN NUMBER,
93 p_arc_object_for IN VARCHAR2
94 )
95 RETURN VARCHAR2;
96
97 --------------------------------------------------------------------
98 -- FUNCTION
99 -- get_source_code(p_parent_id, p_arc_object)
100 --
101 -- PURPOSE
102 -- Generate a unique source code for a campaign schedule or event
103 -- offer. The parent id need to passed in to get a correct prifix
104 -- based on the parent campaign type or event header type.
105 --
106 -- PARAMAETERS
107 -- p_arc_object: must be one of 'CSCH' / 'EVEO'.
108 -- p_parent_id: the parent campaign id or event header id.
109 --
110 -- NOTES
111 -- 1. Raise FND_API.g_exc_error for invalid input parameters.
112 --
113 -- EXAMPLE
114 -- get_source_code(10021, 'CSCH') --> PROD10033
115 --------------------------------------------------------------------
116 FUNCTION get_source_code(
117 p_parent_id IN NUMBER,
118 p_arc_object IN VARCHAR2
119 )
120 RETURN VARCHAR2;
121
122 --------------------------------------------------------------------
123 -- FUNCTION
124 -- get_source_code
125 --
126 -- PURPOSE
127 -- Generate a unique numeric source code without any prefix.
128 --------------------------------------------------------------------
129 FUNCTION get_source_code RETURN VARCHAR2;
130
131
132 ---------------------------------------------------------------------
133 -- PROCEDURE
134 -- create_sourcecode
135 --
136 -- PURPOSE
137 -- Create a unique source code for a campaign/offer/campaign schedule.
138 --
139 -- PARAMETERS
140 -- p_sourcecode : the source code to be created
141 -- p_sourcecode_for : the object which uses the source code (Campaign/offer/campaign schedule
142 -- Event / Event offer)
143 -- p_sourcecode_for_id : Unique identifier that identifies the object
144 -- x_sourcecode_id : The return value - the id of the source code record
145 --
146 -- NOTES
147 -- 1. Check for source code uniqueness. Insert source code if it is unique.
148 -- 2. If source code already exists, check if it is active.
149 -- 3. If the source code is active, return an error.
150 -- 4. If the source code is inactive, modify the source code rec with the new object parameters.
151
152 -- USAGE
153 -- Use this procedure whenever a new source code is being created. Even if an
154 -- existing campaign is modifying the source code, it is in effect creating a new source code.
155 -- Do not use this api to modify the source code after the campaign/ promotion goes active.
156 ---------------------------------------------------------------------
157 PROCEDURE create_sourcecode(
158 p_api_version IN NUMBER,
159 p_init_msg_list IN VARCHAR2 := FND_API.g_false,
160 p_commit IN VARCHAR2 := FND_API.g_false,
161 p_validation_level IN NUMBER := FND_API.g_valid_level_full,
162
163 x_return_status OUT NOCOPY VARCHAR2,
164 x_msg_count OUT NOCOPY NUMBER,
165 x_msg_data OUT NOCOPY VARCHAR2,
166
167 p_sourcecode IN VARCHAR2,
168 p_sourcecode_for IN VARCHAR2,
169 p_sourcecode_for_id IN NUMBER,
170 p_related_sourcecode IN VARCHAR2 := NULL,
171 p_releated_sourceobj IN VARCHAR2 := NULL,
172 p_related_sourceid IN NUMBER := NULL,
173 x_sourcecode_id OUT NOCOPY NUMBER
174 );
175
176
177 ---------------------------------------------------------------------
178 -- PROCEDURE
179 -- revoke_sourcecode
180 --
181 -- PURPOSE
182 -- Invalidate the source code.
183 --
184 -- PARAMETERS
185 -- p_sourcecode : the source code to be revoked
186
187 --
188 -- NOTES
189 -- update the active flag to 'N'
190
191 -- USAGE
192 -- Use this procedure to invalidate a source code. Source can be invalidate
193 -- because the campaign is cancelled or the campaign source code is modified.
194 -- CAUTION : Do not revoke a source code after a campaign goes to active stage.
195 -- Even if the campaign has been in an active stage at some point of time
196 -- and completed, do not revoke the source code as this source code
197 -- can have referring orders / interactions.
198 ---------------------------------------------------------------------
199 PROCEDURE revoke_sourcecode(
200 p_api_version IN NUMBER,
201 p_init_msg_list IN VARCHAR2 := FND_API.g_false,
202 p_commit IN VARCHAR2 := FND_API.g_false,
203 p_validation_level IN NUMBER := FND_API.g_valid_level_full,
204
205 x_return_status OUT NOCOPY VARCHAR2,
206 x_msg_count OUT NOCOPY NUMBER,
207 x_msg_data OUT NOCOPY VARCHAR2,
208
209 p_sourcecode IN VARCHAR2
210 );
211
212 PROCEDURE modify_sourcecode(
213 p_source_code IN VARCHAR2,
214 p_object_type IN VARCHAR2,
215 p_object_id IN NUMBER,
216 p_sourcecode_id IN NUMBER,
217 p_related_sourcecode IN VARCHAR2 := NULL,
218 p_releated_sourceobj IN VARCHAR2 := NULL,
219 p_related_sourceid IN NUMBER := NULL,
220
221 x_return_status OUT NOCOPY VARCHAR2
222 ) ;
223
224 END AMS_SourceCode_PVT;