1 PACKAGE ams_cpyutility_pvt AUTHID CURRENT_USER AS
2 /* $Header: amsvcpus.pls 115.10 2002/11/22 23:36:39 dbiswas ship $ */
3
4 -- Start Of Comments
5 --
6 -- Name:
7 -- Ams_CPYUTILITY_PVT
8 --
9 -- Purpose:
10 -- This is the specification for the utility packages in copy functionality in Oracle Marketing
11 -- from their ids.
12
13 -- GET_name Procedures
14 -- These functions will be called by marketing activities such as promotions,campaigns,
15 -- channels,events,etc and marketing elements such as products,scripts,resources etc while copying them
16 -- and will provide the names if their is any error.
17 -- Function:
18 -- get_objective_name (see below for specification
19 -- get_offer_name (see below for specification)
20 -- get_script_name (see below for specification)
21 -- get_reosurce_name (see below for specification)
22 -- get_product_name (see below for specification)
23 -- get_cell_name (see below for specification)
24 -- get_geo_area_name (see below for specification)
25 -- get_attachment_name (see below for specification)
26 -- get_deliverable_name (see below for specification)
27 -- get_business_party_name (see below for specification)
28 -- get_list_header_name (see below for specification)
29 -- get_access_name (see below for specification)
30 -- get_message_name (see below for specification)
31 -- get_event_header_name
32
33 -- Unique name generation procedures
34 -- These functions would be called while copying marketing activities, if the user doesnot enter a new code
35 -- while creating a new one.
36 -- Function:
37 -- FUNCTION new_channel_code
38 -- FUNCTION new_media_code
39 -- FUNCTION new_promotion(p_src_name VARCHAR2)
40
41 -- Notes:
42 --
43 -- History:
44 -- 07//1999 Mumu Pande Updated Comments
45 -- AMS_CPYUTILITY_PVT package.
46 -- 07/15/1999 Mumu Pande Created ([email protected])
47 -- 05-Apr-2001 choang Added copy_attributes_table_type, copy_columns_rec_type and copy_columns_table_type
48 --
49 -- 29-Oct-2001 rrajesh Added check_attrib_exists.
50 -- End Of Comments
51
52 -- choang - 05-apr-2001
53 -- table and records used by common copy
54 TYPE copy_attributes_table_type IS TABLE OF VARCHAR2(30) INDEX BY BINARY_INTEGER;
55
56 TYPE copy_columns_rec_type IS RECORD (
57 column_name VARCHAR2(30),
58 column_value VARCHAR2(4000)
59 );
60
61 TYPE copy_columns_table_type IS TABLE OF copy_columns_rec_type INDEX BY BINARY_INTEGER;
62
63 -- Sub-Program Unit Declarations
64 /* For ams_copy only. */
65 TYPE log_mesg_type_table IS TABLE OF VARCHAR2(30)
66 INDEX BY BINARY_INTEGER;
67
68 TYPE log_mesg_txt_table IS TABLE OF VARCHAR2(4000)
69 INDEX BY BINARY_INTEGER;
70
71 TYPE log_act_used_by_table IS TABLE OF VARCHAR2(30)
72 INDEX BY BINARY_INTEGER;
73
74 TYPE log_act_used_id_table IS TABLE OF NUMBER
75 INDEX BY BINARY_INTEGER;
76
77 FUNCTION get_offer_code(p_offer_id IN NUMBER)
78 RETURN VARCHAR2;
79
80 /* For ams_copy. */
81 FUNCTION get_event_offer_name(p_event_offering_id IN NUMBER)
82 RETURN VARCHAR2;
83
84 /* For ams_copy only. */
85 FUNCTION get_geo_area_name(p_geo_hierarchy_id IN NUMBER, p_geo_area_type IN VARCHAR2)
86 RETURN VARCHAR2;
87
88 -- For ams_copy.
89 FUNCTION get_product_name(p_category_id IN NUMBER)
90 RETURN VARCHAR2;
91
92 -- For ams_copy.
93 FUNCTION get_message_name(p_message_id IN NUMBER)
94 RETURN VARCHAR2;
95
96 /* For ams_copy only.
97 FUNCTION get_script_name(p_script_id IN NUMBER)
98 RETURN VARCHAR2;
99 */
100
101 /* For ams_copy only. */
102 FUNCTION get_resource_name(p_resource_id IN NUMBER)
103 RETURN VARCHAR2;
104
105 /* For ams_copy only. */
106 FUNCTION get_attachment_name(p_act_attachment_id IN NUMBER)
107 RETURN VARCHAR2;
108
109 /* For ams_copy only. */
110 FUNCTION get_category_name(p_category_id IN NUMBER)
111 RETURN VARCHAR2;
112
113 /* For ams_copy only. */
114 FUNCTION get_deliverable_name(p_deliverable_id IN NUMBER)
115 RETURN VARCHAR2;
116
117 /* For ams_copy only. */
118 FUNCTION get_segment_name(p_cell_id IN NUMBER)
119 RETURN VARCHAR2;
120
121 FUNCTION get_event_header_name(p_event_header_id IN NUMBER)
122 RETURN VARCHAR2;
123 -- Sub-Program Unit Declarations
124 /* Generate unique channel code. */
125 -- FUNCTION new_channel_code
126 -- RETURN VARCHAR2;
127 /* Log an error. */
128
129 PROCEDURE write_log_mesg(
130 p_act_type IN VARCHAR2,
131 p_act_id IN NUMBER,
132 p_message_text IN VARCHAR2,
133 p_message_type IN VARCHAR2);
134
135 /* Refresh the PL/SQL log table. */
136 PROCEDURE refresh_log_mesg;
137
138 /* Write the log infomation from PL/SQL table into ams_activity_logs. */
139 PROCEDURE insert_log_mesg(x_transaction_id OUT NOCOPY NUMBER);
140 -- PL/SQL Specification
141 /* This function will return a number to see the difference between the start and end dates of the
142 source campaign,events or eveo */
143 FUNCTION get_dates(
144 p_arc_act_code IN VARCHAR2,
145 p_activity_id IN NUMBER,
146 x_return_status OUT NOCOPY VARCHAR2)
147 RETURN NUMBER;
148
149 --
150 -- Purpose
151 -- Return the column value associated with the given
152 -- column, if the value exists.
153 --
154 PROCEDURE get_column_value (
155 p_column_name IN VARCHAR2,
156 p_columns_table IN copy_columns_table_type,
157 x_column_value OUT NOCOPY VARCHAR2
158 );
159
160 --
161 -- Purpose
162 -- Return FND_API.G_TRUE if the given attribute
163 -- is one of the attributes to copy.
164 --
165 FUNCTION is_copy_attribute (
166 p_attribute IN VARCHAR2,
167 p_attributes_table IN copy_attributes_table_type
168 ) RETURN VARCHAR2;
169
170 -- While copying an object to check whether an attribute exists.
171 FUNCTION check_attrib_exists (
172 p_obj_type IN VARCHAR2,
173 p_obj_id IN NUMBER,
174 p_obj_attribute IN VARCHAR2
175 ) RETURN VARCHAR2;
176
177 END;