Blog of an overweight SharePoint addict

Tue 24 Nov 09

Should I change the name?

To once a month updates?

I haven’t stopped since I got back from SPC and have been dashing around between clients working on SharePoint 2007 issues. Doesn’t anyone understand I want to play with SharePoint 2010 now? Or more to the point, I need to upskill in some areas very quickly to get the most of SP2010 and all the goodness it brings.

Looking at whats coming in SP2010, I honestly think the IT Pro’s have got it easy.. You guys just have to learn one new application, Us Devs have to learn at least 2, SP2010 and Visual Studio 2010!

Then on top of that, we have an updated object model to contend with, along with a brand new object model in the form of the SharePoint Client OM!

Add to this the requirements to use XSLT for almost every list view in SP2010, SPLinq (Call it SPlinq, MS hate that!!), Silverlight and a lot more Javascript than before, all adds up to a lot of skill-up time!

So here’s to spending many evenings and train journeys in front of Visual Studio, playing with Silverlight 101 and all the new Sharepoint tools that now come out of the box with VS!

I’m booked up in December as solidly as November was, so i wouldn’t expect too many posts on here just yet, although I am planning to extend the piece I wrote on KPI’s to give more ideas and hopefully present on this at a SUG do in the early new year.

Regards

Paul.

Tue 13 Oct 09

Tentative Schedule for SharePoint Conference 2009 – Las Vegas

Filed under: General, SPC09, SUGUK, SharePoint, SharePoint 2010 — Reginald @ 2:53 pm
Join me at SPC09

Twitter @Cimares

Ok, so Microsoft finally released the full session schedule during the last 24 hours and I’ve tentatively booked the sessions that I want to go see.. And this has to be subject to change because there are so many great sessions that i want to get into. Thank god Microsoft are going to provide an AV feed of all sessions within 48 hours of them finishing. Hopefully I can download these and watch them on the train into work during the following week.

So, here’s my current schedule..(Subject to Change.. Hastags for Twitter Search)

Saturday 17th

  • Arriving about 2:30pm PST
  • Gambling and trying to avoid jetlag! Probably joining @jthake somwhere in Vegas

