comparison artifacts/doc/conf/meta-data.xml @ 6110:5ba28b563614

Fix datacage for user data by adding facet filtering. Now the facets are joined in the user data select statement and afterwards we just filter on the facet name where previously new queryies were created. Grouping also fixes the repeating folders caused by the change in the statements during the large perfomance cleanup.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 27 May 2013 15:36:56 +0200
parents 96b5066ab55e
children 6815714c1f97
comparison
equal deleted inserted replaced
6109:2a4ff87ef357 6110:5ba28b563614
388 </dc:call-macro> 388 </dc:call-macro>
389 </dc:macro> 389 </dc:macro>
390 390
391 <!-- Macros to load user data --> 391 <!-- Macros to load user data -->
392 392
393 <dc:macro name="select-facets">
394 <!-- FIXME : this is broken now! -->
395 <dc:context>
396 <dc:statement>
397 SELECT a.gid AS aid,
398 f.id AS fid,
399 f.name AS facet_name,
400 f.num AS facet_num,
401 f.description AS facet_description
402 FROM artifacts a
403 JOIN outs o ON o.artifact_id = a.id
404 JOIN facets f ON f.out_id = o.id
405 WHERE a.id = ${a_id}
406 AND f.name = ${facet_type}
407 </dc:statement>
408 <dc:if test="dc:has-result()">
409 <dc:macro-body/>
410 </dc:if>
411 </dc:context>
412 </dc:macro>
413
414 <dc:macro name="differences"> 393 <dc:macro name="differences">
415 <dc:variable name="facet_type" value="w_differences"/> 394 <dc:filter expr="$facet_name = 'w_differences'">
416 <dc:call-macro name="select-facets"> 395 <dc:if test="dc:has-result()">
417 <differences> 396 <differences>
418 <dc:for-each> 397 <dc:for-each>
419 <w_differences 398 <w_differences
420 description="{$facet_description}" 399 description="{$facet_description}"
421 factory="winfo" 400 factory="winfo"
422 artifact-id="{$aid}" 401 artifact-id="{$aid}"
423 ids="{$aid}" 402 ids="{$aid}"
424 out="w_differences"/> 403 out="w_differences"/>
425 </dc:for-each> 404 </dc:for-each>
426 </differences> 405 </differences>
427 </dc:call-macro> 406 </dc:if>
407 </dc:filter>
428 </dc:macro> 408 </dc:macro>
429 409
430 <dc:macro name="reference-curves"> 410 <dc:macro name="reference-curves">
431 <dc:variable name="facet_type" value="reference_curve"/> 411 <dc:variable name="facet_type" value="reference_curve"/>
432 <dc:call-macro name="select-facets"> 412 <dc:call-macro name="select-facets">

http://dive4elements.wald.intevation.org