Friday, April 21, 2006

"We need to figure this out".......Huh?!?!?

On his blog, Victor Vogelpoel is showing something he found in the code of the Dataviewer Webpart. Looks like the programmers did not know what to do with it: We need to figure this out :-)

Wednesday, April 19, 2006

Usefull tool: iFilter Explorer

A colleague of mine pointed me to a tool called iFilter Explorer. With this tool you can view which iFilters are installed on a machine and which products are able to use them (Sharepoint, SQL, Desktop search, etc). Very usefull!!

This tool can be found at: http://citeknet.com/

Thursday, April 13, 2006

Restore via SPSBackup might fail when back-end is running SQL 2005

Since SPS SP2 the use of SQL Server 2005 as back-end database server is supported for Sharepoint (WSS and SPS). But when a backup is made using SPSBackup and restored again, the following message might appear both in SPSBackup as in the Eventlog: "SQL Server restore failed. Error: The operation failed on server <servername>.".

In the log which has been created in the Program Files\Sharepoint Portal Server\Logs directory the following is logged:

00012E8C CRI 00000000 00000E5C Connecting to SQL Server <servername> ...
00012ED2 CRI 00000000 00000E5C Connected to SQL Server <servername>
00012ED2 CRI 00000000 00000E5C Connected To Server
00012ED2 CRI 00000000 00000E5C Entering RestoreDB for database <portalname>1_SITE ...
00012ED2 CRI 00000000 00000E5C Entered Critical Section in RestoreDB for database <portalname>1_SITE ...
00012ED2 CRI 00000000 00000E5C Left Critical Section in RestoreDB for database <portalname>1_SITE ...
00012FCC UNK 00000000 000007F8 Overall % Completed: 0%
00013008 CRI 80045510 00000E5C GetDatabaseByName Failed. Trying to obtain path from master database.
0001313F CRI 00000000 00000E5C Command Text sent to SQL is: RESTORE DATABASE [<portalname>1_SITE] FROM DISK = N'\\backup\bk-<servername>-<portalname>1_SITE.SPB' WITH FILE = 1, NOUNLOAD , STATS = 5, RECOVERY , REPLACE , MOVE N'<portalname>1_SITE' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Data.MDF', MOVE N'<portalname>1_SITE_log' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Log.LDF', MOVE N'sysft_ix_<portalname>1_SITE' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Data.MDF'
0001313F CRI 00000000 00000E5C Database <portalname>1_SITE does not exist, proceeding to restore it.
0001313F CRI 00000000 00000E5C Restoring database <portalname>1_SITE ...
000131A3 CRI 80040C68 00000E5C Failed to restore the database.
000131A3 UNK 00000000 00000E5C No error information available
000131A3 UNK 00000000 00000E5C No error information available
000131A3 UNK 00000000 00000E5C Exception in BackupSQL: Source=SQLBkMgd, Message=The operation failed on server <servername>. For more information, see the Microsoft Windows Event Log on that server.
000131A3 UNK 00000000 00000E5C BackupSQL Thread setting its status to completed and exiting


After copying and pasting the query into the SQL Management Studio, SQL returns the following error:

Msg 3176, Level 16, State 1, Line 1
File 'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Data.MDF' is claimed by 'sysft_ix_<portalname>1_SITE'(65537) and '<portalname>1_SITE'(1). The WITH MOVE clause can be used to relocate one or more files.
Msg 3013, Level 16, State 1, Line 1
RESTORE DATABASE is terminating abnormally.


The above information indicates that two parameters of the query point to the same name. Investigation of the query turns out that this is the case. Both the SITE database as the index are being restored to the same MDF file:
MOVE N'<portalname>1_SITE' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Data.MDF',
MOVE N'sysft_ix_<portalname>1_SITE' TO N'C:\Program Files\Microsoft SQL Server\MSSQL\data\<portalname>1_SITE_Data.MDF'

The solution to this problem is installing the hotfix KB914445. Unfortunatelly this hotfix cannot be downloaded from the Microsoft site, so you have to call Microsoft to ask them to send it to you by email. Or if you have access to the Premier site, download it there.

"Restore operation is not completed successfully when you use the SharePoint Portal Server Backup and Restore tool (Spsbackup.exe) to restore a portal site from backup

