Thinking out Aloud

Dave Hunter's SharePoint Blog

I’m attending the first ever SharePoint Saturday in the UK

leave a comment »

You may have heard already that the UK is to have its first SharePoint Saturday event on the 2nd October 2010.   The event will be held at the Hilton Birmingham Metropole Hotel, National Exhibition Centre, Birmingham, B40 1PP from 08:30 to 17:00 

The agenda is currently work in-progress but will be published here.  The speakers list can also be found on the website.

Admission is free, register today while there are still places available.

Im Attending SPSUK 

Thanks goes to Brett Lonsdale, Mark Macrae and Tony Pounder for organising the event.

Written by Dave Hunter

31 Aug 2010 at 7:45 PM

Posted in Uncategorized

I’ve re-joined CIBER UK

leave a comment »

I’ve had a busy couple of months or so.  After looking for a new challenge I have decided to take it with an old company of mine, CIBER UK.  I spent 4 years at CIBER working with a strong team of consultants who specialise with every product of Microsoft’s server stack.  On 2nd August I re-joined CIBER, it was like “coming home”.

My new role will be specialising with SharePoint (obviously) and Microsoft CRM Dynamics.  I touched on CRM previously during some integration projects with SharePoint and look forward to working more in this space.

 

CIBER UK

Written by Dave Hunter

31 Aug 2010 at 7:30 PM

Posted in Uncategorized

I’ve been Awarded a MVP for SharePoint

leave a comment »

I’m proud to announce that I have been awarded a Microsoft Most Valuable Professional (MVP) for my efforts in the community.

“Congratulations! We are pleased to present you with the 2010 Microsoft® MVP Award! This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in SharePoint Services technical communities during the past year”

I hope to continue my efforts on the MSDN Forums, publish new content on my blog on a regular basis and support the community to prove the award is deserved.

Written by Dave Hunter

01 Apr 2010 at 7:45 PM

Posted in Uncategorized

SharePoint 2010 Training on Microsoft E-Learning

leave a comment »

I can’t believe I’ve only just came across this … The free SharePoint 2010 developer training on Microsoft E-Learning today.  Have a look at:

Clinic 10277: What’s New in Microsoft SharePoint 2010 for Developers https://www.microsoftelearning.com/eLearning/courseDetail.aspx?courseId=160329&tab=overview

Also one for IT Pros https://www.microsoftelearning.com/eLearning/courseDetail.aspx?courseId=161467&tab=overview

Apparently the offer is only available for a limited time.

Enjoy!

Written by Dave Hunter

15 Mar 2010 at 6:00 PM

Posted in Uncategorized

SharePoint UK User Group – Thursday 27th August London Meeting

leave a comment »

I was planning to attend the SharePoint UK User Group on Thursday for the Best Practices in Gathering Requirements for SharePoint Projects.  The event had Dux speaking at the event.

Important news, Dux can’t make the event so its now going to be a virtual event instead of being held at Microsoft’s offices in Victoria London.  Please see an update here http://suguk.org/forums/thread/20502.aspx.

Written by Dave Hunter

25 Aug 2009 at 6:00 PM

Posted in Uncategorized

CAML Query that filters on the current user

leave a comment »

CAML Queries are troublesome at the best of times.  I find it best to use a tool or a tried and tested method like the one I use here Tip – Creating CAML Queries – Thinking out aloud – Dave Hunter’s.

When you create a view and you want to show only items that have been created by the current user you use the [Me] keyword.  For example: filter by “Author” equals [Me].

How can I do this using a CAML query?

The [Me] keyword is represented in CAML by the following <Value Type=”Integer”><UserID Type=”Integer”/></Value>.  In the CAML query for returning items that the current user has created becomes …

<Where><Eq><FieldRef Name=’Author’ /><Value Type=”Integer”><UserID Type=”Integer”/></Value></Eq></Where>

Mirjam has done a good job of writing this up http://www.sharepointblogs.com/mirjam/archive/2009/07/16/creating-a-custom-view-that-filters-on-the-current-user-or-me.aspx.  Glad I could help.

Written by Dave Hunter

23 Jul 2009 at 5:50 PM

Posted in Uncategorized

Microsoft Ramp Up Free SharePoint Developer Training

leave a comment »

Microsoft Ramp Up http://msdn.microsoft.com/en-us/rampup/default.aspx has been about for a while now but not everyone knows about this training.  Microsoft Ramp Up offers free online community based learning to help you build up on your development skills.  There are many tracks which include:

  • Move from ASP to ASP.NET
  • Learn ASP.NET: for PHP Developers
  • Web Development with ASP.NET
  • Develop Windows Mobile 6 Applications
  • SharePoint for Developers Part 1
  • SharePoint for Developers Part 2
  • Visual Studio 2008
  • Developer Basics
  • Java Developer: Learn .NET
  • VB6 Developer: Lean VB 2005
  • VS 2002/2003 Developer: Learn VS 2005

Something for everyone.

The SharePoint track is available here: part 1 http://msdn.microsoft.com/en-us/rampup/dd221355.aspx and part 2 http://msdn.microsoft.com/en-us/rampup/dd320759.aspx

Written by Dave Hunter

22 Jul 2009 at 9:00 PM

Posted in Uncategorized

How To: Change a SharePoint Application Pool Programmatically

leave a comment »

Central Administration has a screen allow users to change the application pool identity, but doesn’t allow you to change the application pool which the web application uses.  You can modify manually by opening IIS, changing the application pool and making changes to the metabase.xml.  But how do I make these changes programmatically?

Theory

An IIS Web Site in SharePoint is represented by the SPWebApplication class http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.aspx this has a property called ApplicationPool which allows to be retrieved and set http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spwebapplication.applicationpool.aspx

Code

System.Uri webAppToChangeUri = new System.Uri(“http://intranet”);
SPWebApplication webAppToChange = SPWebApplication.Lookup(webAppToChangeUri);
webAppToChange.ApplicationPool.Name = “ALL MOSS”;
webAppToChange.Update(true);

webAppToChange.Provision();

Demo

I ran this code inside a windows form, you can use this or a console application.  The current application pool and the one I want to change it to has the same identity, so I just changed the ApplicationPool Name.  If your identify is different you will need to set the Username and Password properties as well.

Before running the code the intranet web application has the following properties

Before

After I run the code, right click IIS Manager and click refresh.  I open the properties of the intranet web application and check the settings have came through.

After

That’s it.

Why change the application pool?

For every application pool a w3wp process will be launched and can consume large amounts of memory.  You need to find a good balance of isolation (provided by having many application pools) and consumption of memory.  Have a look at Joel’s article here http://blogs.msdn.com/joelo/archive/2007/10/29/sharepoint-app-pool-settings.aspx

Written by Dave Hunter

07 Jul 2009 at 6:10 PM

Posted in Uncategorized

SharePoint Forums Topping 100 Answers

leave a comment »

I haven’t been very active on the blog for a while as I have been busy with work and active on the SharePoint Forums, particularly the SharePoint Developer Forum http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/threads

It’s rewarding to help people with their SharePoint issues.  Recently I got credited with answering 120 questions in 30 days, this isn’t just a reply to the question, its to provide a resolution to their issue helping them solve their problem.

My profile http://social.msdn.microsoft.com/Profile/en-US/?user=Dave%20Hunter

spdev_topanswers2

Written by Dave Hunter

06 Jul 2009 at 12:30 PM

Posted in Uncategorized

Find out the SharePoint Internal Name for a Column or Site Column

leave a comment »

When you create a column on a list or site column in SharePoint through the user interface you enter the column name, type and any other properties.  The name is used for the internal name and display name.  The internal name is escaped to remove any special characters and spaces.  The table below displays the list of characters and their escaped version.

Character Hex Code Escaped Version
[space] 20 _X0020_
| 7C _X007C_
- 2D _X002D_
\ 5C _X005C_
( 28 _X0028_
) 29 _X0029_
27 _X0027_
, 2C _X002C_
! 21 _X0021_
% 25 _X0025_
& 26 _X0026_
? 3F _X003F_
$ 24 _X0024_
£ A3 _X00A3_
22 _X0022_
< 3C _X003C_
> 3E _X003E_
= 3D _X003D_
# 23 _X0023_

 

The following are examples of this escaping:

Name entered Escaped Version
Published Date Published_X0020_Date
Buyer’s Name Buyer_X0027_s_X0020_Name
Zip / Postal Code Zip_X0020__X002F__X0020_Postal_X0020_Code

 

Please note: The internal name has a maximum length which is calculated after the internal name has been escaped.

There are a few way’s to check the internal name, one of which is the through the User Interface, here’s how:

1.  Open a web browser.

2.  If you have created a site column open the site column gallery, if you created a column on a list open the list settings.

3.  Click on the column name.

4.  Check the URL for the “field” querystring parameter, as you see from the screenshot below it contains the internal name.

column

 

Other ways include …

using .NET

You can also find out the escaped version using the System.Xml namespace and the XmlConvert.EncodeName.  For example:

using System.Xml;

// encode the column name
string escapedString = XmlConvert.EncodeName(“Published Date”);

// decode the escaped column name
string normalString = XmlConvert.DecodeName(escapedString);

which produces

escapedString = Published_X0020_Date

normalString = Published Date

 

Content Types Viewer

Download it here MOSS Content Types Viewer – Home

More about the Content Type Viewer http://www.davehunter.co.uk/Blog/Lists/Posts/Post.aspx?ID=100.

You can browse to the SharePoint environment, browse the content types and investigate the columns which are associated to the content type chosen, using the “show fields” button.

 

Controlling the internal name

You can control the internal names when you provision the site columns using a feature.  You can also do this using the User Interface by creating a field without any spaces or special characters and then re-edit the column to change the display name with any characters you wish.

 

Hope this helps

Written by Dave Hunter

28 May 2009 at 9:55 AM

Posted in Uncategorized

Follow

Get every new post delivered to your Inbox.