SharePoint Sharpener

Obsessively Sharpening SharePoint

SPC09: Overview of New Developer Features in SharePoint 2010

with 2 comments

 

At the SharePoint Conference in Las Vegas, Paul Andrew gave a thorough overview of the new features for developers in SharePoint 2010.

This is my modest attempt to convey Paul’s presentation in a simple blog post. Please note that the session contained a huge amount of information and I probably (definitely!) didn’t manage to take it all in. Read on at your own risk…

 

Development environment and tools

Traditionally, the path to your first SharePoint hello world-web part is littered with technical obstacles in the shape of tedious installation problems, Windows Server 2003 blues, virtual server nightmares etc. No more. Now you just need your laptop to develop SharePoint applications.

The box

SharePoint developers no longer need to run a Windows 2003 Server. In fact, SharePoint and the development tools can now be installed directly on Windows 7 or Vista (service pack 1). Either versions of SharePoint can be used, i.e. SharePoint Foundation (formerly WSS) or SharePoint Server.

The operating system must be 64 bit since SharePoint 2010 only runs in a 64 bit environment.

SharePoint on a desktop operating system is just for developers and not for running a production environment.

 

Visual Studio 2010

Many of SharePoint 2010’s new features can be accessed from inside Visual Studio 2010. Also, quite a few third-party add-ons may not be needed anymore as the functionality is now covered by Visual Studio.

Highlights:

  • Built-in designers for:
    • Web parts
    • BCS (formerly BDC)
    • Workflows
  • Package and deploy SharePoint projects
  • Generate WSPs
  • View SharePoint sites in server explorer
  • Integration to Team Foundation Server
  • Support for SharePoint sandboxed solutions
  • WSPs from SharePoint Designer can be imported (including workflows)
  • Build workflow steps for SharePoint Designer
  • SharePoint Business Connectivity Services support
  • New events projects templates

 

General improvents

Developer dashboard

A developer dashboard can be displayed automatically at the bottom of every page. The DD displays valuable information about how the page is generated, for instance:

  • Timing and duration of events
  • Database queries (even the ones SharePoint does in the background)

The DD is activated with the follow stsadm command:

stsadm –o setproperty –pn developer-dashboard –pv ondemand

 

Coding

Coding for SharePoint just got slightly easier due to the many improvements in .NET framework 4.0 and SharePoint 2010.

Below is a rundown of some of the new features:

  • LINQ for SharePoint
  • After-synchronous events
  • New event types:
    • Site-scoped events
    • Web creation events
  • Workflow improvements:
    • Initiation and association forms in Visual Studio
    • New design user interface for workflows in SharePoint Designer
    • Use Visio 2010 to design workflows
  • SharePoint UI can now be saved as a template
  • WSP is now the unified developer format – works in site collections and machine

 

Improvements to lists

In SharePoint 2007, lists can cause any developer headaches. Hopefully, the new list architecture in SharePoint 2010 will solve this. Below is an overview of some of the improvements:

  • Validation with Excel-like Formula – forms can be validated using simple syntax
  • Lookup to multiple columns
  • Lookup fields have true relations which ensure proper deletion (transaction-style)
  • List index auto-creation
  • Scalability and performance vastly improved:
    • Lists and folders can now contain a million elements
    • Document libraries can contain 10 million documents
  • List query throttling
  • Lists views no longer based on CAML but XSL-T. Queries still use CAML

 

Ribbon and Dialog framework

The ribbon we know (and some love) from Microsoft Office is now used in SharePoint 2010.

Some of the highlights:

  • Custom actions can be embedded in the ribbon
  • The ribbon is context sensitive
  • The SharePoint out-of-the-box forms are replaceable
  • New web dialog functionality:
    • A dialog floats on top of the SharePoint page and is used to get input from the user
    • Fully programmable

 

Silverlight 3

