Attention: We are retiring the ASP.NET Community Blogs. Learn more >

Contents tagged with SharePoint Forums

  • Source Code Posted for SharePoint Forums Web Part

    As I continue to cleanup my projects on CodePlex, I've posted the latest version of the source code for my SharePoint Forums Web Part. This is version 1.2 that was released in August (better late than never?).

    If you're interested in contributing/enhancing the project please do so. Right now I'm juggling a bunch of projects with lots of team members so it might take some time to get you added to the team if you're interested. If you are interested in modifying the codebase then Scott Hanselman has a great blog entry here on creating patches. You can simply submit a patch file to me (via email) and I'll add it to the codebase. This way you don't have to sign up for a CodePlex account and go through setting up all those tools. Your choice but please consider contributing to the project.

    The source code does not include the 2007 version as that will be released under the Community Kit for SharePoint project (CKS) which also lives on CodePlex (surprise surprise). I'm donating the 2007 version to CKS but in reality just simply having it hosted under that project. It'lll be the same Web Part however hopefully we'll have some more bodies working on it under CKS.

    You can download the source code directly from here (sort of direct since direct file links don't work anymore on CodePlex) or through a TFS client (Teamprise, Team Explorer, etc.) if you're signed up on the site via the latest change set here.

  • Adding SharePoint Forums Web Part to a page

    Okay, stupid error that I need to fix later today when adding the SharePoint Forums Web Part to a Web Part Page.

    When an assembly with SafeControl entries is installed in the GAC (like this version is) the DWP file requires that the <Assembly> tag is a fully qualified one (with the public key token, etc.). This is to distinguish it from other assemblies.

    The DWP file that is installed doesn't contain the fully qualified name, only the assembly name so SharePoint throws a hissy fit and says it's not safe.

    So to fix this:

    1. Navigate to your wpcatalog folder under c:\inetpub\wwwroot (or wherever SharePoint is installed to)
    2. Manually find and edit (with Notepad or something) the BilSimser.SharePoint.WebParts.Forums*.dwp file
    3. Change the <Assembly> tag to read:
      <Assembly>BilSimser.SharePoint.WebParts.Forums, Version=1.1.0.0, Culture=neutral, PublicKeyToken=e516dadc23877c32</Asssembly>
    4. Now you can import the web part onto a page from the virtual gallery.

    The <Assembly> tag should match the entry in the SafeControls entry in your web.config file.

    Stupid error that I should have realized. I'll rebuild the MSI (again) and update it for those that will download it later today.

    Sorry about that folks. Sometimes coffee just isn't enough.

  • SharePoint Forums 1.1 Released

    Happy times are here again. I’ve finished the packaging and released version 1.1 of the SharePoint Forums Web Part. This contains a fairly large chunk of bug fixes and new functionality. Here’s a rundown:

    • Installation. Installation is HUGELY simplified. Just download the MSI and run it. Yeah, should have done that a long time ago.
    • Language Support. This release includes a language file (currently only english is available) with translatable strings from the Web Part. The file is just an xml file and you can create your own (using the existing one as a template) and deploy your own language resources (just drop the file onto the server and go). More instructions on creating additional languages will be available on the Wiki shortly and more translatations are to come with upcoming releases (I didn’t get to externalize them all, but it’s a start).
    • Date Sorting. Forums and topics were being displayed backwards (oldest to newest) so this has been corrected to “bump” the latest posts to the top
    • Todays Topics. You can now click on a link to show all the topics posted today.
    • RSS feeds. Each forum has it’s own unique RSS feed you can subscribe to.
    • Cleanup of display. A few links (like Delete Topic) have been cleaned up and put in a better place to make it easier to find. Other minor fixes to the display.
    • Performance. This was a big boo-boo I made. Now the forums load in under a second (no matter how many posts you have).
    • New Admin Functions. There’s a couple of new admin functions like recalcuating the totals (sometimes they get out of whack), deleting all the forums and restarting, and creating a set of sample data to play around with.

    Hope you like it! Keep your suggestions coming in the Discussion Forums and Issue Tracker. Next drop is in August (we’re now on monthly drop cycles) with anonymous users, NNTP synchronization, ASP.NET 2.0 and MOSS 2007 support!

    You can grab the file from the Releases section on CodePlex or directly from here.

    Enjoy!

  • Automating your Web Part builds (and distribution) with WPPackager and NAnt

    I’m just finishing up the packaging for the new version of the SharePoint Forums Web Part tonight and thought I would share with you some ideas and concepts around the packaging and distribution of it.

    Thanks to Paul Schaeflin who took time out of his busy schedule to put together a CAB installer for me. It was great but I thought I could improve on his foundation. I used that as a basis, but then went back to an additional friend, WPPackager. WPPackager is a sweet little tool that will package up your Web Part assemblies, resources, and additional files and create an MSI for you. The end user just runs the MSI without any fuss or mess screwing around with web.config or custom policy files. There’s a great MSDN article that explains how to use the tool with some examples. Check it out here.

    Anyways, so I use NAnt for my builds (free, open source, blah, blah, blah) and with NAnt you can practically automate anything. Here’s part of my NAnt build file for SharePoint Forums:

        1 <?xml version="1.0"?>

        2 <project name="SharePoint Forums Web Part" default="deploy">

        3 

        4     <property name="config.build" value="Debug" />

        5     <property name="output.dir" value="build" />

        6     <property name="deploy.dir" value="C:\Inetpub\wwwroot\bin" />

        7     <property name="resource.dir" value="C:\Inetpub\wwwroot\wpresources\BilSimser.SharePoint.WebParts.Forums" />

        8     <property name="wppackager.dir" value="C:\Program Files\WPPackager" />

        9 

       43     <target name="dist" description="create a distribution MSI for the web part" depends="build">

       44 

       45         <!-- Copy the files needed by WPPackager to the build directory -->

       46         <copy todir="${output.dir}" flatten="true">

       47             <fileset>

       48                 <include name="SharePointForums-1.1.0.0.xml" />

       49                 <include name="src\Manifest.xml" />

       50                 <include name="src\SharePointForums.dwp" />

       51             </fileset>

       52         </copy>

       53 

       54         <!-- Use WPPackager to create a MSI -->

       55         <exec program="WPPackager.exe" basedir="${wppackager.dir}" workingdir="${output.dir}">

       56             <arg value="SharePointForums-1.1.0.0.xml" />

       57         </exec>

       58 

       59     </target>

       60 

       61     <target name="install" description="installs the web part using the MSI installer" depends="dist">

       62         <exec program="SharePointForums-1.1.0.0.MSI" basedir="${output.dir}" />

       63     </target>

       64 

       65 </project>

    It’s fairly long and I’ve removed some of the targets for clarity but let’s break it down here. The default target is “deploy” which will in turn call “build” which first calls “clean”. These do what you think and deploy just copies the files to the “C:\Inetpub\wwwroot\bin” directory (or wherever you run your SharePoint server from).

    The target we’re interested here is “dist”. The “dist” target will do three things:

    • Clean out the build directory and rebuild the system
    • Copy all the distribution files needed for the distribution
    • Execute the WPPackager.exe program and create an MSI

    The build is done through the “build” dependency target which compiles the solution file but first executes the “clean” target which just deletes the build directory. All files are output first to the build directory (here specified as the variable ${output.dir}. This keeps all the dll files in one place rather than hunting all over for a Debug or Release directory.

    The WPPackager program needs a single file which contains instructions to build the MSI. Here’s the SharePointForums-1.1.0.0.xml file:

        1 <?xml version="1.0" ?>

        2 

        3 <!--

        4     WPPackager file for SharePoint Forums Web Part

        5     Version 1.1.0.0

        6     GAC install

        7 -->

        8 

        9 <Wppackager xmlns="http://schemas.microsoft.com/WebPart/v1/Wppackager">

       10 

       11     <Manifest FileName="Manifest.xml" />

       12 

       13     <MSI

       14         Name="SharePointForums-1.1.0.0"

       15         Version="1.1.0.0"

       16         Manufacturer="Bil Simser" />

       17 

       18 </Wppackager>

    Not much to look at. This just tells WPPackager that I’m building an MSI, giving it a name and version and manufacturer (that’s ME!). The Manifest.xml is the standard one from SharePoint that just lists the assemblies we’re including and the SafeControl entries (these are added to the web.config file auto-magically when the MSI is run).

    The WPPackager needs all the files that are going into the distribution (much like if you were using a CAB project in Visual Studio to build a CAB) so the build script (using the “copy” task) copies the Manifest.xml and SharePointForums.dwp file from the Web Part directory into the build directory so WPPackager can find it when it runs.

    Finally WPPackager is run using the “exec” task as shown here. This will create SharePointForums-1.1.0.0.MSI in the output directory.

    I also use an install target that will run the MSI after it’s built. I do this on a clean system just to test the build and install to make sure everything works (note to self: I’ll probably add an “un-install” target for rolling it back, if I can figure out how to execute the MSI backwards).

    One note is on the output of WPPackager. You’ll see something like this:

    dist:

         [copy] Copying 3 files to 'C:\dev\BilSimser.SharePoint\WebParts\ForumSingleSolution\build'.
         [exec] Success: MSI Installer: 'SharePointForums-1.1.0.0' created successfully from 'SharePointForums-1.1.0.0.xml'.
         [exec] Note: 'SharePointForums-1.1.0.0' is not signed. Consider signing 'SharePointForums-1.1.0.0' so that the user can identify the source of the MSI.

    BUILD SUCCEEDED

    Total time: 6.2 seconds.

    The MSI that gets created is unsigned (and will be untrusted on the installing sever when it’s run). I didn’t want to get into the details of signing here but check out this article on using SignTool. Once you install SignTool you can do something like this in your build file:

    signtool sign /a MyFile.msi

    Which will sign the file with the best certificate it can find. I haven’t tried it so you’ll have to check it out yourself (I just need to get around to installing the Platform SDK, something I normally don’t do). Until then you’ll just have to trust me ;)

    That’s about it for automating your distributions with NAnt. A similar build could be created with MSBuild and it’s format so I may create that when I move the project over to the 2007 platform later this month. Otherwise, with a few simple tools and commands you can have a nice little automated MSI builder so you don’t have to put your users through hell (like I did) on editing web.config files manually and trying to locate the “bin” folder (sorry about that guys).

    BTW, WPPackager is being discontinued. Please read, speak up, and support the post here from Maurice Prather on it. Personally it’s a nice tool once you get to know it. It’s not perfect, but at least it a) creates an MSI for you b) inserts the SafeControl entries for you and c) will apply a custom policy file for you (it copies whatever is there and adds your own policy entries). Additionally, it will roll all this back all these changes when you un-install the Web Part from the Add/Remove Program Files menu. You could probably do the same with a custom installer but then you need to mess with the web.config file (finding the right node, adding entries to it, etc.) and backing up and creating custom policy files (as well as rolling this back during an un-install). Neither rocket nor science, but not just a few if/then/else statements either so WPPackager helps. A lot.

    At this point, there’s no slick way I know of to install Web Parts in 2007 (yet), although Todd Baginski’s SharePoint Feature Manager is looking good, but it still needs things to manage and won’t install the Web Parts/Solutions for you. Hopefully someone will have something put together (perhaps a resurrection of WPPackager?) for 2007 as we really do need to in order to deliver packages to you, the consumer, and not have you go through crazy setups like in the past (or is it the present?).

    Watch for the Web Part release later tonight on CodePlex.

  • Installing the SharePoint Forums Web Part

    The biggest problem that I keep hearing about with the SharePoint Forums Web Part is installation. I think there is a flaw so that you will, almost always, get at least one error on security but with a page refresh this goes away (at least with all the tests I've done where I'm running as non-admin, non-Full trust, I get this).

    However the biggest problem that everyone is talking about is the steps they're going through installing the web part and the errors they're getting. Here's an example:

    "I've read all the documetation and followed it exactly and installed the dll files in the c:\inetpub\wwwroot directory but it still doesn't work."

    Okay, this is wrong. The documentation does not say this, it says to find the directory where SharePoint is installed and in a default setup it will be this. It also says to create the "bin" folder (where the assemblies are) if it doesn't exist.

    It's feedback like this that is causing problems with people installing the web part.

    I'll be the first to admit, if the documentation is wrong (and it might be) then I'll update it so that anyone can install this. I'll also be the first to admit that if you've never installed a custom web part (and there are a lot of people that haven't) that these instructions can be a little daunting. We are working on an installer to make it as idiot-proof as possible and hopefully reduce it to a one-click install. The problem is that there are several moving parts that need to happen for the web part to make it into a virgin system including:

    • Copying the assemblies to the "bin" folder
    • Adding the SafeControl entries to the web.config file
    • Creating a custom policy file
    • Setting the custom policy file in the web.config
    • Adding an assembly to the "gac"

    These are non-trivial steps, but as far as I know I've documented them as much as possible on the Wiki site. So please refer to the installation instructions here first and foremost. Also remember to click on the hyperlink for each step, as it contains a more detailed set of instructions.

    Like I said, if the instructions are incorrect or missing information (even the smallest thing) please let me know. Did I screw up? Maybe? Did you just assume things and skip steps? Possibly. I've been communicating with a *lot* of people and *almost* everytime, they've just ignored what the documentation said and put things in weird places (I even had one guy that copied the dll files to the 60 hive, which is just completely wrong).

    Okay, enough of my ranting. Since I can't be at everyones machine to do the install for them the documentation (until a complete installer comes along) is the next best thing. Please help make it a complete and accurate document.

    Thanks.

  • SharePoint Forums schedule update

    Just a quick update on the SharePoint Forums project. I’ve moved the next release (v1.1.0.0) out to July 1st. It’s just too close to TechEd and I wasn’t able to actually get any work done while I was there (no surprise). The monthly iterations will continue, but they’ll start on the first of the month. This just gives me a little time to get things going. Also the roadmap is being planned out for the August and beyond releases which will include new functionality and support Office 2007 installations.

    Also when you’re reporting issues, can you please provide some information about your setup. It’s important to know if you’re on a SharePoint Portal Server install, or just a Windows SharePoint Services setup (or a Small Business Server setup) and if you’ve installed ASP.NET 2.0 on WSS or something crazy like that. It’ll help track down problems much faster for me.

    Thanks!

  • TechEd 2006 - Day 3 - Zappa does Zappa and change is good

    I didn’t get a chance to blog yesterday as it was a full day for me but here’s the recap as there were many things going on all over the place and the entire day is a bit of a blur (much like this blog entry is looking right now after 3 hours of sleep).

    I was manning the Technical Learning Center (TLC) in the Offiice area. I’ll be here all week at various times so drop by and chat. It was great talking to everyone as there were so much diversity and different problems. It’s always interesting to talk to people about real world scenarios and see what people are doing (or wanting to do) with SharePoint. This helps me direct content to you that is most appropriate and valuable to you so please keep it coming (if you’re not here at TechEd or can’t catch up with me there’s always email). TechEd is such a great show and one of the biggest benefits (IMHO) is not the sessions, it’s not the keynotes, it’s not even the schwag (did I even say that?) but it’s the personal networking. I speak to more people in the Technical Learning Center than I ever have and either helped solved peoples problems, hooked up with new people and got them hooked on the SharePoint drug, or strengthened old contacts.

    I had a great opportunity of meeting with Jim Newkirk for lunch and we spent a good hour or two talking about NUnit, Agile development, Team Rooms, Agile at Microsoft, and of course CodePlex. Jim had a session this morning on patterns which filled three rooms (and was packed). It was a great overview of patterns but just scratches the surface, but I prefer to see this kind of content come out of Microsoft . Don’t get me wrong, the other stuff that’s product based is great too (and much needed) but seeing Agile and Pattern sessions (even if they are high level) is a good thing. If you get a chance to drop by the Patterns and Practices guys, please do. They do good work.

    Jim is full time on CodePlex and it’s growing like gangbusters, even if it hasn’t been fully released for primetime yet by Microsoft (but they’re getting there). There are some great things happening with CodePlex so time will tell as the story unfolds and we see more good stuff from the team. It was however, a discussion with Jim that led to meeting Korby Parnell, one of the key guys behind CodePlex. In discussions with Korby, Lawrence Liu, Chad Hower, and others there are some adjustments I’m making in the SharePoint Forums project.

    Korby and CodePlex

    First off, I’m moving to a scheduled monthly iteration. I’m still a one-man team (but don’t intend to keep it that way) but want to follow a regular schedule. Monthly iterations sounds good from a management perspective and they’ll be enough time to work on each release and get features baked in that are value-added.

    The first of the new features that arose out of discussions Tuesday is anonymous support. Currently all users have to be a member of a SharePoint site which is great for intranets, but if you want to host SharePoint Forums on an internet facing site, it just doesn’t works (to be honest, I don’t know what it will do yet so I have to see but I’m pretty sure it won’t work). In any case, I’m going to do some specific things around anonymous support. If a user hits the site and is anonymous, then they can get read access (configurable as to what access they have). Once they want to post they’ll need to be signed in so if they’re not, they’ll be whisked away to a new login/register page. Again, it’s up to you how much access they get on sign up so they can post or you can set it so they have to be approved first before their word can be heard. This will all be configurable per forum so you can have some forums open, some slightly locked down, and others completely verbotten to internet users. Also extranet users will look just like internet ones as far as the forums go, just behind the scenes we’ll store more info because right now users information (display name, email, etc.) is all coming from SharePoint. The forums only store the SharePoint ID for a lookup so this will change. Again, the forums are polymorphic in design so once a new version goes out, the lists will automatically be upgraded and transformed. There’s no data migration you’ll have to do. I think this is the best of both worlds.

    The next thing is the introduction of an question/answer system. Currently with a message you can reply (or quote) and the message just shows up in the thread. For each forum, you’ll be able to flip a flag that turns it into a question/answer forum. This means that an additional link will appear next to the reply button called “Answer”. An answer is a reply, but just has different characteristics. As the thread owner, you’ll be able to look through the answers and click on a new button called “Accept” (which will be next to “Edit”). This will allow you to accept an answer as correct and give us a bit of ranking/rating system (for example you can get a list of threads with questions that are “unanswered”). Think of a system like Experts Exchange and you’ll get the idea.

    I’ll be putting these in as work items on the CodePlex site and adding a few new releases to the release schedule for the next few months. There are additional features planned and actively being worked on so check out the release roadmap for more information. Speaking of the forums, I spent an exhausting 15 minutes yesterday porting the Web Part over to 2007 and have it running in my VM. If you’re in the TLC, drop by and take a look. There are some bugs due to deprecated features I’m using so I have to switch some controls over to their ASP.NET 2.0 counterparts, but it looks pretty good. Expect a 2007 version in the August drop.

    Last night I was the recipient of the “Win a Date with Fitz” contest. Okay, there wasn’t a contest but it sounded good. Fitz and I headed out to see Dweezil Zappa and his band doing his Frank’s music in a show called “Zappa does Zappa”. Let me say that while I’m not a huge Zappa fan, I’m all for good music and yeah, this was good. Wait. Correct that. It was fantastic. Even better. It kicked any tech gadget I’ve seen so far (even the Sony Vaio and that’s saying a lot coming from me).

    There are two truths to the world that I’ve come to learn. In every city, anywhere I go, there are two things that stand out. In Boston last night I discovered both of them. First, cabbies generally do not know where anything is. We hopped into the cab and told him we were going to the Orpheum. Blank stare. Okay, maybe he’s heard of it but not sure what we’re referring to (or something like it). A few more minutes of prodding and coaxing and he still didn’t get it. We told him the area it was in because hey, we’re strangers in a strange land and if we knew where it was we would be driving. Still nothing. Finally Fitz slogged out the Crackberry and looked it up (I’m sure he was using Google but I didn’t want to intrude). He called out the address. Still nothing.

    Some neuron must have fired in the cabbies head as he just started driving and well, we eventually got there. I don’t know how but the cab came to a stop and apparently it was nearby (although we still couldn’t see it). No biggie. We hopped out and figured if we can’t find it, we’ll ask (men are not afraid to ask for directions to a concert, we just won’t do it in a car at a gas station). Luckily it was down at the end of alley so we’re good to go.

    Oh yeah, the other truth. Bostonians wait until the last possible moment and *then* walk out in front of you. I watched two different occasions last night on the way to the Orpheum where someone would walk to the curb, wait, then when the light was red and cars were coming they decided to walk out. I’ve seen this happen other days as well so it must be true, as I now have 2 or 3 data points. Maybe it’s a Boston thing?

    Anyways, we needed to grab some food before the concert and that’s when the fun began (actually it began when Fitz was googling the location but the real fun was just around the corner).

    On the way to the substinance we happened along the alley where some bicycle cops have subdued someone and had them face planted on the sidewalk. Boston’s finest had just pulled up and was going to escort our friend to a nightly stay with them. There was opportunity for us to add insult to injury and perhaps accidently swipe the poor fellows head with Fitz’s boot, but we’re geeks and the passive type. Too bad I didn’t have the camera with me.

    So yes, the music. Oh the music. It was loud, and great, and never ended. Steve Vai showed up and joined in the fun with a guitar solo the likes I’ve never seen before. 2 hours into the set it wound down as things finished up, but then it was the encore. Which lasted an entire hour. The encore was a series of solos, the sax player belting out someting that Lisa Simpson would be proud of, and duets between Dweezil and Steve finished up by a killer drum solo.

    Incredible.

    So that was yesterday, this is today and I’m back in the TLC with some sessions today, lots of talking, and more parties. The fun never stops in Boston.

  • Performance fix for SharePoint Forums

    Okay, I’m human and prone to mistakes. I did a silly error when I released my SharePoint Forums Web Part in dynamically calculating post counts. I thought I was being smart by just using the value of the collection objects, trouble is that they’re all lazy loaded so when something like the stats come up for the site, every freakin’ message in the system gets loaded into memory.

    Simple fix and will be included in the next release. For those of you with a few hundred messages (and growing) you’ll find a huge difference. I test filled the system with 100,000 messages (yes, you can do that in SharePoint lists if you do it right) and load times are back to under 1 second, which is where they should be.

    Probably too many Fritos and Mountain Dew that night for this code monkey.

  • Friday catch-up blogging

    I’m just going through a few hundred emails and RSS feeds as I do everyday and getting caught up (in addition to dusting off my workspace due to construction out back). I wanted to address a few things in the SharePoint Forums Web Part.

    First is performance. Some people have mentioned it’s taking a long time to load the pages when there are a lot of posts. I’m going to do some more tests this weekend and see what’s going on. When I first built it, I had a small routine to fill the forums with 10 posts in 100 topics in 10 forums, which I thought was a good test (10,000 messages). Load times were negligible (less than 5s) even on my VM so I thought this was acceptable. I’ll go back and revisit this and might have to do something different for the June 19th release.

    Second is deployment. I still get emails from people who are putting the files in the “web server extensions\bin” folder so obviously my instructions are not clear enough (or people are not reading). There are some that refuse to put my dll in the GAC which is fine (you can deploy that assembly to the bin folder if you want). And there are others that still have security problems. So I’m doing a couple of things to rectify this. First I’m going to recheck the impersonation code and run it on a portal with an account that absolutely has no permissions. I’ve done this before and it worked fine, but this time I’m going to set it up and screenshot/cast it so you’ll see the step-by-step which should help you configure it in your own environment. Second, I’m going to produce a special single-dll version of the code for the next release so you can just deploy the web part and not have to worry about where this file goes or do any ugly GAC stuff. Finally, I will get an installer working (and maybe take another stab at with the single assembly) but this probably won’t be ready for next release as I have too many things to do before now and then.

    As for the source code, it is going to be posted on CodePlex and no, I’m not hiding anything. I’m just trying to figure out how to get the silly thing up there without having to “upsize” my 2003 project to a 2005 one. I wish the command line would just do a “tf -import” or something but it keeps looking like I have to import every file AND associate every checkin with a package. Oh, how much I LOVE Team Foundation.

    And yes, I still need to post the Calgary Code Camp presentations and code. Watch for that this weekend.