Skip to content

Commit

Permalink
For constructed documents, set $base-uri to a new URI which is rela…
Browse files Browse the repository at this point in the history
…tive to the current `base-uri()` (its child)
  • Loading branch information
namedgraph committed Nov 1, 2023
1 parent 469eb41 commit ac48e63
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 34 deletions.
2 changes: 1 addition & 1 deletion http-tests/document-hierarchy/HEAD-accept-lang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the readers group to be able to read documents (might already be done by another test)
# add agent to the readers group to be able to read documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/document-hierarchy/HEAD-accept.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the readers group to be able to read documents (might already be done by another test)
# add agent to the readers group to be able to read documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/misc/POST-content-length-413.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pwd=$(realpath -s "$PWD")

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the writers group to be able to read/write documents (might already be done by another test)
# add agent to the writers group to be able to read/write documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/misc/POST-transfer-chunked-413.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pwd=$(realpath -s "$PWD")

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the writers group to be able to read/write documents (might already be done by another test)
# add agent to the writers group to be able to read/write documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/misc/webid-delegation.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ curl --head -k -w "%{http_code}\n" -o /dev/null -s \

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the writers group to be able to read/write documents (might already be done by another test)
# add agent to the writers group to be able to read/write documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/proxy/GET-proxied-external-502.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the readers group to be able to read documents (might already be done by another test)
# add agent to the readers group to be able to read documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/proxy/GET-proxied-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the readers group to be able to read documents (might already be done by another test)
# add agent to the readers group to be able to read documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/proxy/GET-proxied.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the readers group to be able to read documents (might already be done by another test)
# add agent to the readers group to be able to read documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
2 changes: 1 addition & 1 deletion http-tests/proxy/HEAD-proxied-accept.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ purge_cache "$FRONTEND_VARNISH_SERVICE"

pushd . > /dev/null && cd "$SCRIPT_ROOT/admin/acl"

# add agent to the writers group to be able to read/write documents (might already be done by another test)
# add agent to the writers group to be able to read/write documents

./add-agent-to-group.sh \
-f "$OWNER_CERT_FILE" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ exclude-result-prefixes="#all">
<xsl:with-param name="name" select="'rdf'"/>
<xsl:with-param name="type" select="'hidden'"/>
</xsl:call-template>
<xsl:call-template name="xhtml:Input">
<xsl:with-param name="name" select="'v'"/>
<xsl:with-param name="type" select="'hidden'"/>
<xsl:with-param name="value" select="base-uri()"/>
</xsl:call-template>

<xsl:call-template name="xhtml:Input">
<xsl:with-param name="name" select="'sb'"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,11 +711,6 @@ extension-element-prefixes="ixsl"
<xsl:with-param name="name" select="'rdf'"/>
<xsl:with-param name="type" select="'hidden'"/>
</xsl:call-template>
<xsl:call-template name="xhtml:Input">
<xsl:with-param name="name" select="'v'"/>
<xsl:with-param name="type" select="'hidden'"/>
<xsl:with-param name="value" select="ac:absolute-path($ldh:requestUri)"/>
</xsl:call-template>

<input type="hidden" class="target-id"/>

Expand Down Expand Up @@ -754,7 +749,7 @@ extension-element-prefixes="ixsl"
</xsl:template>

<xsl:template match="rdf:RDF[$ac:forClass][$ac:method = 'GET']" mode="bs2:RowForm" priority="1" use-when="system-property('xsl:product-name') = 'SAXON'">
<xsl:param name="action" select="ac:build-uri($a:graphStore, map{ 'forClass': string($ac:forClass), 'mode': '&ac;EditMode' })" as="xs:anyURI"/>
<xsl:param name="action" select="ac:build-uri($document-uri, map{ 'forClass': string($ac:forClass), 'mode': '&ac;EditMode' })" as="xs:anyURI"/>
<xsl:param name="classes" as="element()*"/>

<xsl:next-match>
Expand All @@ -765,7 +760,8 @@ extension-element-prefixes="ixsl"

<xsl:template match="rdf:RDF" mode="bs2:RowForm">
<xsl:param name="method" select="'post'" as="xs:string"/>
<xsl:param name="action" select="ldh:href($ldt:base, ac:absolute-path(base-uri()), map{}, ac:build-uri(ac:absolute-path(base-uri()), map{ '_method': 'PUT', 'mode': for $mode in $ac:mode return string($mode) }))" as="xs:anyURI"/>
<xsl:param name="base-uri" select="base-uri()" as="xs:anyURI" tunnel="yes"/>
<xsl:param name="action" select="ldh:href($ldt:base, ac:absolute-path($base-uri), map{}, ac:build-uri(ac:absolute-path($base-uri), map{ '_method': 'PUT', 'mode': for $mode in $ac:mode return string($mode) }))" as="xs:anyURI"/>
<xsl:param name="id" select="concat('form-', generate-id())" as="xs:string?"/>
<xsl:param name="class" select="'form-horizontal'" as="xs:string?"/>
<xsl:param name="accept-charset" select="'UTF-8'" as="xs:string?"/>
Expand Down Expand Up @@ -793,11 +789,6 @@ extension-element-prefixes="ixsl"
<xsl:with-param name="name" select="'rdf'"/>
<xsl:with-param name="type" select="'hidden'"/>
</xsl:call-template>
<xsl:call-template name="xhtml:Input" use-when="system-property('xsl:product-name') = 'SAXON'">
<xsl:with-param name="name" select="'v'"/>
<xsl:with-param name="type" select="'hidden'"/>
<xsl:with-param name="value" select="ac:absolute-path($ldh:requestUri)"/>
</xsl:call-template>

