Skip to content

Commit 5238b00

Browse files
committed
Fixing container mode for queries
1 parent 21adada commit 5238b00

File tree

1 file changed

+18
-28
lines changed
  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block

1 file changed

+18
-28
lines changed

src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client/block/query.xsl

Lines changed: 18 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ exclude-result-prefixes="#all"
289289
<xsl:sequence select="$request[current-date() lt xs:date('2000-01-01')]"/>
290290
</xsl:template>
291291

292-
<!-- toggle query results to chart mode (prioritize over container.xsl) -->
292+
<!-- toggle query results to chart mode (prioritize over view.xsl) -->
293293

294294
<xsl:template match="ul[contains-token(@class, 'nav-tabs')][contains-token(@class, 'nav-query-results')]/li[contains-token(@class, 'chart-mode')][not(contains-token(@class, 'active'))]/a" mode="ixsl:onclick" priority="1">
295295
<xsl:variable name="container" select="ancestor::div[@typeof][1]" as="element()"/>
@@ -309,7 +309,7 @@ exclude-result-prefixes="#all"
309309
<xsl:apply-templates select="$form" mode="ixsl:onsubmit"/>
310310
</xsl:template>
311311

312-
<!-- toggle query results to container mode (prioritize over container.xsl) -->
312+
<!-- toggle query results to container mode (prioritize over view.xsl) -->
313313

314314
<xsl:template match="ul[contains-token(@class, 'nav-tabs')][contains-token(@class, 'nav-query-results')]/li[contains-token(@class, 'container-mode')][not(contains-token(@class, 'active'))]/a" mode="ixsl:onclick" priority="1">
315315
<xsl:variable name="block" select="ancestor::div[contains-token(@class, 'block')][1]" as="element()"/>
@@ -323,31 +323,21 @@ exclude-result-prefixes="#all"
323323
<xsl:variable name="endpoint" select="($service/sd:endpoint/@rdf:resource/xs:anyURI(.), sd:endpoint())[1]" as="xs:anyURI"/>
324324
<xsl:variable name="query-id" select="'id' || ac:uuid()" as="xs:string"/>
325325
<xsl:variable name="query-uri" select="xs:anyURI(ac:absolute-path(ldh:base-uri(.)) || '#' || $query-id)" as="xs:anyURI"/>
326-
<xsl:variable name="query-type" select="ldh:query-type($query-string)" as="xs:string?"/>
327-
<xsl:variable name="forClass" select="xs:anyURI('&sp;' || upper-case(substring($query-type, 1, 1)) || lower-case(substring($query-type, 2)))" as="xs:anyURI"/>
326+
<xsl:variable name="query-form" select="ldh:query-type($query-string)" as="xs:string?"/>
327+
<xsl:variable name="query-type" select="xs:anyURI('&sp;' || upper-case(substring($query-form, 1, 1)) || lower-case(substring($query-form, 2)))" as="xs:anyURI"/>
328328
<xsl:variable name="block-id" select="'id' || ac:uuid()" as="xs:string"/>
329-
<xsl:variable name="block-uri" select="xs:anyURI(ac:absolute-path(ldh:base-uri(.)) || '#' || $block-id)" as="xs:anyURI"/>
330-
<xsl:variable name="constructor" as="document-node()">
329+
<xsl:variable name="block-uri" select="if ($block/@about) then $block/@about else xs:anyURI(ac:absolute-path(ldh:base-uri(.)) || '#' || $block-id)" as="xs:anyURI"/>
330+
<xsl:variable name="constructor" as="document-node()"> <!-- make sure the structure will match the ldh:RenderRow pattern in view.xsl -->
331331
<xsl:document>
332-
<rdf:RDF>
333-
<rdf:Description rdf:about="{$query-uri}">
334-
<rdf:type rdf:resource="&sp;Query"/>
335-
<rdf:type rdf:resource="{$forClass}"/>
336-
<!-- <dct:title><xsl:value-of select="$title-input/ixsl:get(., 'value')"/></dct:title>-->
337-
<sp:text rdf:datatype="&xsd;string"><xsl:value-of select="$query-string"/></sp:text>
338-
339-
<xsl:if test="$service-uri">
340-
<ldh:service rdf:resource="$service-uri"/>
341-
</xsl:if>
342-
</rdf:Description>
343-
<rdf:Description rdf:about="{$block-uri}">
344-
<rdf:type rdf:resource="&ldh;View"/>
345-
<spin:query rdf:resource="{$query-uri}"/>
346-
</rdf:Description>
347-
</rdf:RDF>
332+
<div about="{$block-uri}" typeof="&ldh;View">
333+
<div property="&spin;query" resource="{$query-uri}"/>
334+
</div>
348335
</xsl:document>
349336
</xsl:variable>
350-
<xsl:variable name="value" select="$constructor//*[@rdf:about = $block-uri]" as="element()"/>
337+
<!-- <xsl:variable name="view" select="$constructor//*[@rdf:about = $block-uri]" as="element()"/>-->
338+
<xsl:variable name="this" select="ancestor::div[@about][1]/@about" as="xs:anyURI"/> <!-- not the same as $block-uri! -->
339+
<xsl:message>$block-uri: <xsl:value-of select="$block-uri"/> $block-uri: <xsl:value-of select="$block-uri"/></xsl:message>
340+
<xsl:message>$constructor: <xsl:value-of select="serialize($constructor)"/></xsl:message>
351341

352342
<!-- deactivate other tabs -->
353343
<xsl:for-each select="../../li">
@@ -360,18 +350,18 @@ exclude-result-prefixes="#all"
360350

361351
<ixsl:set-style name="cursor" select="'progress'" object="ixsl:page()//body"/>
362352

363-
<!-- create new cache entry using content URI as key -->
353+
<!-- create new cache entry using content URI as key
364354
<ixsl:set-property name="{'`' || $block-uri || '`'}" select="ldh:new-object()" object="ixsl:get(ixsl:window(), 'LinkedDataHub.contents')"/>
365-
<!-- store this content element -->
366-
<ixsl:set-property name="content" select="$value" object="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $block-uri || '`')"/>
355+
store this content element
356+
<ixsl:set-property name="content" select="$value" object="ixsl:get(ixsl:get(ixsl:window(), 'LinkedDataHub.contents'), '`' || $block-uri || '`')"/>-->
367357

368358
<xsl:for-each select="$block//div[contains-token(@class, 'bar')]">
369359
<!-- update progress bar -->
370360
<ixsl:set-style name="width" select="'50%'" object="."/>
371361
</xsl:for-each>
372362

373-
<xsl:apply-templates select="$value" mode="ldh:RenderRow">
374-
<xsl:with-param name="this" select="ancestor::div[@about][1]/@about"/> <!-- not the same as $block-uri! -->
363+
<xsl:apply-templates select="$constructor" mode="ldh:RenderRow">
364+
<xsl:with-param name="this" select="$this"/>
375365
<xsl:with-param name="container" select="$container//div[contains-token(@class, 'sparql-query-results')]"/>
376366
<xsl:with-param name="block-uri" select="$block-uri"/>
377367
<xsl:with-param name="base-uri" select="ac:absolute-path(ldh:base-uri(.))"/>

0 commit comments

Comments
 (0)