Wednesday, 16 February 2011

UK Cloud User Group

Yesterday I attended the 2nd Cloud Evening meeting it was terrific - this event focused on Microsoft's offering.  Specifically the latest version of Azure (1.4 I think) and it looks impressive.  Previously, I felt limited by Azure however, I think Azure SQL is a good option for storing application data especially when Office 365 is released or to extend SharePoint 2010. 

Both Mark Rendle and Planky (Steve Plank) gave good presentations.  I came away with tons of information and I'm pleased I went along.  Planky's blog is definitely worth following.  The security around Azure and Office 365 is fairly complex but considering the integration with LDAP providers and the security considerations it is well thought out and tooled.

Additional Info:
http://cloudeve.ning.com/

Monday, 7 February 2011

SP2010 Coding Tips

Retrieving a list using the Serve-side Object Model
*******************************************
Problem:  In MOSS we could use CAML queries or the SharePoint API (Server side object model) to retrieve list data.  In SP2010 there are various methods for getting a list however, the Server-side Object Model has been improved/enhanceced.

SPSite site = new SPSite("http://demo.dev");
SPWeb web = site.OpenWeb();
SPList list = web.Lists["Customers"];

Hypothesis:
If the list doesn't exist you received a NullReferenceException.  A try catch block is usually wrapped around the list retrieval however, SP2010 has an improved method TryGetList().

Resolution:
SPList list = web.TryGetLists["Customers"];  // if list doesn't exist list will be null.
Other improvements to the API include: TryGetFieldByStaticName,

Disposing Objects
***************
Problem: SPSite and SPWeb objects are not automatically disposed.
Resolution:  Use either using statements or try catch finally statements to dispose of SPWeb and SPSite objects.  Check all code using the SPDisposal tool.

More Info:
Reading this post jogged my thoughts on the 2 topics posted above.  This is useful for SP developers to know.

Saturday, 5 February 2011

What version of SharePoint do I have? Common mistake!

Problem: You have a SharePoint web site and you have no idea what version is running.

Initial Hypthesis: Using Central Admin (CA) you can lookup the exact version.  However, if you are looking ata  website or don't have CA access, a lot of people think they can look at the http header.  (You can see the https header using fiddler or the IE developer tools).  However, the http header with the version number is not the actual version installed.  It is the version when the SharePoint install was performed!
This behaviour applied to MOSS and I have no idea if it is fixed in SP2010.  The http and you version number will be idenitcal if you install using slipstreamed images as the install will include the patches you have in you install.
Resolution:
  • You can't rely on the http header SharePoint version number returned via the page requests to determine the version of SharePoint you are looking at.
  • I recommend removing the http header info for SharePoint as it makes a hackers life marginally more difficult as they don't know what version you are patched to or originally installed.  They will also need to use another technique to determine if your website is a SharePoint server. 
  • Todd Bleaker has a simple technique for identify SharePoint public websites, "Since most people allow anonymous access to the images in the 60 Hive/12 Hive and there really isn't any reason to remove the default images (in fact it probably isn't supported), it is an easy litmus test to detect SharePoint.  However, I recently wanted to determine whether a site was SharePoint 2010 or not, but since visual upgrade is now a viable upgrade scenario and CPVW.GIF is not unique to the SharePoint 2010 I needed something new to look for. So, I poked around a bit and found that /_layouts/images/FGIMG.PNG isn't too hard to remember and it shows an equally unlikely image to be in a non-SharePoint 2010 site". 
More Info:
http://vspug.com/bobbyhabib/2008/05/16/getting-the-correct-moss-wss-version-for-each-server-in-the-farm/

http://www.sharepointdevwiki.com/display/SharePointAdministrationWiki/SharePoint+Versions

http://www.sharepointdevwiki.com/display/spadmin2010/SharePoint+2010+Versions

Update 28/03/2010 - Todd Carter has a post on versions of SharePoint Versions
Update 20/02/2012 - PS to determine SP edtition and patching level