<input type="hidden" class="target-id"/>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,8 +500,7 @@ exclude-result-prefixes="#all"
<xsl:param name="class" select="'subject input-xxlarge'" as="xs:string?"/>
<xsl:param name="disabled" select="false()" as="xs:boolean"/>
<xsl:param name="auto" select="local-name() = 'nodeID' or starts-with(., $ldt:base)" as="xs:boolean"/>
<xsl:param name="base-uri" select="base-uri()" as="xs:anyURI" tunnel="yes" use-when="system-property('xsl:product-name') = 'SAXON'"/>
<xsl:param name="base-uri" select="base-uri()" as="xs:anyURI" tunnel="yes" use-when="system-property('xsl:product-name') eq 'SaxonJS'"/>
<xsl:param name="base-uri" select="base-uri()" as="xs:anyURI" tunnel="yes"/>

<xsl:choose>
<xsl:when test="not($type = 'hidden')">
Expand Down Expand Up @@ -533,8 +532,7 @@ exclude-result-prefixes="#all"
-->
<!-- hidden inputs in which we store the old values of the visible input -->
<input type="hidden" class="old su">
<xsl:variable name="resource-uri" select="resolve-uri(ac:uuid() || '/', $base-uri)" as="xs:anyURI"/>
<xsl:attribute name="value" select="if (local-name() = 'about') then . else $resource-uri"/>
<xsl:attribute name="value" select="if (local-name() = 'about') then . else $base-uri"/>
</input>
<input type="hidden" class="old sb">
<xsl:attribute name="value" select="if (local-name() = 'nodeID') then . else generate-id()"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ exclude-result-prefixes="#all">
<xsl:param name="ldh:base" as="xs:anyURI" static="yes"/>
<xsl:param name="ldh:requestUri" as="xs:anyURI"/>
<xsl:param name="ac:endpoint" select="resolve-uri('sparql', $ldt:base)" as="xs:anyURI"/>
<xsl:param name="a:graphStore" select="resolve-uri('service', $ldt:base)" as="xs:anyURI"/> <!-- TO-DO: rename to ac:graphStore? -->
<!-- <xsl:param name="a:graphStore" select="resolve-uri('service', $ldt:base)" as="xs:anyURI"/> TO-DO: rename to ac:graphStore? -->
<xsl:param name="sd:endpoint" as="xs:anyURI?"/>
<xsl:param name="acl:agent" as="xs:anyURI?"/>
<xsl:param name="lapp:Application" as="document-node()?"/>
Expand All @@ -111,7 +111,7 @@ exclude-result-prefixes="#all">
<xsl:param name="acl:mode" as="xs:anyURI*"/>
<xsl:param name="ldh:forShape" as="xs:anyURI?"/>
<xsl:param name="ldh:createGraph" select="false()" as="xs:boolean"/>
<xsl:param name="ldh:ajaxRendering" select="true()" as="xs:boolean"/> <!-- TO-DO: rename to ldhc:ajaxRendering? -->
<xsl:param name="ldh:ajaxRendering" select="true()" as="xs:boolean"/>
<xsl:param name="ldhc:enableWebIDSignUp" as="xs:boolean"/>
<xsl:param name="google:clientID" as="xs:string?"/>
<xsl:param name="default-classes" as="map(xs:string, xs:anyURI)">
Expand Down Expand Up @@ -828,7 +828,8 @@ LIMIT 100
<xsl:with-param name="constructor-query" select="$constructor-query" tunnel="yes"/>
<xsl:with-param name="constraint-query" select="$constraint-query" tunnel="yes"/>
<xsl:with-param name="shape-query" select="$shape-query" tunnel="yes"/>
<xsl:with-param name="base-uri" select="ac:absolute-path(base-uri())" tunnel="yes"/> <!-- ac:absolute-path(base-uri()) is empty on constructed documents -->
<!-- base-uri() is empty on constructed documents. Create a new URI which is relative to the current base-uri(). -->
<xsl:with-param name="base-uri" select="resolve-uri(ac:uuid() || '/', base-uri())" tunnel="yes"/>
<xsl:sort select="ac:label(.)"/>
</xsl:apply-templates>
</xsl:when>
Expand All @@ -838,7 +839,8 @@ LIMIT 100
<xsl:with-param name="constructor-query" select="$constructor-query" tunnel="yes"/>
<xsl:with-param name="constraint-query" select="$constraint-query" tunnel="yes"/>
<xsl:with-param name="shape-query" select="$shape-query" tunnel="yes"/>
<xsl:with-param name="base-uri" select="ac:absolute-path(base-uri())" tunnel="yes"/> <!-- ac:absolute-path(base-uri()) is empty on constructed documents -->
<!-- base-uri() is empty on constructed documents. Create a new URI which is relative to the current base-uri(). -->
<xsl:with-param name="base-uri" select="resolve-uri(ac:uuid() || '/', base-uri())" tunnel="yes"/>
<xsl:sort select="ac:label(.)"/>
</xsl:apply-templates>
</xsl:otherwise>
Expand Down

0 comments on commit ac48e63

Please sign in to comment.