posts - 380, comments - 634, trackbacks - 117,
Dan Bartels online engineering logbook... Items that I find useful organized for my use, and indexed by google for yours. Here you can find information about Microsoft C# programming, SQL SERVER 2005, Telligent Systems CommunityServer, Dot Net Nuke, Windows Vista / Longhorn, and just about anything else that would compel me to type.

News

What I am Reading:


Professional Community Server

Past books can be viewed on:

Post Categories

Archives

Coding Techniques

Coding Tools

Community Sites

Deal Finders

Friends Businesses

Microsofties

Smartphones

Utilities

my blogmap
Installing CS 1.1 under DNN 3.1

As we continue to look at potential integration paths between Dot Net Nuke and Community Server, I thought it would be nice to get the two running under the same IIS website...  Actually to do this is rather quite simple...  All you HAVE to do, is:

  1. Upload the latest CS binaries to a folder on your site
  2. Mark the \Web directory as an application in IIS, or better yet, make it a Virtual Directory in IIS under DNN called something original like "CS"
  3. You *should* ensure that the ASPNET or NETWORK SERVICE accounts have at least write access to the CS folders, well BLOGS and GALLERIES, (this will already be the case if you installed this under your DNN directory)
  4. Update the DNN siteurls.config to tell DNN where to send requests to your CS installation (where the CS below is the web path to the CS install)

    <RewriterRule>
         <LookFor>.*/CS/(.*)</LookFor>
         <SendTo>~/CS/$1</SendTo>
    </RewriterRule>


  5. Update the Web.Config for Community Server, You need to remove some HTTPModules (by adding the following tags) and comment out the CS "TimeZone" provider property.

    <httpModules>
    <!-- remove DNN modules that interfere with CS-->
          <remove name="ProfilePrototype"/>
          <remove name="AnonymousIdentificationPrototype"/>
          <remove name="RoleManagerPrototype"/>
          <remove name="DNNMembership"/>
          <remove name="Personalization"/>
          <remove name="UrlRewrite" />
          <remove name="Exception"/>
          <remove name="UsersOnline"/>



    and

    <properties>
          <!--add name="timezone" type="System.Double" defaultValue="0" /-->

  6. Copy the following files from your DNN \bin folder into the CS \bin folder

    DNNSQLMembershipProvider.dll
    DNNSQLProfileProvider.dll
    DNNSQLRoleProvider.dll
    DotNetNuke.dll
    DotNetNuke.HttpModules.DNNMembership.dll
    DotNetNuke.HttpModules.Exception.dll
    DotNetNuke.HttpModules.Personlization.dll
    DotNetNuke.HttpModules.URLRewrite.dll
    DotNetNuke.HttpModules.UsersOnline.dll

  7. Edit the CS\Web\Installer\Default.aspx file and set INSTALLER_ENABLED = true;
  8. Navigate to the CS installer page (something like http://localhost/DotNetNuke/CS/Installer)...  Installing CS into any Database you Choose...  I recommend the same database as your DNN installation.

Now that should get you a working CS install under DNN, the only real "magic" involved was the DNN siteurls.config.  This allows you to have a CS site running along side you DNN installation...  Also if you have installed CS into your DNN directory you are a step closer to having integrated logins.

To integrate the logins with a portal on your DNN installation, you need to have created your CS install under your DNN application, and then you need do a couple more steps. (I highly recommend you do these, they extend the steps before 6 above and replace 7 and 8)

  1. Remove the "MachineValidationKey", "MachineDecryptionKey", "MachineValidationMode" and the entire "Authentication" region from the CS Web.Config; we are going to let the DNN Web.Config specify these settings.
  2. Add a MachineKey tag to the system.web section of the DNN Web.Config.  This is required to let CS and DNN share your login token.

    <machineKey
                validationKey= "[PUT YOUR ValidationDecryptionKey HERE]"
                decryptionKey= "[PUT YOUR MachineDecryptionKey HERE]"
                validation="SHA1"/>


  3. Go into your DNN portal Security Roles, and Add: "BlogAdministrator", "Everyone" (Go ahead and make this one Auto Assign), "FourmsAdministrator", "GalleryAdministrator", "SystemAdministrator", "Moderator", and "Editor" (CS will also share the existing Registered Users role)
  4. Go into your DNN portal User Accounts and create a user named "Anonymous"; also if you want to make a separate user for the CS admin you should do that now, I just use the DNN "admin" user.
  5. Install the CS database by running the following SQL scripts in order against your DNN database.. (the scripts are located in the CS\Web\Installer\SQLScripts folder)

    cs_Schema.SQL
    cs_Default.SQL
    cs_Procedures.SQL

  6. Now we need to update the CS 1.1 stored procedure named cs_system_CreateCommunity, to make it DNN friendly.  Download an run this sql script against your DNN database.
  7. Manually edit the CS Web.Config and comment out the "SiteSQLServer" key, we are going to inherit the one from DNN
  8. Run the cs_system_CreateCommunity sproc against the portal you wish to link the logins to: (replace the ApplicationName with the portal number you want to link the logins to, and of course use your SiteURL, Admin UserName, and Admin Password for this step)

    DECLARE @RC int
    DECLARE @SiteUrl nvarchar(512)
    DECLARE @ApplicationName nvarchar(512)
    DECLARE @AdminUserName nvarchar(256)
    DECLARE @AdminPassword nvarchar(256)
    DECLARE @CreateSamples bit

    SET @SiteURL = 'localhost/dotnetnuke/cs';
    SET @ApplicationName = '0';
    SET @AdminUserName = 'admin'
    SET @AdminPassword = 'admin'
    SET @CreateSamples = 0;

    EXECUTE @RC = [dbo].[cs_system_CreateCommunity]
       @SiteUrl
      ,@ApplicationName
      ,@AdminUserName
      ,@AdminPassword
      ,@CreateSamples

That should do it, you can register multiple DNN portals in CS, the only rule is that they have to have a unique "SiteURL"; so under this scheme, only portals with unique URLS can be tied to CS installs, DNN "Sub Portals" are not part of the CS URL and therefore do not qualify.

This leaves us with a couple of loose ends; new users created in DNN will not be automatically created in the CS tables (the following SQL snippit will fix this)

Declare @ApplicationName nvarchar(512)
Declare @SettingsID int
Declare @ApplicationID uniqueidentifier

Set @ApplicationName = 'YourPortalID'
Select @ApplicationID = ApplicationId FROM aspnet_Applications where  LoweredApplicationName = Lower(@ApplicationName)
Select @SettingsID = SettingsID FROM cs_SiteSettings where ApplicationName = @ApplicationName

 --Import ApplicationID specific users from aspnet_Users if they dont already exists

INSERT INTO [cs_Users]([MembershipID], [ForceLogin], [UserAccountStatus], [AppUserToken], [LastActivity], [LastAction])
 SELECT aspnet.UserID, 0,1, null, getdate(), '' from dbo.vw_aspnet_MembershipUsers aspnet LEFT OUTER JOIN dbo.cs_vw_Users_FullUser cs on aspnet.UserID = CS.UserID WHERE aspnet.ApplicationID = @ApplicationID and cs.UserID is null

 --Create cs_UserProfile records for any cs_Users without Profiles

INSERT INTO [cs_UserProfile]([UserID], [TimeZone], [TotalPosts], [PostSortOrder], [PostRank], [IsAvatarApproved], [ModerationLevel], [EnableThreadTracking], [EnableDisplayUnreadThreadsOnly], [EnableAvatar], [EnableDisplayInMemberList], [EnablePrivateMessages], [EnableOnlineStatus], [EnableHtmlEmail], [MembershipID], [SettingsID], [PropertyNames], [PropertyValues])
 SELECT cs_Users.UserID, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 1, 0, cs_Users.MembershipID, @SettingsID, NULL, NULL FROM cs_Users LEFT OUTER JOIN cs_UserProfile on cs_Users.UserID = cs_UserProfile.UserID Where cs_UserProfile.UserID is null

And finally all of your user admin must be done through DNN, actually the CS user admin screen will be broken as a result of us removing the timezone key...  I am working on a fix for this one at the moment...  If you have the CS 1.1 source code here is a fix that will work, Edit the CommunityServerComponents\Componets\Profile.cs:



/// <summary>
/// Specifies the user's timezone offset.
/// </summary>

public
double Timezone {     
  get
 
  {
   
   object
obj = GetObject("timezone");
     
if (profilebase["timezone"].GetType() == Timezone.GetType())

         return obj == null ? 0 : ( double )obj;
      else //DNN stores this as an INT (Minutes off GMT)
         returnobj == null? 0 : Convert.ToDouble(obj)/60;  
   }
   set 
   {
      if(profilebase["timezone"].GetType() == Timezone.GetType())

      {
         if ( value < -12 || value
> 12)
            Set("timezone",0);
         else 
            Set("timezone",value
);
      }
      else //DNN stores this as an INT (Minutes off GMT)
      {
         Set("TimeZone",Convert.ToInt32(
value
*60));
      }
   }
}
#endregion

Happy Hacking =)

