Skip to content

Commit

Permalink
Merge pull request #175 from donker/fixjournal
Browse files Browse the repository at this point in the history
Fix Html in Journal
  • Loading branch information
donker authored Nov 12, 2020
2 parents f950004 + a75f56b commit 56bad47
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 149 deletions.
288 changes: 144 additions & 144 deletions Server/Blog/Components/Integration/JournalController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -29,156 +29,156 @@ Imports DotNetNuke.Entities.Modules

Namespace Integration

Public Class JournalController
Public Class JournalController

#Region " Public Methods "
''' <summary>
''' Informs the core journal that the user has posted a blog Post.
''' </summary>
''' <param name="objPost"></param>
''' <param name="portalId"></param>
''' <param name="tabId"></param>
''' <param name="journalUserId"></param>
''' <param name="url"></param>
''' <remarks></remarks>
Public Shared Sub AddBlogPostToJournal(objPost As PostInfo, portalId As Integer, tabId As Integer, journalUserId As Integer, url As String)
If journalUserId = -1 Then Exit Sub
Dim objectKey As String = ContentTypeName + "_" + ContentTypeName + "_" + String.Format("{0}:{1}", objPost.BlogID, objPost.ContentItemId)
Dim ji As JournalItem = DotNetNuke.Services.Journal.JournalController.Instance.GetJournalItemByKey(portalId, objectKey)

If Not ji Is Nothing Then
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End If

ji = New JournalItem

ji.PortalId = portalId
ji.ProfileId = journalUserId
ji.UserId = journalUserId
ji.ContentItemId = objPost.ContentItemId
ji.Title = objPost.Title
ji.ItemData = New ItemData()
ji.ItemData.Url = url
ji.Summary = objPost.Summary
ji.Body = Nothing
ji.JournalTypeId = GetBlogJournalTypeID(portalId)
ji.ObjectKey = objectKey
ji.SecuritySet = "E,"

Dim moduleInfo As ModuleInfo = ModuleController.Instance.GetModule(objPost.ModuleID, tabId, False)
DotNetNuke.Services.Journal.JournalController.Instance.SaveJournalItem(ji, moduleInfo)
End Sub

''' <summary>
''' Deletes a journal item associated with the specified blog Post.
''' </summary>
''' <param name="blogId"></param>
''' <param name="PostId"></param>
''' <param name="portalId"></param>
''' <remarks></remarks>
Public Shared Sub RemoveBlogPostFromJournal(blogId As Integer, PostId As Integer, portalId As Integer)
Dim objectKey As String = ContentTypeName + "_" + ContentTypeName + "_" + String.Format("{0}:{1}", blogId, PostId)
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End Sub

''' <summary>
''' Informs the core journal that the user has commented on a blog Post.
''' </summary>
''' <param name="objPost"></param>
''' <param name="objComment"></param>
''' <param name="portalId"></param>
''' <param name="tabId"></param>
''' <param name="journalUserId"></param>
''' <param name="url"></param>
Public Shared Sub AddOrUpdateCommentInJournal(objBlog As BlogInfo, objPost As PostInfo, objComment As Entities.Comments.CommentInfo, portalId As Integer, tabId As Integer, journalUserId As Integer, url As String)
If journalUserId = -1 Then Exit Sub
Dim objectKey As String = ContentTypeName + "_" + JournalCommentTypeName + "_" + String.Format("{0}:{1}", objPost.ContentItemId.ToString(), objComment.CommentID.ToString())
Dim ji As JournalItem = DotNetNuke.Services.Journal.JournalController.Instance.GetJournalItemByKey(portalId, objectKey)
If Not ji Is Nothing Then
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End If

ji = New JournalItem

ji.PortalId = portalId
ji.ProfileId = journalUserId
ji.UserId = journalUserId
ji.ContentItemId = objPost.ContentItemId
ji.Title = objPost.Title
ji.ItemData = New ItemData()
ji.ItemData.Url = url
ji.Summary = objComment.Comment
ji.Body = Nothing
ji.JournalTypeId = GetCommentJournalTypeID(portalId)
ji.ObjectKey = objectKey
ji.SecuritySet = "E,"

Dim moduleInfo As ModuleInfo = ModuleController.Instance.GetModule(objPost.ModuleID, tabId, False)
DotNetNuke.Services.Journal.JournalController.Instance.SaveJournalItem(ji, moduleInfo)

If objBlog.OwnerUserId = journalUserId Then
Dim title As String = DotNetNuke.Services.Localization.Localization.GetString("CommentAddedNotify", SharedResourceFileName)
Dim summary As String = "<a target='_blank' href='" + url + "'>" + objPost.Title + "</a>"
NotificationController.CommentAdded(objComment, objPost, objBlog, portalId, summary, title)
End If

End Sub

''' <summary>
''' Deletes a journal item associated with the specific comment.
''' </summary>
''' <param name="PostId"></param>
''' <param name="commentId"></param>
''' <param name="portalId"></param>
Public Shared Sub RemoveCommentFromJournal(PostId As Integer, commentId As Integer, portalId As Integer)
Dim objectKey As String = ContentTypeName + "_" + JournalCommentTypeName + "_" + String.Format("{0}:{1}", PostId, commentId)
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End Sub
''' <summary>
''' Informs the core journal that the user has posted a blog Post.
''' </summary>
''' <param name="objPost"></param>
''' <param name="portalId"></param>
''' <param name="tabId"></param>
''' <param name="journalUserId"></param>
''' <param name="url"></param>
''' <remarks></remarks>
Public Shared Sub AddBlogPostToJournal(objPost As PostInfo, portalId As Integer, tabId As Integer, journalUserId As Integer, url As String)
If journalUserId = -1 Then Exit Sub
Dim objectKey As String = ContentTypeName + "_" + ContentTypeName + "_" + String.Format("{0}:{1}", objPost.BlogID, objPost.ContentItemId)
Dim ji As JournalItem = DotNetNuke.Services.Journal.JournalController.Instance.GetJournalItemByKey(portalId, objectKey)

