DBA Data[Home] [Help]

PACKAGE: APPS.BISM_CORE

Source


1 package bism_core as
2 /* $Header: bibcores.pls 120.2 2006/04/03 05:21:25 akbansal noship $ */
3 type myrctype is ref cursor;
4 type obj_uvs is table of BISM_OBJECTS.USER_VISIBLE%TYPE;
5 type obj_ids is table of BISM_OBJECTS.OBJECT_ID%TYPE;
6 type obj_otids is table of BISM_OBJECTS.OBJECT_TYPE_ID%TYPE;
7 
8 function get_next_element(str varchar2,delimiter varchar2,startpos in out nocopy integer) return varchar2;
9 function get_last_object_id(fid raw,path varchar2,startpos in out nocopy integer,myid raw) return raw;
10 procedure delete_folder(fid raw,myid raw);
11 procedure delete_folder(fid raw,path varchar2,myid raw);
12 procedure delete_object(fid raw,objname varchar2,myid raw);
13 procedure set_privilege(fid raw,grantor raw,grantee_name varchar2,priv number);
14 procedure delete_folder_wo_security(fid raw,myid raw);
15 function prepare_rebind(fid raw,oname varchar2,myid raw,ids out nocopy bism_object_ids, current_time out nocopy date,num number,status out nocopy integer) return raw;
16 function prepare_rebind_30(fid raw,oname varchar2,myid raw,ids out nocopy raw, current_time out nocopy date,num number,status out nocopy integer) return raw;
17 function get_attributes(p_fid raw, p_objname varchar2, p_myid raw) return myrctype;
18 function check_modify_attrs_access(fid raw,objname varchar2,myid raw,status out nocopy number,callerid number) return varchar2;
19 function check_get_attrs_access(fid raw,objname varchar2,myid raw) return varchar2;
20 function check_user_privileges(p_username varchar2, p_oid raw, p_myid raw) return number;
21 function entries(p_oid in raw,p_myid in raw) return myrctype;
22 function add_entries(fid in raw,acllist in out nocopy  bism_acl_obj_t,myid in raw,cascade in varchar2,topfolder in varchar2) return bism_acl_obj_t;
23 procedure add_entries_30(fid in raw,acllist in CLOB,myid in raw,cascade in varchar2,topfolder in varchar2, aclseparator in varchar2);
24 function remove_entries(fid in raw,acllist in out nocopy  bism_acl_obj_t,myid in raw,cascade in varchar2,topfolder in varchar2) return bism_chararray_t;
25 function remove_entries_30(fid in raw,acllist in out nocopy CLOB,myid in raw,cascade in varchar2,topfolder in varchar2, aclseparator in varchar2) return varchar2;
26 function is_src_ancestor_of_target(srcfid raw,tgtfid raw) return boolean;
27 procedure move(srcfid raw,tgtfid raw,objname varchar2,myid raw);
28 procedure move_folder(topfolderid raw,tgtfid raw,objname varchar2, srcfid raw,myid raw);
29 procedure move_object(srcfid raw,tgtfid raw,objname varchar2,objid raw,myid raw);
30 function can_copy_folder(srcfid raw,tgtfid raw,myid raw) return boolean;
31 procedure copy_folder(srcfid raw,tgtfid raw,destobjname varchar2,myid raw,copytype integer,first_level boolean);
32 procedure copy(srcfid raw,tgtfid raw,srcobjname varchar2,destobjname varchar2,myid raw,copytype integer);
33 procedure copy_object(srcfid raw,tgtfid raw,srcobjname varchar2,destobjname varchar2,myid raw,copytype integer);
34 procedure copy_next_level(oldparentid raw,newparentid raw,tgtfid raw,myid raw,dummycounter in out nocopy integer,copytype integer);
35 procedure lookuphelper(fid raw,path bism_lookup_info_in_50_a,lookup_output out nocopy bism_lookup_info_out_50_a,myid raw);
36 procedure lookuphelper(fid raw,path varchar2, objname out nocopy varchar2,objid out nocopy raw,typeid out nocopy number, myid raw);
37 procedure lookup(fid raw,path bism_lookup_info_in_50_a,lookup_output in out nocopy bism_lookup_info_out_50_a,idx in out nocopy integer,myid raw);
38 procedure lookup(fid raw,path varchar2,a_objname out nocopy varchar2,a_objid out nocopy raw,a_typeid out nocopy number,myid raw,startpos in out nocopy integer) ;
39 function check_access_super_tree(startoid raw,stopoid raw,myid raw) return varchar2;
40 function get_object_full_name(oid raw) return varchar2;
41 function object_load (objid raw,myid raw) return myrctype;
42 function check_lookup_access(oid raw,fid raw,objtype number,visible varchar2,myid raw) return varchar2;
43 function get_folder(oid raw, myid raw) return myrctype;
44 function get_object(objid raw, myid raw, traceLastLoaded varchar2) return myrctype;
45 function fetch_objectsSQL1(cid raw, objid raw, myid raw) return myrctype;
46 function fetch_objectsSQL2(cid raw, myid raw, traceLastLoaded varchar2) return myrctype;
47 function rename_object(fid raw, objname varchar2, myid raw, callerid number, newobjname varchar2) return number;
48 function list(p_fid bism_objects.FOLDER_ID%type, p_subid bism_subjects.SUBJECT_ID%type) return myrctype;
49 
50 /* Added due to refactoring (ccchow) */
51 function init(p_subname in bism_subjects.subject_name%type) return bism_subjects.SUBJECT_ID%type;
52 function create_subcontext(p_tempTimeC bism_objects.time_date_created%type,
53                            p_tempTimeM bism_objects.time_date_modified%type,
54                            p_creator bism_subjects.subject_name%type,
55                            p_modifier bism_subjects.subject_name%type,
56                            p_fid bism_objects.folder_id%type,
57                            p_subid bism_subjects.subject_id%type,
58                            p_version bism_objects.VERSION%type,
59                            p_object_name bism_objects.object_name%type,
60                            p_title bism_objects.title%type,
61                            p_application bism_objects.application%type,
62                            p_database bism_objects.database%type,
63                            p_desc bism_objects.description%type,
64                            p_keywords bism_objects.keywords%type,
65                            p_appsubtype1 bism_objects.application_subtype1%type,
66                            p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
67                            p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
68                            p_compsubtype3 bism_objects.COMP_SUBTYPE3%type) return bism_objects.object_id%type;
69 procedure bind(p_creator bism_subjects.SUBJECT_NAME%type,
70                p_modifier bism_subjects.SUBJECT_NAME%type,
71                p_subject_id bism_subjects.SUBJECT_ID%type,
72                p_visible bism_objects.USER_VISIBLE%type,
73                p_obj_type_id bism_objects.OBJECT_TYPE_ID%type,
74                p_version bism_objects.VERSION%type,
75                p_time_created bism_objects.TIME_DATE_CREATED%type,
76                p_time_modified bism_objects.TIME_DATE_MODIFIED%type,
77                p_oid bism_objects.OBJECT_ID%type,
78                p_container_id bism_objects.CONTAINER_ID%type,
79                p_fid bism_objects.FOLDER_ID%type,
80                p_obj_name bism_objects.OBJECT_NAME%type,
81                p_title bism_objects.TITLE%type,
82                p_application bism_objects.APPLICATION%type,
83                p_database bism_objects.DATABASE%type,
84                p_desc bism_objects.DESCRIPTION%type,
85                p_keywords bism_objects.KEYWORDS%type,
86                p_xml bism_objects.XML%type,
87                p_appsubtype1 bism_objects.APPLICATION_SUBTYPE1%type,
88                p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
89                p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
90                p_compsubtype3 bism_objects.COMP_SUBTYPE3%type,
91                p_container_id2 bism_aggregates.CONTAINER_ID%type,
92                p_aggregate_info bism_aggregates.AGGREGATE_INFO%type);
93 procedure bind(p_creator bism_subjects.SUBJECT_NAME%type,
94                p_modifier bism_subjects.SUBJECT_NAME%type,
95                p_subject_id bism_subjects.SUBJECT_ID%type,
96                p_visible bism_objects.USER_VISIBLE%type,
97                p_obj_type_id bism_objects.OBJECT_TYPE_ID%type,
98                p_version bism_objects.VERSION%type,
99                p_time_created bism_objects.TIME_DATE_CREATED%type,
100                p_time_modified bism_objects.TIME_DATE_MODIFIED%type,
101                p_oid bism_objects.OBJECT_ID%type,
102                p_container_id bism_objects.CONTAINER_ID%type,
103                p_fid bism_objects.FOLDER_ID%type,
104                p_obj_name bism_objects.OBJECT_NAME%type,
105                p_title bism_objects.TITLE%type,
106                p_application bism_objects.APPLICATION%type,
107                p_database bism_objects.DATABASE%type,
108                p_desc bism_objects.DESCRIPTION%type,
109                p_keywords bism_objects.KEYWORDS%type,
110                p_xml bism_objects.XML%type,
111                p_appsubtype1 bism_objects.APPLICATION_SUBTYPE1%type,
112                p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
113                p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
114                p_compsubtype3 bism_objects.COMP_SUBTYPE3%type,
115                p_container_id2 bism_aggregates.CONTAINER_ID%type,
116                p_aggregate_info bism_aggregates.AGGREGATE_INFO%type,
117                p_ext_attrs_clob CLOB,
118                p_time_last_loaded bism_objects.TIME_DATE_LAST_ACCESSED%type);
119 procedure bind_aggregate(p_container_id bism_aggregates.CONTAINER_ID%type,p_containee_id bism_aggregates.CONTAINEE_ID%type,p_aggregate_info bism_aggregates.AGGREGATE_INFO%type);
120 function list_bindings(p_fid bism_objects.FOLDER_ID%type,p_subid bism_subjects.SUBJECT_ID%type) return myrctype;
121 procedure rebind(p_creator bism_subjects.SUBJECT_NAME%type,
122                  p_modifier bism_subjects.SUBJECT_NAME%type,
123                  p_subject_id bism_subjects.SUBJECT_ID%type,
124                  p_visible bism_objects.USER_VISIBLE%type,
125                  p_obj_type_id bism_objects.OBJECT_TYPE_ID%type,
126                  p_version bism_objects.VERSION%type,
127                  p_time_created bism_objects.TIME_DATE_CREATED%type,
128                  p_time_modified bism_objects.TIME_DATE_MODIFIED%type,
129                  p_oid bism_objects.OBJECT_ID%type,
130                  p_container_id bism_objects.CONTAINER_ID%type,
131                  p_fid bism_objects.FOLDER_ID%type,
132                  p_obj_name bism_objects.OBJECT_NAME%type,
133                  p_title bism_objects.TITLE%type,
134                  p_application bism_objects.APPLICATION%type,
135                  p_database bism_objects.DATABASE%type,
136                  p_desc bism_objects.DESCRIPTION%type,
137                  p_keywords bism_objects.KEYWORDS%type,
138                  p_xml bism_objects.XML%type,
139                  p_appsubtype1 bism_objects.APPLICATION_SUBTYPE1%type,
140                  p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
141                  p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
142                  p_compsubtype3 bism_objects.COMP_SUBTYPE3%type);
143 procedure rebind(p_creator bism_subjects.SUBJECT_NAME%type,
144                  p_modifier bism_subjects.SUBJECT_NAME%type,
145                  p_subject_id bism_subjects.SUBJECT_ID%type,
146                  p_visible bism_objects.USER_VISIBLE%type,
147                  p_obj_type_id bism_objects.OBJECT_TYPE_ID%type,
148                  p_version bism_objects.VERSION%type,
149                  p_time_created bism_objects.TIME_DATE_CREATED%type,
150                  p_time_modified bism_objects.TIME_DATE_MODIFIED%type,
151                  p_oid bism_objects.OBJECT_ID%type,
152                  p_container_id bism_objects.CONTAINER_ID%type,
153                  p_fid bism_objects.FOLDER_ID%type,
154                  p_obj_name bism_objects.OBJECT_NAME%type,
155                  p_title bism_objects.TITLE%type,
156                  p_application bism_objects.APPLICATION%type,
157                  p_database bism_objects.DATABASE%type,
158                  p_desc bism_objects.DESCRIPTION%type,
159                  p_keywords bism_objects.KEYWORDS%type,
160                  p_xml bism_objects.XML%type,
161                  p_appsubtype1 bism_objects.APPLICATION_SUBTYPE1%type,
162                  p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
163                  p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
164                  p_compsubtype3 bism_objects.COMP_SUBTYPE3%type,
165                  p_ext_attrs_clob CLOB,
166                  p_time_last_loaded bism_objects.TIME_DATE_LAST_ACCESSED%type,
167                  p_aggregate_info bism_aggregates.AGGREGATE_INFO%type,
168                  p_obj_is_top_level varchar2);
169 /* new methods for object level security */
170 function add_entries(oid in raw,acllist in out nocopy bism_acl_obj_t,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2) return bism_acl_obj_t;
171 procedure add_entries_30(oid in raw,acllist in CLOB,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2, aclseparator in varchar2);
172 function remove_entries(oid in raw,acllist in out nocopy bism_acl_obj_t,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2) return bism_chararray_t;
173 function remove_entries_30(oid in raw,acllist in out nocopy CLOB,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2, aclseparator in varchar2) return varchar2;
174 function set_entries(oid in raw,acllist in out nocopy bism_acl_obj_t,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2) return bism_acl_obj_t;
175 procedure set_entries_30(oid in raw,acllist in out nocopy CLOB,myid in raw,cascade_to_subfolders in varchar2,cascade_to_objs in varchar2,topfolder in varchar2,isfolder in varchar2, aclseparator in varchar2);
176 function check_lookup_access(oid raw,objtype number,visible varchar2,myid raw) return varchar2;
177 function check_del_access_for_folder(fid raw,myid raw) return varchar2;
178 function check_obj_del_access(oid raw,fid raw,myid raw) return varchar2;
179 function get_privilege(oid raw, myid raw) return number;
180 function prepare_rebind(fid raw,folder_path varchar2,oname varchar2,myid raw,ids out nocopy bism_object_ids, current_time out nocopy date,num number,status out nocopy integer,parentid out nocopy raw) return raw;
181 function prepare_rebind_30(fid raw,folder_path varchar2,oname varchar2,myid raw,ids out nocopy raw, current_time out nocopy date,num number,status out nocopy integer,parentid out nocopy raw) return raw;
182 procedure lookup_folder_wo_security(fid raw,path varchar2,a_objid out nocopy raw,myid raw,startpos in out nocopy integer);
183 function create_subcontext_30(p_tempTimeC bism_objects.time_date_created%type,
184                               p_tempTimeM bism_objects.time_date_modified%type,
185                               p_oid bism_objects.object_id%type,
186                               p_creator bism_subjects.subject_name%type,
190                               p_version bism_objects.VERSION%type,
187                               p_modifier bism_subjects.subject_name%type,
188                               p_fid bism_objects.folder_id%type,
189                               p_subid bism_subjects.subject_id%type,
191                               p_object_name bism_objects.object_name%type,
192                               p_title bism_objects.title%type,
193                               p_application bism_objects.application%type,
194                               p_database bism_objects.database%type,
195                               p_desc bism_objects.description%type,
196                               p_keywords bism_objects.keywords%type,
197                               p_appsubtype1 bism_objects.application_subtype1%type,
198                               p_compsubtype1 bism_objects.COMP_SUBTYPE1%type,
199                               p_compsubtype2 bism_objects.COMP_SUBTYPE2%type,
200                               p_compsubtype3 bism_objects.COMP_SUBTYPE3%type,
201                               p_extAttrs_clob CLOB) return bism_objects.object_id%type;
202 
203 function list_dependents(p_fid bism_objects.FOLDER_ID%type, p_objname varchar2, p_myid raw) return myrctype;
204 procedure update_attribute(a_fid raw,a_obj_name varchar2,a_attr_name varchar2, a_attr_val varchar2, a_sub_id raw);
205 procedure update_date_attribute(a_fid raw,a_obj_name varchar2,a_attr_name varchar2, a_attr_val date, a_sub_id raw);
206 procedure update_attribute(a_fid raw,a_obj_name varchar2,a_ext_attr_xml varchar2, a_sub_id raw);
207 procedure set_auto_commit(p_val varchar2);
208 v_auto_commit BOOLEAN := TRUE;
209 
210 CURSOR obj_ids_cursor(cid raw,myid raw) IS
211 SELECT T.USER_VISIBLE, T.OBJECT_TYPE_ID, T.OBJECT_ID
212     from
213 	(
214 	SELECT A.USER_VISIBLE, A.OBJECT_TYPE_ID, A.OBJECT_ID
215     from bism_objects A,
216     (
217     /* 3. distinct is required because there may be diamond relationships in the hierarchy
218     and if so, we only want to fetch it once */
219     /* 4. container_id = '30' is important because an object may have multiple containers
220     in which case we end up fetching those rows as well, which is useless
221     */
222     select distinct containee_id,container_id,aggregate_info from bism_aggregates start with containee_id = cid and container_id='30' connect by container_id = prior containee_id
223     )
224     T1
225     /* 5. fetch only the required object hierarchy */
226     where A.object_id=T1.containee_id
227     )
228     T
229     /* 6. the foll. security check is not needed, because lookuphelper the function that was
230     called before this stmt gets executed has indeed checked for lookup_access
231     but dropping this check does not seem to improve perf. so I am leaving it in
232     for now */
233     where
234     'y' = bism_core.check_lookup_access(T.object_id, T.object_type_id, T.USER_VISIBLE, myid);
235 
236 end  bism_core;