User story #1246
closedPolicy Configuration: multivalued section within multivalues sections
Description
I would like to be able to have multi-valued variables in multi-valued sections. In this example, that would be for each command, allow several users, and on a higher level, allow several commands.
Technical precisions: we want to have a Policy.xml like:
<SECTIONS> <SECTION name="SX" component="true" /> <SECTION name="SA" multivalued="true"> <INPUT name="iA" /> <INPUT name="iB" /> <SECTION name="SB" multivalued="true"> <input name="iC" /> </SECTION> </SECTION> <SECTION name="SC"> <input name="iC" /> </SECTION> </SECTIONS>
And be able to use following values (with format: "#section name : iteration" and "variable name : value"
- PI-CR-SERIAL-1:
- #SA : SA1
- iA : iA1
- iB : iB1
- #SB : SB1
- iC : iC1
- #SB : SB2
- iC : iC2
- #SA : SA2
- iA : iA2
- iB : iB3
- #SB : SB3
- iC : iC3
- #SC : SC1
- iD : iD1
- #SA : SA1
- PI-CR-SERIAL-2:
- #SA : SA3
- iA : iA3
- iB : iB3
- #SB : SB4
- iC : iC4
- #SC : SC2
- iD : iD2
- #SA : SA3
Updated by François ARMAND over 13 years ago
- Subject changed from Policy Configuration: multivalued variables within multivalues sections to Policy Configuration: multivalued section within multivalues sections
- Assignee set to François ARMAND
- Priority changed from N/A to 1 (highest)
- Target version changed from 10 to 17
Updated by François ARMAND over 13 years ago
- Description updated (diff)
- Status changed from New to Discussion
Updated by François ARMAND over 13 years ago
We have to:
- update parsers to understand sub-multivalued sections
- change format of LDAP serialisation for variable values (use only one attribute containing a JSON serialisation of that)
- update stringtemplate to understand the magic tag &POLICY_VARIABLES& to produce the following output:
"SA[1][PI]" string => "PI-CR-SERIAL-1"; "SA[1][vars][iA]" string => "iA1"; "SA[1][vars][iB]" string => "iB1"; "SA[1][sections][SB][1][vars][iC]" string => "iC1"; "SA[1][sections][SB][2][vars][iC]" string => "iC2"; "SA[2][PI]" string => "PI-CR-SERIAL-1"; "SA[2][vars][iA]" string => "iA2"; "SA[2][vars][iB]" string => "iB2"; "SA[2][sections][SB][1][vars][iC]" string => "iC3"; "SA[3][PI]" string => "PI-CR-SERIAL-2"; "SA[3][vars][iA]" string => "iA3"; "SA[3][vars][iB]" string => "iB3"; "SA[3][sections][SB][1][vars][iC]" string => "iC4"; "SC[1][PI]" string => "PI-CR-SERIAL-1"; "SC[1][vars][iD]" string => "iD1"; "SC[2][PI]" string => "PI-CR-SERIAL-2"; "SC[2][vars][iD]" string => "iD2";
Updated by François ARMAND over 13 years ago
- Status changed from Discussion to In progress
We should also keep the current syntax in .st working for variables in non-multivalued sub-section.
Updated by François ARMAND over 13 years ago
- Status changed from In progress to Pending technical review
Actually, the use case is not complete, because variable under the root section are missing.
<SECTIONS> <INPUT name="iRoot" /> <SECTION name="SX" component="true" /> <SECTION name="SA" multivalued="true"> <INPUT name="iA" /> <INPUT name="iB" /> <SECTION name="SB" multivalued="true"> <input name="iC" /> </SECTION> </SECTION> <SECTION name="SC"> <input name="iC" /> </SECTION> </SECTIONS>
And values:
- PI-CR-SERIAL-1:
- iRoot : iRoot1
- #SA : SA1
- iA : iA1
- iB : iB1
- #SB : SB1
- iC : iC1
- #SB : SB2
- iC : iC2
- #SA : SA2
- iA : iA2
- iB : iB3
- #SB : SB3
- iC : iC3
- #SC : SC1
- iD : iD1
- PI-CR-SERIAL-2:
- iRoot : iRoot2
- #SA : SA3
- iA : iA3
- iB : iB3
- #SB : SB4
- iC : iC4
- #SC : SC2
- iD : iD2
And so, the final structure must be (with ROOT a magic key-word):
"ROOT[1][PI]" string => "PI-CR-SERIAL-1"; "ROOT[1][vars][iRoot]" string => "iRoot1"; "ROOT[2][PI]" string => "PI-CR-SERIAL-2"; "ROOT[2][vars][iRoot]" string => "iRoot2"; "SA[1][PI]" string => "PI-CR-SERIAL-1"; "SA[1][vars][iA]" string => "iA1"; "SA[1][vars][iB]" string => "iB1"; "SA[1][sections][SB][1][vars][iC]" string => "iC1"; "SA[1][sections][SB][2][vars][iC]" string => "iC2"; "SA[2][PI]" string => "PI-CR-SERIAL-1"; "SA[2][vars][iA]" string => "iA2"; "SA[2][vars][iB]" string => "iB2"; "SA[2][sections][SB][1][vars][iC]" string => "iC3"; "SA[3][PI]" string => "PI-CR-SERIAL-2"; "SA[3][vars][iA]" string => "iA3"; "SA[3][vars][iB]" string => "iB3"; "SA[3][sections][SB][1][vars][iC]" string => "iC4"; "SC[1][PI]" string => "PI-CR-SERIAL-1"; "SC[1][vars][iD]" string => "iD1"; "SC[2][PI]" string => "PI-CR-SERIAL-2"; "SC[2][vars][iD]" string => "iD2";
Updated by François ARMAND over 13 years ago
- Status changed from Pending technical review to In progress
Status modification was a scrolling issue, sorry.
Updated by François ARMAND over 13 years ago
It is decided that the <sections> element can not hold variable directly.
So ignore the precedent remark.
Updated by François ARMAND over 13 years ago
- Target version changed from 17 to 20
Updated by François ARMAND over 13 years ago
- Status changed from In progress to 2
- Priority changed from 1 (highest) to 3
Stop for now, perhaps we can do what is needed for #1547 without them.
Updated by Jonathan CLARKE over 13 years ago
- Target version changed from 20 to 18
Updated by François ARMAND about 13 years ago
- Target version changed from 18 to 24
Updated by Jonathan CLARKE over 12 years ago
- Target version changed from 24 to Ideas (not version specific)
Updated by François ARMAND over 11 years ago
- Assignee deleted (
François ARMAND)
Updated by François ARMAND almost 3 years ago
- Status changed from New to Rejected
We won't ever do it like that. It will be done through rudderc and technique editor, and loops/iterator. Closing it.