Silverlight plays an important part in SharePoint 2010 and is used in many of the improved UI elements. From a developer’s point of view, these are the highlights:

  • Built-it and customisable media player web part
  • List and site creation from within Silverlight
  • Office web applications run in Silverlight
  • Client object model – call SharePoint APIs from within Silverlight

Written by Thomas Sondergaard

October 19, 2009 at 9:48 pm

SPC09: SharePoint 2010 Unveiled – Rundown of New Features

with one comment

This is it – the long awaited SharePoint 2010 has been unveiled, not released, by Microsoft CEO Steve Ballmer. The public beta will be available next month.

SharePoint 2010 is a huge update of the platform and most attendees at the keynote were blown away by the dramatic improvements across the board in SharePoint.

Jeff Teper (MS Corporate VP), Jared Spataro (MS Director, SharePoint) and Arpan Shah (Director, SharePoint Technical Management) showed off many of the new features in SharePoint 2010 – see my notes below.

New features in 2010

User interface

  • Ribbon-based contextual menus, much like in Office 2007
  • Live preview of font changes etc.
  • Broad use of AJAX to minimise number of page refreshes
  • More seamless integration of web-based and desktop clients
  • All Office documents can now be viewed and edited in a rich web version of the desktop client

Accessibility

  • Cross-browser compatibility
  • XHTML and WCAG compatible output

Collaboration

  • Completely revamped wiki
    • Improved editing tool
    • Dramatically improved image upload and handling
  • Richer blogs
  • Improvements to the calendar lists
  • Web-based, OneNote-like functionality

Organisation

  • Tagging, social tagging
  • Rating of documents
  • Bookmarks

MySite and Social Computing

  • Smart profiles
  • Activity feed – overview of a user’s recent activity
  • Browse colleagues
  • Locate experts within the organisation
  • Tag cloud of a person’s recent activities
  • Note board – i.e. a tagwall

Content Management

  • Improved scalability – lists and folders can now contain a million elements. Document libraries can contain 10 million documents
  • Digital Asset Management
  • Consistent content type across all servers in a farm
  • Streaming of video placed in document libraries
  • Improved governance possibilities

Search

  • Choice between standard SharePoint search and FAST Search
  • Wild card searching – used of asterisks
  • Improved people search – rich info on the search results page
  • Live preview of documents, slides etc right on the search results page

Business intelligence

  • Excel Services – including SQL Server PowerPivot
  • PerformancePoint Services – advanced BI dashboards
  • Visio Services and Chart web part
  • Business Connectivity Services – the new name for Business Data Catalog (BDC)

SharePoint Workspace (the new name for Groove)

  • Improved offline content
  • Improved mobile access to content

IT infrastructure

  • 64-bit only!
  • SharePoint Foundation is the new name for WSS
  • Online/cloud version of SharePoint is a focus point for Microsoft
  • PowerShell Admin
    • Fully scriptable admin of SharePoint
    • Around 500 PowerShell commandlets will be shipped with 2010
    • Admin SharePoint from PowerShell running on Windows 7
    • Whatif command to preview impact of commands
  • New Central Administration
    • Problems and solutions page with overview of current problems on the farm, and possible solutions
  • Throttling
    • Control how many resources specific lists, sites etc. may use
  • Monitoring, Analytics
    • Usage analysis database will be customisable
  • Improved Upgrade and Availability
    • Visual Upgrade enables individual users to choose when to upgrade a site

SPC09: Arrival in Las Vegas

leave a comment »

Last night I arrived in Las Vegas for the annual Microsoft SharePoint Conference – along with 13 colleagues from PeopleNet and a handful of clients from Denmark.

Some of us are staying at Mandalay Bay and some (including me) at the Luxor.

View from Luxor Hotel, Las Vegas

Today is the official Microsoft welcome reception and, more importantly, the first SharePint of the conference.

Tomorrow the NDA of SharePoint 2010 is lifted and the sessions can begin. I’ve signed up for many more sessions than I can possibly attend and I also intend to spend time at the partner floor and network/socialise with SharePoint contacts from around the world.

