Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 47 additions & 1 deletion ExpandableText/Components/ExpandableTextHtmlController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,14 @@
using DotNetNuke.Common;
using DotNetNuke.Common.Utilities;
using DotNetNuke.Entities.Modules;
using DotNetNuke.Services.Search.Entities;

namespace ICG.Modules.ExpandableTextHtml.Components
{
/// <summary>
/// This is the controller class providing functionality to the module
/// </summary>
public class ExpandableTextHtmlController : IPortable
public class ExpandableTextHtmlController : ModuleSearchBase, IPortable
{
#region Public Methods

Expand Down Expand Up @@ -123,6 +124,51 @@ public void DeleteExpandableTextHtml(int moduleId, int itemId)

//#endregion

#region ModuleSearchBase Members

/// <summary>
/// Gets the search documents for the module.
/// </summary>
/// <param name="moduleInfo">The module information.</param>
/// <param name="beginDateUtc">The begin date in UTC.</param>
/// <returns>A collection of search documents.</returns>
public override IList<SearchDocument> GetModifiedSearchDocuments(ModuleInfo moduleInfo, DateTime beginDateUtc)
{
var searchDocuments = new List<SearchDocument>();

// Get all expandable text items for this module, ordered by last updated date
var items = GetExpandableTextHtmls(moduleInfo.ModuleID, "ORDER BY LastUpdated");

foreach (var item in items)
{
// Only include items that have been updated since the begin date
if (item.LastUpdated.ToUniversalTime() >= beginDateUtc)
{
var searchDoc = new SearchDocument
{
UniqueKey = $"ETH_{moduleInfo.ModuleID}_{item.ItemId}",
PortalId = moduleInfo.PortalID,
TabId = moduleInfo.TabID,
ModuleId = moduleInfo.ModuleID,
ModuleDefId = moduleInfo.ModuleDefID,
Title = item.Title,
Body = item.Body,
Description = item.Title,
ModifiedTimeUtc = item.LastUpdated.ToUniversalTime(),
AuthorUserId = -1, // Default author as system since we don't track the author in this module
IsActive = true, // Assuming all items are active
CultureCode = moduleInfo.CultureCode,
};

searchDocuments.Add(searchDoc);
}
}

return searchDocuments;
}

#endregion

#region IPortable Members

///// <summary>
Expand Down
2 changes: 1 addition & 1 deletion ExpandableText/ExpandableTextHtml.dnn
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<license src="ManifestAssets\License.txt" />
<releaseNotes src="ManifestAssets\ReleaseNotes.txt" />
<dependencies>
<dependency type="CoreVersion">07.00.00</dependency>
<dependency type="CoreVersion">09.07.00</dependency>
</dependencies>
<components>

Expand Down
7 changes: 6 additions & 1 deletion ExpandableText/ManifestAssets/ReleaseNotes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
 <h2>Version 06.01.00 - April 21st, 2012</h2>
 <h2>Version 06.02.00 - [Current Date]</h2>
<ul>
<li>Added support for DNN 10.x Search Integration using ModuleSearchBase</li>
</ul>

<h2>Version 06.01.00 - April 21st, 2012</h2>
<ul>
<li>Resolved issues installing to SQL Azure</li>
<li>Updated module to support proper installation if a failure occured during initial install</li>
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ A simple Expanding/Collapsing text module for use with DNN

## Minimum DNN Version

Current releases support DNN 7.0.0 and later
Version 10.0.0 of this module requires DNN 9.7.0 or later

## Upgrade Warning - DNN 10.x Support

You must update to version 10.0.0 of this module BEFORE moving to DNN 10 to prevent errors.