miguelm
committed
on 13 Jun 05
file settings.adp was added on branch oacs-5-2 on 2005-11-30 15:31:02 +0000
oacs-5-2:miguelm:20050613072236:1
openacs-4/.../contacts/www/searches.xql (deleted)
1   <?xml version="1.0"?>
2   <queryset>
3  
4   <fullquery name="select_owner_options">
5         <querytext>
6         select CASE WHEN owner_id = :user_id
7                     THEN '\#contacts.My_Searches\#'
8                     ELSE contact__name(owner_id) END,
9                owner_id
10           from ( select distinct owner_id
11                    from contact_searches
12                   where ( title is not null or owner_id = :user_id )
13                     and owner_id in ( select party_id from parties )) distinct_owners
14           order by CASE WHEN owner_id = :user_id THEN '0000000000000000000' ELSE upper(contact__name(owner_id)) END
15         </querytext>
16   </fullquery>
17  
18   <fullquery name="select_searches">
19         <querytext>
20   (    select search_id, title, upper(title) as order_title, all_or_any, object_type
21          from contact_searches
22         where owner_id = :owner_id
23           and title is not null
24           and not deleted_p
25   ) union (
26        select search_id, 'Search \#' || to_char(search_id,'FM9999999999999999999') || ' on ' || to_char(creation_date,'Mon FMDD') as title, 'zzzzzzzzzzz' as order_title, all_or_any, contact_searches.object_type
27          from contact_searches, acs_objects
28         where owner_id = :owner_id
29           and search_id = object_id
30           and contact_searches.title is null
31           and not deleted_p
32         limit 10
33   )
34         order by order_title
35         </querytext>
36   </fullquery>
37  
38   <fullquery name="get_saved_p">
39       <querytext>
40           select
41                   aggregated_attribute
42           from
43                   contact_searches
44           where
45                   search_id = :search_id
46                   and aggregated_attribute is not null
47       </querytext>
48   </fullquery>
49  
50   </queryset>