source: trunk/src/core/net/sf/basedb/core/filter-def.hbm.xml @ 3905

Last change on this file since 3905 was 3905, checked in by Nicklas Nordborg, 14 years ago

Fixes #810: Implement query options for Include.ANNOTATED and Include.NOT_ANNOTATED

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 5.5 KB
Line 
1<?xml version="1.0"?>
2<!DOCTYPE hibernate-mapping PUBLIC
3    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
4    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
5<!--
6  $Id: filter-def.hbm.xml 3905 2007-11-05 09:59:06Z nicklas $
7
8  Copyright (C) 2005 Nicklas Nordborg
9  Copyright (C) 2006 Jari Hakkinen
10
11  This file is part of BASE - BioArray Software Environment.
12  Available at http://base.thep.lu.se/
13
14  BASE is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18
19  BASE is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  GNU General Public License for more details.
23
24  You should have received a copy of the GNU General Public License
25  along with this program; if not, write to the Free Software
26  Foundation, Inc., 59 Temp le Place - Suite 330,
27  Boston, MA  02111-1307, USA.
28-->
29<!--
30  This XML file contains predefined filters used
31  by queries for filtering out items to which the logged
32  in user doesn't have access. The actual filter expressions are
33  added to the configuration by HibernateUtil.addFilterConditions().
34  The filter are applied at runtime by classes created by the
35  QueryRuntimeFilterFactory.
36-->
37<hibernate-mapping>
38  <!--
39    Do not return any items, since the user has been denied
40    to all of them.
41  -->
42  <filter-def name="denyAll">
43  </filter-def>
44
45  <!--
46    Filter Removable items on the isRemoved status
47    Typical condition is ":removed = removed"
48  -->
49  <filter-def name="isRemoved">
50    <filter-param name="removed" type="boolean" />
51  </filter-def>
52 
53  <!--
54    Filter Annotatable items on the presense/absense of annotations
55    Typical condition is ":annotated = (`annotationset_id` IS NULL)"
56  -->
57  <filter-def name="isAnnotated">
58    <filter-param name="annotated" type="boolean" />
59  </filter-def>
60 
61  <!--
62    Filter Ownable items on the owner to only return
63    items owned by the logged in user.
64    Typical condition is ":owner = owner"
65  -->
66  <filter-def name="ownedBy">
67    <filter-param name="owner" type="int" />
68  </filter-def>
69
70  <!--
71    Filter Ownable items on the owner to only return
72    items NOT owned by the logged in user.
73    Typical condition is ":owner != owner"
74  -->
75  <filter-def name="notOwnedBy">
76    <filter-param name="owner" type="int" />
77  </filter-def>
78
79  <!--
80    Filter items on the id to only return
81    items that the logged in user is a member of.
82    Typical condition is ":owner != owner AND id IN (:items)"
83  -->
84  <filter-def name="memberOf">
85    <filter-param name="owner" type="int" />
86    <filter-param name="items" type="int" />
87  </filter-def>
88 
89  <!--
90    Filter items on the owner and id
91    to only return items where the logged in user is the owner or
92    a member. 
93    Typical condition is ":owner = owner OR id IN (:items)"
94  -->
95  <filter-def name="ownedByOrMemberOf">
96    <filter-param name="owner" type="int" />
97    <filter-param name="items" type="int" />
98  </filter-def>
99
100  <!--
101    Filter Shareable items on the item key to only return
102    items that are shared to the logged in user.
103    Typical condition is ":owner != owner AND itemkey_id IN (:itemKeys)"
104  -->
105  <filter-def name="sharedTo">
106    <filter-param name="owner" type="int" />
107    <filter-param name="itemKeys" type="int" />
108  </filter-def>
109
110  <!--
111    Filter Shareable items on the owner and item key
112    to only return items owned by or shared to
113    the logged in user
114    Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys)"
115  -->
116  <filter-def name="ownedByOrSharedTo">
117    <filter-param name="owner" type="int" />
118    <filter-param name="itemKeys" type="int" />
119  </filter-def>
120
121  <!--
122    Filter Shareable items on the active project
123    to only return items shared to the active project.
124    Typical condition is "projectkey_id IN (:projectKeys)"
125  -->
126  <filter-def name="inProject">
127    <filter-param name="owner" type="int" />
128    <filter-param name="projectKeys" type="int" />
129  </filter-def>
130
131  <!--
132    Filter Shareable items on the owner and the active project
133    to only return items owned by logged in user or shared to
134    the active project.
135    Typical condition is ":owner = owner OR projectkey_id IN (:projectKeys)"
136  -->
137  <filter-def name="ownedByOrInProject">
138    <filter-param name="owner" type="int" />
139    <filter-param name="projectKeys" type="int" />
140  </filter-def>
141
142  <!--
143    Filter Shareable items on the item key and the active project
144    to only return items shared to the logged in user or to
145    the active project.
146    Typical condition is "(:owner != owner AND itemkey_id IN (:itemKeys)) OR projectkey_id IN (:projectKeys)"
147  -->
148  <filter-def name="sharedToOrInProject">
149    <filter-param name="owner" type="int" />
150    <filter-param name="itemKeys" type="int" />
151    <filter-param name="projectKeys" type="int" />
152  </filter-def>
153
154  <!--
155    Filter Shareable items on the owner, item key and the active project
156    to only return items owned by or shared to the logged in user, or shared to
157    the active project.
158    Typical condition is ":owner = owner OR itemkey_id IN (:itemKeys) OR projectkey_id IN (:projectKeys)"
159  -->
160  <filter-def name="ownedByOrSharedToOrInProject">
161    <filter-param name="owner" type="int" />
162    <filter-param name="itemKeys" type="int" />
163    <filter-param name="projectKeys" type="int" />
164  </filter-def>
165
166  <!--
167    Filter News on todays date.
168    Typical condition is ":today >= start_date AND (:today <= end_date OR end_date IS NULL)"
169  -->
170  <filter-def name="todaysNews">
171    <filter-param name="today" type="date" />
172  </filter-def>
173</hibernate-mapping>
Note: See TracBrowser for help on using the repository browser.