Turn off Local Loopback feature

March 25th, 2010

A litle time ago I created a new SharePoint 2010 Web Application. For the hostheader I typed in custom name: intranet. At the root I created a team site. When I tried to access the site collection on http://intranet, I got a HTTP 401.1 - Unauthorized.

This is because Windows Server 2008 and 2003 have a Local Loopback feature turned on by default. You can turn this feature off in the registry:

  1. Click Start, click Run, type regedit, and then click OK.
  2. In Registry Editor, locate and then click the following registry key:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Lsa
  3. Right-click Lsa, point to New, and then click DWORD Value.
  4. Type DisableLoopbackCheck, and then press ENTER.
  5. Right-click DisableLoopbackCheck, and then click Modify.
  6. In the Value data box, type 1, and then click OK.
  7. Quit Registry Editor, and then restart your computer.

Read more about it in the following Microsoft’s knowledge base article:
http://support.microsoft.com/kb/896861

Web applications that use methods of the Microsoft.SharePoint.Administration namespace

September 12th, 2009

Web applications that use methods of the Microsoft.SharePoint.Administration namespace, such as for creating or deleting sites and for global administrative customizations, require a different security validation. Add the following code to the .cs file in an application:

SPGlobalAdmin globalAdmin = new SPGlobalAdmin();
Context.Items[SPGlobalAdmin.RequestFromAdminPort] = true;
Page.RegisterHiddenField(”__REQUESTDIGEST”, globalAdmin.AdminFormDigest);

This security validation uses the AdminFormDigest property of the SPGlobalAdmin class to insert a message digest on the page in the browser, registering the digest as a hidden field through the RegisterHiddenField method of the System.Web.UI.Page class. In addition, the RequestFromAdminPort field specifies that the context of the request is through the administrative port.

Source:
http://epham.wordpress.com/2007/01/22/how-to-fix-security-validation-errors-in-sharepoint-aspnet-page/

System and Site masterpages

September 12th, 2009

On this blog I read a clear explanation of site masterpages and system masterpages:
http://mysharepointworld.blogspot.com/2006/07/moss-2007-and-wss-30-master-page.html

Parameterize your page url to access SharePoint functionality

July 28th, 2009

Webpart maintenance page
Some people think they’re removing a webparts by clicking on ‘x’, actually the webpart is closed and stille exists (invisible) on the page. With the SharePoint webparts maintenance page you can close, remove or delete (multiple) webparts on a page. This is very handy page specially when your well written SharePoint webpart causes an error so the whole page can’t be displayed. Here is the solution to remove the blocking webpart, add the following to your page url: ?contents=1

Acces the SharePoint ToolPanes
Is it possible to edit forms pages like AllItems.aspx, DispForm.aspx EditForm.aspx …? Yes, add the following to you’re Forms page url ?ToolPaneView=2, now you can edit existing webparts or add new webparts, a content editor webpart with a disclaimer text for example. With ?ToolPaneView=3 you can search for webparts and with ?ToolPaneView=5 you can upload you’re custom webpart.

U2U - CAML Query Builder

February 11th, 2009

A time ago I need to write a SPQuery to query a List. I tested my query with the CAML Query Builder by Karine Bosch - U2U. After testing it I put the following query into my code like this:

SPList list = GetMyList();
SPQuery query = new SPQuery();
query.Query = “<Query><Where><Eq><FieldRef Name=’Title’/><Value Type=’Text’>TEST</Value></Eq></Where></Query>”;
list.GetItems(query);

The code above always return all items in the list. So I start looking at the query, after a few minutes I saw that I had set the Query property of the SPQuery object, so I had to remove <Query> and </Query> from my query. Like this:

query.Query = “<Where><Eq><FieldRef Name=’Title’/><Value Type=’Text’>TEST</Value></Eq></Where>”;

Otherwise the query is ignored and therefore all items from the list are returned.

Do not use SharePoint Computed fields

January 16th, 2009

In this posting I will explain why not to use Computed fields. I was experiencing the following issue with the Computed field type:

I made a Computed column that combines two fields seperated with a minus sign:
 
<Field Name=”IDTitleField” Type=”Computed”>
   <FieldRefs>
      <FieldRef ID=”{GUID}” Name=”Title”/>
      <FieldRef ID=”{GUID}” Name=”ID”/>
   <FieldRefs>
   <DisplayPattern>
      <Column Name=”ID”/>
      <HTML><![CDATA[ - ]]></HTML>
      <Column Name=”Title”/>
   </DisplayPattern>
</Field>

After creating the column you can see the column at the site collection columns. You can add the column to you’re site collections contenttypes. But when you add the contenttype to a list the Computed columns are not copied(!) to the list. Why the Computed fields are not copied I don’t know.

So I start using the Calculated field with the following:

<Field Name=”IDTitleField2″ Type=”Calculated” ResultType=”Text”>
   <FieldRefs>
      <FieldRef ID=”{GUID}” Name=”Title”/>
      <FieldRef ID=”{GUID}” Name=”ID”/>
   <FieldRefs>
   <Formula>=CONCATENATE(ID, ” - “, Title)</Formula>
</Field>

This Calculated field solved my issue. Because the calculated fields are copied when adding the contenttype (which contains the Calculated field) to the list! So my conclusion is to avoid using the Computed field type. Therefore you can use the Calculated field type in many cases.

SharePoint SPBuiltIn classes

November 27th, 2008

I often reuse fields and contenttypes that are shipped with WSS 3.0 or the fields and contenttypes from the SharePoint publishing feature. To keep you’re code clean, use the following classes:

WSS 3.0 fields (using Microsoft.SharePoint) returns a Guid:

SPBuiltInFieldId._Author;
SPBuiltInFieldId._Category;
SPBuiltInFieldId._CheckinComment;
SPBuiltInFieldId._Comments;
SPBuiltInFieldId._Contributor;
SPBuiltInFieldId._CopySource;
SPBuiltInFieldId._Coverage;
SPBuiltInFieldId._DCDateCreated;
SPBuiltInFieldId._DCDateModified;
SPBuiltInFieldId._EditMenuTableEnd;
SPBuiltInFieldId._EditMenuTableStart;
SPBuiltInFieldId._EndDate;
SPBuiltInFieldId._Format;
SPBuiltInFieldId._HasCopyDestinations;
SPBuiltInFieldId._Identifier;
SPBuiltInFieldId._IsCurrentVersion;
SPBuiltInFieldId._LastPrinted;
SPBuiltInFieldId._Level;
SPBuiltInFieldId._ModerationComments;
SPBuiltInFieldId._ModerationStatus;
SPBuiltInFieldId._Photo;
SPBuiltInFieldId._Publisher;
SPBuiltInFieldId._Relation;
SPBuiltInFieldId._ResourceType;
SPBuiltInFieldId._Revision;
SPBuiltInFieldId._RightsManagement;
SPBuiltInFieldId._SharedFileIndex;
SPBuiltInFieldId._Source;
SPBuiltInFieldId._SourceUrl;
SPBuiltInFieldId._Status;
SPBuiltInFieldId._UIVersion;
SPBuiltInFieldId._UIVersionString;
SPBuiltInFieldId._Version;
SPBuiltInFieldId.ActualWork;
SPBuiltInFieldId.AdminTaskAction;
SPBuiltInFieldId.AdminTaskDescription;
SPBuiltInFieldId.AdminTaskOrder;
SPBuiltInFieldId.Anniversary;
SPBuiltInFieldId.AssignedTo;
SPBuiltInFieldId.AssistantNumber;
SPBuiltInFieldId.AssistantsName;
SPBuiltInFieldId.Attachments;
SPBuiltInFieldId.AttendeeStatus;
SPBuiltInFieldId.Author;
SPBuiltInFieldId.BaseAssociationGuid;
SPBuiltInFieldId.BaseName;
SPBuiltInFieldId.BillingInformation;
SPBuiltInFieldId.Birthday;
SPBuiltInFieldId.Body;
SPBuiltInFieldId.BodyAndMore;
SPBuiltInFieldId.BodyWasExpanded;
SPBuiltInFieldId.Business2Number;
SPBuiltInFieldId.CallbackNumber;
SPBuiltInFieldId.CarNumber;
SPBuiltInFieldId.Categories;
SPBuiltInFieldId.Category;
SPBuiltInFieldId.CellPhone;
SPBuiltInFieldId.CheckoutUser;
SPBuiltInFieldId.ChildrensNames;
SPBuiltInFieldId.Combine;
SPBuiltInFieldId.Comment;
SPBuiltInFieldId.Comments;
SPBuiltInFieldId.Company;
SPBuiltInFieldId.CompanyNumber;
SPBuiltInFieldId.CompanyPhonetic;
SPBuiltInFieldId.Completed;
SPBuiltInFieldId.ComputerNetworkName;
SPBuiltInFieldId.ConnectionType;
SPBuiltInFieldId.ContentType;
SPBuiltInFieldId.ContentTypeId;
SPBuiltInFieldId.CorrectBodyToShow;
SPBuiltInFieldId.Created;
SPBuiltInFieldId.Created_x0020_By;
SPBuiltInFieldId.Created_x0020_Date;
SPBuiltInFieldId.CustomerID;
SPBuiltInFieldId.Data;
SPBuiltInFieldId.DateCompleted;
SPBuiltInFieldId.DecisionStatus;
SPBuiltInFieldId.Deleted;
SPBuiltInFieldId.Department;
SPBuiltInFieldId.DiscussionLastUpdated;
SPBuiltInFieldId.DiscussionTitle;
SPBuiltInFieldId.DiscussionTitleLookup;
SPBuiltInFieldId.DLC_Description;
SPBuiltInFieldId.DLC_Duration;
SPBuiltInFieldId.DocIcon;
SPBuiltInFieldId.Duration;
SPBuiltInFieldId.Edit;
SPBuiltInFieldId.Editor;
SPBuiltInFieldId.EMail;
SPBuiltInFieldId.Email2;
SPBuiltInFieldId.Email3;
SPBuiltInFieldId.EmailBody;
SPBuiltInFieldId.EmailCalendarDateStamp;
SPBuiltInFieldId.EmailCalendarSequence;
SPBuiltInFieldId.EmailCalendarUid;
SPBuiltInFieldId.EmailCc;
SPBuiltInFieldId.EmailFrom;
SPBuiltInFieldId.EmailReferences;
SPBuiltInFieldId.EmailSender;
SPBuiltInFieldId.EmailSubject;
SPBuiltInFieldId.EmailTo;
SPBuiltInFieldId.EncodedAbsThumbnailUrl;
SPBuiltInFieldId.EncodedAbsUrl;
SPBuiltInFieldId.EncodedAbsWebImgUrl;
SPBuiltInFieldId.EndDate;
SPBuiltInFieldId.Event;
SPBuiltInFieldId.EventCanceled;
SPBuiltInFieldId.EventType;
SPBuiltInFieldId.Expires;
SPBuiltInFieldId.ExtendedProperties;
SPBuiltInFieldId.fAllDayEvent;
SPBuiltInFieldId.File_x0020_Size;
SPBuiltInFieldId.File_x0020_Type;
SPBuiltInFieldId.FileDirRef;
SPBuiltInFieldId.FileLeafRef;
SPBuiltInFieldId.FileRef;
SPBuiltInFieldId.FileSizeDisplay;
SPBuiltInFieldId.FileType;
SPBuiltInFieldId.FirstName;
SPBuiltInFieldId.FirstNamePhonetic;
SPBuiltInFieldId.FormData;
SPBuiltInFieldId.FormURN;
SPBuiltInFieldId.fRecurrence;
SPBuiltInFieldId.FSObjType;
SPBuiltInFieldId.FTPSite;
SPBuiltInFieldId.FullBody;
SPBuiltInFieldId.FullName;
SPBuiltInFieldId.Gender;
SPBuiltInFieldId.GovernmentIDNumber;
SPBuiltInFieldId.Group;
SPBuiltInFieldId.GUID;
SPBuiltInFieldId.HasCustomEmailBody;
SPBuiltInFieldId.Hobbies;
SPBuiltInFieldId.Home2Number;
SPBuiltInFieldId.HomeAddressCity;
SPBuiltInFieldId.HomeAddressCountry;
SPBuiltInFieldId.HomeAddressPostalCode;
SPBuiltInFieldId.HomeAddressStateOrProvince;
SPBuiltInFieldId.HomeAddressStreet;
SPBuiltInFieldId.HomeFaxNumber;
SPBuiltInFieldId.HomePhone;
SPBuiltInFieldId.HTML_x0020_File_x0020_Type;
SPBuiltInFieldId.ID;
SPBuiltInFieldId.IMAddress;
SPBuiltInFieldId.ImageCreateDate;
SPBuiltInFieldId.ImageHeight;
SPBuiltInFieldId.ImageSize;
SPBuiltInFieldId.ImageWidth;
SPBuiltInFieldId.Indentation;
SPBuiltInFieldId.IndentLevel;
SPBuiltInFieldId.Initials;
SPBuiltInFieldId.InstanceID;
SPBuiltInFieldId.IsActive;
SPBuiltInFieldId.ISDNNumber;
SPBuiltInFieldId.IsRootPost;
SPBuiltInFieldId.IsSiteAdmin;
SPBuiltInFieldId.IssueStatus;
SPBuiltInFieldId.Item;
SPBuiltInFieldId.ItemChildCount;
SPBuiltInFieldId.JobTitle;
SPBuiltInFieldId.Keywords;
SPBuiltInFieldId.Language;
SPBuiltInFieldId.Last_x0020_Modified;
SPBuiltInFieldId.LastNamePhonetic;
SPBuiltInFieldId.LessLink;
SPBuiltInFieldId.LimitedBody;
SPBuiltInFieldId.LinkDiscussionTitle;
SPBuiltInFieldId.LinkDiscussionTitleNoMenu;
SPBuiltInFieldId.LinkFilename;
SPBuiltInFieldId.LinkFilenameNoMenu;
SPBuiltInFieldId.LinkIssueIDNoMenu;
SPBuiltInFieldId.LinkTitle;
SPBuiltInFieldId.LinkTitleNoMenu;
SPBuiltInFieldId.List;
SPBuiltInFieldId.Location;
SPBuiltInFieldId.ManagersName;
SPBuiltInFieldId.MasterSeriesItemID;
SPBuiltInFieldId.MessageBody;
SPBuiltInFieldId.MessageId;
SPBuiltInFieldId.MetaInfo;
SPBuiltInFieldId.MiddleName;
SPBuiltInFieldId.Mileage;
SPBuiltInFieldId.Modified;
SPBuiltInFieldId.Modified_x0020_By;
SPBuiltInFieldId.MoreLink;
SPBuiltInFieldId.Name;
SPBuiltInFieldId.NameOrTitle;
SPBuiltInFieldId.Nickname;
SPBuiltInFieldId.Notes;
SPBuiltInFieldId.Occurred;
SPBuiltInFieldId.Office;
SPBuiltInFieldId.OffsiteParticipant;
SPBuiltInFieldId.OffsiteParticipantReason;
SPBuiltInFieldId.ol_Department;
SPBuiltInFieldId.ol_EventAddress;
SPBuiltInFieldId.Order;
SPBuiltInFieldId.OrganizationalIDNumber;
SPBuiltInFieldId.OtherAddressCity;
SPBuiltInFieldId.OtherAddressCountry;
SPBuiltInFieldId.OtherAddressPostalCode;
SPBuiltInFieldId.OtherAddressStateOrProvince;
SPBuiltInFieldId.OtherAddressStreet;
SPBuiltInFieldId.OtherFaxNumber;
SPBuiltInFieldId.OtherNumber;
SPBuiltInFieldId.Outcome;
SPBuiltInFieldId.owshiddenversion;
SPBuiltInFieldId.PagerNumber;
SPBuiltInFieldId.ParentFolderId;
SPBuiltInFieldId.ParentLeafName;
SPBuiltInFieldId.ParentVersionString;
SPBuiltInFieldId.PendingModTime;
SPBuiltInFieldId.PercentComplete;
SPBuiltInFieldId.PermMask;
SPBuiltInFieldId.PersonalWebsite;
SPBuiltInFieldId.PersonImage;
SPBuiltInFieldId.PersonViewMinimal;
SPBuiltInFieldId.Picture;
SPBuiltInFieldId.PostCategory;
SPBuiltInFieldId.Preview;
SPBuiltInFieldId.PreviewOnForm;
SPBuiltInFieldId.PrimaryNumber;
SPBuiltInFieldId.Priority;
SPBuiltInFieldId.Profession;
SPBuiltInFieldId.ProgId;
SPBuiltInFieldId.PublishedDate;
SPBuiltInFieldId.Purpose;
SPBuiltInFieldId.QuotedTextWasExpanded;
SPBuiltInFieldId.RadioNumber;
SPBuiltInFieldId.RecurrenceData;
SPBuiltInFieldId.RecurrenceID;
SPBuiltInFieldId.ReferredBy;
SPBuiltInFieldId.RelatedIssues;
SPBuiltInFieldId.RelevantMessages;
SPBuiltInFieldId.RepairDocument;
SPBuiltInFieldId.ReplyNoGif;
SPBuiltInFieldId.RequiredField;
SPBuiltInFieldId.Role;
SPBuiltInFieldId.RulesUrl;
SPBuiltInFieldId.ScopeId;
SPBuiltInFieldId.SelectedFlag;
SPBuiltInFieldId.SelectFilename;
SPBuiltInFieldId.SelectTitle;
SPBuiltInFieldId.SendEmailNotification;
SPBuiltInFieldId.ServerUrl;
SPBuiltInFieldId.Service;
SPBuiltInFieldId.ShortestThreadIndex;
SPBuiltInFieldId.ShortestThreadIndexId;
SPBuiltInFieldId.ShortestThreadIndexIdLookup;
SPBuiltInFieldId.ShowCombineView;
SPBuiltInFieldId.ShowRepairView;
SPBuiltInFieldId.SipAddress;
SPBuiltInFieldId.SpouseName;
SPBuiltInFieldId.StartDate;
SPBuiltInFieldId.StatusBar;
SPBuiltInFieldId.Subject;
SPBuiltInFieldId.Suffix;
SPBuiltInFieldId.SurveyTitle;
SPBuiltInFieldId.SystemTask;
SPBuiltInFieldId.TaskCompanies;
SPBuiltInFieldId.TaskDueDate;
SPBuiltInFieldId.TaskGroup;
SPBuiltInFieldId.TaskStatus;
SPBuiltInFieldId.TaskType;
SPBuiltInFieldId.TelexNumber;
SPBuiltInFieldId.TemplateUrl;
SPBuiltInFieldId.ThreadIndex;
SPBuiltInFieldId.Threading;
SPBuiltInFieldId.ThreadingControls;
SPBuiltInFieldId.ThreadTopic;
SPBuiltInFieldId.Thumbnail;
SPBuiltInFieldId.TimeZone;
SPBuiltInFieldId.Title;
SPBuiltInFieldId.ToggleQuotedText;
SPBuiltInFieldId.TotalWork;
SPBuiltInFieldId.TrimmedBody;
SPBuiltInFieldId.TTYTDDNumber;
SPBuiltInFieldId.UID;
SPBuiltInFieldId.UniqueId;
SPBuiltInFieldId.URL;
SPBuiltInFieldId.URLNoMenu;
SPBuiltInFieldId.URLwMenu;
SPBuiltInFieldId.User;
SPBuiltInFieldId.UserField1;
SPBuiltInFieldId.UserField2;
SPBuiltInFieldId.UserField3;
SPBuiltInFieldId.UserField4;
SPBuiltInFieldId.V3Comments;
SPBuiltInFieldId.VirusStatus;
SPBuiltInFieldId.WebPage;
SPBuiltInFieldId.WikiField;
SPBuiltInFieldId.WorkAddress;
SPBuiltInFieldId.WorkCity;
SPBuiltInFieldId.WorkCountry;
SPBuiltInFieldId.WorkFax;
SPBuiltInFieldId.WorkflowAssociation;
SPBuiltInFieldId.WorkflowInstance;
SPBuiltInFieldId.WorkflowInstanceID;
SPBuiltInFieldId.WorkflowItemId;
SPBuiltInFieldId.WorkflowLink;
SPBuiltInFieldId.WorkflowListId;
SPBuiltInFieldId.WorkflowName;
SPBuiltInFieldId.WorkflowOutcome;
SPBuiltInFieldId.WorkflowTemplate;
SPBuiltInFieldId.WorkflowVersion;
SPBuiltInFieldId.WorkPhone;
SPBuiltInFieldId.Workspace;
SPBuiltInFieldId.WorkspaceLink;
SPBuiltInFieldId.WorkState;
SPBuiltInFieldId.WorkZip;
SPBuiltInFieldId.xd_ProgID;
SPBuiltInFieldId.xd_Signature;
SPBuiltInFieldId.XMLTZone;
SPBuiltInFieldId.XomlUrl;

