Archive

Archive for the ‘SharePoint’ Category

Kerberos authentication and NLB clusters

November 24, 2008 Leave a comment

When you use Kerberos as the authentication mechanism with Sharepoint and want to configure NLB for load balanced front-end servers you will have to configure an extra SPN for the NLB cluster name. This is caused by the fact that Kerberos uses the hostname as a part of the Kerberos Ticket request, even if the URL used is something different. This is described in detail in Microsoft KB929650.

With the following scenario, set the SPN names accordingly:
NLB server A: SPServerA.MyDomain.com
NLB server B: SPServerB.MyDomain.com
NLB Cluster Name: SPNLB.MyDomain.com
Web Application Account: MyDomain\SharepointApp

SPN commands for NLB with Kerberos for the described scenario:
setspn.exe /A HTTP://SPServerA.MyDomain.com MyDomain\SharepointApp
setspn.exe /A HTTP://SPServerB.MyDomain.com MyDomain\SharepointApp
setspn.exe /A HTTP://SPNLB.MyDomain.com MyDomain\SharepointApp

Please note that all computer and application accounts must be enabled as trusted for delegation!

N’Joy!

CKS:EBE 2.5 Review

November 23, 2008 Leave a comment

I’ve been using the Community Kit for Sharepoint Enhanced Blog Edition 2.5 Beta for a couple of weeks and is quite impressed. Even if there’s several features that does not work, and the solution is somewhat unstable, I think this is the best addition to Sharepoint regardless of FreeProg or commercial wares.

I’ve posted some requests and questions on the authors web site (The Kid), which I hope will be implemented in the next final release, and I certainly hope the final release of 2.5 is somewhat close by.

I will recommend this solution to anyone with a public WSS3 site which they want to make a bit more user friendly and appealing to the user.

My rating: 10 of 10!

N’Joy!

iFrame page template for MOSS

November 17, 2008 Leave a comment

As you all know, the web page viewer web part included in Sharepoint does not support dynamic sizing of the iFrame it creates. Because of this, I found the need for a page template which users might use to create a Sharepoint page with external content. The following code is the entire page template, which might be used as is by anyone it might suit.

Please not that the javascript variable FooterHeight has to be set according to the whitespace you would like at the bottom the page. The height of 30 pixels is based on the footer height of the default collaboration master included in Sharepoint 2007.

<%@ Page language="C#" Inherits="Microsoft.SharePoint.Publishing.PublishingLayoutPage,Microsoft.SharePoint.Publishing,Version=12.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c" meta:progid="SharePoint.WebPartPage.Document" %>
<%@ Register Tagprefix="SharePointWebControls" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="PublishingWebControls" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="PublishingNavigation" Namespace="Microsoft.SharePoint.Publishing.Navigation" Assembly="Microsoft.SharePoint.Publishing, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>   <asp:Content ContentPlaceholderID="PlaceHolderPageTitle" runat="server">
   <SharePointWebControls:FieldValue id="PageTitle" FieldName="Title" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderPageTitleInTitleArea" runat="server">
   <SharePointWebControls:TextField runat="server" id="TitleField" FieldName="Title"/>
</asp:Content>
<asp:Content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
   <PublishingWebControls:editmodepanel runat="server" id="editmodestyles">
     <!-- Styles for edit mode only-->
     <SharePointWebControls:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/zz2_editMode.css %>" runat="server"/>
   </PublishingWebControls:editmodepanel>
   <SharePointWebControls:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/rca.css %>" runat="server"/>
   <SharePointWebControls:FieldValue id="PageStylesField" FieldName="HeaderStyleDefinitions" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderTitleBreadcrumb" runat="server">
   <div class="breadcrumb">
     <asp:SiteMapPath ID="siteMapPath" Runat="server" SiteMapProvider="CurrentNavSiteMapProviderNoEncode" RenderCurrentNodeAsLink="false" SkipLinkText="" CurrentNodeStyle-CssClass="breadcrumbCurrent" NodeStyle-CssClass="ms-sitemapdirectional"/>
   </div>
</asp:Content>
<asp:Content ContentPlaceholderID="PlaceHolderMain" runat="server">
   <SharePointWebControls:CssRegistration name="<% $SPUrl:~sitecollection/Style Library/~language/Core Styles/pageLayouts.css %>" runat="server"/>
   <table id="MSO_ContentTable" cellpadding="0" cellspacing="0" border="0" width="100%">
     <tr>
        <td>
           <div class="pageContent">
             <PublishingWebControls:RichHtmlField id="content" FieldName="PublishingPageContent" runat="server"/>
           </div>
        </td>
     </tr>
     <tr>
        <td style="padding-top: 5px;">
     <WebPartPages:WebPartZone runat="server" FrameType="None" AllowPersonalization="false" Title="<%$Resources:sps,LayoutPageZone_BottomZone%>" ID="MiddleLeftZone" Orientation="Vertical" QuickAdd-ShowListsAndLibraries="false" allowlayoutchange="false"><ZoneTemplate></ZoneTemplate></WebPartPages:WebPartZone> <!-- _locID@Title="L_MiddleLeftZone_Title" -->
        </td>
     </tr>
   </table>
   <PublishingWebControls:editmodepanel runat="server" id="editmodepanel1">
     <!-- Add field controls here to bind custom metadata viewable and editable in edit mode only.-->
     <table cellpadding="10" cellspacing="0" align="center" class="editModePanel">
        <tr>
           <td>
             <PublishingWebControls:RichImageField id="ContentQueryImage" FieldName="PublishingRollupImage" AllowHyperLinks="false" runat="server"/>
           </td>
           <td width="200">
             <asp:label text="<%$Resources:cms,Article_rollup_image_text%>" runat="server" />
           </td>
        </tr>
     </table>
   </PublishingWebControls:editmodepanel>
