1 PACKAGE INV_ORGHIERARCHY_PVT AUTHID CURRENT_USER AS
2 /* $Header: INVVORGS.pls 115.20 2004/04/15 13:11:32 nesoni ship $ */
3 --+=======================================================================+
4 --| Copyright (c) 2001 Oracle Corporation |
5 --| Redwood Shores, CA, USA |
6 --| All rights reserved. |
7 --+=======================================================================+
8 --| FILENAME |
9 --| INVVORGS.pls |
10 --| |
11 --| DESCRIPTION |
12 --| Spec of INV_ORGHIERARCHY_PVT |
13 --| |
14 --| HISTORY |
15 --| 08/28/00 vjavli Created |
16 --| 10/29/00 vjavli updated with Org_Hier_Level_Resp_Access |
17 --| 11/01/00 vjavli updated with parameter business group for|
18 --| the Org_Hier_Level_Resp_Access |
19 --| 11/13/00 vjavli The function Org_Hier_Level_Resp_Access |
20 --| modified. removed resp_appl_id parameter |
21 --| 12/11/00 vjavli removed overloading |
22 --| 05/22/01 vjavli created api:Org_exists_in_hierarchy |
23 --| for valid query in the forms |
24 --| 11/14/01 vjavli Created Org_Hier_Origin_Resp_Access |
25 --| This function is a performance |
26 --| enhancement of the previous function |
27 --| Org_Hier_Level_Resp_Access |
28 --| 12/11/01 vjavli insert_hierarchy_index_list created |
29 --| 05/03/02 vjavli dbdrv hint added for the version:115.15 |
30 --| version:115.16 has an issue since this |
31 --| file got updated with dbdrv hint for the |
32 --| earlier version of the file which does |
33 --| not contain the performance apis |
34 --| 11/22/2002 vma Added NOCOPY to OUT parameters |
35 --| 04/12/2004 nesoni Bug 3555234. Introduced another log level|
36 --| G_LOG_PRINT which will be printed always |
37 --| irrespective of FND Debug mode. |
38 --+======================================================================*/
39
40
41 --===================
42 -- CONSTANTS
43 --===================
44 /* Following debug level G_LOG_PRINT has been added to print summary report
45 irrespective of FND Debug Enabled profile option. Bug 3555234.
46 */
47 G_LOG_PRINT CONSTANT NUMBER := 6;
48
49 G_LOG_ERROR CONSTANT NUMBER := 5;
50 G_LOG_EXCEPTION CONSTANT NUMBER := 4;
51 G_LOG_EVENT CONSTANT NUMBER := 3;
52 G_LOG_PROCEDURE CONSTANT NUMBER := 2;
53 G_LOG_STATEMENT CONSTANT NUMBER := 1;
54
55 --===================
56 -- GLOBAL VARIABLES
57 --===================
58 -- Table type used to hold organization codes
59 TYPE OrgID_tbl_type IS TABLE OF hr_all_organization_units.organization_id%TYPE
60 INDEX BY BINARY_INTEGER;
61
62 -- list to store the index organization list
63 -- where organization_id is the index of the table
64 g_orgid_index_list INV_ORGHIERARCHY_PVT.orgID_tbl_type;
65 --
66 --=========================
67 -- PROCEDURES AND FUNCTIONS
68 --=========================
69
70
71 --========================================================================
72 -- FUNCTION : validate_property PUBLIC
73 -- PARAMETERS: p_org_id_tbl This is a list of organization ids,
74 -- typically obtained from a call to
75 -- get_organization_list
76 -- p_property Returns 'Y' if the property applies to
77 -- the list of organizations
78 -- p_property can be one of:
79 -- 'MASTER'
80 -- 'CALENDAR'
81 -- 'CHART_OF_ACCOUNTS'
82 --=========================================================================
83
84 FUNCTION validate_property
85 ( p_org_id_tbl IN OrgID_Tbl_Type
86 , p_property IN VARCHAR2
87 )
88 RETURN VARCHAR2;
89
90
91
92 --========================================================================
93 -- FUNCTION : get_organization_list PUBLIC
94 -- PARAMETERS: p_hierarchy_id IN NUMBER
95 -- Organization Hierarchy Id
96 -- p_origin_org_id IN NUMBER
97 -- Hierarchy Origin Organization Id
98 -- org_id_tbl OUT NOCOPY OrgID_Tbl_Type
99 -- List of Organization Ids
100 -- p_include_origin IN VARCHAR DEFAULT 'Y'
101 -- Include the origin in list
102 --
103 -- COMMENT : returns a list containing all organizations from the hierarchy
104 -- below the origin organization to which the user
105 -- has access.
106 -- p_include_origin flag determines whether the origin org id is part
107 -- of the list or not.
108 -- Both Inventory Organization Security and HR Security Group
109 -- are enforced, as well as effective date ranges.
110 -- This api does not return the organizations in the list in any
111 -- particular order. The order may change between revisions.
112 -- origin_id:
113 --=========================================================================
114
115 PROCEDURE get_organization_list
116 ( p_hierarchy_id IN NUMBER
117 , p_origin_org_id IN NUMBER
118 , x_org_id_tbl OUT NOCOPY OrgID_Tbl_Type
119 , p_include_origin IN VARCHAR2 DEFAULT 'Y'
120 );
121
122
123
124 --========================================================================
125 -- FUNCTION : contained_in_hierarchy PUBLIC
126 -- PARAMETERS: p_org_hierarchy_name IN VARCHAR2 Organization Hierarchy
127 -- Name
128 -- p_org_id IN NUMBER Organization Id
129 --
130 -- COMMENT : Returns 'Y' if p_org_id is contained in the current version of
131 -- the named organization hierarchy
132 --=========================================================================
133 FUNCTION contained_in_hierarchy
134 ( p_org_hierarchy_name IN VARCHAR2
135 , p_org_id IN NUMBER
136 )
137 RETURN VARCHAR2;
138
139
140
141 --========================================================================
142 -- FUNCTION : Org_Hierarchy_Access PUBLIC
143 -- PARAMETERS: p_org_hierarchy_name IN VARCHAR2(30) Organization Hierarchy
144 -- Name
145 --
146 -- COMMENT : This API accepts the name of an hierarchy and returns Y if the
147 -- user has access to it, N Otherwise The API checks whether the
148 -- user has an access or authorization for the organization
149 -- hierarchy based on the fact that atleast one of the organization
150 -- in the organization hierarchy belongs to the security profile
151 -- which has been assigned thru the responsibility to the user.
152 --=========================================================================
153 FUNCTION Org_Hierarchy_Access
154 ( p_org_hierarchy_name IN VARCHAR2 ) RETURN VARCHAR2;
155
156
157
158 --========================================================================
159 -- FUNCTION : Org_Hierarchy_Level_Access PUBLIC
160 -- PARAMETERS: p_org_hierarchy_name IN VARCHAR2(30) Organization Hierarchy
161 -- Name
162 -- p_org_hier_level_id IN NUMBER Organization Hierarchy
163 -- Level Id
164 --
165 -- COMMENT : This API accepts the name of an hierarchy, hierarchy level
166 -- Id and returns Y if the user has access to it N otherwise
167 --=========================================================================
168 FUNCTION ORG_HIERARCHY_LEVEL_ACCESS
169 ( p_org_hierarchy_name IN VARCHAR2,
170 p_org_hier_level_id IN NUMBER ) RETURN VARCHAR2;
171
172
173
174 --========================================================================
175 -- PROCEDURE : Org_Hierarchy_List PUBLIC
176 -- PARAMETERS: p_org_hierarchy_name IN VARCHAR2(30) Organization Hierarchy
177 -- Name
178 -- p_org_hier_level_id IN NUMBER Hierarchy Level Id
179 -- x_org_code_list List of Organizations
180 --
181 -- COMMENT : API accepts the name of an hierarchy, hierarchy level id and
182 -- returns the list of organizations it contains.
183 -- p_org_hierarchy_name contains user input organization hierarchy
184 -- name
185 -- p_org_hier_level_id contains user input hierarchy level
186 -- organization id in the hierarchy
187 -- x_org_code_list contains list of organizations for a given org
188 -- hierarchy level
189 --=========================================================================
190 PROCEDURE Org_Hierarchy_List
191 ( p_org_hierarchy_name IN VARCHAR2,
192 p_org_hier_level_id IN NUMBER,
193 x_org_code_list OUT NOCOPY OrgID_tbl_type);
194
195
196
197 --========================================================================
198 -- FUNCTION : Org_Hier_Level_Property_Access PUBLIC
199 -- PARAMETERS: p_org_hierarchy_name IN VARCHAR2(30) Organization Hierarchy
200 -- Name
201 -- p_org_hier_level_id IN NUMBER Hierarchy Level Id
202 --
203 -- p_property_type IN VARCHAR2(25) Property Type
204 --
205 -- COMMENT : API accepts the name of an hierarchy, hierarchy level id,
206 -- property and returns Y if the property is satisfied,
207 -- N otherwise.
208 -- The supported properties are:
209 -- MASTER: all the organizations share the same item master
210 -- CALENDAR: all the organizations share the same calendar
211 -- CHART_OF_ACCOUNTS: all the organizations share the same chart of
212 -- accounts
213 --=========================================================================
214 FUNCTION Org_Hier_Level_Property_Access
215 ( p_org_hierarchy_name IN VARCHAR2,
216 p_org_hier_level_id IN NUMBER,
217 p_property_type IN VARCHAR2 ) RETURN VARCHAR2 ;
218
219
220
221 --========================================================================
222 -- FUNCTION : Org_Hier_Level_Resp_Access PUBLIC
223 -- PARAMETERS: p_api_version_number known api version
224 -- p_org_id IN NUMBER Hierarchy Level Id
225 -- (Organization Id)
226 -- p_business_id IN NUMBER Business Group Id
227 -- p_responsibility_id IN NUMBER Current Responsibility
228 -- Id
229 -- COMMENT : API accepts the Organization Id of an organization
230 -- hierarchy level(organization name), business group,current
231 -- responsibility user has signed on and returns Y if the
232 -- organization is valid(unexpired) and has an access for the
233 -- responsibility, N otherwise.
234 --=========================================================================
235 FUNCTION Org_Hier_Level_Resp_Access
236 ( p_org_id IN NUMBER,
237 p_business_group_id IN NUMBER,
238 p_responsibility_id IN NUMBER ) RETURN VARCHAR2;
239
240
241
242 --========================================================================
243 -- FUNCTION : Org_Hier_Origin_Resp_Access PUBLIC
244 -- PARAMETERS: p_api_version_number known api version
245 -- p_org_id IN NUMBER Hierarchy Level Id
246 -- (Organization Id)
247 -- p_responsibility_id IN NUMBER Current Responsibility
248 -- Id
249 -- COMMENT : API accepts the Organization Id of an
250 -- hierarchy origin(organization name), current
251 -- responsibility user has signed on and returns Y if the
252 -- organization is valid(unexpired) and has an access for the
253 -- responsibility, N otherwise.
254 --=========================================================================
255 FUNCTION Org_Hier_Origin_Resp_Access
256 ( p_org_id IN NUMBER,
257 p_responsibility_id IN NUMBER ) RETURN VARCHAR2;
258
259
260
261 --========================================================================
262 -- FUNCTION : Org_exists_in_hierarchy PUBLIC
263 -- PARAMETERS: p_organization_id IN NUMBER Inventory Organization Id
264 -- COMMENT : This API accepts the organization id, name of an hierarchy,
265 -- hierarchy origin id and returns Y if the organization id exists
266 -- in the given hierarchy and origin
267 --=========================================================================
268 FUNCTION Org_exists_in_hierarchy
269 ( p_organization_id IN NUMBER) RETURN VARCHAR2;
270
271
272
273 --========================================================================
274 -- PROCEDURE : Insert_hierarchy_index_list PUBLIC
275 -- PARAMETERS: p_orgid_tbl_list IN orgID_tbl_type Orgid list of an
276 -- hierarchy
277 -- COMMENT : This API copies the organization list into the global
278 -- variable organization id index list. The table index is
279 -- the organization_id
280 -- This api is used in the form: Transaction Open Interface
281
282 --========================================================================
283 PROCEDURE Insert_hierarchy_index_list
284 ( p_orgid_tbl_list IN orgID_tbl_type);
285
286
287
288 --========================================================================
289 -- PROCEDURE : Log_Initialize PUBLIC
290 -- COMMENT : Initializes the log facility. It should be called from
291 -- the top level procedure of each concurrent program
292 --========================================================================
293 PROCEDURE Log_Initialize;
294
295
296
297 --========================================================================
298 -- PROCEDURE : Log PUBLIC
299 -- PARAMETERS: p_level IN priority of the message - from
303 -- -- G_LOG_EVENT
300 -- highest to lowest:
301 -- -- G_LOG_ERROR
302 -- -- G_LOG_EXCEPTION
304 -- -- G_LOG_PROCEDURE
305 -- -- G_LOG_STATEMENT
306 -- p_msg IN message to be print on the log
307 -- file
308 -- COMMENT : Add an entry to the log
309 --=======================================================================
310 PROCEDURE Log
311 ( p_priority IN NUMBER
312 , p_msg IN VARCHAR2
313 );
314
315
316 END INV_ORGHIERARCHY_PVT;