Skip to content

Commit

Permalink
bs2:RowContent mode sets @data-content-graph on content, client-s…
Browse files Browse the repository at this point in the history
…ide `ldh:LoadContent` template uses is at request URI
  • Loading branch information
namedgraph committed Nov 12, 2023
1 parent ce5f361 commit ab2f62c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ exclude-result-prefixes="#all"
<xsl:variable name="this" select="ancestor::div[@about][1]/@about" as="xs:anyURI"/>
<xsl:variable name="content-uri" select="(@about, $this)[1]" as="xs:anyURI"/> <!-- fallback to @about for charts, queries etc. -->
<xsl:variable name="content-value" select="ixsl:get(., 'dataset.contentValue')" as="xs:anyURI"/> <!-- get the value of the @data-content-value attribute -->
<xsl:variable name="graph" select="if (ixsl:contains(., 'dataset.contentGraph')) then xs:anyURI(ixsl:get(., 'dataset.contentGraph')) else ac:absolute-path(base-uri())" as="xs:anyURI"/> <!-- get the value of the @data-content-graph attribute -->
<xsl:variable name="mode" select="if (ixsl:contains(., 'dataset.contentMode')) then xs:anyURI(ixsl:get(., 'dataset.contentMode')) else ()" as="xs:anyURI?"/> <!-- get the value of the @data-content-mode attribute -->
<xsl:variable name="container" select="." as="element()"/>
<xsl:variable name="progress-container" select="if (contains-token(@class, 'row-fluid')) then ./div[contains-token(@class, 'main')] else ." as="element()"/>
Expand All @@ -1049,7 +1050,7 @@ exclude-result-prefixes="#all"
</xsl:result-document>
</xsl:for-each>

<xsl:variable name="request-uri" select="ldh:href($ldt:base, ac:absolute-path(base-uri()), map{}, $content-value)" as="xs:anyURI"/>
<xsl:variable name="request-uri" select="ldh:href($ldt:base, $graph, map{}, $content-value)" as="xs:anyURI"/>
<xsl:variable name="request" as="item()*">
<ixsl:schedule-action http-request="map{ 'method': 'GET', 'href': ac:document-uri($request-uri), 'headers': map{ 'Accept': 'application/rdf+xml' } }">
<xsl:call-template name="onContentValueLoad">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -770,6 +770,7 @@ extension-element-prefixes="ixsl"
<xsl:template match="*[@rdf:about][rdf:type/@rdf:resource = '&ldh;Content'][rdf:value/@rdf:resource]" mode="bs2:RowContent" priority="2">
<xsl:param name="id" select="if (contains(@rdf:about, ac:absolute-path(base-uri()) || '#')) then substring-after(@rdf:about, ac:absolute-path(base-uri()) || '#') else generate-id()" as="xs:string?"/>
<xsl:param name="class" select="'row-fluid content resource-content'" as="xs:string?"/>
<xsl:param name="graph" select="sd:graph/@rdf:resource" as="xs:anyURI?"/>
<xsl:param name="mode" select="ac:mode/@rdf:resource" as="xs:anyURI?"/>
<xsl:param name="left-class" select="'left-nav span2'" as="xs:string?"/>
<xsl:param name="main-class" select="'main span7'" as="xs:string?"/>
Expand All @@ -786,6 +787,9 @@ extension-element-prefixes="ixsl"
<xsl:if test="$class">
<xsl:attribute name="class" select="$class"/>
</xsl:if>
<xsl:if test="$graph">
<xsl:attribute name="data-content-graph" select="$graph"/>
</xsl:if>
<xsl:if test="$mode">
<xsl:attribute name="data-content-mode" select="$mode"/>
</xsl:if>
Expand Down

0 comments on commit ab2f62c

Please sign in to comment.