我正在尝试扩展 Tridion 的“CheckOut”命令,到目前为止,我正在尝试显示我自己的消息,并希望在我单击功能区工具栏中的“CheckOut”选项时需要放置 OOTB CheckOut 操作。
我已经创建了配置文件和 .js 文件,如下所示,我也在 System.config 中进行了更改并创建了虚拟目录。但是我的 .js 没有被触发,也没有显示我的自定义消息。
配置文件
<?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">
<resources cache="true">
<cfg:filters/>
<cfg:groups>
<cfg:group name="CommandsExtensions.Commandset" merger="Tridion.Web.UI.Core.Configuration.Resources.CommandGroupProcessor" merge="always">
<cfg:fileset>
<cfg:file type="script">/js/ExtendCheckOut.js</cfg:file>
<cfg:file type="reference">CommandsExtensions.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:dependencies>
</cfg:group>
</cfg:groups>
</resources>
<definitionfiles/>
<extensions>
<ext:editorextensions>
<ext:editorextension target="CME">
<ext:editurls/>
<ext:listdefinitions/>
<ext:taskbars/>
<ext:commands/>
<ext:commandextensions>
<ext:commands>
<ext:command name="CheckOut" extendingcommand="ExtendCheckOut" />
</ext:commands>
<ext:dependencies>
<cfg:dependency>CommandsExtensions.Commandset</cfg:dependency>
</ext:dependencies>
</ext:commandextensions>
<ext:contextmenus/>
<ext:lists/>
<ext:tabpages/>
<ext:toolbars/>
<ext:ribbontoolbars/>
</ext:editorextension>
</ext:editorextensions>
<ext:dataextenders/>
</extensions>
<commands>
<cfg:commandset id="CommandsExtensions.Interface">
<cfg:command name="ExtendCheckOut" implementation="CommandsExtensions.ExtendCheckOut"/>
</cfg:commandset>
</commands>
<contextmenus/>
<localization/>
<settings>
<defaultpage>/Views/Default.aspx</defaultpage>
<navigatorurl>/Views/Default.aspx</navigatorurl>
<editurls/>
<listdefinitions/>
<itemicons/>
<theme>
<path>css</path>
</theme>
<customconfiguration/>
</settings>
.js 文件
Type.registerNamespace("Extensions");
Extensions.ExtendCheckOut = function Extensions.ExtendCheckOut() {
Type.enableInterface(this, "Extensions.ExtendCheckOut");
this.addInterface("Tridion.Cme.Command", ["ExtendCheckOut"]);
};
Extensions.ExtendCheckOut.prototype.isAvailable = function ExtendCheckOut$isAvailable(selection) {
return true;
}
Extensions.ExtendCheckOut.prototype.isEnabled = function ExtendCheckOut$isEnabled(selection) {
return true;
}
Extensions.ExtendCheckOut.prototype._execute = function ExtendCheckOut$_execute(selection) {
$messages.registerWarning("This is Extended CheckOut");
}