3

I am developing a Alchemy Plugin which extends “Localize” command.

For that, I am creating the command extension as below:

public class MyCommandExtension : CommandExtension
    {
        public MyCommandExtension()
        {
            Name = "Localize";
            ExtendingCommand = "MyLocalizeCommand";

            Dependencies.Add<MyResourceGroup>();
        }
    }

In the CommandExtension, I am adding the dependency for MyResourceGroup, which contains the JS files implementing MyLocalizeCommand command.

Now when I deploy the plugin, Tridion doesn’t fire the command because Alchemy doesn’t update “AlchemyEditor.config” as expected and do not add MyResourceGroup dependency inside <ext:commandextensions> node as below:

    <ext:commandextensions>
              <ext:commands>
                <!--Plugin: MyPlugIn-->
                <ext:command name="Localize" extendingcommand="LocalizeComment" />
              </ext:commands>
              <ext:dependencies>
                <!--Plugin: MyPlugIn -->
                <!--Missing dependency -->

              </ext:dependencies>
    </ext:commandextensions>

When I add the dependency (as below) manually by replacing comment <!--Missing dependency -->, it starts working fine.

<cfg:dependency> MyResourceGroup.Resources.MyCommands</cfg:dependency>

I guess, I am missing something in the code, Can someone point that out?

Thanks

3

I'll have to check to see if Alchemy supports resource groups in the command extensions, I actually haven't done too much with command extensions myself and based it off some of the existing editors that I had seen which didn't have dependencies in their command extension (which may explain why the command extensions do not add them). In the mean time, you can also try the following:

  1. Create your JavaScript command that is extending an existing command.
  2. Create your CommandSet class that adds your JS command.
  3. Create your ResourceGroup that adds the JS file and the CommandSet reference.
  4. Create your CommandExtension.

Having the ECL editor open in front of me, it looks like the ones in there differs from the above steps by adding a Dependency to the ResourceGroup from the CommandSet, and not having a reference to the CommandSet from the ResourceGroup. If the first doesn't work out for you, try the latter...

I'll add to the GitHub issues to allow support for dependencies from the commandextensions as well for a future release.

Hope that helps!

Update 5/11/2016 It looked like there was an issue with not resolving the name of the resource group dependencies. Version 0.8.1 of A4T resolves this issue.

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.