Friday, 4 February 2011

MOSS export list SSL issue

Problem: I can't export a list to a excel spreadsheet file from a SharePoint 2007/WSS3.0 site is using SSL.  SP2010 exports https lists correctly. 
Initial Hypothesis: File is being exported however, when opening the *.iqy file, the error "Excel cannot connect to the SharePoint list." pops up. 
Resolution: This is a bug with 2 workarounds,
  • Option1: From excel connect to the list. or
  • Option 2: Save the *.iqy file, open it using notepad, chnage the url to use https instead of http (it occurs twice in the iqy file.

Issue in Document libraries in MOSS using Word 2010

Problem:  The business upgrades there Office desktop version to Office 2010.  If a user needs to add new documents into a document library running on MOSS.  Word 2010 opens and then throws the error "This file could not be found.".
Initial Hypothesis: Office(Word) 2007 and Office(Word) 2003 can create the new documents.  Office(Word) 2010 can edit a document added by a previous version or an uploaded document correctly.  The issue appears to be between Word 2010 and document libraries in MOSS when adding a new document under SSL.

I can open the full url to the word template correctly using IE and Word 2010, so the issue must be with the url that is crafted for Word 2010.

I was looking at the templates associate with each content type in my document library, the path is always relative however, as I am adding the the template it stores a relative value.

Resolution: The url that is requested using the new document derives from the content type's default document template.  My site uses SSL, and it looks like the path that SharePoint generate is incorrect (I need to confirm this using fiddler, but as I'm on my clients site using a locked down workstation and no access to the servers I can't see the url being generated).  Anyway, my fix is to save the full https path in the "Enter the URL of an existing document template".

Friday, 28 January 2011

Writing Windows Phone 7 Applications

Overview:  Windows Phone 7 (WP7) was released in the end of October 2010 on the HTC Mozart, Samsung Omnia 7 & LG Optimus 7 in the UK.  WP7 apps are written in .NET and based on Silverlight or XDA.  As a C# enterprise developer I always use Silverlight as this is for Rich Internet Applications (RIA).  Microsoft XDA is for games development.

Tooling:  Microsoft have great free tools such as expression blend and Visual Studio 2010 express for WP7.
There is a single download for all the tools including the Windows Phone 7 emulator.
VS has dedicate template for the WP7 in VS2010 that are a good starting point.
There is Intelisense and full debugging integration with the WP7 emulator.
Xaml is responsible for the UI and it's pretty straight forward especially if you have done ant Silverlight development previously.


Training: Microsoft have done a great job on providing getting started examples and video learning via Channel 9.  It really can't be simpler.  Take a look at Channel 9's Windows Phone 7 Development for Absolute Beginners.

More info:
Updated 25/02/2011 - SharePoint integration with Windows Phone 7 by B.K. Winstead 

Thursday, 27 January 2011

Information Architecture for SharePoint

Overview: I was speaking to a client recently about there SharePoint Intranet and I mentioned they should have a Information Architecture (IA).  This should preferably be done by an Information architect but at a minimum the organisation can get the IA from project stakeholders.  Below I list the 2 most commonly found IA representations approaches: Wireframes & Hierarchy/structure diagrams.

What is IA?
Wikipedia define IA as "Information architecture is the categorization of information into a coherent structure, preferably one that most people can understand quickly, if not inherently. It's usually hierarchical, but can have other structures".
For web based projects, the best 2 methods for defining IA are a hierarchy and a wireframe other useful tools are defining the taxonomy against the hierarchy IA diagram.  I have seen various techniques to achieve this but keeping it simple as listed below and having a separate annotated version defining the term set or formal business taxonomy at each level is useful.

Hierarchy IA Diagram
WireFrame
Read More:
http://www.informit.com/articles/article.aspx?p=1657659

Update 23 April 2011 - I have seen people looking for a starting point for an Intranet Menu structure, this is a generic option I propose for Intranets.  Please feel free to suggest your own structure.