Opened 10 years ago

Closed 9 years ago

Last modified 9 years ago

#665 closed Feature request (fixed)

Wizard: Support flexible setting of values

Reported by: Sven Rech Owned by: Sven Rech
Priority: Important Milestone: CrypTool 2.0 BETA 10
Component: Wizard Keywords:
Cc:

Description

Introduce XML tags like: <set plugins...>value</set>

Change History (11)

comment:1 Changed 10 years ago by Sven Rech

Milestone: CrypTool 2.0 BETA 9

comment:2 Changed 10 years ago by Sven Rech

Priority: Nice to haveImportant
Status: newaccepted

comment:3 Changed 9 years ago by Sven Rech

Resolution: fixed
Status: acceptedclosed

(In [4990]) closes #665

comment:4 Changed 9 years ago by Sven Rech

You can use it in "input" and in "sampleViewer" pages like this:

<pluginSetter plugin="Scytale" property="StickSize">12</pluginSetter>

comment:5 Changed 9 years ago by Arno Wacker

Milestone: CrypTool 2.0 BETA 9CrypTool 2.0 BETA 10
Resolution: fixed
Status: closedreopened

Please add this functionality also to comboBox -- the value should be the index from the comboBox.

For usage have a look at \trunk\CrypPlugins\Wizard\Config\Indiv\wizard.config.indiv.xml, Line 33:

<comboBox plugin="AES;Switch" property="Action" alignment="Left" width="20%" group="1">
...
<comboBox>

There is a hack in BooleanInput to make this work. What we need, is

<comboBox alignment="Left" width="20%" group="1">
  <pluginSetter plugin="AES" property="Action" \>
  <pluginSetter plugin="Switch" property="Value" \>
..
</comboBox>

Pleaee ensure, this feature works together with the feature introduced in #666.

Actually, what would be a good use case for this in its current form? For input and sampleViwer we can set some fixed value, whenever an input is generated. Right? Wouldn't it be better, to use the input value (in case of input) as value for the plugin? However, I might be missing some cases right now..

comment:6 Changed 9 years ago by Arno Wacker

After revisiting a situation where this is needed, I have to refine the above statement. In a sample, we want to switch from encryption to decryption. However, there are string decoders and string encoders in the path, and they have to be switched as well in order to make the entire chain work. See for example the wizard, Modern symmetric cryptography: currently for most (all?) algorithms the decryption path does not work at all. Looking at the sample reveals, that it actually cannot work and probably never did (will make a ticket for that too). However, in order to solve this, we need a very flexible way to set plugin-settings depending on some comboBox in the wizard config, e.g.:

<comboBox alignment="Left" width="20%" group="1">
      <item lang="en" content="Encrypt">
        <pluginSetter plugin="AES" property="Action">0</pluginSetter>
        <pluginSetter plugin="Encoder" property="Value>3</pluginSetter>
        <pluginSetter plugin="Decoder" property="Value>1</pluginSetter>
      </item>
      <item lang="de" content="Verschlüsseln"/>
      <item lang="en" content="Decrypt"/>
        <pluginSetter plugin="AES" property="Action">1</pluginSetter>
        <pluginSetter plugin="Encoder" property="Value>0</pluginSetter>
        <pluginSetter plugin="Decoder" property="Value>3</pluginSetter>
      </item>
      <item lang="de" content="Entschlüsseln"/>
..
</comboBox>

As one can see, there is a problem, that we actually have to specify this for every language - and there is no different behavior for different languages. Hence, maybe, there is a better way, which gives as the flexibility to set an arbitrary number of properties on an arbitrary number of plugins to arbitrary values depending on the user selection in a comboBox.

comment:7 Changed 9 years ago by Sven Rech

Status: reopenedaccepted

comment:8 Changed 9 years ago by Sven Rech

Resolution: fixed
Status: acceptedclosed

(In [5342]) fixes #665

comment:9 Changed 9 years ago by Sven Rech

Works exactly like in your example. Plugin setters in different language items get merged, so you only have to specify them once. The "comboBox" elements plugin and property attributes still exist, but are optional now. You can also specify them together with some pluginSetters, so you have the full flexibility.

comment:10 Changed 9 years ago by Arno Wacker

(In [5347]) Templates

  • Updated the standard AES template with a better organization and with some explaining text (this template is also the base for the Wizard-path: cryptography->modern->symmetric->AES)

Wizard path cryptography->modern->symmetric->AES

  • Reorganized elements: "1.)What to do, 2.) How to do, 3.) With what data"
  • Changed labels to conditional (using feature from #666)
  • In combination with the new template decryption should now also work by using feature from #665 in r5342. However, it does not seem to set the corresponding components (refs #665)
  • When the feature from #665 works*, this (i.e. AES) would be the first one from six to solve, refs #757
  • I might just use it in the wrong way (@Sven: please have a look)

comment:11 Changed 9 years ago by Arno Wacker

(In [5349]) Wizard:

  • Added workaround for a small problem with #665
  • Now the wizard path "Cryptography->Modern->Symmetric->AES" fully works incl. decryption. This has to be adapted for the other 5 paths; refs #757

This refs #665: Setting one plugin as attribute in the comboBox is required for now as a workaround. Without this attribute, the wizard forgets the settings from the last page. It manifest like this: when going one step backward it shows the right settings in the GUI, but in the background the wizard uses the initial value.

Note: See TracTickets for help on using tickets.