If Not ji Is Nothing Then
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End If

ji = New JournalItem

ji.PortalId = portalId
ji.ProfileId = journalUserId
ji.UserId = journalUserId
ji.ContentItemId = objPost.ContentItemId
ji.Title = objPost.Title
ji.ItemData = New ItemData()
ji.ItemData.Url = url
ji.Summary = HttpUtility.HtmlDecode(objPost.Summary)
ji.Body = Nothing
ji.JournalTypeId = GetBlogJournalTypeID(portalId)
ji.ObjectKey = objectKey
ji.SecuritySet = "E,"

Dim moduleInfo As ModuleInfo = ModuleController.Instance.GetModule(objPost.ModuleID, tabId, False)
DotNetNuke.Services.Journal.JournalController.Instance.SaveJournalItem(ji, moduleInfo)
End Sub

''' <summary>
''' Deletes a journal item associated with the specified blog Post.
''' </summary>
''' <param name="blogId"></param>
''' <param name="PostId"></param>
''' <param name="portalId"></param>
''' <remarks></remarks>
Public Shared Sub RemoveBlogPostFromJournal(blogId As Integer, PostId As Integer, portalId As Integer)
Dim objectKey As String = ContentTypeName + "_" + ContentTypeName + "_" + String.Format("{0}:{1}", blogId, PostId)
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End Sub

''' <summary>
''' Informs the core journal that the user has commented on a blog Post.
''' </summary>
''' <param name="objPost"></param>
''' <param name="objComment"></param>
''' <param name="portalId"></param>
''' <param name="tabId"></param>
''' <param name="journalUserId"></param>
''' <param name="url"></param>
Public Shared Sub AddOrUpdateCommentInJournal(objBlog As BlogInfo, objPost As PostInfo, objComment As Entities.Comments.CommentInfo, portalId As Integer, tabId As Integer, journalUserId As Integer, url As String)
If journalUserId = -1 Then Exit Sub
Dim objectKey As String = ContentTypeName + "_" + JournalCommentTypeName + "_" + String.Format("{0}:{1}", objPost.ContentItemId.ToString(), objComment.CommentID.ToString())
Dim ji As JournalItem = DotNetNuke.Services.Journal.JournalController.Instance.GetJournalItemByKey(portalId, objectKey)
If Not ji Is Nothing Then
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End If

ji = New JournalItem

ji.PortalId = portalId
ji.ProfileId = journalUserId
ji.UserId = journalUserId
ji.ContentItemId = objPost.ContentItemId
ji.Title = objPost.Title
ji.ItemData = New ItemData()
ji.ItemData.Url = url
ji.Summary = HttpUtility.HtmlDecode(objComment.Comment)
ji.Body = Nothing
ji.JournalTypeId = GetCommentJournalTypeID(portalId)
ji.ObjectKey = objectKey
ji.SecuritySet = "E,"

Dim moduleInfo As ModuleInfo = ModuleController.Instance.GetModule(objPost.ModuleID, tabId, False)
DotNetNuke.Services.Journal.JournalController.Instance.SaveJournalItem(ji, moduleInfo)

If objBlog.OwnerUserId = journalUserId Then
Dim title As String = DotNetNuke.Services.Localization.Localization.GetString("CommentAddedNotify", SharedResourceFileName)
Dim summary As String = "<a target='_blank' href='" + url + "'>" + objPost.Title + "</a>"
NotificationController.CommentAdded(objComment, objPost, objBlog, portalId, summary, title)
End If

End Sub

