@@ -288,10 +288,10 @@ WHERE
288288 <ixsl : promise select ="
289289 ixsl:http-request($context('request')) (: Step 1: send initial request :)
290290 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
291- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
291+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
292292 => ixsl:then(ldh:load-edited-resource#1) (: Step 4: extract resource, build next request :)
293293 => ixsl:then(ldh:http-request-threaded#1) (: Step 5: send next request and rethread :)
294- => ixsl:then(ldh:handle-responseA #1) (: Step 6: handle retry if needed :)
294+ => ixsl:then(ldh:handle-response #1) (: Step 6: handle retry if needed :)
295295 => ixsl:then(ldh:load-type-metadata#1) (: Step 7: final step using full context :)
296296 => ixsl:then(ldh:render-row-form#1)
297297 " />
@@ -344,70 +344,16 @@ WHERE
344344 <ixsl : promise select ="
345345 ixsl:http-request($context('request')) (: Step 1: send initial request :)
346346 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
347- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
347+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
348348 => ixsl:then(ldh:load-edited-resource#1) (: Step 4: extract resource, build next request :)
349349 => ixsl:then(ldh:http-request-threaded#1) (: Step 5: send next request and rethread :)
350- => ixsl:then(ldh:handle-responseA #1) (: Step 6: handle retry if needed :)
350+ => ixsl:then(ldh:handle-response #1) (: Step 6: handle retry if needed :)
351351 => ixsl:then(ldh:load-type-metadata#1) (: Step 7: final step using full context :)
352352 => ixsl:then(ldh:wrap-into-document#1)
353353 => ixsl:then(ldh:render-form#1)
354354 " />
355355 </xsl : template >
356356
357- <xsl : function name =" ldh:rethread-response" as =" map(*)" ixsl : updating =" no" >
358- <xsl : param name =" context" as =" map(*)" />
359- <xsl : param name =" response" as =" map(*)" />
360-
361- <xsl : sequence select =" map:merge(($context, map{ 'response': $response }), map{ 'duplicates': 'use-last' })" />
362- </xsl : function >
363-
364- <xsl : function name =" ldh:http-request-threaded" as =" map(*)" ixsl : updating =" yes" >
365- <xsl : param name =" context" as =" map(*)" />
366-
367- <xsl : sequence select ="
368- ixsl:http-request($context('request'))
369- => ixsl:then(ldh:rethread-response($context, ?))
370- " />
371- </xsl : function >
372-
373- <xsl : function name =" ldh:handle-responseA" as =" item()*" ixsl : updating =" yes" >
374- <xsl : param name =" context" as =" map(*)" />
375-
376- <xsl : variable name =" request" select =" $context('request')" as =" map(*)" />
377- <xsl : variable name =" response" select =" $context('response')" as =" map(*)" />
378- <xsl : variable name =" default-retry-after" select =" 1" as =" xs:integer" />
379-
380- <xsl : choose >
381- <xsl : when test =" $response?status = 429" >
382- <xsl : variable name =" retry-after" select ="
383- if (map:contains($response?headers, 'Retry-After'))
384- then xs:integer($response?headers('Retry-After'))
385- else $default-retry-after" />
386-
387- <xsl : sequence select ="
388- ixsl:sleep($retry-after * 1000)
389- => ixsl:then(ldh:retry-requestA($context, ?))
390- " />
391- </xsl : when >
392- <xsl : otherwise >
393- <xsl : sequence select =" $context" />
394- </xsl : otherwise >
395- </xsl : choose >
396- </xsl : function >
397-
398- <xsl : function name =" ldh:retry-requestA" as =" item()*" ixsl : updating =" yes" >
399- <xsl : param name =" context" as =" map(*)" />
400- <xsl : param name =" sleep-result" as =" item()?" />
401-
402- <xsl : variable name =" request" select =" $context('request')" />
403-
404- <xsl : sequence select ="
405- ixsl:http-request($request)
406- => ixsl:then(ldh:rethread-response($context, ?))
407- => ixsl:then(ldh:handle-responseA#1)
408- " />
409- </xsl : function >
410-
411357 <xsl : function name =" ldh:load-edited-resource" as =" map(*)" ixsl : updating =" yes" >
412358 <xsl : param name =" context" as =" map(*)" />
413359 <xsl : variable name =" response" select =" $context('response')" as =" map(*)" />
@@ -442,8 +388,9 @@ WHERE
442388 </xsl : when >
443389 <!-- error response -->
444390 <xsl : otherwise >
445- <ixsl : set-style name =" cursor" select =" 'default'" object =" ixsl:page()//body" />
446- <xsl : sequence select =" ixsl:call(ixsl:window(), 'alert', [ ?message ])" />
391+ <!-- <ixsl:set-style name="cursor" select="'default'" object="ixsl:page()//body"/>
392+ <xsl:sequence select="ixsl:call(ixsl:window(), 'alert', [ ?message ])"/>-->
393+ <xsl : sequence select =" error(QName('&ldh; ', 'ldh:ldh:load-edited-resource-error'), 'Could not load edited resource', map{ 'code': 999 })" />
447394 </xsl : otherwise >
448395 </xsl : choose >
449396 </xsl : for-each >
@@ -691,7 +638,7 @@ WHERE
691638 <ixsl : promise select ="
692639 ixsl:http-request($context('request')) (: Step 1: send initial request :)
693640 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
694- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
641+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
695642 => ixsl:then(ldh:form-horizontal-response#1)
696643 " />
697644 </xsl : otherwise >
@@ -747,7 +694,7 @@ WHERE
747694 <ixsl : promise select ="
748695 ixsl:http-request($context('request')) (: Step 1: send initial request :)
749696 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
750- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
697+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
751698 => ixsl:then(ldh:modal-form-patch-response#1)
752699 " on-failure =" ldh:form-horizontal-submit-error#1" />
753700 </xsl : template >
@@ -801,7 +748,7 @@ WHERE
801748 <ixsl : promise select ="
802749 ixsl:http-request($context('request')) (: Step 1: send initial request :)
803750 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
804- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
751+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
805752 => ixsl:then(ldh:row-form-patch-response#1)
806753 " />
807754 </xsl : template >
@@ -1011,7 +958,7 @@ WHERE
1011958 <xsl : sequence select ="
1012959 ixsl:http-request($context('request')) (: Step 1: send initial request :)
1013960 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
1014- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
961+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
1015962 => ixsl:then(ldh:xhtml-document-loaded#1)
1016963 " />
1017964 </xsl : for-each >
@@ -1034,7 +981,7 @@ WHERE
1034981 <xsl : sequence select ="
1035982 ixsl:http-request($context('request')) (: Step 1: send initial request :)
1036983 => ixsl:then(ldh:rethread-response($context, ?)) (: Step 2: attach response to context :)
1037- => ixsl:then(ldh:handle-responseA #1) (: Step 3: handle 429s, etc. :)
984+ => ixsl:then(ldh:handle-response #1) (: Step 3: handle 429s, etc. :)
1038985 => ixsl:then(ldh:xhtml-document-loaded#1)
1039986 " />
1040987 </xsl : for-each >
0 commit comments