You use the SharePoint Portal Server Backup and Restore tool to back up the portal site. However, when you try to restore the portal site from backup, the operation is not completed successfully. This problem occurs if the following conditions are true:
  • You use Microsoft SQL Server 2005 as the database back end for SharePoint Portal Server 2003.

  • You configure the Enable full-text search and index component option for content that is hosted on the portal site.

  • In this situation, the restore operation is not completed successfully because of a file naming conflict that occurs in SharePoint Portal Server 2003.
    "

    [UPDATE] The mentioned hotfix has been included in the SharePoint Portal Server 2003 post-Service Pack 2 hotfix package: June 16, 2006 (KB919175)

    Friday, April 07, 2006

    Automatically applying a theme to a WSS site when it is created

    On his blog, Ishai Sagi describes a method he has found to automatically apply a certain theme after it has been created.

    "WSS site definitions dont support setting a default theme. This leave the administrator with three options, none of them recommended:

    1. Have users manually set a theme after creating a site (ugly!)
    2. Set the company theme to a site, and save it as template and deploy the template globaly in the server (complicated, and also disconnects the sites from the file system templates, making it hard to change in the future)
    3. Change the default css files and not use the theme (extremely ugly - why are the themes for??? also does not support multiple templates with different themes)

    The solution I found for the problem is to add in the site definition a link to a custom page that will run code when the site is created. the code will apply the theme to the new site.

    Step 1 - Changing The Site Definition

    1. Create the site definition that you want
    2. Go into the "xml" folder and open the "onet.xml" file in notepad or visual studio (or any editor)
    3. Find the "Configurations" tag at the bottom, and for every configuration you want to change add the following in the "Configuration" tag (where it says "THEMENAMEHERE" write your theme name. This may be case sensative):
      <ExecuteUrl Url="_layouts/1033/ThemeSetter.aspx?Theme=THEMENAMEHERE" />

    Step 2 - Creating the ThemeSetter ASPX Page

    1. Open "C:\Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033"
    2. Create a new text file, rename it to "ThemeSetter.aspx"
    3. Open the file for editing, and paste the following code into it:


    <html dir="ltr">
    <%@ Page Language="C#" ValidateRequest="False" %>
    <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %>
    <%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
    <%@ Import Namespace="Microsoft.SharePoint" %>
    <%

    SPWeb myNewWeb = SPControl.GetContextWeb(Context);
    myNewWeb.AllowUnsafeUpdates = true;
    myNewWeb.ApplyTheme(this.Page.Request["Theme"].ToString());
    myNewWeb.Update();
    Response.Redirect(myNewWeb.Url);

    %>
    </html>


    Step 3 - Reset the IIS
    for the changes to take affect, you will need to reset the IIS.

    Now, create a site from the site definition, and the site should automatically be with the theme."

    Link: http://spstips.blogspot.com/2006/03/automatically-applying-theme-to-site.html

    Thursday, April 06, 2006

    Sharepoint databases

    Sharepoint uses SQL (or MSDE) for its data storage. By default several databases are created. Here is a small summary of the databases and their purpose.

    • Configuration database (Default: Sharepoint_Config_db) - In a Windows Sharepoint Services environment, there can be multiple front-end Web servers that contain several websites whose content is stored in one of a number of back-end databases. To keep the front-end Web servers stateless, a centralized database is needed to keep track of which content database holds the data for a specific site. When a front-end Web server receives a request for a page from a site, the first connection it must make is to this configuration database. For performance reasons, this information is cached on the front-end Web servers for subsequent requests and the cached information is used by the front-end Web server thereafter.

      During installation Sharepoint Portal Server adds extensions to the configuration database created by Windows Sharepoint Services. These extensions include adding a new schema and modifying tables by adding new stored procedures. This means that WSS cannot connect to a SPS configuration database and vise versa.

      There is only one configuration database

    • Profiles database (Default: <portalname>1_PROF) - This is the is the profiles database. It contains all the information relating to peoples profiles, including those imported from the AD, and audiences.

    • Services database (Default: <portalname>1_SERV) - This database stores component settings in order to provide services to the Sharepoint Portal Environment. It contains alert definitions, notifications and the gatherer logs. Also called component settings database.

    • Content database (Default: SPS <portalname>1_SITE, WSS STS_<machine name and guid>) - This is the content database for a given virtual server. By default it contains all the portal and team site information including documents and lists.

      Content databases provide content to the front-end Web servers when it is requested. All site content -including site documents, list data, Web Part properties, as well as user names and rights- are stored in the content databases. You can create as many content databases as needed to support the websites on your server. This can range from just one to thousands, depending on the number of users.

    Wednesday, April 05, 2006

    Theme messes up the WSS search box

    Over the last few weeks I have been working on an issue with the search box in WSS. For some reason the seach box couldn't be selected, causing the user not to be able to do a search. After trying to disable and enable the full-text indexing (and experiencing the problems I have described in my previous post) I found out that when I move the mouse to the top of the search box, I could select the search box. Some troubleshooting later I found out that the theme was the cause:
    - Somehow the theme did move the graphics of the search box down, but not the search box control.

    Our theme-creation-guy fixed this issue by modifying the theme,adding
    "position: relative" to the ".ms-searchform" class.

    A simple solution for something so simple, but which has taken me weeks to figure out. You always start thinking in difficult solutions :-)