WSS 3.0 contenttypes (using Microsoft.SharePoint) returns a SPContentTypeId:

SPBuiltInContentTypeId.AdminTask;
SPBuiltInContentTypeId.Announcement;
SPBuiltInContentTypeId.BasicPage;
SPBuiltInContentTypeId.BlogComment;
SPBuiltInContentTypeId.BlogPost;
SPBuiltInContentTypeId.Contact;
SPBuiltInContentTypeId.Discussion;
SPBuiltInContentTypeId.Document;
SPBuiltInContentTypeId.DocumentWorkflowItem;
SPBuiltInContentTypeId.DomainGroup;
SPBuiltInContentTypeId.DublinCoreName;
SPBuiltInContentTypeId.Event;
SPBuiltInContentTypeId.FarEastContact;
SPBuiltInContentTypeId.Folder;
SPBuiltInContentTypeId.Issue;
SPBuiltInContentTypeId.Item;
SPBuiltInContentTypeId.Link;
SPBuiltInContentTypeId.LinkToDocument;
SPBuiltInContentTypeId.MasterPage;
SPBuiltInContentTypeId.Message;
SPBuiltInContentTypeId.ODCDocument;
SPBuiltInContentTypeId.Person;
SPBuiltInContentTypeId.Picture;
SPBuiltInContentTypeId.RootOfList;
SPBuiltInContentTypeId.SharePointGroup;
SPBuiltInContentTypeId.System;
SPBuiltInContentTypeId.Task;
SPBuiltInContentTypeId.UDCDocument;
SPBuiltInContentTypeId.UntypedDocument;
SPBuiltInContentTypeId.WebPartPage;
SPBuiltInContentTypeId.WikiDocument;
SPBuiltInContentTypeId.WorkflowHistory;
SPBuiltInContentTypeId.WorkflowTask;
SPBuiltInContentTypeId.XMLDocument;