''' <summary>
''' Deletes a journal item associated with the specific comment.
''' </summary>
''' <param name="PostId"></param>
''' <param name="commentId"></param>
''' <param name="portalId"></param>
Public Shared Sub RemoveCommentFromJournal(PostId As Integer, commentId As Integer, portalId As Integer)
Dim objectKey As String = ContentTypeName + "_" + JournalCommentTypeName + "_" + String.Format("{0}:{1}", PostId, commentId)
DotNetNuke.Services.Journal.JournalController.Instance.DeleteJournalItemByKey(portalId, objectKey)
End Sub
#End Region

#Region " Private Methods "
''' <summary>
''' Returns a journal type associated with blog Posts (using one of the core built in journal types)
''' </summary>
''' <param name="portalId"></param>
''' <returns></returns>
''' <remarks></remarks>
Private Shared Function GetBlogJournalTypeID(portalId As Integer) As Integer
Dim colJournalTypes As IEnumerable(Of JournalTypeInfo)
colJournalTypes = (From t In DotNetNuke.Services.Journal.JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = JournalBlogTypeName)
Dim journalTypeId As Integer

If colJournalTypes.Count() > 0 Then
Dim journalType As JournalTypeInfo = colJournalTypes.[Single]()
journalTypeId = journalType.JournalTypeId
Else
journalTypeId = 7
End If

Return journalTypeId
End Function

''' <summary>
''' Returns a journal type associated with commenting (using one of the core built in journal types)
''' </summary>
''' <param name="portalId"></param>
''' <returns></returns>
Private Shared Function GetCommentJournalTypeID(portalId As Integer) As Integer
Dim colJournalTypes As IEnumerable(Of JournalTypeInfo)
colJournalTypes = (From t In DotNetNuke.Services.Journal.JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = JournalCommentTypeName)
Dim journalTypeId As Integer

If colJournalTypes.Count() > 0 Then
Dim journalType As JournalTypeInfo = colJournalTypes.[Single]()
journalTypeId = journalType.JournalTypeId
Else
journalTypeId = 18
End If

Return journalTypeId
End Function
''' <summary>
''' Returns a journal type associated with blog Posts (using one of the core built in journal types)
''' </summary>
''' <param name="portalId"></param>
''' <returns></returns>
''' <remarks></remarks>
Private Shared Function GetBlogJournalTypeID(portalId As Integer) As Integer
Dim colJournalTypes As IEnumerable(Of JournalTypeInfo)
colJournalTypes = (From t In DotNetNuke.Services.Journal.JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = JournalBlogTypeName)
Dim journalTypeId As Integer

If colJournalTypes.Count() > 0 Then
Dim journalType As JournalTypeInfo = colJournalTypes.[Single]()
journalTypeId = journalType.JournalTypeId
Else
journalTypeId = 7
End If

Return journalTypeId
End Function

''' <summary>
''' Returns a journal type associated with commenting (using one of the core built in journal types)
''' </summary>
''' <param name="portalId"></param>
''' <returns></returns>
Private Shared Function GetCommentJournalTypeID(portalId As Integer) As Integer
Dim colJournalTypes As IEnumerable(Of JournalTypeInfo)
colJournalTypes = (From t In DotNetNuke.Services.Journal.JournalController.Instance.GetJournalTypes(portalId) Where t.JournalType = JournalCommentTypeName)
Dim journalTypeId As Integer

If colJournalTypes.Count() > 0 Then
Dim journalType As JournalTypeInfo = colJournalTypes.[Single]()
journalTypeId = journalType.JournalTypeId
Else
journalTypeId = 18
End If

Return journalTypeId
End Function
#End Region

End Class
End Class

End Namespace
4 changes: 2 additions & 2 deletions Server/Blog/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ Imports System.Runtime.InteropServices
' You can specify all the values or you can default the Build and Revision Numbers
' by using the '*' as shown below:

<Assembly: AssemblyVersion("6.5.0")>
<Assembly: AssemblyVersion("6.5.1")>

<Assembly: Guid("49cae2ac-30c7-45fe-8663-948e1543d8d3")>
<Assembly: AssemblyInformationalVersion("06.04.01")>
<Assembly: AssemblyFileVersion("6.5.0")>
<Assembly: AssemblyFileVersion("6.5.1")>
4 changes: 2 additions & 2 deletions Server/OpenUrlRewriter/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("6.5.0")>
<Assembly: AssemblyFileVersion("6.5.0")>
<Assembly: AssemblyVersion("6.5.1")>
<Assembly: AssemblyFileVersion("6.5.1")>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dnn-blog",
"version": "6.5.0",
"version": "6.5.1",
"description": "The DotNetNuke Blog module is an easy to use content publishing module that is tightly integrated with the core DotNetNuke framework. It can be used in single or multi-author environments and also permits content authoring using off-site tools such as Windows Live Writer.",
"dnn": {
"projectFolders": [
Expand Down

0 comments on commit 56bad47

Please sign in to comment.