1st Weekend Gosport

Saturday 17-Mar-2012:

Went to checkout B and Q Titchfield, pretty grim two hours.

Went further to Southampton to check out IKEA. discovered the itchen toll bridge, 50p a bargain.

Sat nav tried to take me into the pedestrianised high street, while reversing out a bus tried to shunt me out of the way.

For future reference IKEA is in the “Retail park”, huge M and S and John Lewis plus all the shops you could ever want.

Bought a Kodak printer, spent two hours getting it to actually install.

Sunday 18-Mar-2012:

Moved all stuff from living room to space I cleared in kitchen.
Cleared wardrobe space in bedroom, created built in wardrobe
Fixed all but one upstairs light pendants
Mopped various floors
Cleaned all upstairs windows
Finished around 18:00

SharePoint 2010 Service Application Groups

IMHO, Microsoft obviously rushed the release of SharePoint 2010 and there are quite a few unfinished areas at the very least in the UI.

Try to create more than one custom Service Application Group in Central admin for example. You just cant do it, as far as I can see.

The good news is, powershell SharePoint CmdLets allow you to fill this gap. I crafted this in a bit of a hurry, but it does the job.

$PSSnapin = Add-PsSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
 
 
$AppProxyGroupFriendlyName = "New Custom Proxy group"
$ProxyDisplayNamesToAddToGroup = @(
                    "State Service Application Proxy",
                    "MyApp Taxonomy",
                    "Secure Store Service Proxy",
                    "Web Analytics Service Application",
                    "Application Discovery and Load Balancer Service Application Proxy_aa187b7a-cc28-448a-b232-4c9f0713d0bb",
                    "WSS Usage Application"
                    )
 
# Grab our new ApplicationProxyGroup
#
$appProxyGroup = get-SPServiceApplicationProxyGroup | where-object {$_.FriendlyName -eq $AppProxyGroupFriendlyName}
 
if(-not $appProxyGroup) {
    write-host "Creating" $AppProxyGroupFriendlyName
    New-SPServiceApplicationProxyGroup -Name $AppProxyGroupFriendlyName
}
 
 
 
# Get each of the application proxies to be used by this group
#
$ProxyDisplayNamesToAddToGroup | % {
    $thisProxy = $_
    $appProxy = Get-SPServiceApplicationProxy | where-object {$_.DisplayName -eq $thisProxy}
 
    if($appProxyGroup.Contains($appProxy)) {
        # Already present
        write-host $thisProxy "already present"
    }
    else {
        write-host "Adding" $thisProxy
        $appProxyGroup.Add($appProxy)
    }
}
 
# Show the proxies in the new group
#
$appProxyGroup = Get-SPServiceApplicationProxyGroup -Identity $AppProxyGroupFriendlyName
$appProxyGroup.DefaultProxies | Format-list -Property DisplayName

SP 2003 – Managed paths

SharePoint 2003: How to exclude paths to run ASP.NET applications
Running an ASP.NET application on a server with a SharePoint instance requires excluding the virtual paths the application needs, as the SharePoint ISAPI filter will intercept all requests. This post assumes you have SharePoint installed as a Default Web Site.

1. From the Administration Tools, click on SharePoint Central Administration.

2. Click on SharePoint Portal Server in the left menu.

3. Click on Configure virtual server settings from the Virtual Server List page.

4. Click on Default Web Site.

5. Click on Define managed paths.

6. Enter a path, check Exclude Path, and click OK.

DataFormWebPart simple example – without GUIDs

<WebPartPages:DataFormWebPart
  runat="server"
  DataSourceID="test1"
  IsIncluded="True"
  AsyncRefresh="True"
  FrameType="None"
  NoDefaultStyle="TRUE"
  ViewFlag="8"
  Title="Contacts"
  PageType="PAGE_NORMALVIEW"
  __markuptype="vsattributemarkup"
  partorder="2"
  __WebPartId="{F282332F-8BEF-4B6B-8A46-7C1E00177C4E}"
  id="g_f282332f_8bef_4b6b_8a46_7c1e00177c4e">
 
 <DataSources>
 
  <SharePoint:SPDataSource
   DataSourceMode="List"
   ID="test1"
   UseInternalName="true"
   SelectCommand="<View />"
   runat="server" >
 
<SelectParameters>
<WebPartPages:dataformparameter Name="ListName" ParameterKey="ListName" PropertyName="ParameterValues" DefaultValue="Contacts" />
<WebPartPages:dataformparameter Name="WebURL" ParameterKey="WebURL" PropertyName="ParameterValues" DefaultValue="{sitecollectionroot}" />
</SelectParameters>
 
  </SharePoint:SPDataSource>
 </DataSources>
 
<datafields>@ID,ID;@ContentType,Content Type;@Title,Last Name; SNIPPED HERE
</datafields>
 
 
  <xsl>
      <xsl:stylesheet
        xmlns:x="http://www.w3.org/2001/XMLSchema"
        xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
        version="1.0"
        exclude-result-prefixes="xsl msxsl ddwrt"
        xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
        xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
        xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxsl="urn:schemas-microsoft-com:xslt"
        xmlns:SharePoint="Microsoft.SharePoint.WebControls"
        xmlns:ddwrt2="urn:frontpage:internal"
        xmlns:o="urn:schemas-microsoft-com:office:office"> 
 
          <xsl:include href="/_layouts/xsl/main.xsl"/> 
          <xsl:include href="/_layouts/xsl/internal.xsl"/>
          <xsl:output method="xml" />
 
          <xsl:template match="/"
            xmlns:x="http://www.w3.org/2001/XMLSchema"
            xmlns:d="http://schemas.microsoft.com/sharepoint/dsp"
            xmlns:asp="http://schemas.microsoft.com/ASPNET/20"
            xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer"
            xmlns:SharePoint="Microsoft.SharePoint.WebControls"
            xmlns:o="urn:schemas-microsoft-com:office:office">
              <ul class="list-arrow">
                <xsl:apply-templates select="/dsQueryResponse/Rows/Row"></xsl:apply-templates>
              </ul>
          </xsl:template>
 
          <xsl:template match="/dsQueryResponse/Rows/Row">
            <li>
              <a href="{@Title}">
                <xsl:value-of select="@Title"/>
              </a>
            </li>    
          </xsl:template>
 
      </xsl:stylesheet>
    </xsl>
 
</WebPartPages:DataFormWebPart>

SPDatasource

Stolen from Chris O’Brien
His blog

<SPWebControls:SPDataSource
	runat="server"
	ID="dsPersonTitles"
	DataSourceMode="List"
	SelectCommand="<Query><OrderBy><FieldRef Name='SortOrder' Ascending='true' /></OrderBy></Query>"
	<SelectParameters>
		<asp:Parameter Name="WebUrl" DefaultValue="/configuration/" />
		<asp:Parameter Name="ListName" DefaultValue="PersonTitles" />
	</SelectParameters>
</SPWebControls:SPDataSource>
 
<asp:DropDownList
	runat="server"
	ID="ddlPersonTitles"
	CssClass="title"
	DataSourceID="dsPersonTitles"
	DataTextField="Title"
	DataValueField="ID">
</asp:DropDownList>