Windows Live Alerts web tracker BlogRankers.com Software
Computers blogs
Chat with me if I'm online!
Search Zimmergren.net
Goodies

SharePoint Forums WebPart : What's going on?

As a follow-up to my previous blogpost: "Forum Web Part for SharePoint" I thought I'd let you know the status of my personal pet-project.

I've been getting alot of feedback regarding the Forum WebPart which is soon to enter it's beta-testing stage. Thanks for the feedback in terms of the comments to my previous blogpost and all the emails I keep getting regarding the SharePoint Forum WebPart.

Status

The status of this project is as follows:

I'm currently trying to get as much done on the SharePoint Forum WebPart as I possibly can on my (few) free hours right now. I've got tons to tend to before I go to Egypt in May (which by the way will be awesome).

I plan to release it for alpha-/betatesting before I go on vacation to Egypt though, and I've been getting some response as to whom might be interested in testing it.
Unfortunately not everyone left their email, which makes it hard for me to contact those individuals.

So if you're not sure, or know that you didn't send over your email but you want to try the WebPart out, add a comment here and include your email. ;)

This is what the SharePoint Forum WebPart currently looks like:

Basic overview of all availible forums
scr009

Basic overview of threads in a forum
scr010

Basic features:

  • Forum Management
    • Manage what forums exists (Using the default SharePoint interface)
  • Thread Management
    • Manage threads (Using the default SharePoint interface)
    • Create new threads (Using a custom interface) - ugly as hell
  • Post Management
    • Manage posts (Using the default SharePoint interface)
    • Create new posts (replies) - also ugly as hell :)
  • Breadcrumbs
    • [Home] > [Forum] > [Thread]
  • Forum Statistics
    • Last post
    • Last poster
    • Total posts
    • Total threads
    • Total forums
  • Paging (WebPart Property, meaning you can set this property yourself to a desired amount of items per page)
  • Theming
    • Supports all built-in themes
    • Supports custom made themes
    • (All styles for the forum is using the built-in SharePoint CSS classes)
  • etc. etc.
Feedback, suggestions, comments and all of that

This is still a work in progress, and I'd like for YOU to leave a comment with suggestions about functionality, accessibility, usability, usage, features etc.

Thanks for tuning in, see you around!


Published: Apr-28-08 | 311 Comments | 21 Links to this post

Stress Testing SharePoint Solutions with Visual Studio 2008

One of my pals, MVP Liam Cleary, posted a very interesting article on how to use Visual Studio 2008 to test the performance of your SharePoint Solution.
 

Published: Mar-27-08 | 1 Comment | 4 Links to this post

Silverlight 1.0 seamless integration with SharePoint 2007 complete!

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

Yep. It's me again...

I managed to salvage most of the data from the bluescreen a couple of hours earlier (due to the persistent use of source control).

I'll cover this topic more in details in one of the days to come, for now - this is what it looks like:

 slclock

Please do comment!

Have a good night everybody! I sure will, now.


Published: Mar-13-08 | 5 Comments | 1 Link to this post

Bluescreen of Death on my VPC

I completed my integration project with Silverlight 1.0 and SharePoint 2007 - which doesn't requiry any configuration on your server, except to install my Web Part with the .wsp solution.

But...

Instead of giving you a nice guide on how to implement and integrate Silverlight, Microsoft gave me a Bluescreen of Death smacked in my face when I was copying my files to the source control environment.

 bluescreen

Anyhow, it's not such a big loss. I think most of the things are checked into the Source Control environment already, so i just need to set up a new VPC - seeing as this one doesn't even start anymore :S

Hang in there a few days and you'll have your Silverlight 1.0 integration served on a Silverplate!

Keep in touch.


Published: Mar-13-08 | 1 Comment | 0 Links to this post

MOSS 2007: Creating a custom AJAX UserControl that will query the SharePoint Search Query Object Model to perform searches

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

If you've read my last two blogposts you already know how to configure ASP.NET 2.0 AJAX for your SharePoint Server and how do deploy a UserControl that uses AJAX functionality on you SharePoint Server.

You can find my previous articles here:

This blogpost shows a simple implementation of a UserControl that uses the Object Model to query the search service using a keyword and then using an UpdatePanel in AJAX to present the result to the user without any page reloads.

Let's create an AJAX based UserControl which purpose will be to search using the Search Query Object Model