Dan

Published Tuesday, June 28, 2005 8:12 AM by DanB

Filed under ,
::

Comments

# re: Installing CS 1.1 under DNN 3.1 @ Wednesday, August 03, 2005 2:49 PM

Thist ist just what I've trying to figure out for several hours. That far: Great Thing! Thanks!

After following all of the proposed steps I ran into trouble: When opening "htpp://localhost/DNN/cs/" I always get this Error:

_________________________________________________________________________

Server Error in '/DNN/cs' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: Annoymous_id_module_not_enabled: Country

Source Error:

[No relevant source lines]


Source File: none Line: 0

_________________________________________________________________________

Probably you know about this error and give me some advice...

Thanks

Philipp

Philipp

# re: Installing CS 1.1 under DNN 3.1 @ Thursday, August 11, 2005 11:19 AM

I managed to get it working ( at least the first step; SSO is will follow... )! What I did:

In CS web.config I removed ( commented out ) following lines:

_______________________________________________________________________________
<!--<anonymousIdentification
enabled="true"
cookieName=".ASPXANONYMOUS"
cookieTimeout="100000"
cookiePath="/"
cookieRequireSSL="false"
cookieSlidingExpiration="true"
cookieProtection="None" domain="" />-->
_______________________________________________________________________________

Now CommunityServer takes over DNN's Setting which enables anonymous Identification per default. It should also work if you set this option in both DNN's and CS's web.config in the same way!