I’ll blog as much as I can and you can also follow me on Twitter.

It’s going to be a busy week…

Written by Thomas Sondergaard

October 18, 2009 at 5:12 pm

Crawl Problem with Multiple Value Lookup Fields Acknowledged by Microsoft

leave a comment »

Last year we at PeopleNet ran into a problem when using lists with many columns, i.e. around 1600!

Indexing such a list would almost always fail with a timeout or out of memory error in the log, even though SharePoint is supposed to be able to handle at least 2000 columns without performance issues.

We corresponded back and forth with a Microsoft support engineer about the problem and it turned out that lists with many multiple value lookup fields will bring the SQL Server to its knees fairly quickly.

Microsoft has recently released a KB article in relation to this, however, it doesn’t specifically single out multiple value lookup fields as the culprit, although they almost always are.

Written by Thomas Sondergaard

August 13, 2009 at 7:39 am

How To Always Link to the Right Application Pages

leave a comment »

As a SharePoint developer you’ve probably run into this problem several times: How to make sure that links to application pages stay valid irrespective of where within a site collection your web part is placed.

If you hand-code links you’re likely to get the path relative to the root site wrong. Even worse, if the the filename of an application page is changed, e.g. from DispForm.aspx to DispFormNew.aspx, your links will surely break.

 

The application pages

Generally, a SharePoint list contains the following application pages:

  • AllItems.aspx
    Shows all items in the list
  • DispForm.aspx
    Displays a read-only version of a list item
  • NewForm.aspx
    Form for creating a new list item
  • EditForm.aspx
    Form for editing an existing list item

More applications pages exist but these are the ones most commonly used.

 

Ensuring unbroken links programmatically

The PAGETYPE Enumeration gives you access to the application pages and enables you to build links that always work.

Assuming you have already created your SPList and SPListItem objects the below snippet builds a link to the correct DispForm:

list.Forms[PAGETYPE.PAGE_DISPLAYFORM].ServerRelativeUrl.ToString();

Of course, the same applies to NewForm and EditForm.

 

Linking to the default view of a list

Below a list of elements you may wish to link to the underlying list’s default view. In many cases this will be the AllItems.aspx page but what happens if a user changes the default view in the settings of the list? If you’ve hardcoded a link to AllItems.aspx you may be lucky that the link still works but if AllItems.aspx has been renamed or removed, you’re out of luck.

Instead of hardcoding the link you should use PAGE_DEFAULTVIEW, like this:

list.Forms[PAGETYPE.PAGE_DEFAULTVIEW].ServerRelativeUrl.ToString();

Simple, isn’t it?

Written by Thomas Sondergaard

May 16, 2009 at 3:01 pm

Groove is now SharePoint Workspace 2010

leave a comment »

According to the Groove dev team’s blog, Microsoft Groove is to be integrated more tightly with SharePoint and in the process be given a new name.

SharePoint Workspace 2010 is the new official name for Groove.

I wonder how many more products Microsoft will collect under the SharePoint umbrella before the next release? It seems like Microsoft are aiming to capitalise on the SharePoint name and rebrand some of their lesser known products and even roll them into SharePoint.

Written by Thomas Sondergaard

May 15, 2009 at 9:11 pm

Posted in News

Tagged with ,

Programmatically Checking if a SharePoint Element is Published

with 3 comments

Here’s a quick tip for you: How to check if the latest version of an element in a SharePoint list is published.

Once you’ve got hold of an SPListItem, you can check the Versions property (an array containing all the versions of the element).

In this block of code IsPublished becomes True if the latest version is published:

bool IsPublished = TheItem.Versions[0].Level == SPFileLevel.Published ? true : false;

 

That’s it.

Written by Thomas Sondergaard

March 26, 2009 at 6:25 pm

JavaScript Tips for SharePoint

leave a comment »

I’ve gatherered a few productive tips for using JavaScript within SharePoint. The below commands can be used within webparts etc. or directly in the browser’s address field while you’re on a SharePoint page, like this:

Putting javascript: in front of your script snippet will fire it right there and then.

These commands are neither terribly advanced nor applicable on all pages, but they make for a useful reference all the same. I aim to continually update this page with new content so if you have any JavaScript tips, feel free to drop them in the comments.

 

Edit an application page: MSOLayout_ToggleLayoutMode()

This enables edit mode on SharePoint’s application pages, like EditForm.aspx, DispForm.aspx etc. so you can insert web parts above or below the normal content:

 

Pop-up an alert with the User ID og the logged-in user: alert(_spUserId)

 

 

Enable the Edit toolbar: javascript:__doPostBack(‘ctl00$PlaceHolderTopNavBar$SiteActionsMenuMain$ctl00$wsaShowMenu_CmsActionControl’,'reviewPage’)

Simply enables the toolbar where you can access the page edit functions:

 

 

Hide the Edit toolbar: __doPostBack(‘ctl00$PlaceHolderTopNavBar$SiteActionsMenuMain$ctl00$wsaHideMenu_CmsActionControl’,'exitMenu’)

No prizes for guessing this one.

 

Show help: TopHelpButtonClick(‘NavBarHelpHome’)

Pops up the built-in help page. Interestingly, you can try this on Microsoft’s SharePoint Conference web site:

Written by Thomas Sondergaard

March 23, 2009 at 11:31 pm

Posted in Development

Tagged with , ,

Travel with the Experts to the SharePoint Conference

leave a comment »

Last year PeopleNet gathered more than 30 Danish SharePoint enthusiasts for a series of events at the SharePoint Conference in Seattle.

The events went down a storm and the Danish delegation benefitted a great deal from the networking facilitated by PeopleNet.

 

Next stop Las Vegas

This year, we are taking things a step further – we are putting together a complete conference package which includes:

  • Return airline ticket (Copenhagen – Las Vegas)
  • Hotel (Mandalay Bay)
  • Conference pass
  • Special events during the week of the conference

This way, SharePoint stakeholders from different Danish organisations get to travel with like-minded people instead of going to the conference alone.

 

For more info (in Danish), click here.

Written by Thomas Sondergaard

March 2, 2009 at 12:56 pm

Posted in News

Tagged with , ,

Hardening Your MOSS 2007 WCM Application

with 4 comments

This is a re-post of a still relevant post from my old blog at SharePointBlogs.com:

Today Last year at the SharePoint Conference in Berlin, Ben Robb of cScape Ltd gave a talk about configuring internet-facing web sites running MOSS 2007/WCM.

He brought up some interesting points about securing the application against unauthorised content editing and attacks from hackers.

Make sure your installation check list contains a least the following items:

1. Enable firewalls and standard network security
Fairly standard stuff, but necessary all the same.

2. Disable SMTP and incoming mail
In essence, you shouldn’t be running services on the server that aren’t necessary for MOSS. Also, close any ports that MOSS doesn’t need.

3. Secure the Central Administration site
Surprisingly, it is very common to leave this entry point wide open. The admin site should be accessible only via an SSL connection .

4. Use lockdown mode
Use this stsadm command to activate lockdown mode:
stsadm –o activatefeature –url <url> -filename ViewFormPagesLockdown\feature.xml
Read more about ViewFormPagesLockdown.

5. Restricted reader role
The anonymous user should have a restricted reader role which only enables viewing of pages, documents and images.

6. Policies
Constrain the maximum access per web application and deny all write access via http://sitename:80.

7. Content deployment
Use different servers for authoring and the actual internet-facing web application. Content generated on the authoring server (typically within the intranet) should be pushed out to the public site using scheduled content deployment jobs.

To many administrators the above bullets merely point out the obvious and do feel free to leave comments if you have any additions to the list.

Thanks to Ben Robb for providing 99% of the info for this post.

Written by Thomas Sondergaard

February 18, 2009 at 9:54 am