Articles about European Sharepoint Hosting Service
Posts tagged european sharepoint 2010 hosting
European SharePoint 2010 Hosting :: SharePoint 2010 XML Navigation with Selected Highlighted Tabs
May 21st
So you’ve got you XML Navigation set up and ready to go on your SharePoint 2010 Site. You log into your site and now you noticed that the XML has no idea what site you are on and so the Top Navigation Tab isn’t selected (highlighted) when you click on a site and some of your end users use this as a queue to know what site they are on because it stands out a little more than the site title. The Steps below will get you your XML Navigation implemented onto the Master Page and all of the tools that will help you control the behavior of your navigation.
The first step is to open your SharePoint 2010 Master Page in a tool like SharePoint Designer or Visual Studio 2010. Now look for the asp content placeholder: <asp:ContentPlaceHolder
id=”PlaceHolderHorizontalNav” runat=”server”>
Now you will want to change the Data source from DataSourceID=”topSiteMap” to DataSourceID=”DemoXmlDataSource”.
Then we are going to change the SiteMapProvider from:
<SharePoint:DelegateControl runat="server"
ControlId="TopNavigationDataSource"
Id="topNavigationDelegate"><Template_Controls><asp:SiteMapDataSource
ShowStartingNode="False"
SiteMapProvider="SPNavigationProvider" id="topSiteMap"
runat="server" StartingNodeUrl="sid:1002"/></Template_Controls></SharePoint:DelegateControl>
To:
<DataBindings> <asp:MenuItemBinding Depth="0"
DataMember="siteMapNode" NavigateUrlField="url"
TextField="title" ToolTipField="description"
ValueField="title" />
< asp:MenuItemBinding Depth="1" DataMember="siteMapNode"
NavigateUrlField="url" TextField="title"
ToolTipField="description" ValueField="title" />
< asp:MenuItemBinding Depth="2" DataMember="siteMapNode"
NavigateUrlField="url" TextField="title"
ToolTipField="description" ValueField="title" />
< asp:MenuItemBinding Depth="3" DataMember="siteMapNode"
NavigateUrlField="url" TextField="title"
ToolTipField="description" ValueField="title" />
< /DataBindings> </SharePoint:AspMenu> <asp:XmlDataSource
DataFile="/_layouts/XMLNavigation/topnavigation.xml"
ID="DemoXmlDataSource" runat="server"
XPath="/*/*"/>
The above change has the SiteMapProvider switched from pointing to the SharePoint site to point to a folder location on my server that has my XML Navigation in it. My new location is:
/_layouts/XMLNavigation/topnavigation.xml
Here is a complete view of what the asp content placeholder should look like:
<asp:ContentPlaceHolder id="PlaceHolderHorizontalNav" runat="server">
<SharePoint:AspMenu
ID="TopNavigationMenu" Runat="server" EnableViewState="false"
DataSourceID="DemoXmlDataSource" AccessKey="<%$Resources:wss,navigation_accesskey%>"
UseSimpleRendering="true" UseSeparateCss="false" Orientation="Horizontal" StaticDisplayLevels="1"
MaximumDynamicDisplayLevels="5"
DynamicHorizontalOffset="0"
SkipLinkText="" CssClass="s4-tn">
< DataBindings>
< asp:MenuItemBinding Depth="0"
DataMember="siteMapNode" NavigateUrlField="url"
TextField="title" ToolTipField="description"
ValueField="title" />
< asp:MenuItemBinding
Depth="1" DataMember="siteMapNode"
NavigateUrlField="url" TextField="title"
ToolTipField="description" ValueField="title" />
< asp:MenuItemBinding Depth="2" DataMember="siteMapNode" NavigateUrlField="url" TextField="title" ToolTipField="description" ValueField="title" />
<asp:MenuItemBinding Depth="3" DataMember="siteMapNode" NavigateUrlField="url"
TextField="title" ToolTipField="description" ValueField="title" />
< /DataBindings>
< /SharePoint:AspMenu>
< asp:XmlDataSource DataFile="/_layouts/XMLNavigation/topnavigation.xml"
ID="DemoXmlDataSource" runat="server" XPath="/*/*"/>
</asp:ContentPlaceHolder>
Now I will need to properly create my XML Navigation with URL’s that will allow me to highlight a tab when it has been selected on the SharePoint site. The main rule is that you will need to use the entire url for your site in order for this to work. So instead of having http://yoursharepointsite you will need to have http://yoursharepointsite/default.aspx or whatever the entire path is to the aspx file for your landing page is on your site. The limitation that should be noted is that the top nav items will only be highlight when you are on the root level of each site collection or sub-site.
Here is an example of what your XML file navigation should look like:
<?xml version="1.0" encoding="utf-8" ?><siteMap>
<siteMapNode url="http://yoursharepointsite/SitePages/Home.aspx"
title="Home" description="Home"/>
<siteMapNode url="http://yoursharepointsite/SearchCenter/Pages/default.aspx"
title="Search Center" description="Search Center"/>
<siteMapNode
url="http://yoursharepointsite/subsite1/SitePages/Home.aspx"
title="Subsite #1" description="Subsite #1"/>
<siteMapNode
url="http://yoursharepointsite/couseling/SitePages/Home.aspx"
title="Counseling" description="Counseling">
<siteMapNode url="http://yoursharepointsite/dropdown1"
title="Housing Services" description="Housing Services"/>
<siteMapNode url="http://yoursharepointsite/dropdown2"
title="Specialized Services" description="Specialized
Services" />
<siteMapNode url="http://yoursharepointsite/dropdown3"
title="Services" description="Services" />
</siteMapNode>
<siteMapNode url="http://yoursharepointsite/TestSite/SitePages/Home.aspx"
title="Test Site" description="Test Site"/>
<siteMapNode
url="http://yoursharepointsite/finalsite/SitePages/Home.aspx"
title="Another Test Site" description="Another Test
Site"/>
</siteMap>
Now we will need to reference and create some JQuery to allow for the magic to happen. We will be using jquery-1.6.1.js for this tutorial. So that file will need to be referenced in your masterpage to get the JQuery to work on the Top Navigation Highlighted selection.
For the JavaScript needed to make the Top Navigation stay selected when you are on the site you will need to create a JS file using the following code:
var TCSC = {};
TCSC.ShowMenuSelection = function () {
var url = location.href;
var url_parts = url.split('?');
var main_url = url_parts[0];
$('[href="' + main_url + '"]',
$('div.menu-horizontal')).addClass('selected');
};
$(function () {
TCSC.ShowMenuSelection();
});
Save the file as something like topnav.js. You can create this file in a program like notepad and then just save it with the .js file extension. The JavaScript above tells the tab to add the Selected class to the class id when you are landed on a page in the XML Navigation file.
Now we will reference your two JavaScript files in your SharePoint 2010 Master Page. Before the closing </head>tag put <script type="text/JavaScript"
first and then below that add:
src="/_layouts/jquery/jquery-1.6.1.js"></script><script type="text/JavaScript" src="/_layouts/jquery/topnav.js"></script>
Let me explain my file location that you see above. When I create a master page solution I put my JQuery files into a folder called jquery that will be deployed to the layouts directory on my server. I will be including a Master Page Solution at the end of this posting that you can deploy to your site and all of the files can be edited to your liking.
The XML Navigation created to use in this solution will be deployed to the directory: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\LAYOUTS\XMLNavigation on your server. There you can change and experiment with the URL’s on your site to create the selected tab. What you see below is the example XML Navigation file’s contents.
<?xml version="1.0" encoding="utf-8" ?><siteMap>
<siteMapNode url="http://yoursharepointsite/SitePages/Home.aspx"
title="Home" description="Home"/>
<siteMapNode url="http://yoursharepointsite/SearchCenter/Pages/default.aspx"
title="Search Center" description="Search Center"/>
<siteMapNode
url="http://yoursharepointsite/subsite1/SitePages/Home.aspx"
title="Subsite #1" description="Subsite #1"/>
<siteMapNode
url="http://yoursharepointsite/couseling/SitePages/Home.aspx"
title="Counseling" description="Counseling">
<siteMapNode url="http://yoursharepointsite/dropdown1"
title="Housing Services" description="Housing Services"
/>
<siteMapNode url="http://yoursharepointsite/dropdown2"
title="Specialized Services" description="Specialized
Services" />
<siteMapNode url="http://yoursharepointsite/dropdown3"
title="Services" description="Services" />
</siteMapNode>
<siteMapNode url="http://yoursharepointsite/TestSite/SitePages/Home.aspx"
title="Test Site" description="Test Site"/>
<siteMapNode
url="http://yoursharepointsite/finalsite/SitePages/Home.aspx"
title="Another Test Site" description="Another Test
Site"/>
</siteMap>
Part of this XML gives you the ability to have dropdown links as well. Located here in the code:
<siteMapNode
url="http://yoursharepointsite/couseling/SitePages/Home.aspx"
title="Counseling" description="Counseling">
<siteMapNode url="http://yoursharepointsite/dropdown1"
title="Housing Services" description="Housing Services"
/>
<siteMapNode url="http://yoursharepointsite/dropdown2"
title="Specialized Services" description="Specialized
Services" />
<siteMapNode url="http://yoursharepointsite/dropdown3"
title="Services" description="Services" />
</siteMapNode>
The Master Page will be called xmlnav.master and the server side copy will be located at:
C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURE \XML.SharePoint2010.Masterpage\Masterpage
Also a virtual copy will appear in the _catalogs/masterpage folder on your Site Collection once you deploy and activate the Feature.
With a combination of having a full URL path for your links and some JavaScript you can now have the ability to highlight your tabs when using XML just like SharePoint 2010 Navigation does by default without XML.
If you are using the supplied WSP file you will have to manually update the XML file to have your website url’s for this Solution to work, but I wanted to supply this to help get you started.
Note: If your aren’t familiar with using XML within SharePoint, you must enable the XML Data Source to be “True” in your web.config file as shown below:
TypeName=”XmlDataSource” Safe=”True”

European SharePoint 2010 Hosting :: How to Deploy .wsp file Using Visual Studio 2010 for SharePoint 2010
Apr 20th
A solution package is a distribution package that delivers your custom SharePoint Server 2010 development work to the Web servers or the application servers in your server farm. Use solutions to package and deploy custom Features, site definitions, templates, layout pages, Web Parts, cascading style sheets, and assemblies.
In SharePoint 2010 it is easy to create a .wsp file using visual studio 2010, which was previously very difficult in MOSS 2007. To deploy any solution package in any local environment in Visual Studio 2010 simply right click on the project and deploy. But to deploy the same thing in the production server we will need to deploy through .wsp file.
Steps to generate the wsp file:
Right click on the project/solution in Visual Studio 2010 then choose package. If you are building the
project/solution in debug mode then you will get the .wsp file inside the Bin\Debug folder and if you are building the project in release mode then you will get the .wsp file inside the Bin\Release folder. This wsp file is needed to deploy in the production environment.
This is the best way to create the wsp file in visual studio 2010.
There are different ways you can deploy the .wsp file
Using browser:
Go to the Central Administration -> Site Actions ->Site Settings -> Galleries –> click on Solutions. After this the below page will open as shown in the figure.
Click on Upload solution and then browse to the wsp file as shown below in the figure.
Once you will click Ok then activation window will appear like below figure.
Then you can use the solution.
Using PowerShell:
To add a solution using PowerShell:
Open the SharePoint 2010 Management Shell. You can get to this by going to Start > All Programs > Microsoft SharePoint 2010 Products > SharePoint 2010 Management Shell.
Add-SPSolution {path of wsp file}
To deploy the solution using power shell
Install-SPSolution –Identity {path of wsp file}.wsp –WebApplication http://-GACDeployment
To update solution
Update-SPSolution –Identity {path of wsp file}.wsp –LiteralPath {local path of wsp file}wsp –GACDeployment
To uninstall solution
Uninstall-SPSolution –Identity {path of wsp file}.wsp –WebApplication http://
Remove solution
Remove-SPSolution –Identity {path of wsp file}.wsp
Using Stsadm:
Add the solution
stsadm -o addsolution -filename {path of wsp file}
Deploy the solution
stsadm -o deploysolution -name {path of wsp file} -url {URL}
Retract solution:
stsadm.exe -o retractsolution -name {path of wsp file}.wsp –URL
Delete Solution
stsadm.exe -o deletesolution -name {path of wsp file}.wsp

European SharePoint 2010 Hosting :: Solve – “Your search cannot be completed because this site is not assigned to an indexer” on SharePoint 2010 Foundation
Apr 6th
SharePoint 2010 Foundation problems encountered when doing a quick spin-up of a test instance.
- Search service wouldn’t start
- Performing a search returned the error “Your search cannot be completed because this site is not assigned to an indexer”
To allow the search service to start the credentials assigned to the service were changed from Local Service to Local System.
To fix the “not assigned to indexer” error use Central Administration.
Navigate to “Manage content databases.”
Make sure you have the correct web application selected and click on the content database.
Scroll down and find the Search Server section and select the search server from the drop-down.

European SharePoint 2010 Hosting :: Customize SharePoint Custom Lists Using MS InfoPath 2010
Mar 20th
Problem
The default SharePoint 2010 list forms (DispForm , EditForm & NewForm) are quite generic (as they were with previous SharePoint versions).. Wouldn’t it be great to be able to customize the look & feel of them?
InfoPath 2010 to the rescue…
Solution
Microsoft InfoPath 2010 makes designing and publishing electronic forms easier than ever. InfoPath enables you to create powerful, interactive forms without writing any code. With a few clicks, an Office user can customize SharePoint list forms, add custom layout elements, and add business rules to validate the data. In addition to working with the forms online while connected to SharePoint Server 2010, you can also take the list and associated forms offline, and then work with the forms in SharePoint Workspace.
InfoPath is based on Extensible Markup Language (XML). When you design a form template, InfoPath creates an .xsn file, which is a cabinet (.cab) file that contains the files necessary for the form to function, such as XML Schema (XSD) and XSL Transformation (XSLT) files. When a user fills out a form in InfoPath, the data in that form is saved or submitted as industry-standard XML. However, you don’t have to know anything about XML to design a form template or fill out a form. The point is that XML can make it easier for your organization to repurpose the data that it collects by using forms.
Let’s see how to customize a SharePoint custom list using MS InfoPath 2010 designer:
– Assume that we have a SharePoint custom list named “MSSharePointTips IFP” with the following columns “Name , Age , Address & Birth Date”:
– When we click on “Add new item” link we’ll see:
– Click the “Customize Form” button under “List” settings at the ribbon option “List Tools”:
– InfoPath Designer 2010 will be launched and add the “MSSharePointTips IFP” columns fields at a custom InfoPath “New” entry form :
– Let’s customize the fields, making them bold and setting the font-color to be red”. Save the form, then click on the “Preview” button:
– Here’s the form after applying a set of customizations in preview mode. Click on “Close Preview” button.
– Click on the “Quick Publish” button or use “Ctrl + Shift + Q”:
– Wait until receiving the confirmation message: “Your form template was published successfully”…
– If we return back to the “MSSharePointTips IFP” list and click on the “Add new item” link , we’ll see our customizations:
– If we want to revert (rollback) our InfoPath customizations and return to the SharePoint default settings, click on the “List Settings” button under “List” settings at ribbon “List Tools”:
– Click on “Form Settings” under “General Settings”:
– Select “Use the default SharePoint form” and check “Delete the InfoPath Form from the server” then click OK:
– Now if we click on “Add new item”, we’ll see the SharePoint default entry “New Item” form:

European SharePoint 2010 Hosting :: Modifying the Core Search Results Web Part to Display Results Sorted by Site Name or Document Title
Mar 2nd
I recently had a requirement from my client to have the following functionality in SharePoint 2010:
a) The Search Core Results web part displaying sorted in Alpha order
b) The Search Core results part should just show sites (not documents) that the current user has access to.
Requirement b) was simple – you can set the keywords on the Core Search Web Part to just display sites (using the “contentclass:STS_Site” keyword in the “Fixed Keyword Query” property – and the part would default to showing a list of sites the current user has access to (via the normal SharePoint 2010 security trimming functionality).
However, the first requirement was a little bit trickier. The default Core Search Web part only provides for 2 search sort options – by date and by relevance (which is the default).
To fix this, the XSLT which defines the search results needs to be changed. This XSLT is specific to the instance of the web part – modifying it won’t affect the normal search functionality of your site.
To modify the XSLT for the search results web part, you need to first uncheck the “Use Location Visualization” checkbox. The XSLT that opens is around 700 lines long and has a lot of different XSL templates defined within it. To sort the search results by alpha order, you need to use an xsl-sort call within the main apply-templates call.
Some sites such as http://kwizcom.blogspot.com/2008/11/how-to-change-moss-search-retults-sort.html have a simple suggestion – but this would not work as the “select node is missing” on the “apply-templates directive. You need to provide a valid parent to allow for sorting. The fix was to change the empty apply-templates node in the default search XSL:
1 |
<xsl:apply-templates /> |
to the following:
1 2 3 4 |
<xsl:apply-templates select="All_Results/Result"> <!-- The xsl-sort needs operate upon a single field - it doesn't work if the sort has to evaluate child nodes--> <xsl:sort select="title" /> </xsl:apply-templates> |
Note that I didn’t require the other elements in the Search XML (the TotalResults and the NumberOfResults nodes), so this solution may not work in your scenario. This list can then act as a facility for cross-site collection navigation (which is not available out of the box in SharePoint 2010)
Another limitation of this approach is that it will only work on a non-paged resultset – which is a pretty major limitation! In our scenario (for Phase 1 of our provisioning solution), it was acceptable for our customer to increase the page size to avoid any pagination from occurring. Your mileage may vary.
Other solution options are:
- Scripting – Using jQuery to do a search call and sorting and paging the results yourself
- Server side – with your own custom web part that also does the paging for you – using the SPGridView or inheriting from
Microsoft.Office.Server.Search.WebControls.CoreResultsWebPart
Phase 2 of our project will use a combination of Server Side customization (as described at http://msdn.microsoft.com/en-us/gg620579) by extending the CoreResultsWebPart
and the jQuery approach above for easy inline searching of accessible site collections.
European SharePoint 2010 Hosting :: How to Create a Custom Web Service in SharePoint 2010
Feb 21st
There are numbers of out of the box web services present in SharePoint that will do most of the
common tasks like methods for working with list ,sites and sub sites, users and groups etc. For
using these web services you need to add the reference of the web service . But if your
requirement doesn’t fit with any of the web methods like parameters of the method or functionality
of the method then you need to create a custom web service.
Below are the steps how you can create a custom web service.
Step: 1
Create an asp.net web service project in the visual studio. Name the project as TestServiceProject and rename the Service1.asmx file to TestWebService.asmx.
This .asmx file will contain the web methods and the programming logic. Now we
can go to the TestWebService.asmx.cs page and define a web method.
Let’s say i want to create a web method which will do some operations on the list
[WebMethod]
1 2 3 4 |
public string TestMethod(string listName , SPWeb oWeb) { //Write the logic for the operation } |
Step: 2
In Solution Explorer, right-click TestWebService.asmx and select View Markup.
You will see the following line:
1 |
<%@ WebService CodeBehind="Service1.asmx.cs" %> |
Change this to:
1 |
<%@ WebService %> |
Step: 3
Now create a strong key name for the class library project and compile the project
Step: 4
Now host this application in your IIS. Now we need to generate the .disco and the .wsdl files.
To generate the .disco and .wsdl file we need to run the disco.exe command.
The disco.exe file will be present at the path “C:\Program Files\Microsoft SDKs
\Windows\v6.0A\Bin”.
Now open the command prompt and run the disco command as:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin > disco http://localhost:5050
/TestServiceProject/TestWebService.asmx
Step: 5
Now open both the TestWebService.disco and TestWebService.wsdl file which will
be present at “C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin” and replace the XML processing instruction
“<?xml version=”1.0″ encoding=”utf-8″?>”
with
1 2 3 4 |
<%@ Page Inherits="System.Web.UI.Page"%> <%@ Assembly %> <%@ Import Namespace="Microsoft.SharePoint.Utilities" %> <%@ Import Namespace="Microsoft.SharePoint" %> <% Response.ContentType = "text/xml"; %> |
Step: 6
In TestWebService.disco file modify the contactref and the soap address tags to:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<contractRef ref=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode (SPWeb.OriginalBaseUrl(Request) + "?wsdl"),Response.Output=""); %>docRef=<%SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode (SPWeb.OriginalBaseUrl(Request)),Response.Output); %>xmlns="http://schemas.xmlsoap.org/disco/scl/" /> <soap address=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode (SPWeb.OriginalBaseUrl(Request)),Response.Output); %>xmlns:q1="http://tempuri.org" binding="q1:TestWebServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> <soap address=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode (SPWeb.OriginalBaseUrl(Request)),Response.Output); %>xmlns:q2="http://tempuri.org" binding="q2:TestWebServiceSoap12" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> |
Step: 7
In TestWebService.wsdl file modify the soap:address and soap12:address to:
1 2 3 4 5 |
<soap:address location=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)) ,Response.Output); %> /> <soap12:address location=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(SPWeb.OriginalBaseUrl(Request)) ,Response.Output); %> /> |
Now save the two files as TestWebServicedisco.aspx and TestWebServicewsdl.aspx.
Step: 8
Now copy the files TestWebService.asmx, TestWebServicedisco.aspx and TestWebServicewsdl.aspx to the “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI” folder
Step: 9
To include the Web service in the list of web services on the server, open the spdisco.aspx file which is present at “C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI” and add the following within the discovery element.
Now save the two files as TestWebServicedisco.aspx and TestWebServicewsdl.aspx.
1 2 3 4 5 6 |
<contractRef ref=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/TestWebService.asmx?wsdl"), Response.Output); %> docRef= <% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/TestWebService.asmx"), Response.Output); %> xmlns="http://schemas.xmlsoap.org/disco/scl/" /> <soap address=<% SPHttpUtility.AddQuote(SPHttpUtility.HtmlEncode(spWeb.Url + "/_vti_bin/TestWebService.asmx"), Response.Output); %> xmlns:q1="http://schemas.microsoft.com/sharepoint/soap/directory/" binding="q1:TestWebServiceSoap" xmlns="http://schemas.xmlsoap.org/disco/soap/" /> |
Step: 10
Now deploy the TestServiceProject.dll to GAC and the bin directory of the site on which you want to use the web service. Now you can consume the web service like the out of the box web service provided by SharePoint.