Skip Ribbon Commands
Skip to main content
Delta-N Blogs > SharePoint Blog
augustus 25
Changing SharePoint 2010 Search Ranking Model

SharePoint 2010 Enterprise Search uses ranking models to determine how data is weighed and results are ranked. Out of the box SharePoint 2010 provides nine different models, from which two are used by default. You also have the option to create your own if this is required. To see which models are registered with your Search Service Application, you can use the following PowerShell Command:

[sourcecode language='powershell'  padlinenumbers='true']
 Get-SPEnterpriseSearchRankingModel -SearchApplication "Search
 Service Application"
[/sourcecode]

1

The default Core Results Web Part uses the MainResultsDefaultRankingModel and the People Results Web Part uses the MainPeopleModel. To try the different models, you can just append the search results querystring with &rm=<guid>

So …/Pages/peopleresults.aspx?k=john&s=People&rm=0bba4d7d-4f2c-4086-975a-8f9d2b6c6d53 would return people results using the NameModel.

If you want to permanently alter the used ranking model, you have to adjust the Results Web Part. Follow these steps to modify the normal search:

  1. Export the Core Results Web Part.
  2. Add or modify the following property, for instance:
    <property name="DefaultRankingModelID" type="string">0bba4d7d-4f2c-4086-975a-8f9d2b6c6d53</property>.
  3. Import and re-add the web part.

For people search, this unfortunately does not work very well. The People Core Results Web Part will reset your DefaultRankingModelID back to use the MainPeopleModel once you upload your web part. Just add a (hidden) Core Results Web Part to your page and configure the property that way.

juli 19
Speed up SharePoint 2010 development

SharePoint Development tends to be a wee bit more time consuming compared to “standard” ASP.NET development. Although Microsoft really helped us a lot by providing seriously improved integration with Visual Studio 2010, building, packaging, deploying and debugging can still be annoyingly slow.

Here are a couple of things you could do to speed things up a bit.

1. Fast hardware

Of course the most important part. Be sure to have a lot of RAM in your development machine, at least 4 GB. With the 64-bit OS requirement for SharePoint 2010 we can address more than 3 GB so make sure it is available. Even current generation laptops can handle 8 GB of RAM, no excuses anymore (apart from budget that is).

Because you probably run all required software on one machine, fast disks are equally important. This component improves the overall experience, but MSSQL Server benefits the most. If you are running virtuals, you can go for fast external disks using eSata (or maybe USB 3.0). If you are more like me (and don’t like the external disk hassle) be sure to examine the disk specs when shopping for new hardware.

2. The right OS

I tried running Windows 7 Ultimate with SharePoint 2010 installed locally. Yes it works, but it is still a desktop OS. And you really can’t run things like domain controllers and stuff like that locally. If you really want things to go fast, you boot a regular server OS, say Windows Server 2008 R2. It handles server software far better than any desktop OS. And if you can, just install all needed components on one server (i.e. MSSQL Server, SharePoint 2010, Visual Studio, Office, Domain Controller, DNS, etc.). And Windows 7 VHD boot makes dual booting a breeze!

If you do need more than one server, think about installing Windows Server 2008 R2 with the Hyper-V role. And run your servers on top of that! You will probably need at least 8GB (host + 2 guests), but will give you ultimate flexibility.

3. Tweak your OS and server software

Same old story:

  • Don’t run unneeded services or components. No, you don’t need Adobe Auto Updater or the Windows Media Player Online Subscription blah blah. Check the Windows Services and registry “run” keys.
  • If you run MSSQL Server (and you probably do), be sure to maximize its memory to a value you consider adequate. This way, it won’t hog up your machine. Also if you have more than one disk, store the “tempdb” on a different disk than the content or configuration database. Other “production” performance tweaks also apply of course.
  • Regarding SharePoint IIS configuration, I normally run most parts on the same Application Pool. This saves valuable memory, but makes recycling take a bit longer. If you run many Web Applications but only develop in one, dedicate one AppPool to your development application and share the rest.
  • Keep your content databases lean. There is normally no need to develop against a 50+ GB database. Just use a default empty one or with limited content. You can of course switch later on if you need to test your solution.

4. Be smart

When deploying and debugging SharePoint solutions, Application Pool recycles are a pain! Be smart when laying out your Visual Studio projects and decide which parts must be farm solutions and which parts sandbox solutions. Remember: farm solutions require a IIS recycle where as sandbox solutions do not (see earlier post about Sandbox solutions). You can always merge them later when heading towards production state.

If you are developing loads of Web Parts or User Controls (used by Visual Web Parts), there is another thing you could do. Since most of them are plain ASP.NET components, you can stick them on a simple ASPX page and develop them using IIS. Especially handy during the early stages and you can add them to your SharePoint project when they need a SharePoint environment.

5. Time savers

You probably already have the “CKS: Development Tools Edition” installed. If not, please do. They also contain several time savers regarding deployment, like Quick Deploy, Copy Assemblies and Copy Files. There is even a feature that warms up your site after a IIS recycle!

You probably have other tricks up your sleeve, but I thought I’d share mine.

Pingback on July 19, 2011 by yuriburger from http://allthingssharepoint.wordpress.com/2011/07/19/speed-up-sharepoint-2010-development/

juni 15
Visual Studio 2010: Sandbox Deployment Errors

So you created a nice Sandbox SharePoint solution and need to deploy it. You entered the correct Site URL and hit deploy. Unfortunately the output shows  a failed deployment step:

image

Couple of deployment errors Visual Studio might throw at you at this stage:

Error occurred in deployment step 'Activate Features': Cannot start service SPUserCodeV4 on computer <name>.

Check if the Windows Service is not disabled: “SharePoint 2010 User Code Host”. Better yet, set it to “Automatic” on your development machine.
Error occurred in deployment step 'Activate Features': This feature cannot be activated at this time. The contents of the feature's solution requires the Solution Sandbox service to be running. Your development environment should have at least one server running the “Microsoft SharePoint Foundation Sandboxed Code Service “. Check in Central Administration/ Services on Server.
Error occurred in deployment step 'Add Solution': Sandboxed code execution request failed. This could have a couple of reasons, but the one I encounter the most is lack of rights. I normally enable “god-mode” on my dev machines (see below).
Error occurred in deployment step 'Activate Features': Attempted to perform an unauthorized operation. If you are running in “god-mode” this shouldn’t happen. Just make sure you are Site Collection Administrator.

This list is by no means complete and I will extend it as I encounter other issues, hopefully not too many :).

Running in “God-mode”

Important: Not recommended in production environments. Since you are deploying with Visual Studio, this is obviously not the case.

To enable easy access on your development machine, make sure the following is true

  • Disable User Account Control (in Windows 2008 R2 this means lowering the setting to “Never notify”.

image

  • Microsoft Visual Studio runs as Administrator (see title bar).

image

  • You are a member of the local Administrators group
  • You are a member of the local WSS_ADMIN_WPG group
  • You are database owner (dbo) of both content databases and the SharePoint_Config database
  • You are Farm Administrator
  • You are Site Collection Administrator
februari 22
Custom SharePoint Designer Activity

SharePoint 2010 comes with several powerful pre-defined workflows and activities. But what if the out of the box workflow activities don’t (fully) meet your requirements? You could of course go fully Windows Workflow Foundation and develop the complete workflow in Visual Studio 2010. Another option is to develop a custom Activity and make it available to SharePoint Designer. This way the end user can tune and modify the workflow without the need to bother the developer.

Things we need:
• Visual Studio 2010
• SharePoint 2010 (any edition will work)
• SharePoint Designer 2010

Create the activity

1. Create a new C# Workflow Activity Library Project
2. Add references and “using” statements to the following assemblies:

using System.Workflow.ComponentModel;
using System.Workflow.Activities;
using System.ComponentModel;
using Microsoft.SharePoint;

Make sure your project targets Framework 3.5 and everything should be available right from the “Add Reference” dialog.

3. Modify Activity1.cs which will contain our activity

Of course we now need some properties for our workflow activity. In order to access the properties from our custom activity, we need some form of special declaration. This way we can ensure SharePoint Designer hooks up all the needed information. This declaration is done with the help of what is called “Dependency Properties”. They start off with a standard .Net property with get and set methods and then get registered as a “DependencyProperty”. You do this by appending “Property” to the name (this is important) and declaring it like this:

public static DependencyProperty SiteUrlProperty = DependencyProperty.Register("SiteUrl",typeof(string), typeof(CreateSite), new PropertyMetadata(""));

I want my activity to create a site, so I need the following properties at least:
• SiteUrl: url of the root site where the new site will be created
• SiteName: name of the new site
• SiteTemplate: template to be used for the new site

After we setup the properties, we need to override the Execute method:

protected override ActivityExecutionStatus Execute(ActivityExecutionContext executionContext)
{
  Create();
  return ActivityExecutionStatus.Closed;
}

4. Sign the assembly with a strong named key.

Create the deployment

Because we are targeting SharePoint Designer, it is now the time to work on our deployment.
1. Add a new Empty SharePoint Project to our solution and make it a Farm Solution.
2. Add the following mapped SharePoint folder: {SharePointRoot}\Template\1033\Workflow
3. Create the Actions xml file

<WorkflowInfo>
  <Actions Sequential="then" Parallel="and">
    <Action Name="Create Site" ClassName="CustomActivityLibrary.CustomActivityCreateSite" Assembly="CustomActivityLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b2a70b987e8b655" AppliesTo="all" Category="Custom SPD Activity">
      <RuleDesigner Sentence="Site Name %1 in root site %2 using template %3.">
        <FieldBind Field="SiteName" Text="Site Name" DesignerType="TextArea" Id="1"/>
        <FieldBind Field="SiteUrl" Text="Url of root site" Id="2" DesignerType="TextArea"/>
        <FieldBind Field="SiteTemplate" Text="Name of the template" Id="3" DesignerType="TextArea"/>
      </RuleDesigner>
      <Parameters>
        <Parameter Name="SiteName" Type="System.String, mscorlib" Direction="In" />
        <Parameter Name="SiteUrl" Type="System.String, mscorlib" Direction="In" />
        <Parameter Name="SiteTemplate" Type="System.String, mscorlib" Direction="In" />
      </Parameters>
    </Action>
  </Actions>
</WorkflowInfo>

4. Add the project output from the ActivityLibrary as an additional assembly to the Package.

spd3

5. Add the assembly as an authorized type to the web.config:

<authorizedType Assembly="CustomActivityLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1b2a70b987e8b655" Namespace="CustomActivityLibrary" TypeName="*" Authorized="True" />

And voila, we can now make use of our own custom activity:

spd2

Deployment on a production machine, is of course somewhat different. You need the following components:
1. Your workflow activity library (the assembly)
2. The workflow .actions file (place it in the Template\1033\workflow folder)
3. The SafeControl entry in the web.config
4. The authorizedType entry in the web.config

 

Original article can be found at: http://allthingssharepoint.wordpress.com/2011/02/21/custom-sharepoint-designer-activity/

september 22
€ 100,- korting op de entreeprijs voor SharePoint Connections 2010 Autum

Wil je nog naar SharePoint Connections?
Gebruik onderstaande kortingscode en ontvang 100,- korting.

SharePoint Connections 2010 Autumn is op 28 en 29 september 2010 in het World Forum in Den Haag.

Klik hier voor het volledige programma

Registration URL: http://sharepoint.msregistration.com/reg

code: DC7JF

image

september 21
Microsoft SharePoint 2010, is it a true Document Management System?
A post I did on SharePoint 2010 and DMS: http://allthingssharepoint.spaces.live.com/
september 13
Verbergen SharePoint Designer optie, 2007 en 2010

In SharePoint 2007 is en was het redelijk ingewikkeld om op een juiste manier de SharePoint Designer optie weg te krijgen. Ook om vooral andere functionaliteiten nog wel te laten werken. Voor een volledig overzicht en een zeer goede blog post zie “Locking Down SharePoint Designer" van het Microsoft SharePoint Designer Team Blog.

Voor SharePoint 2010 en SharePoint Designer 2010 is het allemaal wat eenvoudiger. Dit kan gewoon op site collectie niveau.

Ga naar Site Actions –> Site Settings dan onder Site Collection Administration Kies je SharePoint Designer Settings

image image image

Simpel toch?

september 08
Nice, Delta-N zomaar ineens genoemd

Gisteren kwam ik heel toevallig via Twitter te weten dat er 2 artikelen over de SharePoint en CRM implementatie bij de Marnix Academie gescheven zijn.

image

Voor de 2 artikelen zie: Softwarecentraal en CRM Kiezen

augustus 26
How to add a SharePoint shortcut on desktop for drag and drop files

Soms is het handig om even een shortcut van een SharePoint bibliotheek op je desktop te hebben. Bijvoorbeeld voor drag and drop files.

Echter is het niet iets wat ik aan iedereen zal adviseren, aangezien je het gehele metadata systeem ondermijnd.

-> Open the document library, for example "Shared Documents"

-> Go to Actions and open with Windows Explorer

clip_image001

-> copy the url

clip_image002

-> Go to your desktop using Microsoft Key + D

-> Press right mouse button and create new shortcut

clip_image003

-> paste the URL

clip_image004

And give it an name.

Now you can drag and drop files into the SharePoint document Library without opening SharePoint.

augustus 26
How to… create site content type

Even een how to, waarom zal je afvragen. Het is een vraag die ik regelmatig van collega’s en klanten krijg of ik met regelmaat wat (al zijn het redelijk eenvoudige) how to’s te plaatsen.

Vandaag, hoe een site content type te creeren.

Voordat je direct aan de slag gaat met het creeren van site content types zal je eerst moeten afvragen WAAROM je site content types zal gaan aanmaken. Ik zal dit niet helemaal gaan uitleggen aangezien dit redelijk beschreven is op diverse websites en hier. Wat is nu bijvoorbeeld een voordeel die je hebt met een sit content type?

  • 1 maal creeren en overal kunnen gebruiken in dezelfde site collectie, MOSS 2007. SharePoint 2010 bruikbaar in andere sitecollecties
  • Bij wijzigen site content type wordt deze ook gewijzigd in de diverse lijsten en blibliotheken waar deze bijgevoegd is.
  • Aanhangen specifieke metadata en Workflows.

Hoe maak je nu daadwerkelijk zo een site content type en hoe voeg je deze toe aan je lijst/bibliotheek? Excuus voor de Engelse beschrijving, reden heb het al eerder beschreven voor een Engelstalige klant.

    • First we need to activate the "allow management content types"
    • Open the document library
    • Go to document library settings
    • clip_image001
    • Go to advanced settings
    • clip_image002
    • Enable Yes in the allow management content types section
    • clip_image003
    • Next step is now to create the content type, this must be done when the content type is not available
    • The creation of a new content type can be done at 2 levels in SharePoint. These are site collection and site level.
    • We are going to create is at site level
    • Go to site actions and site settings
    • clip_image004
    • Go to Site Content Types, under Galleries
    • clip_image005
    • Go to create
    • clip_image006
    • Fill in the fields, and select the content type where it should inherit from. Mostly used is Document Content Types
    • The Parent Content Type is Document
    • Create a custom group or use an existing group. This is where you can find the content type back.
    • Before we are going to add the site content type to the document library we need to add the template, example document to the site content type.
    • Go to advanced settings
    • clip_image007
    • Upload a new template or select a template direct from SharePoint with the copy paste technique
    • Now we need to add the site content type to the document library
    • Go to the document libray
    • Go to settings, document library settings
    • clip_image008
    • Add from existing content type
    • clip_image009
    • Now the content type is available with the new button.. You can also change the order etc..
1 - 10Next
 

 Top posters