THX for this great Solution!

Philipp

# re: Installing CS 1.1 under DNN 3.1 @ Friday, August 12, 2005 12:01 AM

In my case the proposed change of CommunityServerComponents\Componets\Profile.cs didn't work. Ich changed the code as following:

/// <summary>
/// Specifies the user's timezone offset.
/// Changed for DotNetNuke Compatibility
/// </summary>

public double Timezone
{
get
{
object obj;
try //CS stores this as an double "timezone" (hours off GMT)
{
obj = GetObject("timezone");
return obj == null ? 0 : (double)obj;
}
catch //DNN stores this as an INT "TimeZone" (Minutes off GMT)
{
obj = GetObject("TimeZone");
return obj == null ? 0 : (double)(Convert.ToDouble(obj)/60);
}

}
set
{
try //CS stores this as an double "timezone" (hours off GMT)
{
if ( value < -12 || value > 12)
Set("timezone",0);
else
Set("timezone",value );
}
catch //DNN stores this as an INT "TimeZone" (Minutes off GMT)
{
if ( value < -12 || value > 12)
Set("TimeZone",0);
else
Set("TimeZone",Convert.ToInt32( value *60));
}
}
}
#endregion


Now even Single Sign On works great. The next step would be a total integration into DNN as a Module...

Philipp

# re: Installing CS 1.1 under DNN 3.1 @ Friday, August 12, 2005 12:39 AM

Yep, there are a couple of pieces of this in development... But the key is getting it installed in the same DB with linked users... I have been working on blogs first... and should have a CTP release ready in the next week or two... It will probably just feature a blog viewer and feedback form, where you would still need to go to the CS admin pages to post a new entry or remove feedback... But it is being worked on =)

Dan

DanB

# Installing CS 1.1 under DNN 3.1 @ Sunday, August 14, 2005 7:12 PM


As we continue to look at potential integration paths between Dot Net Nuke and Community Server, I...

Danny的博客生涯

# re: Installing CS 1.1 under DNN 3.1 @ Saturday, August 20, 2005 8:32 AM

Dan,

I tried following exactly the steps here and I can get CS working with dnn

but i can't seem to get the sign in to work. When I set up the user in dnn, the users dont seem to be in registered in cs

where is the snippet
This leaves us with a couple of loose ends; new users created in DNN will not be automatically created in the CS tables (the following SQL snippit will fix this)

go? has it got to be run everytime a user is added?

regards
Eric

Eric

# re: Installing CS 1.1 under DNN 3.1 @ Saturday, August 20, 2005 10:18 AM

Yep, at the moment, that code, syncs the users... I haven't found the right spot for it yet. It should probably get appended to the end of the stored proc that DNN uses to create users... (or perhaps to a trigger on the DNN users table) not quite sure...

Dan

DanB

# re: Installing CS 1.1 under DNN 3.1 @ Monday, August 22, 2005 1:39 PM

Dan, do you want to add the DNN category to this post? When I came back to your site to look for this post, I scanned the DNN category first and this didn't show up.

Went through these steps on Friday with mixed success. I'm starting afresh with DNN 3.1.1 today.

Tim Sherrill

# re: Installing CS 1.1 under DNN 3.1 @ Tuesday, August 30, 2005 4:46 AM

to dan

i follow your guide,but the stored procedure seems not work.no result returns.


