cloud.net

Monday, May 26, 2008

Customizing the sharepoint search control

There are a couple ways of doing this.
  1. Modify ..\12\TEMPLATE\FEATURES\ContentLightup\Controls\searchArea.xml
  2. Modify ..\12\TEMPLATE\CONTROLTEMPLATES\searcharea.ascx
  3. Create a new feature and control
  4. Create a new feature that changes parameters for "SmallSearchInputBox"
I believe option 4 to be the best as it uses Microsoft.SharePoint.PortalWebControls.SearchBoxEx class and you don't need to create a new control.
There are a large number of properties you can use to customize the control and you should find the one you're looking for microsoft.sharepoint.portal.webcontrols.searchboxex_properties.
So how do we customize it? Create a new feature.
  1. Create a new directory anywhere eg: C:\RPSearchFeature
  2. Create a new manifest.xml in C:\RPSearchFeature with the following:
    <?xml version="1.0" encoding="utf-8"?>
    <Solution
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SolutionId="GENERATE_A_GUID" ResetWebServer="True" xmlns="http://schemas.microsoft.com/sharepoint/">
    <FeatureManifests> <FeatureManifest Location="PortalSearch\feature.xml" /> </FeatureManifests> </Solution>
  3. Create "C:\RPSearchFeature\PortalSearch\feature.xml" with:
    <?xml version="1.0" encoding="utf-8"?>
    <Feature  Id="7095f774-1efa-4879-b074-ff211f5559c7"
              Title="Small Portal Search"
              Description="Smaller search bar without scopes"
              Version="12.0.0.0"
              Hidden="FALSE"
              Scope="Web"
              DefaultResourceFile="core"
    xmlns="http://schemas.microsoft.com/sharepoint/">
    <ElementManifests> <ElementManifest Location="elements.xml"/> </ElementManifests> </Feature>
  4. Create "C:\RPSearchFeature\PortalSearch\elements.xml" with:
    <?xml version="1.0" encoding="utf-8" ?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
     <Control
      Id="SmallSearchInputBox"
      Sequence="25"
      ControlClass="Microsoft.SharePoint.Portal.WebControls.SearchBoxEx" 
      ControlAssembly="Microsoft.SharePoint.Portal, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
      <Property Name="SearchResultPageURL">/search/results.aspx</Property>
      <Property Name="FrameType">None</Property>
      <Property Name="DropDownMode">HideDD_NoScope</Property>
      <Property Name="TextBoxWidth">140</Property>
      <Property Name="ShowAdvancedSearch">false</Property>
     </Control>
    </Elements>
  5. Wrap the feature up in to a solution "SearchFeature.wsp" with cabpack
  6. Deploy the solution.
  7. Enable the feature (Scope is web, but you can change it to site if that suits you).

The instruction that will enable these parameters over the default is the sequence number. The default sequence is 99, so anything below 99 will load first. The parameters I'm using set the "SearchResultPageURL", hide the scope drop down and remove the advance search link.

Wednesday, May 21, 2008

Application Event Log: Unable to connect publishing custom string handler for output caching.

After adding the Reports Services virtual directories to a sharepoint site/web application you see the below in the event log.

Event Type: Error
Event Source: Office SharePoint Server
Event Category: Publishing Cache
Event ID: 5785
Date: 21/05/2008
Time: 3:01:52 PM
User: N/A
Computer:
Description:
Unable to connect publishing custom string handler for output caching. IIS Instance Id is '1957155781', Url is 'http://localhost/ReportServer/ReportService2005.asmx'.

For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

Cause: microsoft.sharepoint.publishing.publishinghttpmodule is trying to cache an unmanaged path.

Fix: Remove this httpmodule from the ./ReportServer virtual directory web.config.

    Steps:
  1. Open the web.config file (D:\Program Files\Microsoft SQL Server\MSSQL.1\Reporting Services\ReportServer\web.config)
  2. Locate the <httpModules> node, if it's not there create it below the <httpHandlers> node.
  3. Add the following <remove name="PublishingHttpModule" />.
Everytime you call a report or the reportserver URL/web service SharePoint tries to turn caching on and it's not a managed path it throws an error, so we need to remove the module in the reportserver.

Friday, May 16, 2008

Movie of the day: Mr. Nobody

I watched the extended version of Mr. Nobody the other night. I thought director Jaco Van Dormael did a fantastic job with the great attention to detail. Jared Leto was good too.

Mr. Nobody
imdb.com

Friday, May 2, 2008

Movie of the day

I watched an entertaining movie with Christian Slater the other day I feel is worth a mention...

He Was a Quiet Man
imdb.com

Sunday, April 27, 2008

{61738644-F196-11D0-9953-00C04FD919C1} Local Activation SharePoint

Event Type: Error
Event Source: DCOM
Event Category: None
Event ID: 10016
Date: 27/04/2008
Time: 9:35:28 AM
User: VMDomain\SPConfigAcct
Computer: VMDEV
Description:
The application-specific permission settings do not grant Local Activation permission for the COM Server application with CLSID {61738644-F196-11D0-9953-00C04FD919C1} to the user VMDomain\SPConfigAcct SID (S-1-5-21-2183741768-1351022156-4028051374-1111). This security permission can be modified using the Component Services administrative tool.

The event kind of tells you how to fix it: "This security permission can be modified using the Component Services administrative tool". But first we need to figure out what 61738644-F196-11D0-9953-00C04FD919C1 is; Win + R > regedit > search = IIS WAMREG admin Service
  1. Win + R C:\WINDOWS\system32\Com\comexp.msc
  2. Expand Component Services > Computers > My Comp > DCOM Config
  3. Right Click IIS WAMREG admin Service
  4. Select Properties > Security
  5. Launch and Activation Permissions "Customize" > Edit
  6. You need to grant the "user" rights.
  7. My user is a SharePoint Config account and as such belongs to the IIS_WPG group, but is also the sole member of WSS_RESTRICTED_WPG group so using the safest security I'm going to use WSS_RESTRICTED_WPG until more errors appear.
    Because it's not going to need to lauch or activate remotely I just need to enable "Local".

SharePoint 2007 Song

SharePoint 2007 Song.

Wednesday, April 16, 2008

Joke of the day

THE MIRACLE OF TOILET PAPER

Fresh from my shower, I stood in front of the mirror complaining to my husband that my breasts are too small.

Instead of romantically telling me this is not true, he uncharacteristically comes up with a suggestion: 'If you want your breasts to grow, then take a piece of toilet paper and rub it between them for a few seconds every day'

Willing to try anything, I got a piece of toilet paper and stood in front of the mirror, rubbing it between my breasts. How long will this take?' I asked. They will grow larger over a period of years,' my husband replies.

I stopped. 'Do you really think rubbing a piece of toilet paper between my breasts every day will make my breasts larger over the years?'

Without missing a beat he said 'Worked for your bum, didn't it?'

He's still alive, and with a great deal of therapy, he may even walk again although he will probably continue to take his meals through a straw.