Hi Michel,
1/
below the details of the error in question and modify your source code appropriately.
Compiler Error Message: BC30561: 'Entities' is ambiguous, imported from the namespaces or types 'DotNetNuke,
DotNetNuke.Services.Search'.
Source Error:
Line 13: Public Class HtmlTextController
Line 14:
Line 15: Implements Entities.Modules.ISearchable
Line 16: Implements Entities.Modules.IPortable
Line 17: 'Implements Entities.Modules.IUpgradeable
Source File: \ App_Code \ effority.WF_HTML \ HtmlTextController.vb Line: 15
Reply, the problem come from implementation of Isearchable.
I've been able to reproduce the bug on a local test site. This is fixable by some minor
changes in the file : \App_Code\effority.WF_HTML\HtmlTextController.vb
'--- begin of vb file
Imports System
Imports System.Configuration
Imports System.Data
Imports DotNetNuke.Services.Search
Imports DotNetNuke
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Common.Globals
Imports System.XML
Imports System.Web
Imports DotNetNuke.Entities.Modules
Namespace effority.WF_HTML
Public Class HtmlTextController
Implements ISearchable
Implements IPortable
'Implements Entities.Modules.IUpgradeable
Private Const MAX_DESCRIPTION_LENGTH As Integer = 100
#Region "Public Methods"
Public Function GetHtmlTextLastVersion(ByVal moduleId As Integer) As HtmlTextInfo
Return CBO.FillObject(DataProvider.Instance().ExecuteReader("effority_WF_HtmlText_GetLastVersion", moduleId), GetType(HtmlTextInfo))
End Function
Public Function GetHtmlTextActiveVersion(ByVal moduleId As Integer) As HtmlTextInfo
Return CBO.FillObject(DataProvider.Instance().ExecuteReader("effority_WF_HtmlText_GetActiveVersion", moduleId), GetType(HtmlTextInfo))
End Function
Public Function GetHtmlTextByVersion(ByVal moduleId As Integer, ByVal Version As Integer) As HtmlTextInfo
Return CBO.FillObject(DataProvider.Instance().ExecuteReader("effority_WF_HtmlText_GetByVersion", moduleId, Version), GetType(HtmlTextInfo))
End Function
Public Function GetHtmlTextById(ByVal Id As Integer) As HtmlTextInfo
Return CBO.FillObject(DataProvider.Instance().ExecuteReader("effority_WF_HtmlText_GetById", Id), GetType(HtmlTextInfo))
End Function
Public Function GetHtmlTextAllVersions(ByVal moduleId As Integer) As ArrayList
Return CBO.FillCollection(DataProvider.Instance().ExecuteReader("effority_WF_HtmlText_GetAllVersions", moduleId), GetType(HtmlTextInfo))
End Function
Public Sub SetHtmlTextActive(ByVal Id As Integer)
DataProvider.Instance().ExecuteNonQuery("effority_WF_HtmlText_SetActive", Id)
End Sub
Public Sub DeleteHtmlText(ByVal Id As Integer)
DataProvider.Instance().ExecuteNonQuery("effority_WF_HtmlText_DeleteById", Id)
End Sub
Public Sub AddHtmlText(ByVal objText As HtmlTextInfo)
DataProvider.Instance.ExecuteNonQuery("effority_WF_HtmlText_Add", objText.ModuleId, objText.DeskTopHTML, objText.DesktopSummary, objText.CreatedByUser)
End Sub
Public Sub UpdateHtmlText(ByVal objText As HtmlTextInfo)
DataProvider.Instance().ExecuteNonQuery("effority_WF_HtmlText_Update", objText.ModuleId, objText.DeskTopHTML, objText.DesktopSummary, objText.CreatedByUser)
End Sub
Public Function NewVersionAvaiable(ByVal ModuleId As Integer) As Boolean
Return Not CBool(DataProvider.Instance().ExecuteScalar("effority_WF_SearchForNewVersion", ModuleId))
End Function
#End Region
#Region "Optional Interfaces"
Public Function GetSearchItems(ByVal ModInfo As ModuleInfo) As SearchItemInfoCollection Implements ISearchable.GetSearchItems
Dim SearchItemCollection As New SearchItemInfoCollection()
Dim HtmlText As HtmlTextInfo = Me.GetHtmlTextActiveVersion(ModInfo.ModuleID)
If Not HtmlText Is Nothing Then
'DesktopHTML is encoded in the Database so Decode before Indexing
Dim strDesktopHtml As String = HttpUtility.HtmlDecode(HtmlText.DeskTopHTML)
'Get the description string
Dim strDescription As String = HtmlUtils.Shorten(HtmlUtils.Clean(strDesktopHtml, False), MAX_DESCRIPTION_LENGTH, "...")
Dim SearchItem As SearchItemInfo = New SearchItemInfo(ModInfo.ModuleTitle, strDescription, HtmlText.CreatedByUser, HtmlText.CreatedDate, ModInfo.ModuleID, "", HtmlText.DesktopSummary & " " & strDesktopHtml, "", Null.NullInteger)
SearchItemCollection.Add(SearchItem)
End If
Return SearchItemCollection
End Function
Public Function ExportModule(ByVal ModuleID As Integer) As String Implements IPortable.ExportModule
Dim strXML As String = ""
Dim objHtmlText As HtmlTextInfo = GetHtmlTextActiveVersion(ModuleID)
If Not objHtmlText Is Nothing Then
strXML += "<htmltext>"
strXML += "<desktophtml>" & DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(objHtmlText.DeskTopHTML) & "</desktophtml>"
strXML += "<desktopsummary>" & DotNetNuke.Common.Utilities.XmlUtils.XMLEncode(objHtmlText.DesktopSummary) & "</desktopsummary>"
strXML += "</htmltext>"
End If
Return strXML
End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' ImportModule implements the IPortable ImportModule Interface
''' </summary>
''' <remarks>
''' </remarks>
''' <param name="ModuleID">The Id of the module to be imported</param>
''' <history>
''' [cnurse] 11/15/2004 documented
''' </history>
''' -----------------------------------------------------------------------------
Public Sub ImportModule(ByVal ModuleID As Integer, ByVal Content As String, ByVal Version As String, ByVal UserId As Integer) Implements IPortable.ImportModule
Dim xmlHtmlText As XmlNode = GetContent(Content, "htmltext")
Dim objText As HtmlTextInfo = New HtmlTextInfo
objText.ModuleId = ModuleID
objText.CreatedByUser = UserId
'Get the original item
Dim objTextOld As HtmlTextInfo = Me.GetHtmlTextActiveVersion(ModuleID)
'See if there was an item already
If objTextOld Is Nothing Then
'Need to insert the imported item
objText.DeskTopHTML = xmlHtmlText.SelectSingleNode("desktophtml").InnerText
objText.DesktopSummary = xmlHtmlText.SelectSingleNode("desktopsummary").InnerText
AddHtmlText(objText)
Else
'Need to appende the imported item to the existing item
objText.DeskTopHTML = objTextOld.DeskTopHTML & xmlHtmlText.SelectSingleNode("desktophtml").InnerText
objText.DesktopSummary = objTextOld.DesktopSummary & xmlHtmlText.SelectSingleNode("desktopsummary").InnerText
UpdateHtmlText(objText)
End If
End Sub
'Public Function UpgradeModule(ByVal Version As String) As String Implements Entities.Modules.IUpgradeable.UpgradeModule
' InitPermissions()
' Return Version
'End Function
''' -----------------------------------------------------------------------------
''' <summary>
''' adds the module specific permissions
''' </summary>
''' -----------------------------------------------------------------------------
Public Shared Sub InitPermissions()
Dim moduleDefId As Integer
Dim pc As New DotNetNuke.Security.Permissions.PermissionController
Dim permissionList As ArrayList = pc.GetPermissionByCodeAndKey(Permission.PermissionCode, Permission.PermissionKey)
If permissionList Is Nothing Or permissionList.Count = 0 Then
Dim dc As New DotNetNuke.Entities.Modules.DesktopModuleController
Dim desktopInfo As DotNetNuke.Entities.Modules.DesktopModuleInfo
desktopInfo = dc.GetDesktopModuleByModuleName(Definition.ModuleName)
Dim mc As New DotNetNuke.Entities.Modules.Definitions.ModuleDefinitionController
Dim mInfo As DotNetNuke.Entities.Modules.Definitions.ModuleDefinitionInfo
mInfo = mc.GetModuleDefinitionByName(desktopInfo.DesktopModuleID, Definition.DefinitionFriendlyName)
moduleDefId = mInfo.ModuleDefID
Dim p As New DotNetNuke.Security.Permissions.PermissionInfo
p.ModuleDefID = moduleDefId
p.PermissionCode = Permission.PermissionCode
p.PermissionKey = Permission.PermissionKey
p.PermissionName = Permission.PermissionName
pc.AddPermission(p)
End If
End Sub
#End Region
End Class
End Namespace
'--------- end of vb file
2/ don't change them, we get an other error if needed. You can comprae a fresh web.config file from install pack to be sure.
3/ It can be a possibility to get you site working to use a new web.config in some case, but in your case, if you do that your web.config will missing some specif code for APP_Code folder (user with Effority WorkFlow)
HTH, regards