Sunday 18th

  • Getting to see Vegas,
  • Catch the Formula 1 somewhere (#ShareF1)
  • 18:00 ish.. register then #SharePint

Monday 19th

  • 9:00AM – Keynote Speech – Steve Ballmer
  • 10:30AM – Keynote 2 – Jeff Teper
  • 1:15PM – Overview of the SP2010 Developer platform
  • 2:45PM – Visual Studio 2010 SP Development Tools Overview
  • 4:30PM – Developing with SP2010 Sandboxed Solutions
  • Evening – no idea yet..going with the flow.

Tuesday 20th

  • 9:00AM – Advanced Webpart development in VS2010
  • 10:30AM SP2010 based document assembley and manipulation using Word
  • 1:15PM – Authentication & Authorisation in SP2010
  • 1:15PM – Deep Dive Open XML and Open XML SDK
  • 2:45PM – SP2010 Upgrade part 1 – Fundamentals
  • 4:30PM – SP2010 Development Best practices
  • Evening – 80’s Beach party!!!!! and then #TweetupSPC09 if it’s still going on

Wednesday 21st

  • 9:00AM – Workflow development in SP2010 with VS2010
  • 10:30AM – Developing with the new User Interface features in SP2010
  • 1:15PM – Developing with REST and LINQ in SP2010
  • 2:45PM – Extending the VS2010 SP tools with new Designers
  • 4:30PM – Customizing the VS2010 Sharepoint deployment process
  • Evening – Jury’s out on this one.. might go watch #ShareHoldem

Thursday 22nd

  • 9:00AM – Load testing SP2010 with VSTS
  • 10:30AM – Deep Dive into SP2010 Profile Store and profile Data
  • 1:15PM – Application Lifecycle Management for Developers in SP2010
  • 2:45PM – Building rich dynamic websites with SP2010
  • Evening – #ShareHofBrau – Last chance to catchup with SP stragglers..

Friday 23rd

  • 16:40 Takeoff for London Gatwick!! (arrives 10:30AM!)

So all told a pretty rammed week.. But I’m REALLY looking forward to it..

Fri 19 Sep 08

Using Google Map API keys with Alternate Access Mapping.

Filed under: Programming, SUGUK, SharePoint — Reginald @ 2:20 pm

On a clients Intranet/Extranet recently, I was asked to provide a static Google map for both staff and visitors to find the Head Office location.

The main problem with this is that Google want you to use a static API key for each URL that will refer a connection. Obviously if you’re using alternate access mapping then this will be a problem as internal staff may be connecting to http://intranet whilst your customers may be using http://extranet.myhouse.com

The simplest way that i could see of fixing this problem is to use Javascript in a content editor webpart to look at the Document.URL and output the correct IMG tag accordingly. I also wanted to ensure that it wouldn’t matter if we had a port in the URL, so I’ve stripped that as well.

Here’s the code.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script type="text/javascript" language="javascript">
var myRequest = document.URL.toUpperCase();
 
var firstBound = myRequest.indexOf("HTTP://")+ 7;
 
var secondBound = myRequest.indexOf('/',firstBound);
 
var serverUrl = myRequest.substring(firstBound,secondBound);
 
//Now check for a port entry.
if (serverUrl.indexOf(':') == -1)
{
//There isn't a port so we're ok.
}
else
{
//We've got a port entry to remove.
serverUrl = serverUrl.substring(0,serverUrl.indexOf(':'));
}
if (serverUrl == "{INTERNALURL HERE in UPPERCASE")
{
document.writeln("<div class="bs-BoxBorder" style="text-align: center;">");
document.writeln("<img src="http://maps.google.com/staticmap?center=51.504235,-0.081904&zoom=15&size=400x400&markers=51.504035,-0.081890,blueb&key={Your Google API Key goes Here}"></div>");
 
}
else if (serverUrl == "{EXTERNALURL HERE  in UPPERCASE}")
{
document.writeln("<div class="bs-BoxBorder" style="text-align: center;">");
document.writeln("<img src="http://maps.google.com/staticmap?center=51.504235,-0.081904&zoom=15&size=400x400&markers=51.504035,-0.081890,blueb&key={Your Google API Key goes Here}"></div>");
 
 
}
 
</script>

EDIT: Ok, I’m really not happy with the way this code plugin is formatting pasted scripts.. they look fine in the editor but awful on the site. I’ll leave this one as is for now and hopefully sort out a better code display block asap. EDITEDIT Much better.. I changed to the WP-Syntax plugin which seems to work.

Reg.

Fri 15 Aug 08

SUGUK London Meeting.

Filed under: General, Installation, Programming, SUGUK, SharePoint — Reginald @ 8:17 am

Well last night saw what was possibly the busiest August SUGUK meeting i’ve ever seen, so much so that they ran out of Pizza!! (Nick, this is a crime that can never be repeated!!!)

Two very good sessions, the first by Eric (www.sharepointcowboy.com) Shupps (I think I spelled that right..) and the second from our very own Matt Groves of SUGUK forum fame.

Eric covered off the subject of performance in your code, with a neat display of the differences between iterating through a collection of items using a for statement, and then doing the same using the SPListItemCollection and a CAML query. I’m pleased to say that I’ve been doing the more efficient methods for sometime now, so I feel suitably pleased with myself.. The results that Eric showed on the timings for a 250 item library were quite shocking.

The second sessions from Matt Groves talked about publishing SharePoint Extranets through Microsoft’s ISA server. Now I must admit, my own experience of ISA is from many years ago with the ISA 2000 version and it wasn’t pleasant. We put it in place for a Government client that required excessive filtering of content using ISA plugins and performance and configuration was a nightmare. From what I saw of ISA last night, It looks like there have been marked improvements and Matt built a bridged SSL published application in just 22 minutes. (And this included creating the web collection!)

Out of Eric’s session, one comment he made for me caused me to prick up my ears, and that is, if you declare the SPSite object inside a using statement, and then declare the SPWeb object from that, you DON’T need to declare the SPWeb inside a using statement as the previous using statement WILL dispose of the SPWeb for you. This saved a few lines of code and possibly a little bit of performance?

Then finally out of Matt’s session, I was hoping to ask Matt about using ISA with Microsoft NLB on your webfarm. One of the problems that I’ve had with NLB in the past is the way that NLB uses the source IP as the decision maker on the load balancing. In theory if all the extranet traffic comes from a single source IP (In this case the ISA) then the load balancing won’t do anything and all traffic will go to a single host.

Once my internet connection lets me get back onto the SugUk site, I’ll post that question up in the admin section for Matt to answer..

Reg.

Tue 8 Apr 08

Dropdown option lists in webpart personalisation menus

Filed under: Installation, Programming, SUGUK, SharePoint, Visual Studio 2005 — Reginald @ 2:57 pm

I’ve been writing my own SharePoint webparts for a few months now and have been quite happy using personalisation options to provide a certain degree of control during runtime from the Edit Shared Webpart properties menu.

All of these controls have either been using a text box entry or a tick box boolean, Until now that is. I realised that I needed to have some form of control over what was being entered by the admin. After all, whilst it’s always good to make sure that you validate any user input, it makes sense to restrict that input to selected options when possible.

In my case, I want the admin to be able to choose between which teams to filter the inbound data on, this in turn was then fed into a CAML query to return the correct data for the webpart.

After much reading of logs and blogs, I posted a quick question on the SUGUK forum and one of the readers, Paul Leigh suggested I look at using an Enum to provide the drop down.

Quite intrigued, I brushed off my c# text book to remind me how to define an enum, and set off on the following code.

First we define the enum within the webpart class boundary.

Public enum resourceTypes : int
{
NR,
Projects,
Windows,
Networks,
Unix,

snipped......

FirstAssist
};

Now we need to define the public and private members of the class, You don’t have to do this, but it’s best practice!


private resourceTypes m_resourceFilter;

[Personalizable(PersonalizationScope.Shared), Category("ESSOP"), WebBrowsable(true), WebDisplayName("Select team to filter results by")
, WebDescription("Use NR value when not required.")]
public resourceTypes resourceFilter
{
get {return m_resourceFilter;}
set {m_resourceFilter = value;}
}

Thats really all there is to it, in my case, i evaluate the enumeration using the ToString method and push that into my query string.

NB: You can only use a single word in the enum, spaces aren’t allowed, so in order to get around some of my teams that have double barrelled names, I put a Select statement further down the code at the injection point into the CAML query….


switch (m_resourceFilter.ToString())
{
case "StorageBackup":
resourceSelection = "Storage & Backup";
break;

case "TechOps":
resourceSelection = "Tech Ops";
break;

case "FirstAssist":
resourceSelection = "First Assist";
break;

case "BusinessAssurance":
resourceSelection = "Business Assurance";
break;

default:
resourceSelection = m_resourceFilter.ToString();
break;
}

Hopefully this might give you some pointers to solve a similar issue in your projects.

Regards

Reg.

Tue 1 May 07

The Excel properties predicament – A resolution..

Filed under: Excel, SUGUK — Reginald @ 4:35 pm

Well thanks to a fellow SUGUK member, I found the solution to passing Date values from Excel into a SharePoint document library.

‘The devil is in the detail’ as the saying goes and it’s no truer in this instance.. The trick is making sure that the date format of the text you’re passing out of Esxcel matches what SharePoint expects to see in a date format library column. Basically it must meet a particular format of ISO8601, which basically equates to yyyy-mm-ddThh:mm:ssZ

ISO8601 specifies that dates should be formatted year, month then day, and times should be formatted hours, minutes then seconds. If they are stored in a single string, then they should be seperated by a Capital T. If a timezone is not specified, then the ISO8601 assumes local time. In order to specify GMT, we add Z for ‘Zulu time’ or ‘Zero Meridien’.

So, how do we access this type of date? Well within VB or C# code, we can make a call to the Mirosoft.SharePoint.Utilities namespace and use the SPUtility.CreateISO8601DateTimeFromSystemDateTime method. Unfortunately, this isn’t as easy to achieve from VBA code within Excell 2003. But, we don’t have to..

All you need is a simple text format command, SharePoint will happily accept a properly formatted string and then treat it as a date..

=TEXT(cell_reference,”yyyy-mm-ddThh:mm:ssZ”)

Where cell_reference is a named cell containing a standard date/time.

Now, create a named cell reference for the new cell, Head to the properties page for the spreadsheet and create a linked property that points to the new cell. Make sure you have a library column that matches the named property, then upload the spreadsheet to your document library et voila, your date will appear..

Wed 21 Mar 07

SUGUK – London Meeting.

Filed under: SUGUK — Reginald @ 9:23 am

I’ll be attending the London meeting of the SharePoint User Group UK on Thursday evening. I believe there are still some places left, so take a look at SUGUK Mtg – London 22nd March @ LBi

The evening will be covering an InDepth look at SharePoint Search, looking at Set-up, configuration, customisation and limitations. This will be followed by an item on Building an accessible Internet site with SharePoint 2007, covering design to development, server environments, accessibility as well as a look under the hood at what drives the system.

Arrive at 6pm for a 6:30 start.

LBi, 1 Naoroji Street, London, WC1X 0JD, but you must add your name to the post on SUGUK if you want to come!

Powered by WordPress