Publishing fields SharePoint 2007 (using Microsoft.SharePoint.Publishing) returns a Guid:

FieldId.AnonymousCacheProfile;
FieldId.ArticleDate;
FieldId.AssociatedContentType;
FieldId.AssociatedVariations;
FieldId.AudienceTargeting;
FieldId.AuthenticatedCacheProfile;
FieldId.AutomaticUpdate;
FieldId.ByLine;
FieldId.CacheAllowWriters;
FieldId.CacheAuthenticatedUse;
FieldId.CacheCacheability;
FieldId.CacheCheckForChanges;
FieldId.CacheDisplayDescription;
FieldId.CacheDisplayName;
FieldId.CacheDuration;
FieldId.CacheEnabled;
FieldId.CachePerformAclCheck;
FieldId.CacheVaryByCustom;
FieldId.CacheVaryByHeader;
FieldId.CacheVaryByParam;
FieldId.CacheVaryByRights;
FieldId.Contact;
FieldId.ContentType;
FieldId.ContentTypeId;
FieldId.CreatedBy;
FieldId.CreatedDate;
FieldId.Description;
FieldId.ExpiryDate;
FieldId.HeaderStylesDefinitions;
FieldId.Hidden;
FieldId.LastModifiedBy;
FieldId.LastModifiedDate;
FieldId.LocalContactEmail;
FieldId.LocalContactImage;
FieldId.LocalContactName;
FieldId.MigratedGuid;
FieldId.NotificationListDeliveryDate;
FieldId.NotificationListUrl;
FieldId.PageLayout;
FieldId.PreviewImage;
FieldId.PublishingImageCaption;
FieldId.PublishingPageContent;
FieldId.PublishingPageIcon;
FieldId.PublishingPageImage;
FieldId.RedirectURL;
FieldId.ReusableHtml;
FieldId.ReusableText;
FieldId.ReusableTextType;
FieldId.RollupImage;
FieldId.SpsDescription;
FieldId.StartDate;
FieldId.SummaryAudience;
FieldId.SummaryGroup;
FieldId.SummaryIcon;
FieldId.SummaryImage;
FieldId.SummaryLinks;
FieldId.SummaryLinks2;
FieldId.TargetItemId;
FieldId.Title;
FieldId.VariationGroupId;
FieldId.VariationRelationshipLink;

