0

I need to implement some logic before saving/localizing/unlocalizing a Component. The logic would be the same so I use a GUI extension where I mentioned all commands:

<ext:commandextensions>
  <ext:commands>
    <ext:command name="Save" extendingcommand="AdditionalProcess" />
    <ext:command name="SaveClose" extendingcommand="AdditionalProcess" />
    <ext:command name="Localize" extendingcommand="AdditionalProcess" />
    <ext:command name="UnLocalize" extendingcommand="AdditionalProcess" />
  </ext:commands>
  <ext:dependencies>
    <cfg:dependency>CommandsExtensions.Commandset</cfg:dependency>
  </ext:dependencies>
</ext:commandextensions>

Once additional process done, I need to execute the command which has been extended. For example:

return $cme.getCommand("Save")._execute(selection, pipeline);

Question: How can I set parameter "Save" or "Localize" or "UnLocalize" based on the triggered event?

Or Simply, how Can I find in JS the Command which has been triggered enter image description here

1

You can't.

What I ended up doing a long time ago when I had the same need was to have a different extension for each command, then:

  1. Set a variable with the name of the command the user called (this.properties.CommandCalled="Save") or something along those lines
  2. Call a "central" function which had the logic I wanted to execute
  3. In that "central" function, have some logic to alter the behavior based on the value of CommandCalled
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.