Skip to content

Commit

Permalink
Debug .add-value handler
Browse files Browse the repository at this point in the history
  • Loading branch information
namedgraph committed Aug 10, 2024
1 parent 8bd3c89 commit da3b217
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,18 +307,13 @@ exclude-result-prefixes="#all"
</xsl:for-each>
<xsl:message>ldh:Object ldh:RenderBlock</xsl:message>

<!-- <xsl:for-each select="$container">
<ixsl:set-attribute name="typeof" select="$block-type" object="."/>
</xsl:for-each>-->

<!-- don't use ldh:base-uri(.) because its value comes from the last HTML document load -->
<xsl:variable name="request-uri" select="ldh:href($ldt:base, if (starts-with($graph, $ldt:base)) then $graph else ac:absolute-path(xs:anyURI(ixsl:location())), map{}, ac:document-uri($resource-uri), $graph, ())" as="xs:anyURI"/>
<xsl:variable name="request" as="item()*">
<ixsl:schedule-action http-request="map{ 'method': 'GET', 'href': $request-uri, 'headers': map{ 'Accept': 'application/rdf+xml' } }">
<xsl:call-template name="ldh:LoadBlockObjectValue">
<xsl:with-param name="this" select="$this"/>
<xsl:with-param name="container" select="$container"/>
<!-- <xsl:with-param name="block-type" select="$block-type"/>-->
<xsl:with-param name="resource-uri" select="$resource-uri"/>
<xsl:with-param name="graph" select="$graph"/>
<xsl:with-param name="mode" select="$mode"/>
Expand All @@ -334,7 +329,6 @@ exclude-result-prefixes="#all"
<xsl:template match="*[*][@rdf:about]" mode="ldh:RenderBlock">
<xsl:param name="this" as="xs:anyURI"/>
<xsl:param name="container" as="element()"/>
<!-- <xsl:param name="block-type" select="rdf:type/@rdf:resource" as="xs:anyURI"/>-->
<xsl:param name="graph" as="xs:anyURI?"/>
<xsl:param name="mode" as="xs:anyURI?"/>
<xsl:param name="refresh-content" as="xs:boolean?"/>
Expand All @@ -352,7 +346,6 @@ exclude-result-prefixes="#all"
<ixsl:schedule-action http-request="map{ 'method': 'POST', 'href': sd:endpoint(), 'media-type': 'application/sparql-query', 'body': $query-string, 'headers': map{ 'Accept': 'application/rdf+xml' } }">
<xsl:call-template name="ldh:LoadBlockObjectMetadata">
<xsl:with-param name="container" select="$container"/>
<!-- <xsl:with-param name="block-type" select="$block-type"/>-->
<xsl:with-param name="resource" select="."/>
<xsl:with-param name="graph" select="$graph"/>
<xsl:with-param name="mode" select="$mode"/>
Expand All @@ -367,7 +360,6 @@ exclude-result-prefixes="#all"
<xsl:context-item as="map(*)" use="required"/>
<xsl:param name="container" as="element()"/>
<xsl:param name="this" as="xs:anyURI"/>
<!-- <xsl:param name="block-type" as="xs:anyURI"/>-->
<xsl:param name="resource-uri" as="xs:anyURI"/>
<xsl:param name="graph" as="xs:anyURI?"/>
<xsl:param name="mode" as="xs:anyURI?"/>
Expand Down Expand Up @@ -426,7 +418,6 @@ exclude-result-prefixes="#all"
<xsl:template name="ldh:LoadBlockObjectMetadata">
<xsl:context-item as="map(*)" use="required"/>
<xsl:param name="container" as="element()"/>
<!-- <xsl:param name="block-type" as="xs:anyURI"/>-->
<xsl:param name="resource" as="element()"/>
<xsl:param name="graph" as="xs:anyURI?"/>
<xsl:param name="mode" as="xs:anyURI?"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -620,12 +620,25 @@ WHERE
<xsl:variable name="property-uri" select="../preceding-sibling::*/select/option[ixsl:get(., 'selected') = true()]/ixsl:get(., 'value')" as="xs:anyURI"/>
<xsl:variable name="seq-property" select="starts-with($property-uri, '&rdf;_')" as="xs:boolean"/>
<xsl:variable name="forClass" select="ancestor::div[@typeof][contains-token(@class, 'row-fluid')]/@typeof" as="xs:anyURI*"/>
<xsl:message>$forClass: <xsl:value-of select="$forClass"/></xsl:message>
<xsl:message>.add-value $forClass: <xsl:value-of select="$forClass"/> $property-uri: <xsl:value-of select="$property-uri"/></xsl:message>

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

<xsl:variable name="constructed-doc" select="ldh:construct-forClass($forClass)" as="document-node()"/> <!-- TO-DO: asynchronous request -->
<xsl:variable name="resource" select="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))]" as="element()"/>
<xsl:variable name="resource" as="element()">
<xsl:choose>
<!-- $forClass constructor found -->
<xsl:when test="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))]">
<xsl:sequence select="key('resources-by-type', $forClass, $constructed-doc)[not(key('predicates-by-object', @rdf:nodeID))]"/>
</xsl:when>
<!-- $forClass constructor not found -->
<xsl:otherwise>
<rdf:Description rdf:nodeID="A1">
<rdf:type rdf:resource="{$forClass}"/>
</rdf:Description>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="property" select="$resource/*[concat(namespace-uri(), local-name()) = $property-uri]" as="element()"/>

<!-- remove the current property control group from the current position -->
Expand Down

0 comments on commit da3b217

Please sign in to comment.