Skip to content

Commit 4542e90

Browse files
committed
ldh:ResourceUpdated does not use neither $container nor $forClass params
1 parent c60c801 commit 4542e90

File tree

1 file changed

+11
-12
lines changed
  • src/main/webapp/static/com/atomgraph/linkeddatahub/xsl/bootstrap/2.3.2/client

1 file changed

+11
-12
lines changed

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

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -488,15 +488,15 @@ WHERE
488488

489489
<!-- submit document creation form using PUT -->
490490

491-
<xsl:template match="div[contains-token(@class, 'modal-constructor')]//form[contains-token(@class, 'form-horizontal')]" mode="ixsl:onsubmit" priority="1">
491+
<!-- <xsl:template match="div[contains-token(@class, 'modal-constructor')]//form[contains-token(@class, 'form-horizontal')]" mode="ixsl:onsubmit" priority="1">
492492
<xsl:next-match>
493493
<xsl:with-param name="method" select="'put'"/>
494494
</xsl:next-match>
495-
</xsl:template>
495+
</xsl:template>-->
496496

497497
<!-- submit instance creation form using POST -->
498498

499-
<xsl:template match="form[contains-token(@class, 'form-horizontal')][upper-case(@method) = 'POST']" mode="ixsl:onsubmit">
499+
<xsl:template match="form[contains-token(@class, 'form-horizontal')]" mode="ixsl:onsubmit">
500500
<xsl:param name="method" select="@method" as="xs:string"/>
501501
<xsl:param name="elements" select=".//input | .//textarea | .//select" as="element()*"/>
502502
<xsl:param name="triples" select="ldh:parse-rdf-post($elements)" as="element()*"/>
@@ -566,7 +566,7 @@ WHERE
566566
<xsl:call-template name="ldh:ResourceUpdated">
567567
<xsl:with-param name="doc-uri" select="$doc-uri"/>
568568
<xsl:with-param name="block" select="$block"/>
569-
<xsl:with-param name="container" select="$container"/>
569+
<!-- <xsl:with-param name="container" select="$container"/>-->
570570
<xsl:with-param name="form" select="$form"/>
571571
<xsl:with-param name="resources" select="$resources"/>
572572
</xsl:call-template>
@@ -624,7 +624,7 @@ WHERE
624624
<xsl:call-template name="ldh:ResourceUpdated">
625625
<xsl:with-param name="doc-uri" select="ac:absolute-path(ldh:base-uri(.))"/>
626626
<xsl:with-param name="block" select="$block"/>
627-
<xsl:with-param name="container" select="$container"/>
627+
<!-- <xsl:with-param name="container" select="$container"/>-->
628628
<xsl:with-param name="form" select="$form"/>
629629
<xsl:with-param name="resources" select="$resources"/>
630630
</xsl:call-template>
@@ -703,7 +703,7 @@ WHERE
703703
<xsl:context-item as="map(*)" use="required"/>
704704
<xsl:param name="doc-uri" as="xs:anyURI"/>
705705
<xsl:param name="block" as="element()"/>
706-
<xsl:param name="container" as="element()?"/>
706+
<!-- <xsl:param name="container" as="element()?"/>-->
707707
<xsl:param name="form" as="element()?"/>
708708
<xsl:param name="resources" as="document-node()"/>
709709

@@ -769,9 +769,8 @@ WHERE
769769
</xsl:when>
770770
<!-- POST or PUT constraint violation response is 422 Unprocessable Entity, bad RDF syntax is 400 Bad Request -->
771771
<xsl:when test="?status = (400, 422) and starts-with(?media-type, 'application/rdf+xml')"> <!-- allow 'application/rdf+xml;charset=UTF-8' as well -->
772-
<xsl:variable name="forClass" select="$container/@typeof" as="xs:anyURI"/>
773-
<xsl:message>$forClass: <xsl:value-of select="$forClass"/></xsl:message>
774-
<xsl:variable name="resource" select="key('resources-by-type', $forClass, ?body)[not(key('predicates-by-object', @rdf:nodeID)[not(../rdf:type/@rdf:resource = '&spin;ConstraintViolation')])]" as="element()"/>
772+
<!-- <xsl:variable name="resource" select="key('resources-by-type', $forClass, ?body)[not(key('predicates-by-object', @rdf:nodeID)[not(../rdf:type/@rdf:resource = '&spin;ConstraintViolation')])]" as="element()"/>-->
773+
<xsl:variable name="body" select="?body" as="document-node()"/>
775774
<!-- TO-DO: refactor to use asynchronous HTTP requests -->
776775
<xsl:variable name="types" select="distinct-values($resource/rdf:type/@rdf:resource)" as="xs:anyURI*"/>
777776
<xsl:variable name="property-uris" select="distinct-values($resource/*/concat(namespace-uri(), local-name()))" as="xs:string*"/>
@@ -805,7 +804,7 @@ WHERE
805804
</xsl:message>
806805

807806
<xsl:variable name="row-form" as="node()*">
808-
<xsl:apply-templates select="$resource" mode="bs2:RowForm">
807+
<xsl:apply-templates select="$body/rdf:RDF/*" mode="bs2:RowForm">
809808
<xsl:with-param name="method" select="$form/@method"/>
810809
<!-- <xsl:with-param name="type-metadata" select="$type-metadata" tunnel="yes"/>-->
811810
<xsl:with-param name="property-metadata" select="$property-metadata" tunnel="yes"/>
@@ -894,7 +893,7 @@ WHERE
894893

895894
<xsl:apply-templates select="$constructed-doc" mode="bs2:Form"> <!-- document level template -->
896895
<xsl:with-param name="about" select="()"/> <!-- don't set @about on the container until after the resource is saved -->
897-
<xsl:with-param name="method" select="'post'"/> <!-- browsers do not allow PUT form method -->
896+
<xsl:with-param name="method" select="'put'"/>
898897
<xsl:with-param name="action" select="ldh:href($ldt:base, ac:absolute-path(ldh:base-uri(.)), map{}, $doc-uri)" as="xs:anyURI"/>
899898
<xsl:with-param name="form-actions-class" select="'form-actions modal-footer'" as="xs:string?"/>
900899
<xsl:with-param name="classes" select="$classes"/>
@@ -1603,7 +1602,7 @@ WHERE
16031602
<xsl:call-template name="ldh:ResourceUpdated">
16041603
<xsl:with-param name="doc-uri" select="$doc-uri"/>
16051604
<xsl:with-param name="block" select="$block"/>
1606-
<xsl:with-param name="container" select="$container"/>
1605+
<!-- <xsl:with-param name="container" select="$container"/>-->
16071606
<xsl:with-param name="form" select="$form"/>
16081607
<xsl:with-param name="resources" select="$resources"/>
16091608
</xsl:call-template>

0 commit comments

Comments
 (0)