Skip to content

Commit

Permalink
Merge pull request #31 from Scippy/master
Browse files Browse the repository at this point in the history
DNN9 core search integration
  • Loading branch information
Scippy authored Feb 25, 2022
2 parents c6e3080 + 7c18469 commit 48b6292
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Entities/Constants.vb
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ Namespace Ventrian.PropertyAgent
Public Const MEDIUM_HEIGHT_SETTING As String = "MediumHeight"
Public Const MEDIUM_HEIGHT_SETTING_DEFAULT As Integer = 240
Public Const LARGE_WIDTH_SETTING As String = "LargeWidth"
Public Const LARGE_WIDTH_SETTING_DEFAULT As Integer = 700
Public Const LARGE_WIDTH_SETTING_DEFAULT As Integer = 1600
Public Const LARGE_HEIGHT_SETTING As String = "LargeHeight"
Public Const LARGE_HEIGHT_SETTING_DEFAULT As Integer = 475
Public Const LARGE_HEIGHT_SETTING_DEFAULT As Integer = 1200
Public Const IMAGES_ITEMS_PER_ROW_SETTING As String = "ImagesItemsPerRow"
Public Const IMAGES_ITEMS_PER_ROW_SETTING_DEFAULT As Integer = 2
Public Const IMAGES_WATERMARK_ENABLED_SETTING As String = "ImagesWatermarkEnabled"
Expand Down
27 changes: 22 additions & 5 deletions Entities/Property/PropertyController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Framework
Imports DotNetNuke.Services.Search
Imports DotNetNuke.Entities.Modules
Imports DotNetNuke.Services.Search.Entities
Imports DotNetNuke.Entities.Portals

Namespace Ventrian.PropertyAgent

Public Class PropertyController

Implements ISearchable
Inherits ModuleSearchBase


#Region " Private Methods "
Expand Down Expand Up @@ -212,8 +214,7 @@ Namespace Ventrian.PropertyAgent

#Region " Optional Interfaces "

Public Function GetSearchItems(ByVal ModInfo As DotNetNuke.Entities.Modules.ModuleInfo) As DotNetNuke.Services.Search.SearchItemInfoCollection Implements DotNetNuke.Entities.Modules.ISearchable.GetSearchItems

Public Overrides Function GetModifiedSearchDocuments(ModInfo As DotNetNuke.Entities.Modules.ModuleInfo, beginDateUtc As Date) As IList(Of SearchDocument)
Dim objModuleController As New ModuleController
Dim objSettings As Hashtable = objModuleController.GetModuleSettings(ModInfo.ModuleID)

Expand All @@ -240,6 +241,7 @@ Namespace Ventrian.PropertyAgent
End If

Dim SearchItemCollection As New SearchItemInfoCollection
Dim list As New List(Of SearchDocument)

Dim objPropertyController As New PropertyController
Dim objProperties As List(Of PropertyInfo) = objPropertyController.List(ModInfo.ModuleID, Null.NullInteger, SearchStatusType.PublishedActive, Null.NullInteger, Null.NullInteger, Null.NullBoolean, Null.NullBoolean, SortByType.Published, Null.NullInteger, SortDirectionType.Descending, Null.NullString, Null.NullString, 0, 100000, Null.NullBoolean)
Expand Down Expand Up @@ -333,18 +335,33 @@ Namespace Ventrian.PropertyAgent

Dim SearchItem As New SearchItemInfo(strTitle, strDescription, Null.NullInteger, objProperty.DateModified, objProperty.ModuleID, objProperty.PropertyID.ToString(), strContent, "agentType=View&PropertyID=" & objProperty.PropertyID.ToString())
SearchItemCollection.Add(SearchItem)
Dim TabPath As String = ModInfo.ParentTab.TabPath.Replace("//", "/")
Dim item2 As New SearchDocument With {
.Url = TabPath + "?" + SearchItem.GUID,
.AuthorUserId = SearchItem.Author,
.UniqueKey = SearchItem.SearchKey,
.PortalId = ModInfo.PortalID,
.Title = SearchItem.Title,
.Description = SearchItem.Description,
.Body = SearchItem.Content,
.ModifiedTimeUtc = SearchItem.PubDate
}
list.Add(item2)
Next

Return SearchItemCollection
Return list

End If
End If
End If

Return Nothing

End Function





#End Region

End Class
Expand Down

0 comments on commit 48b6292

Please sign in to comment.