"Declare @ApplicationName nvarchar(512)
Declare @SettingsID int
Declare @ApplicationID uniqueidentifier
Set @ApplicationName = 'YourPortalID'
Select @ApplicationID = ApplicationId FROM aspnet_Applications where LoweredApplicationName = Lower(@ApplicationName)
Select @SettingsID = SettingsID FROM cs_SiteSettings where ApplicationName = @ApplicationName
INSERT INTO [cs_Users]([MembershipID], [ForceLogin], [UserAccountStatus], [AppUserToken], [LastActivity], [LastAction])
SELECT aspnet.UserID, 0,1, null, getdate(), '' from dbo.vw_aspnet_MembershipUsers aspnet LEFT OUTER JOIN dbo.cs_vw_Users_FullUser cs on aspnet.UserID = CS.UserID WHERE aspnet.ApplicationID = @ApplicationID and cs.UserID is null
INSERT INTO [cs_UserProfile]([UserID], [TimeZone], [TotalPosts], [PostSortOrder], [PostRank], [IsAvatarApproved], [ModerationLevel], [EnableThreadTracking], [EnableDisplayUnreadThreadsOnly], [EnableAvatar], [EnableDisplayInMemberList], [EnablePrivateMessages], [EnableOnlineStatus], [EnableHtmlEmail], [MembershipID], [SettingsID], [PropertyNames], [PropertyValues])
SELECT cs_Users.UserID, 0, 0, 0, 0x01, 0, 0, 0, 0, 0, 0, 0, 1, 0, cs_Users.MembershipID, @SettingsID, NULL, NULL FROM cs_Users LEFT OUTER JOIN cs_UserProfile on cs_Users.UserID = cs_UserProfile.UserID Where cs_UserProfile.UserID is null
"
now ,my dnn site is ok,but cs site doesn't run.the error message is as follow:(
Server Error in '/DotNetNuke/cs' Application.
--------------------------------------------------------------------------------

localhost/dotnetnuke/cs
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: CommunityServer.Components.CSException: localhost/dotnetnuke/cs

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

maisie

# re: Installing CS 1.1 under DNN 3.1 @ Wednesday, August 31, 2005 1:41 AM

You did apply the correct PortalID to the script ( Set @ApplicationName = 'YourPortalID' )?

Philipp

# re: Installing CS 1.1 under DNN 3.1 @ Friday, September 23, 2005 8:29 AM

Dan.

I tried the solution using localhost and it works

I created a site for it and as soon as i post a forum post, i get

We are currently unable to serve your request
We apologize, but an error occurred and your request could not be completed.

This error has been logged. If you have additional information that you believe may have caused this error please report the problem here.

This is the url for it

http://mysite.com/community/error.htm?aspxerrorpath=/community/forums/default.aspx

Is there a siteurl that i need to update? it is almost like it can't find the url. I checked the cs_post table and the test post is there

Eric

# re: Installing CS 1.1 under DNN 3.1 @ Friday, September 23, 2005 8:38 AM

I ran the test on the server to get the actual error and this is what i get

Server Error in '/community' Application.
--------------------------------------------------------------------------------

Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:


Line 66: </td>
Line 67: <td class="fh4" align="center" width="175">
Line 68: <%# ForumFormatter.FormatLastPost( (Forum) Container.DataItem, (bool) true ) %>
Line 69: </td>
Line 70: <td class="fh3" align="center" width="64">


Source File: D:\www\cs\50615src\src\Web\Themes\default\Skins\View-ForumGroupView.ascx Line: 68

Eric

# re: Installing CS 1.1 under DNN 3.1 @ Thursday, December 22, 2005 2:44 AM

Any chance of updating this for CS2 & DNN 4? Or maybe it's much the same??

Peter Jones

# re: Installing CS 1.1 under DNN 3.1 @ Saturday, December 31, 2005 6:50 PM

I have tried this with 3.2.2 and CS2 Beta 2 and all I can say from my experience is that we still need to wait for the CS2 source code. On my upgrade CS2 beta 2 is crashing when trying to use the admin pages probably becuase of the incompatability in the TimeZone routine in Profile.cs as before.

I am going to hold off updating any stored proc until I have the source code for CS2.

Really wish there was a dedicated CS2.0 module for DNN :'( I know I would put some cash down on the table for it!!

Lance

# re: Installing CS 1.1 under DNN 3.1 @ Sunday, January 01, 2006 6:10 PM

In the newer builds, we have switched to a custom provider for our Membership provider... We ship out of the box with a wrapper for the aspnet membership dll backport for .NET 1.1.... Hopefully we will also have a .NET 2.0 membership wrapper out of the box when we ship... This means, that for DNN or any other app using the .NET membership API, you would just need to build a compatible wrapper which implements our interface... This should give us the flexibility we need to integrate with other apps that use the ASP.NET membership (or possibly other membership API's)m going forward.

Dan

DanB

# re: Installing CS 1.1 under DNN 3.1 @ Wednesday, January 11, 2006 2:13 PM

That is great news! Can't wait for CS2.0! I really look forward to finally getting these 2 apps working more closely together :D

Lance

Leave a Comment

(required) 
(required) 
(optional)
(required) 
 
Powered by Community Server (Commercial Edition), by Telligent Systems
powered by god (with a little help from Telligent Systems - Community Server 2.1)