4

According to the documentation, it is possible for a GUI extension to have both the model and editor in the same configuration file.

However, I am unable to get this to work.

Here is my Editor.config file (empty elements removed for brevity):

<?xml version="1.0"?>
<Configuration
xmlns="http://www.sdltridion.com/2009/GUI/Configuration/Merge"
xmlns:cfg="http://www.sdltridion.com/2009/GUI/Configuration"
xmlns:ext="http://www.sdltridion.com/2009/GUI/extensions"
xmlns:cmenu="http://www.sdltridion.com/2009/GUI/extensions/ContextMenu"
xmlns:edt="http://www.sdltridion.com/2009/GUI/Configuration/Merge">
  <resources>
    <cfg:groups>
      <cfg:group name="Customization.Extension" merge="always">
        <cfg:fileset>
          <cfg:file type="style">/Client/css/Extension.css</cfg:file>
          <cfg:file type="script">/Client/js/ExtensionCommand.js</cfg:file>
          <cfg:file type="reference">Customization.Extension.Interface</cfg:file>
        </cfg:fileset>
        <cfg:dependencies>
          <cfg:dependency>Tridion.Web.UI.Editors.CME</cfg:dependency>
          <cfg:dependency>Tridion.Web.UI.Editors.CME.commands</cfg:dependency>
          <cfg:dependency>Customization.Extension.Services</cfg:dependency>
        </cfg:dependencies>
      </cfg:group>
      <cfg:group name="Customization.Extension.Services" merge="always">
        <cfg:domainmodel name="Customization.Extension.Services">
          <cfg:fileset/>
          <cfg:services>
            <cfg:service type="wcf">/Client/Services/MyService.svc</cfg:service>
          </cfg:services>
        </cfg:domainmodel>
      </cfg:group>
    </cfg:groups>
  </resources>

  <definitionfiles />

  <extensions>
    <ext:editorextensions>
      <ext:editorextension target="CME">
        <ext:ribbontoolbars>
          <ext:add>
            <ext:extension pageid="CreatePage" groupid="TargetingGroup" name="Customization Extension" assignid="ExntensionBtn">
              <ext:command>Customization.Extension.Interface</ext:command>
              <ext:title>Create Thing</ext:title>
              <ext:issmallbutton>false</ext:issmallbutton>
              <ext:dependencies>
                <cfg:dependency>Customization.Extension</cfg:dependency>
              </ext:dependencies>
              <ext:apply>
                <ext:view name="DashboardView">
                  <ext:control id="DashboardToolbar"/>
                </ext:view>
              </ext:apply>
            </ext:extension>
          </ext:add>
        </ext:ribbontoolbars>
      </ext:editorextension>
    </ext:editorextensions>

  </extensions>

  <commands>
    <cfg:commandset id="Customization.Extension.Interface">
      <cfg:command name="Customization.Extension.Interface" implementation="Customization.Extension" />
      <cfg:dependencies>
        <cfg:dependency>Customization.Extension</cfg:dependency>
        <cfg:dependency>Customization.Extension.Services</cfg:dependency>
      </cfg:dependencies>
    </cfg:commandset>
  </commands>

</Configuration>

My command is working as I can get it to display "hello" in an alert.

However, when trying to call Customization.Extension.Services.Hello() (a simple WCF method). I get "Customization" is not defined.

Please note code anonymised to protect the innocent/client.

Anyone got any hints on how to do this?

I have split out my model into a separate project for now but am interested in how this is supposed to work.

3
  • I'm missing your <ext:modelextensions> element that you insert below the <ext:dataextenders> element? Commented Feb 12, 2016 at 12:10
  • Is that required for this to work? I am unsure what would go in there. It's empty in the real config - removed it for brevity here. Commented Feb 12, 2016 at 12:21
  • It is mentioned in the documentation, so I guess something would need to go in there for it to work yes, but not sure what ;) Commented Feb 12, 2016 at 13:16

1 Answer 1

4

You can include a "Service" call in your Editor UI extension, without configuring a Model extension, I think is what you are trying to achieve.

The configuration part is ok. You need the "Service group" and the dependency in your files group.

What I don't know is if you have included the Web.Config part, something like:

  <system.serviceModel>
    <services>
      <service name="Customization.Extension.Services.MyService" behaviorConfiguration="Tridion.Web.UI.ContentManager.WebServices.DeveloperBehavior">
        <endpoint name="MyService" address="" behaviorConfiguration="Tridion.Web.UI.ContentManager.WebServices.AspNetAjaxBehavior" binding="webHttpBinding" bindingConfiguration="Tridion.Web.UI.ContentManager.WebServices.WebHttpBindingConfig" contract="Customization.Extension.Services.IMyService"/>
      </service>
    </services>
  </system.serviceModel>

(Maybe there are some differences in the namespaces, the name of "MyService" must match your Services, and the contract attribute must match the interface class where the ServiceContract is defined).

Appart from that, the DLL with your service must be placed in the /bin directory of <Tridion>/Web/WebUI/WebRoot/ where all DLLs are placed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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