<script language="JavaScript">
  <!--
    function resizeFrame() {
      objFrame = document.getElementsByTagName("iframe").item(0);
      windowHeight = document.body.offsetHeight;
      headerHeight = absoluteTop(objFrame);
      iframeHeight = windowHeight - (headerHeight + footerHeight);
      if (iframeHeight >=0) { objFrame.style.height = iframeHeight};
      objFrame.style.border = "1px solid gray";
      objFrame.style.margin = "0px";
    }       function absoluteTop(objNode) {
      var currentNode=objNode;
      var sumTop=0;
      while(currentNode.tagName!="BODY"){
        sumTop+=currentNode.offsetTop;
        currentNode=currentNode.offsetParent;
      }
    return sumTop;
    }       function getFooterHeight() {
      objPlaceHolder = document.getElementById("ctl00_MSO_ContentDiv");
      footH = document.body.offsetHeight - (absoluteTop(objPlaceHolder) + objPlaceHolder.offsetHeight);
      return footH;
    }       var footerHeight = 30;
    window.attachEvent ("onresize", resizeFrame);
    window.attachEvent ("onload", resizeFrame);
  //  resizeFrame();
  //  footerHeight = getFooterHeight();
  // -->
</script>
</asp:Content>  

N’Joy!

Resizing an iFrame to it’s parent

November 17, 2008 Leave a comment

In some cases it’s not possible to use the style tags width and height to define the size of an object on a web page. This is typically the case when an inline frame is placed within a placeholder such as a <div> or a <td>. My approach to resolve this is to include a javascript which resizes the iframe based on it’s parents width and height.

The script is based on a Sharepoint 2007 collaboration page template and has a static reference to the page footer. If this should be used elsewhere, please modify the static object references in the code.

function resizeFrame() {
   objFrame = document.getElementsByTagName("iframe").item(0);
   windowHeight = document.body.offsetHeight;
   headerHeight = absoluteTop(objFrame);
   iframeHeight = windowHeight - (headerHeight + footerHeight);
   if (iframeHeight >=0) { objFrame.style.height = iframeHeight};
   objFrame.style.border = "1px solid gray";
   objFrame.style.margin = "0px";
}

function absoluteTop(objNode) {
   var currentNode=objNode;
   var sumTop=0;
   while(currentNode.tagName!="BODY"){
      sumTop+=currentNode.offsetTop;
      currentNode=currentNode.offsetParent;
   }
   return sumTop;
}   function getFooterHeight() {
   objPlaceHolder = document.getElementById("ctl00_MSO_ContentDiv");
   footH = document.body.offsetHeight - (absoluteTop(objPlaceHolder) + objPlaceHolder.offsetHeight);
   return footH;
}

var footerHeight = 30;
window.attachEvent ("onresize", resizeFrame);
window.attachEvent ("onload", resizeFrame);

N’Joy!

Configuring a web application for proxy

October 2, 2008 Leave a comment

For some mysterious reason, the web proxy auto detect setting in the web.config file for a web application does not work that well. Thankfully it’s possible to specify proxy settings manually in the web.config file by adding the following entries in the <system.net> section:

<defaultProxy>
   <proxy proxyaddress="http://%5BServerIP%5D:%5BPort%5D&quot; bypassonlocal="true" />
   <bypasslist>
     <add address="myOwnDomain.com" />
   </bypasslist>
</defaultProxy>

To revert to the default auto detect setting, replace the section above with the following:

<defaultProxy>
    <proxy autoDetect="true" />
</defaultProxy>

N’Joy!

High quality Sharepoint components

August 31, 2008 Leave a comment
Usually I don’t recommend commercial web sites and solutions, but in this case I will make an exception. Bamboo solutions has proven to deliver high quality web parts and Sharepoint solutions, but unfortunately with a high price as well.
 
I’ve used several of the web parts and solutions by Bamboo, and are very pleased. The only down side is that there’s limited customization capabilities and no language translation support.
 
Otherwise it’s great solutions and strongly recommended.
 
N’Joy!

Ekskludering av virtual directory

August 18, 2008 Leave a comment

I enkelte tilfeller kan det være ønskelig å ekskludere et virtual directory fra en IIS web site som kjører .NET applikasjoner. F.eks. kan det være en eldre ASP applikasjon som ønskes kjørt innenfor samme namespace som en .NET applikasjon.

For å få dette til må man få IIS til ikke å håndtere den virtuelle applikasjonen som en .NET applikasjon, og den enkleste måten å gjøre dette på er å ekskludere den fra web.config filen på applikasjonen og fjerne .NET extensions på den virtuelle mappen.

Måten å ekskludere en mappe fra en .NET applikasjon er å legge inn følgende linje i web.config under <configuration> seksjonen:
<location path="[path]" allowOverride="true"/>

For å fjerne .NET extensions på den virtuelle mappen, gjør følgende:

  1. I IIS Manager, høyreklikk på den virtuelle mappen og velg properties.
  2. Under Virtual Directory tabben klikk på Configuration knappen.
  3. Fjern alle .dll referanser fra listen Wildcard application maps.

Etter at dette er gjort må IIS restartes (iisreset /noforce).

%d bloggers like this: