|
< < |
| META TOPICPARENT |
name="WebHome" |
|
> > |
| META TOPICPARENT |
name="Sandbox.WebHome" |
|
| | WCF Hooks Extensions
Version Information |
| |
Additionally, if you do not like the current way the command hook writes messages to the input stream or processes the command response, you can override WriteMessage() or ProcessCommandResponse(). A sample custom implementation is shown below:
|
|
< < | %CODE{lang="C"}% using System; using System.Collections.Generic; using System.Linq; using System.Text; using cPanel.Core.Hooks;
namespace Sample { public class CustomCommandHook : CommandHook { protected override string FormatCommand(string command, HookExtension call, Stage stage, CommandHookMessage config) { // Do what you want here to create the command call string return base.FormatCommand(command, call, stage, config); }
protected override string FormatArguments(string arguments, HookExtension call, Stage stage, CommandHookMessage config) { // Do what you want here to create the command arguments string return base.FormatArguments(arguments, call, stage, config); } } } |
> > | %CODE{lang="C"}%
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using cPanel.Core.Hooks;
namespace Sample
{
public class CustomCommandHook : CommandHook
{
protected override string FormatCommand(string command, HookExtension call, Stage stage, CommandHookMessage config)
{
// Do what you want here to create the command call string
return base.FormatCommand(command, call, stage, config);
}
protected override string FormatArguments(string arguments, HookExtension call, Stage stage, CommandHookMessage config)
{
// Do what you want here to create the command arguments string
return base.FormatArguments(arguments, call, stage, config);
}
}
} |
| | %ENDCODE%
|
| | To implement your own custom versions of these classes, you can use the generic installer types like so:
%CODE{lang="C"}% |
|
< < |
public class CustomCommandHookBehavior : HookBehaviour { }
public class CustomCOmmandHookBehaviorAttribute : HookOperationBehaviorAttribute { } |
> > | public class CustomCommandHookBehavior : HookBehaviour
{
}
public class CustomCOmmandHookBehaviorAttribute : HookOperationBehaviorAttribute
{
} |
| | %ENDCODE%
|
| | <-- SyntaxHighlightingPlugin -->
<add name="CustomCommandHooks" type="Sample.UrlHookBehaviour, Sample" externalConfigurationPath="\\10.1.15.101\e\ApplicationPath\Common\Hooks\CommandHookConfiguration.config" />
<-- end SyntaxHighlightingPlugin --> |
|
> > |
<--
- Set PAGETITLE = WCF Hooks Extensions
--> |
| |
| META FILEATTACHMENT |
attachment="CommandHook.class.png" attr="h" comment="" date="1308180164" name="CommandHook.class.png" path="CommandHook.class.png" size="11293" stream="CommandHook.class.png" tmpFilename="/var/tmp/CGItemp26009" user="JustinSchaefer" version="1" |
| META FILEATTACHMENT |
attachment="CommandHook.Summary.png" attr="h" comment="" date="1308180177" name="CommandHook.Summary.png" path="CommandHook.Summary.png" size="72983" stream="CommandHook.Summary.png" tmpFilename="/var/tmp/CGItemp26031" user="JustinSchaefer" version="1" |
| META FILEATTACHMENT |
attachment="Log.exe.zip" attr="h" comment="" date="1308181252" name="Log.exe.zip" path="Log.exe.zip" size="35234" stream="Log.exe.zip" tmpFilename="/var/tmp/CGItemp26183" user="JustinSchaefer" version="1" |
| META FILEATTACHMENT |
attachment="Log.Source.zip" attr="h" comment="" date="1308181271" name="Log.Source.zip" path="Log.Source.zip" size="87001" stream="Log.Source.zip" tmpFilename="/var/tmp/CGItemp26156" user="JustinSchaefer" version="1" |
| META FILEATTACHMENT |
attachment="Logger.zip" attr="h" comment="" date="1308181286" name="Logger.zip" path="Logger.zip" size="1504" stream="Logger.zip" tmpFilename="/var/tmp/CGItemp26035" user="JustinSchaefer" version="1" |
| META FILEATTACHMENT |
attachment="configfile.png" attr="h" comment="" date="1308226602" name="configfile.png" path="configfile.png" size="82257" stream="configfile.png" tmpFilename="/var/tmp/CGItemp21013" user="MelanieSeibert" version="1" |
|
|
> > |
| META TOPICMOVED |
by="JustinSchaefer" date="1308332077" from="Sandbox.WcfHookExtensions" to="AllDocumentation/EnkompassDocs.WcfHookExtensions" |
|