Refactor the way parameters are passed to expand macro

Instead of the hack that that uses session parameters to pass
parameters to expandMacro, use directly `withParams` method
on macro token. All parameters are mapped to corresponding fields.

Introduce CustomSessionParameter to access parameters in
TemplateApplicationSession.
This commit is contained in:
Fedor Isakov 2021-09-21 16:13:43 +02:00
parent b8f627d0a9
commit 3f606ba63c
4 changed files with 647 additions and 349 deletions

View File

@ -8716,5 +8716,26 @@
<ref role="PMmxG" node="1vAI4X$UxOr" resolve="TermFeature_EditorComponent" />
</node>
</node>
<node concept="24kQdi" id="4qGA5WCQSvL">
<ref role="1XX52x" to="wq2x:4qGA5WCQQZu" resolve="CustomSessionParameter" />
<node concept="3EZMnI" id="4qGA5WCQS$F" role="2wV5jI">
<node concept="PMmxH" id="4qGA5WCQSKB" role="3EZMnx">
<ref role="PMmxG" to="tpco:2wZex4PafBj" resolve="alias" />
<ref role="1k5W1q" node="7ksQUDZpd8b" resolve="ConstraintKeyword" />
</node>
<node concept="3F0ifn" id="4qGA5WCSelK" role="3EZMnx">
<property role="3F0ifm" value="(" />
<ref role="1k5W1q" node="hY9fg1G" resolve="ConstraintLeftParenAfterName" />
</node>
<node concept="3F1sOY" id="4qGA5WCSfYZ" role="3EZMnx">
<ref role="1NtTu8" to="wq2x:4qGA5WCSfbf" resolve="key" />
</node>
<node concept="3F0ifn" id="4qGA5WCSevW" role="3EZMnx">
<property role="3F0ifm" value=")" />
<ref role="1k5W1q" node="hFCSUmN" resolve="ConstraintRightParen" />
</node>
<node concept="l2Vlx" id="4qGA5WCQS$I" role="2iSdaV" />
</node>
</node>
</model>

View File

@ -1716,5 +1716,23 @@
<property role="34LRSv" value="isNonground" />
<ref role="1TJDcQ" node="7lmP5gAmrrX" resolve="TermConstraint" />
</node>
<node concept="1TIwiD" id="4qGA5WCQQZu">
<property role="EcuMT" value="5092612813123973086" />
<property role="TrG5h" value="CustomSessionParameter" />
<property role="34LRSv" value="session parameter" />
<ref role="1TJDcQ" to="tpee:fz3vP1J" resolve="Expression" />
<node concept="1TJgyj" id="4qGA5WCSfbf" role="1TKVEi">
<property role="IQ2ns" value="5092612813124334287" />
<property role="20lmBu" value="fLJjDmT/aggregation" />
<property role="20kJfa" value="key" />
<property role="20lbJX" value="fLJekj4/_1" />
<ref role="20lvS9" to="tpee:fz3vP1J" resolve="Expression" />
</node>
<node concept="1TJgyi" id="4qGA5WCR1kh" role="1TKVEl">
<property role="IQ2nx" value="5092612813124015377" />
<property role="TrG5h" value="paramName" />
<ref role="AX2Wp" to="tpck:fKAOsGN" resolve="string" />
</node>
</node>
</model>

View File

@ -1918,7 +1918,7 @@
</node>
</node>
</node>
<node concept="2tJIrI" id="6PWFJfG6NeX" role="jymVt" />
<node concept="2tJIrI" id="4qGA5WCMtOF" role="jymVt" />
<node concept="3clFb_" id="ZNYuguqmlg" role="jymVt">
<property role="TrG5h" value="resolve" />
<node concept="37vLTG" id="ZNYuguqqMw" role="3clF46">
@ -7969,6 +7969,23 @@
<node concept="3Tm1VV" id="5itBwM86qUW" role="1B3o_S" />
<node concept="3clFbS" id="5itBwM86qUX" role="3clF47" />
</node>
<node concept="2tJIrI" id="4qGA5WD0qiX" role="jymVt" />
<node concept="3clFb_" id="4qGA5WD0pSH" role="jymVt">
<property role="TrG5h" value="withParams" />
<node concept="37vLTG" id="4qGA5WD0pSI" role="3clF46">
<property role="TrG5h" value="param" />
<node concept="8X2XB" id="4qGA5WD0pSJ" role="1tU5fm">
<node concept="3uibUv" id="4qGA5WD0pSK" role="8Xvag">
<ref role="3uigEE" to="wyt6:~Object" resolve="Object" />
</node>
</node>
</node>
<node concept="3uibUv" id="4qGA5WD0pSL" role="3clF45">
<ref role="3uigEE" node="5itBwM86qUH" resolve="Token" />
</node>
<node concept="3Tm1VV" id="4qGA5WD0pSM" role="1B3o_S" />
<node concept="3clFbS" id="4qGA5WD0pSN" role="3clF47" />
</node>
<node concept="2tJIrI" id="5itBwM86qUY" role="jymVt" />
<node concept="3Tm1VV" id="5itBwM86qUZ" role="1B3o_S" />
<node concept="3uibUv" id="5itBwM86qV0" role="3HQHJm">