Integrating info

Last post 08-19-2005, 10:20 AM by gp_330. 2 replies.
Sort Posts: Previous Next
  •  08-18-2005, 3:21 AM 9722

    Integrating info

    I am sure that this is a question that you guys get all the time, but I wanted to know how flexible the Cute Chat applications database structure is. 

    The thing is that I have a MSSQL database setup for another one of my sites, and I see that the table names for the user logins and such are a little different to how I have layed mine out, and I want to know if I buy the application, can I change the references in the source code to fit my current database?

    Thanks
    GP
  •  08-18-2005, 2:15 PM 9749 in reply to 9722

    Re: Integrating info

    Gp,
     
    Please check the document:

    How can I hook CuteChat with my existing login system?

    CuteChat was built with the idea of extensibility in mind.
    CuteChat implements what is commonly known as a "Provider Model" design pattern—which will be used throughout the ASP.NET 2.0 framework. 

    A "Provider Model" design pattern separates the application logic for the service from its underlying storage repository by introducing a "provider" software component in between.

    This "provider" component exposes a standard interface to the service logic, but allows developers to implement the provider component on top of a repository of their choice.
    By creating custom providers, developers can easily write their own data and business logic layers and simply plug it into existing user management system and reuse the same set of user management system.
    The CuteChat 1.0 ships with seven pre-built providers...
     
    Keep me posted

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-19-2005, 10:20 AM 9772 in reply to 9749

    Re: Integrating info

    Hi Adam,

    I found the document that you referred to, but all the guides seem to be written for integrating with IBuySpy, DotNetNuke etc, which I am not using. 

    As I am writing in VB.net I took a look at the guide for Integrating with DotNetNuke 3.0, but obviously because I am not integrating with DotNetNuke I have no reference to theDotNetNuke .dll which is causing quite a few errors.

    I am definitely interested in purchasing your software but I have to be sure that it can indeed integrate with my current system.  I am sure that you are quire busy but I would really appreciate some assistance integrating CuteChat with my site.

    With regards to my code this is what I have gotten so far:

    <code>
    Namespace Chat
        PUBLIC CLASS DotNetNukeDataProvider
            Inherits CuteSoft.Chat.DataProvider
           
            Public Overrides Function GetUserDisplayName(ByVal useruniquename As String) As String
                 Return GetUser(useruniquename).UserName
            End Function
           
            Protected Function GetUser(ByVal uniquename As String) As DotNetNuke.Entities.Users.UserInfo
                 Dim userid As Integer = Integer.Parse(uniquename)
                 Dim ps As DotNetNuke.Entities.Portals.PortalSettings = CType(System.Web.HttpContext.Current.Items("PortalSettings"), DotNetNuke.Entities.Portals.PortalSettings)
                 Return New DotNetNuke.Entities.Users.UserController().GetUser(ps.PortalId, userid)
            End Function

            Public Overrides Function ListUserUniqueName() As String()
                  Dim ps As DotNetNuke.Entities.Portals.PortalSettings = CType(System.Web.HttpContext.Current.Items("PortalSettings"), DotNetNuke.Entities.Portals.PortalSettings)
                  Dim names As New System.Collections.ArrayList
                  For Each user As DotNetNuke.Entities.Users.UserInfo In New DotNetNuke.Entities.Users.UserController().GetUsers(ps.PortalId, False, False)
                      names.Add(user.UserID.ToString())
                  Next
                  Return CType(names.ToArray(GetType(String)), String())
            End Function

            Public Overrides Function IsAdministrator(ByVal useruniquename As String) As Boolean
                Dim user As DotNetNuke.Entities.Users.UserInfo = GetUser(useruniquename)
                If user.IsSuperUser Then
                    Return True
                End If
       
                Dim ps As DotNetNuke.Entities.Portals.PortalSettings = CType(System.Web.HttpContext.Current.Items("PortalSettings"), DotNetNuke.Entities.Portals.PortalSettings)
                Dim roles() As String = New DotNetNuke.Security.Roles.RoleController().GetRolesByUser(user.UserID, ps.PortalId)
       
                Return Array.IndexOf(roles, "Administrators") <> -1
            End Function
           
            Public Overrides Function SearchUserUniqueNameByDisplayName(ByVal userDisplaName As String) As String()
                   Return SearchUserUniqueNamesByProperty("FirstName", userDisplaName)
             End Function
             
             Public Overrides Function SearchUserUniqueNamesByProperty(ByVal category As String, ByVal keyword As String) As String()
                   Dim ps As DotNetNuke.Entities.Portals.PortalSettings = CType(System.Web.HttpContext.Current.Items("PortalSettings"), DotNetNuke.Entities.Portals.PortalSettings)
                   keyword = keyword.ToLower()
                   Dim names As New System.Collections.ArrayList
                   For Each user As DotNetNuke.Entities.Users.UserInfo In New DotNetNuke.Entities.Users.UserController().GetUsers(ps.PortalId, False, False)
                       Dim prop As String
                       Select Case category
                           Case "FirstName"
                               prop = user.FirstName
                               Exit Select
                           Case "UserName"
                               prop = user.Username
                               Exit Select
                           Case "Country"
                               prop = user.Profile.Country
                               Exit Select
                       End Select
                       If prop <> Nothing Then
                           If prop.ToLower().IndexOf(keyword) <> -1 Then
                               names.Add(user.UserID.ToString())
                           End If
                       End If
                   Next
                   Return CType(names.ToArray(GetType(String)), String())
             End Function
        END CLASS
       
        public class DotNetNukeConnectionStringProvider: CuteSoft.Chat.ConnectionStringProvider { }
            Inherits CuteSoft.Chat.DataProvider
           
            Protected Overrides Function GetConnectionString(ByVal user As CuteSoft.Chat.UserIdentity) As String
                    Dim pc As DotNetNuke.Framework.Providers.ProviderConfiguration
                    pc = DotNetNuke.Framework.Providers.ProviderConfiguration.GetProviderConfiguration("data")
                    Dim p As DotNetNuke.Framework.Providers.Provider = pc.Providers(pc.DefaultProvider)
                    Dim s As String = p.Attributes("connectionStringName")
                    If s <> Nothing And s <> "" Then
                        s = System.Configuration.ConfigurationSettings.AppSettings(s)
                        If s <> Nothing And s <> "" Then
                            Return s
                        End If
                    End If
                    Return p.Attributes("connectionString")
             End Function
        END CLASS
    END NAMESPACE
    </code>

    Thanks for the help
    GP
View as RSS news feed in XML