Mercurial > dive4elements > river
comparison flys-artifacts/doc/conf/meta-data-user.xml @ 1019:aff2a0a29aa3
Datacage: use more compatible casts to UUIDs
flys-artifacts/trunk@2465 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Thu, 04 Aug 2011 15:32:10 +0000 |
parents | d42fa223be48 |
children | 3d36e6000915 |
comparison
equal
deleted
inserted
replaced
1018:d42fa223be48 | 1019:aff2a0a29aa3 |
---|---|
5 User specific part | 5 User specific part |
6 ------------------ | 6 ------------------ |
7 </dc:comment> | 7 </dc:comment> |
8 <dc:if test="dc:contains($parameters, 'user-id')"> | 8 <dc:if test="dc:contains($parameters, 'user-id')"> |
9 <dc:context connection="user"> | 9 <dc:context connection="user"> |
10 <dc:statement>SELECT id as user_id FROM users WHERE gid = ${user-id}::uuid</dc:statement> | 10 <dc:statement>SELECT id as user_id FROM users WHERE gid = CAST(${user-id} AS uuid)</dc:statement> |
11 <dc:elements> | 11 <dc:elements> |
12 <dc:context> | 12 <dc:context> |
13 <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement> | 13 <dc:statement>SELECT id AS collection_id FROM collections WHERE user_id = ${user_id}</dc:statement> |
14 <dc:elements> | 14 <dc:elements> |
15 <dc:context> | 15 <dc:context> |
16 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid as a_gid FROM | 16 <dc:statement>SELECT a.id AS a_id, a.state AS a_state, a.gid as a_gid FROM |
17 collection_items ci JOIN artifacts a ON ci.artifact_id = a.id | 17 collection_items ci JOIN artifacts a ON ci.artifact_id = a.id |
18 WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid <> ${artifact-id}::uuid | 18 WHERE collection_id = ${collection_id} AND a.state = ${current-state-id} AND a.gid <> CAST(${artifact-id} AS uuid) |
19 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river}) | 19 AND EXISTS (SELECT id FROM artifact_data WHERE artifact_id = a.id AND k = 'river' AND v = ${river}) |
20 </dc:statement> | 20 </dc:statement> |
21 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment> | 21 <dc:comment> --- TODO: We only need the 'master' artifacts! --- </dc:comment> |
22 <dc:elements> | 22 <dc:elements> |
23 <dc:choose> | 23 <dc:choose> |