Publishing contenttypes SharePoint 2007 (using Microsoft.SharePoint.Publishing) returns a SPContentTypeId:

ContentTypeId.ArticlePage;
ContentTypeId.MasterPage;
ContentTypeId.Page;
ContentTypeId.PageElementOutputCache;
ContentTypeId.PageLayout;
ContentTypeId.PageOutputCache;
ContentTypeId.RedirectPage;
ContentTypeId.ReusableHtml;
ContentTypeId.ReusableText;
ContentTypeId.WelcomePage;

Hope this helps to keep you’re code clean!

All checked out items MOSS 2007

November 7th, 2008

SharePoint is shipped with 7 standard reports. These reports are accessible in the site actions menu.  What if you want a custom report for example to view “All checked out items” (there is already a report All checked out items to me). Simply add an item to the Reports List. You can access the Reports List in the site collection under View All Site Content:
http://SERVERNAME/Reports%20List/AllItems.aspx

Add the following CAML-query:
<Where><IsNotNull><FieldRef Name=’CheckoutUser’ /></IsNotNull></Where>

You can use the CAML query builder to build up the CAML-query.

SharePoint Search did you mean?

October 30th, 2008

When you make a mistype in the Search box. SharePoint is giving a message “did you mean:” or “bedoelde u:” for a dutch site collection. These suggestions are given in the first occurrence of the browser languages. Very strange from Microsoft to use the browser language for this. Imagine that you have the first browser language set to en-us and you search in a dutch site collection for ’succes’:

Then SharePoint comes with the following message: “Bedoelde u? Success”. So be aware for this strange behaviour!

SharePoint language problem with search scopes groups

October 30th, 2008

When you have an english installation of SharePoint and you install the language packs (wss en sharepoint) for example the dutch language. You get the possibility to create dutch site collections. Sometimes when you create a dutch site collection you get errors with search. I didn’t see the searchscope dropdown but only the words ‘All sites’. When I searched for something I got the following javascript error:
‘options is leeg of geen object’.

The reason for this is that I couldn’t select a searchscope because they were not available. So I visited the  Scopes at the site collection level here:
http://SITE_COLLECTION/_layouts/viewscopes.aspx?mode=site

There I saw that the scope display groups has an english title. English titles in a dutch site collection? That is strange so I googled and found the following:
http://patrikluca.blogspot.com/2008/02/all-sites-search-scopes-missing-in.html

After reading this I renamed the scope display groups into:
Vervolgkeuzelijst voor zoeken
and
Geavanceerd zoeken

After this change the scopes dropdown is shown and search will work!