Copy the nessecary assemblies to your local bin folder (I'm deploying locally to the WebApplication on port 80)

To make this work (in this case, since I'm deploying to the UserControls folder with inline code, not calling any own assemblies) you need to copy the two .dll files to your /bin folder of the WebApplication where you want to deploy this UserControl.

  1. Copy C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI\Microsoft.Office.Server.dll
  2. Copy C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI\Microsoft.Office.Server.Search.dll
  3. Paste the two files to C:\Inetpub\wwwroot\wss\VirtualDirectories\80\bin\ (Note: It can be any other port other than 80 if you're deploying to another WebApplication)

The reason that we copy these files to our deployment target's /bin is simply that I'm deploying locally to that WebApplication and some of the namespaces and classes that we need to use in order to be able to query the Search Object Model are availible in those assemblies. There's better ways to accomplish this, but to keep it simple I'm going with this approach.

Create the custom AJAX UserControl that will query the SharePoint Search Query Object Model

For simplicity, I'll reference all the servercode inside the <script> block and not using a code-behind assembly.

  1. Launch Visual Studio 2005 (or whatever version you're running)
  2. Create a new file based on the "Web User Control" template, name it as you please
  3. Add the following tags just below the Control directive:

    <%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>
    <%@ Import Namespace="Microsoft.Office.Server" %>
    <%@ Import Namespace="Microsoft.Office.Server.Search.Query" %>
    <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %>


    It could look something like this:
     searchajax1
  4. Just below all the references you just added, add the following code:

    <script runat="server">

    </script>


  5. Add the following code right below the references you just added. This code is simply to give us a simple user interface for the user to perform the search from:

    <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
        <ProgressTemplate>
            <img src="http://zimmergren/hostedImages/ajax-loader.gif" alt="Searching..." style="border: 0px none #fff;"/>
        </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            Enter a keyword to search for<br />
            <asp:TextBox ID="tbSearchString" runat="server" Width="230px"/><br />
            <asp:Button ID="btnSearch" runat="server" Text="Search" OnClick="btnSearch_Click" />
            <asp:Literal ID="literalSearchResults" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>


    It could look something like this:
     searchajax2

  6. Insert this code inside the <script>-tag you created earlier:

    protected void btnSearch_Click(object sender, EventArgs e)
    {
        // Job insurance, to pause and show that the UpdateProgress works
        System.Threading.Thread.Sleep(2000);
        try
        {
            string startTable = "<table style=\"width: 100%;\">";
            string endTable = "</table>";
            string searchResultItem =
            "<tr>" +
                "<td><a href=\"{0}\">{1}</a></td>" +
            "</tr>" +
            "<tr>" +
                "<td>" +
                    "<em>{2}</em>" +
                "</td>" +
            "</tr>" +
            "<tr>" +
                "<td>Site: {3}</td>" +
            "</tr>" +
            "<tr>" +
                "<td style=\"padding-bottom: 10px;\">Author: {4}, Item Size: {5}</td>" +
            "</tr>";

            string outputResults = startTable;

            ServerContext context = ServerContext.GetContext("SharedServices1");
            KeywordQuery keywordQuery = new KeywordQuery(context);

            keywordQuery.ResultTypes = ResultType.RelevantResults;
            keywordQuery.EnableStemming = true;
            keywordQuery.TrimDuplicates = true;
            keywordQuery.QueryText = tbSearchString.Text;

            ResultTableCollection results = keywordQuery.Execute();
            ResultTable resultTable = results[ResultType.RelevantResults];

            if (resultTable.RowCount == 0)
            {
                literalSearchResults.Text = "Sorry, your search didn't return any results";
            }
            else
            {
                while (resultTable.Read())
                {
                    outputResults += string.Format(searchResultItem,
                        resultTable.GetString(5),
                        resultTable.GetString(2),
                        resultTable.GetString(6),
                        resultTable.GetString(8),
                        resultTable.GetString(3),
                        resultTable.GetString(4));
                }
            }
            outputResults += endTable;
            literalSearchResults.Text = outputResults;
        }
        catch (Exception ex)
        {
            literalSearchResults.Text = ex.Message;
        }
    }

    Instead of going all crazy about how the code actually works with the Search Query Object Model, I'm just pasting the code here for you to try and will explain the Search Query Object Model in another article.

Deploy the UserControl
  • Copy or Save the UserControl to the following location: C:\Inetpub\wwwroot\wss\VirtualDirectories\80\UserControls\ and you're all set.

If you've configured AJAX and installed the SmartPart you should be all set and be able to use it. See this short post on using the SmartPart if you don't know already.

Final Result

This is what it looks like when you hit the button (the red image spins around for 2 seconds (see the code, Thread.Sleep(2000)) to show how it will look if it's a heavy query and needs some loading time.
 searchajax3

This is what the result will look like, note that everything is done within an UpdatePanel and we do not experience the page to reload, or any visual postbacks.
 searchajax4

Download the UserControl here


Published: Mar-13-08 | 13 Comments | 0 Links to this post

SharePoint Cross List Queries in a custom UserControl

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

I got the question last week weather it's possible to get items from all lists of <your chosen type here> gathered and displayed on one page.
This is - like most things - possible in SharePoint without any greater efforts. With something called Queries we can use the object model to query SharePoint and get a result quite painlessly.

To demonstrate a very simple example, I've created a very small usercontrol (for use with Jan Tielen's SmartPart) that looks like this:

 crossqueries1

This code will combine all the items in all of the TaskLists on the current SiteCollection and display them in a simple GridView as seen above in the screenshot.

Code for the Cross List Query UserControl

 crossqueries2

 crossqueries3

Simple enough, huh?
Of course you can create webparts, usercontrols, application pages, or any other type of application to interact with the object model in this way. I chose to do it using a UserControl for the ease of deployment, testing, development and demonstration.

For your conveniance I've uploaded the UserControl (.zip) here so you can download it.


Published: Mar-09-08 | 0 Comments | 0 Links to this post

Silverlight (2.0) Blueprints for SharePoint

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

Hi people, been really busy the last couple of weeks and havn't had the time to answer your mails nor write any new blogposts.

However, I just felt that I needed to get this link out there for you guys to check out in case you havn't already: http://www.ssblueprints.net/sharepoint/

"Open Source Source Code and Full Blueprint coming soon" - Sounds promising

While you check out that link, I'll try to figure out the topic of my next MOSS post ;)


Published: Mar-03-08 | 0 Comments | 0 Links to this post

MOSS 2007: Add support for AJAX in your SharePoint installation

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

In this very short and straight-on post I'll just mention how you can configure your SharePoint installation to enable support for ASP.NET AJAX 1.0 since a lot of people have been asking me about it.

Before we make any changes in the web.config we need the following:

  • A backup of the web.config file (important, because if something goes wrong you might need to revert to the old one)
  • SharePoint (WSS 3.0 or MOSS 2007)
  • ASP.NET 2.0 AJAX 1.0 Extensions
  • Be in the mood for some copy/pasting the following 5 minutes

Copy/Paste time

Locate your default web.config file (usually here: "C:\Inetpub\wwwroot\wss\VirtualDirectories\80\web.config").
Edit the web.config file according to this scenario:

  1. Locate the <configSection> element and add the following code inside it:

      <sectionGroup name="system.web.extensions"
      type="System.Web.Configuration.SystemWebExtensionsSectionGroup,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35">

      <sectionGroup name="scripting"
      type="System.Web.Configuration.ScriptingSectionGroup,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35">

      <section name="scriptResourceHandler"
      type="System.Web.Configuration.ScriptingScriptResourceHandlerSection,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35" requirePermission="false"
      allowDefinition="MachineToApplication"/>

      <sectionGroup name="webServices"
      type="System.Web.Configuration.ScriptingWebServicesSectionGroup,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35">

    <section name="jsonSerialization"
      type="System.Web.Configuration.ScriptingJsonSerializationSection,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35" requirePermission="false"
      allowDefinition="Everywhere" />

      <section name="profileService"
      type="System.Web.Configuration.ScriptingProfileServiceSection,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35" requirePermission="false"
      allowDefinition="MachineToApplication" />

      <section name="authenticationService"
      type="System.Web.Configuration.ScriptingAuthenticationServiceSection,
      System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
      PublicKeyToken=31bf3856ad364e35" requirePermission="false"
      allowDefinition="MachineToApplication" />

      </sectionGroup>
      </sectionGroup>
      </sectionGroup>

  2. Within the <system.web> element, locate the <pages> element and insert the following snippet:

    <controls>
      <add tagPrefix="asp" namespace="System.Web.UI"
      assembly="System.Web.Extensions, Version=1.0.61025.0,
      Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </controls>

    EDIT: Thanks to Hardik Bhilota for pointing out that I was missing a comma after the version number. Cheers

  3. Within the <assemblies> element, insert the following snippet:

    <add assembly="System.Web.Extensions, Version=1.0.61025.0,
    Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

  4. Within the <httpHandlers> element, insert the following snippet:

    <add verb="*" path="*.asmx" validate="false"
    type="System.Web.Script.Services.ScriptHandlerFactory,
    System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35"/>

    <add verb="*" path="*_AppService.axd" validate="false"
    type="System.Web.Script.Services.ScriptHandlerFactory,
    System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35"/>

    <add verb="GET,HEAD" path="ScriptResource.axd"
    type="System.Web.Handlers.ScriptResourceHandler,
    System.Web.Extensions, Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35" validate="false"/>

  5. Within the <httpModules> element, add the following snippet:

    <add name="ScriptModule"
    type="System.Web.Handlers.ScriptModule, System.Web.Extensions,
    Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35"/>

  6. And since we need to ensure that the assembly is trusted, locate the <SafeControls> element ad add the following snippet:

    <SafeControl Assembly="System.Web.Extensions,
    Version=1.0.61025.0, Culture=neutral,
    PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI"
    TypeName="*" Safe="True" />

  7. Within the <configuration> element, add the following snippet:

    <system.web.extensions>
      <scripting>
        <webServices>
        <!-- Uncomment this line to enable the authentication
        service. Include requireSSL="true" if appropriate. -->
        <!--
          <authenticationService enabled="true"
          requireSSL = "true|false"/>
        -->
        <!-- Uncomment these lines to enable the profile service.
        To allow profile properties to be retrieved and modified in
        ASP.NET AJAX applications, you need to add each property
        name to the readAccessProperties and writeAccessProperties
        attributes. -->
        <!--
          <profileService enabled="true"
          readAccessProperties="propertyname1,propertyname2"
          writeAccessProperties="propertyname1,propertyname2" />
        -->
        </webServices>
        <!--
        <scriptResourceHandler enableCompression="true"
        enableCaching="true" />
        -->
      </scripting>
    </system.web.extensions>
    <system.webServer>
      <validation validateIntegratedModeConfiguration="false"/>
      <modules>
        <add name="ScriptModule" preCondition="integratedMode"
        type="System.Web.Handlers.ScriptModule,
        System.Web.Extensions, Version=1.0.61025.0,
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </modules>
      <handlers>
        <remove name="WebServiceHandlerFactory-Integrated" />
        <add name="ScriptHandlerFactory" verb="*" path="*.asmx"
        preCondition="integratedMode"
        type="System.Web.Script.Services.ScriptHandlerFactory,
        System.Web.Extensions, Version=1.0.61025.0,
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

        <add name="ScriptHandlerFactoryAppServices" verb="*"
        path="*_AppService.axd" preCondition="integratedMode"
        type="System.Web.Script.Services.ScriptHandlerFactory,
        System.Web.Extensions, Version=1.0.61025.0,
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

        <add name="ScriptResource" preCondition="integratedMode"
        verb="GET,HEAD" path="ScriptResource.axd"
        type="System.Web.Handlers.ScriptResourceHandler,
        System.Web.Extensions, Version=1.0.61025.0,
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
      </handlers>
    </system.webServer>

You're all set

Save your web.config file, restart IIS (iisreset.exe for convenience) and enjoy your ASP.NET 2.0 AJAX 1.0 support in SharePoint.
This isn't a big deal to accomplish, so that's all you get from this blogpost.

In the next blogpost I'll talk about how you can easily create a UserControl, hosted with the SmartPart, with support for AJAX.


Published: Jan-04-08 | 5 Comments | 0 Links to this post

Silverlight and SharePoint integration

I'm writing this post as a question/survey and want to know if there's any interest in actually posting a blog on some different integration-possibilities with SharePoint and Silverligt.

I've created a couple of smaller projects that uses SharePoint's exposed webservices to create a nice Silverlight application to present the information (in this case some info from the news-list) which then can be displayed nicely on a projector or in a store or why not on the LCD-TV's that a lot of companies have these days to display information to the people that visit the place. Or why not as a billboard - use your imagination.

With this post I'm just curious as to weather there's any interest in seeing such posts coming up, and if so - please leave me a comment in this post or email me using the contactlink.

Thanks for tuning in,
Time to fall asleep on the train here again.


Published: Nov-09-07 | 0 Comments | 0 Links to this post

MOSS 2007: Connect a custom Search Page to a custom Search Scope

Author: Tobias Zimmergren
Url:
http://www.zimmergren.net

The other day I got a comment on a post from one of my readers who wanted to know how you can connect your custom created Search Page with a specific Search Scope.

Create a custom Search Page

  1. Navigate to your Search Center (http://yourcompany/SearchCenter)
  2. Choose "Site Actions -> Create Page"
  3. Create a new Search Page by using the "(Welcome Page) Search Page" template and fill in your details

It should look like this:
customsearchpagescope1

Create a custom Search Results Page

  1. Make sure that you are back at the Search Center site
  2. Choose "Site Actions -> Create Page"
  3. Create a new Search Results Page by using the "(Welcome Page) Search Results Page" template and fill in your details

It should look something like this:
customsearchpagescope2

Add the newly created Search Page to the tablist in your Search Center

  1. Make sure that you are back at the Search Center site
  2. Choose "Site Actions -> View All Site Contents"

You will now see one list for the Search Pages and one list for the Search Results Pages, as seen in this picture:
customsearchpagescope3

  1. Navigate to "Tabs in Search Pages"
  2. Choose "New -> New Item"
  3. Enter the Title, Page (The page.aspx you created earlier. I used ZimmerSearch.aspx) and optionally enter a Tooltip
  4. Click "OK"
  5. You will see your new Tab show up in the list

Add the newly created Search Results Page to the Tablist in your Search Center

  1. In the top of your left menu you will see "View All Site Content", Click it.
  2. Repeat the steps from the previous section but use the Search Results Page you created instead.

If you navigate to your Search Center, you will see that your Tab has been added to the Tablist:
customsearchpagescope4

Connect your Search Page  with your Search Results Page

  1. Click on your newly created Tab
  2. Choose "Site Actions -> Edit Page"
  3. Choose "Edit -> Modify This Shared Web Part" on your Search Box
    customsearchpagescope5
  4. Under the "Scopes Dropdown" section choose "Show, do not include contextual scopes" in the Dropdown mode
  5. Enter a Dropdown label if you'd like

It should look something like this:
customsearchpagescope6

  1. Expand the "Miscellaneous" section
  2. Enter your Search Results Page filename into the "Target search results page URL" textbox (I used ZimmerSearchResults.aspx)
  3. Click "Ok"

Now publish the page and it should look something like this:
customsearchpagescope7

Make sure it works

  1. Make a search on your custom Search Page
  2. Make sure that the url contians your custom Search Results Page
    (Mine is: http://zimmer/SearchCenter/Pages/ZimmerSearchResults.aspx)
  3. It works!

Can I bind the Search Page to a specific Scope?

Of course you can. Follow these steps:

  1. Navigate to the Site's Scope's section (I usually just navigate to http://zimmer/_layouts/viewscopes.aspx?mode=site)
    (This can be done by just navigating to Site Settings, Go to Top Level site settings, Search Scopes)
  2. Choose "New Display Group"
  3. Enter a Title (Important: Remember this name!)
  4. Choose your Scope in the Scopes list
    customsearchpagescope8
  5. Make sure it's also the Default Scope
  6. Click OK

Your displaygroup should be shown with a scope, similar to this:
customsearchpagescope9

  1. Go back to your Search Center
  2. Navigate to your custom created Search Page
  3. Again, choose "Site Actions -> Edit Page"
  4. Expand the "Miscellaneous" section
  5. Locate the "Scope Display Group" text box
  6. Enter your newly created Display Group (The name of the display group, mine was Zimmer)
  7. Click "OK"
  8. Publish your page

The Dropdown with Scopes should now only contain your newly added Display Group, similar to the following screenshot:
customsearchpagescope10

And what do you know... It works :)

Thanks for taking your time to read this, please leave a comment or two :)


Published: Aug-25-07 | 4 Comments | 0 Links to this post
 Next >>