1 package body ad_ctx_ddl as
2 /* $Header: adctxpkg.sql 120.2 2005/08/04 03:59:42 appldev ship $ */
3 v_context varchar2(30) := sys_context('USERENV','CURRENT_USER');
4 procedure add_attr_section (group_name in varchar2,
5 section_name in varchar2,
6 tag in varchar2)
7 is
8
9 begin
10 if group_name like '%.%' then
11 ctx_ddl.add_attr_section(group_name, section_name, tag);
12 else
13 ctx_ddl.add_attr_section( v_context||'.'||group_name, section_name, tag);
14 end if;
15 end add_attr_section;
16 procedure add_field_section (group_name in varchar2,
17 section_name in varchar2,
18 tag in varchar2,
19 visible in boolean default FALSE)
20 is
21
22 begin
23
24 if group_name like '%.%' then
25 ctx_ddl.add_field_section(group_name, section_name, tag, visible);
26 else
27 ctx_ddl.add_field_section( v_context||'.'||group_name, section_name, tag, visible);
28 end if;
29 end add_field_section;
30 procedure add_index (set_name in varchar2,
31 column_list in varchar2,
32 storage_clause in varchar2 default null)
33 is
34
35 begin
36
37 if set_name like '%.%' then
38 ctx_ddl.add_index(set_name, column_list,storage_clause);
39 else
40 ctx_ddl.add_index( v_context||'.'||set_name, column_list, storage_clause);
41 end if;
42 end add_index;
43 procedure add_special_section (group_name in varchar2,
44 section_name in varchar2)
45 is
46
47 begin
48 if group_name like '%.%' then
49 ctx_ddl.add_special_section(group_name, section_name);
50 else
51 ctx_ddl.add_special_section( v_context||'.'||group_name, section_name);
52 end if;
53 end add_special_section;
54 procedure add_stopclass (stoplist_name in varchar2,
55 stopclass in varchar2)
56 is
57
58 begin
59
60 if stoplist_name like '%.%' then
61 ctx_ddl.add_stopclass(stoplist_name, stopclass);
62 else
63 ctx_ddl.add_stopclass( v_context||'.'||stoplist_name, stopclass);
64 end if;
65 end add_stopclass;
66 procedure add_stoptheme (stoplist_name in varchar2,
67 stoptheme in varchar2)
68 is
69
70 begin
71
72 if stoplist_name like '%.%' then
73 ctx_ddl.add_stoptheme(stoplist_name, stoptheme);
74 else
75 ctx_ddl.add_stoptheme( v_context||'.'||stoplist_name, stoptheme);
76 end if;
77 end add_stoptheme;
78 procedure add_stopword (stoplist_name in varchar2,
79 stopword in varchar2,
80 language in varchar2 default null)
81 is
82
83 begin
84
85 if stoplist_name like '%.%' then
86 ctx_ddl.add_stopword(stoplist_name, stopword, language);
87 else
88 ctx_ddl.add_stopword( v_context||'.'||stoplist_name, stopword, language);
89 end if;
90 end add_stopword;
91 procedure add_stop_section (group_name in varchar2,
92 tag in varchar2)
93 is
94
95 begin
96
97 if group_name like '%.%' then
98 ctx_ddl.add_stop_section(group_name, tag);
99 else
100 ctx_ddl.add_stop_section( v_context||'.'||group_name, tag);
101 end if;
102 end add_stop_section;
103 procedure add_sub_lexer (lexer_name in varchar2,
104 language in varchar2,
105 sub_lexer in varchar2,
106 alt_value in varchar2 default null)
107 is
108
109 v_sublexer varchar2(50);
110 begin
111
112 v_sublexer := v_context||'.'||sub_lexer;
113 if lexer_name like '%.%' or sub_lexer like '%.%' then
114 ctx_ddl.add_sub_lexer(lexer_name, language, sub_lexer, alt_value);
115 else
116 ctx_ddl.add_sub_lexer( v_context||'.'||lexer_name, language, v_sublexer, alt_value);
117 end if;
118 end add_sub_lexer;
119 procedure add_zone_section (group_name in varchar2,
120 section_name in varchar2,
121 tag in varchar2)
122 is
123
124 begin
125
126 if group_name like '%.%' then
127 ctx_ddl.add_zone_section(group_name, section_name, tag);
128 else
129 ctx_ddl.add_zone_section( v_context||'.'||group_name, section_name, tag);
130 end if;
131 end add_zone_section;
132 procedure create_index_set (set_name in varchar2)
133 is
134
135 begin
136
137 if set_name like '%.%' then
138 ctx_ddl.create_index_set(set_name);
139 else
140 ctx_ddl.create_index_set( v_context||'.'||set_name);
141 end if;
142 end create_index_set;
143 procedure create_preference (preference_name in varchar2,
144 object_name in varchar2)
145 is
146
147 begin
148
149 if preference_name like '%.%' then
150 ctx_ddl.create_preference(preference_name, object_name);
151 else
152 ctx_ddl.create_preference(v_context||'.'||preference_name, object_name);
153 end if;
154 end create_preference;
155 procedure create_section_group (group_name in varchar2,
156 group_type in varchar2)
157 is
158
159 begin
160
161 if group_name like '%.%' then
162 ctx_ddl.create_section_group(group_name, group_type);
163 else
164 ctx_ddl.create_section_group( v_context||'.'||group_name, group_type);
165 end if;
166 end create_section_group;
167 procedure create_stoplist (stoplist_name in varchar2,
168 stoplist_type in varchar2 default 'BASIC_STOPLIST')
169 is
170
171 begin
172
173 if stoplist_name like '%.%' then
174 ctx_ddl.create_stoplist(stoplist_name, stoplist_type);
175 else
176 ctx_ddl.create_stoplist( v_context||'.'||stoplist_name, stoplist_type);
177 end if;
178 end create_stoplist;
179 procedure drop_index_set (set_name in varchar2)
180 is
181
182 begin
183 if set_name like '%.%' then
184 ctx_ddl.drop_index_set(set_name);
185 else
186 ctx_ddl.drop_index_set( v_context||'.'||set_name);
187 end if;
188 end drop_index_set;
189 procedure drop_preference (preference_name in varchar2)
190 is
191
192 begin
193
194 if preference_name like '%.%' then
195 ctx_ddl.drop_preference(preference_name);
196 else
197 ctx_ddl.drop_preference(v_context||'.'||preference_name);
198 end if;
199 end drop_preference;
200 procedure drop_section_group (group_name in varchar2)
201 is
202
203 begin
204 if group_name like '%.%' then
205 ctx_ddl.drop_section_group(group_name);
206 else
207 ctx_ddl.drop_section_group( v_context||'.'||group_name);
208 end if;
209 end drop_section_group;
210 procedure drop_stoplist (stoplist_name in varchar2)
211 is
212
213 begin
214
215 if stoplist_name like '%.%' then
216 ctx_ddl.drop_stoplist(stoplist_name);
217 else
218 ctx_ddl.drop_stoplist( v_context||'.'||stoplist_name);
219 end if;
220 end drop_stoplist;
221 procedure optimize_index (idx_name in varchar2,
222 optlevel in varchar2,
223 maxtime in number default null,
224 token in varchar2 default null)
225 is
226
227 begin
228
229 if idx_name like '%.%' then
230 ctx_ddl.optimize_index(idx_name, optlevel, maxtime, token);
231 else
232 ctx_ddl.optimize_index( v_context||'.'||idx_name, optlevel, maxtime, token);
233 end if;
234 end optimize_index;
235 procedure remove_index (set_name in varchar2,
236 column_list in varchar2)
237 is
238 begin
239 if set_name like '%.%' then
240 ctx_ddl.remove_index(set_name, column_list);
241 else
242 ctx_ddl.remove_index( v_context||'.'||set_name, column_list);
243 end if;
244 end remove_index;
245 procedure remove_section (group_name in varchar2,
246 section_name in varchar2)
247 is
248
249 begin
250
251 if group_name like '%.%' then
252 ctx_ddl.remove_section(group_name, section_name);
253 else
254 ctx_ddl.remove_section( v_context||'.'||group_name, section_name);
255 end if;
256 end remove_section;
257 procedure remove_section (group_name in varchar2,
258 section_id in number)
259 is
260
261 begin
262
263 if group_name like '%.%' then
264 ctx_ddl.remove_section(group_name, section_id);
265 else
266 ctx_ddl.remove_section( v_context||'.'||group_name, section_id);
267 end if;
268 end remove_section;
269 procedure remove_stopclass (stoplist_name in varchar2,
270 stopclass in varchar2)
271 is
272
273 begin
274
275 if stoplist_name like '%.%' then
276 ctx_ddl.remove_stopclass(stoplist_name, stopclass);
277 else
278 ctx_ddl.remove_stopclass( v_context||'.'||stoplist_name, stopclass);
279 end if;
280 end remove_stopclass;
281 procedure remove_stoptheme (stoplist_name in varchar2,
282 stoptheme in varchar2)
283 is
284
285 begin
286
287 if stoplist_name like '%.%' then
288 ctx_ddl.remove_stoptheme(stoplist_name, stoptheme);
289 else
290 ctx_ddl.remove_stoptheme( v_context||'.'||stoplist_name, stoptheme);
291 end if;
292 end remove_stoptheme;
293 procedure remove_stopword (stoplist_name in varchar2,
294 stopword in varchar2,
295 language in varchar2 default null)
296 is
297
298 begin
299
300 if stoplist_name like '%.%' then
301 ctx_ddl.remove_stopword(stoplist_name, stopword, language);
302 else
303 ctx_ddl.remove_stopword( v_context||'.'||stoplist_name, stopword, language);
304 end if;
305 end remove_stopword;
306 procedure remove_sub_lexer (lexer_name in varchar2,
307 language in varchar2)
308 is
309
310 begin
311
312 if lexer_name like '%.%' then
313 ctx_ddl.remove_sub_lexer(lexer_name, language);
314 else
315 ctx_ddl.remove_sub_lexer( v_context||'.'||lexer_name, language);
316 end if;
317 end remove_sub_lexer;
318 procedure set_attribute (preference_name in varchar2,
319 attribute_name in varchar2,
320 attribute_value in varchar2)
321 is
322
323 begin
324 if preference_name like '%.%' then
325 ctx_ddl.set_attribute(preference_name, attribute_name, attribute_value);
326 else
327 ctx_ddl.set_attribute(v_context||'.'||preference_name, attribute_name, attribute_value);
328 end if;
329 end set_attribute;
330 procedure sync_index (idx_name in varchar2 default null)
331 is
332
333 begin
334
335 if idx_name like '%.%' then
336 ctx_ddl.sync_index(idx_name);
337 else
338 ctx_ddl.sync_index( v_context||'.'||idx_name);
339 end if;
340 end sync_index;
341 procedure unset_attribute (preference_name in varchar2,
342 attribute_name in varchar2)
343 is
344 begin
345
346 if preference_name like '%.%' then
347 ctx_ddl.unset_attribute(preference_name, attribute_name);
348 else
349 ctx_ddl.unset_attribute( v_context||'.'||preference_name, attribute_name);
350 end if;
351 end unset_attribute;
352 procedure set_effective_schema(user_schema in varchar2)
353 is
354 begin
355 v_context := upper(user_schema);
356 end set_effective_schema;
357 end ad_ctx_ddl;