Project

General

Profile

Bug #2155 » metacat-intersect-new.txt

Matt Jones, 04/13/2007 07:35 AM

 
1
SELECT docid,docname,doctype,date_created, date_updated, rev 
2
      FROM xml_documents 
3
      WHERE docid IN (
4
                      (SELECT DISTINCT docid FROM xml_path_index 
5
                              WHERE 
6
                              (UPPER(nodedata) LIKE '%ORGANIZATION OF BIOLOGICAL FIELD STATIONS%' AND path = 'organizationName')
7
                              AND
8
                              (UPPER(nodedata) LIKE '%SOIL%' AND path IN
9
                                    ('surName', 'givenName','keyword','para','geogrpahicDescription','literalLayout','title',
10
                                     '@packageid','abstract/para')
11
                              )
12
                      )
13
      AND (
14
           docid IN (
15
                        SELECT docid from xml_access 
16
                            WHERE( 
17
                                   (
18
                                     lower(principal_name) = 'public' 
19
                                     AND perm_type = 'allow' 
20
                                     AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
21
                                   )
22
                                   OR 
23
                                   (
24
                                     lower(principal_name) = 'public' 
25
                                     AND perm_type = 'allow' 
26
                                     AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
27
                                   )
28
                                 ) 
29
                            AND subtreeid IS NULL
30
                     ) 
31
          AND docid NOT IN (
32
                             SELECT docid from xml_access 
33
                               WHERE( 
34
                                      (
35
                                        lower(principal_name) = 'public' 
36
                                        AND perm_type = 'deny' 
37
                                        AND perm_order ='allowFirst' 
38
                                        AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
39
                                      )
40
                                      OR 
41
                                      (
42
                                        lower(principal_name) = 'public' 
43
                                        AND perm_type = 'deny' 
44
                                        AND perm_order ='allowFirst' 
45
                                        AND (permission='4' OR permission='5' OR permission='6' OR permission='7')
46
                                       )
47
                                   ) AND subtreeid IS NULL 
48
                             )
49
        )
(5-5/34)