これに関する情報は少しスケッチです。私が使用したドキュメントについては、以下を参照してください。
AppCode (または Old_App_Code) でカスタム グローバル イベント ハンドラーを作成し、それが CMSModule Loader の部分クラスであることを確認します。
カスタム イベント ハンドラーをオーバーライドに追加します。Init()
必要なものはDocumentEvents.GetContent.Execute
.
送信者オブジェクトは、現在TreeNode
検索用にインデックス化されている必要があります。その後、そのノードを使用して関連する添付ファイルにアクセスし、イベント引数e.content
を変更してドキュメント テキストを検索に追加できます。
[CustomDocumentEvents]
public partial class CMSModuleLoader
{
private class CustomDocumentEventsAttribute : CMSLoaderAttribute
{
public override void Init()
{
// Assigns custom handlers to the appropriate events
DocumentEvents.GetContent.Execute += Document_GetContent;
}
private void Document_GetContent(object sender, DocumentEventArgs e)
{
TreeNode node = sender as TreeNode;
if (node != null)
{
//Note, this is psuedo code, this isnt the way to iterate over TreeNode.Attachments
foreach( attachment in node.Attachments ) {
e.Content += attachment.content;
}
}
}
}
}
より詳しい情報
バージョン 7 での一般的なカスタム イベントの実装については、 http://devnet.kentico.com/docs/devguide/index.html?event_handlers_overview.htmを参照してください。
バージョン 5 のカスタム検索については、こちらを参照してください
http://devnet.kentico.com/Knowledge-Base/Search/How-to-search-for-documents-using-assigned-categor.aspx
バージョン 5 のカスタム検索の例で参照されているバージョン 7 の更新されたイベント名については、http://devnet.kentico.com/Knowledge-Base/API-and-Internals/Custom-Handler-Library-compatibility.aspxを参照してください。