Tuesday, 22 September 2009
SharePoint Conference 2009
Wednesday, 16 September 2009
RNIB - World's first AAA website launched in SharePoint
- Full WCAG 2.0 AAA XHTML rendering
- Accessible feature-set
- WYSIWYG Page editing and publishing
- Full list item editing
- Accessible Web Part editing {Add | Remove | Update properties}
- Full list views and list editing (including document libraries, Check-in Check-out and content approval)
- Site Administration (Permissions | Navigation | Basic site settings | features | Recycle Bin | View Site Content}
Friday, 28 August 2009
SharePoint 2010 - Hints, Tips and New Features - Watch this Space!
- Development - Code examples and Walkthroughs
- New Features - new functionality and areas of the SharePoint 2010 product
- Hints and Tips - tricks and "didn't know that .." information about the new build, and my experience with it once it becomes available.
Monday, 17 August 2009
SharePoint Timer Jobs and Multiple Servers
Timer jobs are wonderfully robust creatures. They effectively replace the "Windows Scheduled Task" for SharePoint servers, allowing you to run .Net code on a scheduled or "one off" basis.
However, there can be some confusion about running Timer Jobs on multiple servers, so this should clear it up a bit.
- By default Timer Jobs will only execute on the server that they are called from (typically the Central Administration server)
- Through code you can specify a specific box (SPServer) to run your Timer Job on.
-
It is possible to run a Timer Job on every server on the farm (although this can be dangerous!)
The crux of all this is based on the SPJobDefinition constructor (http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjobdefinition.spjobdefinition.aspx).
The constructor includes a parameter for an SPServer object, which allows you to specify which server the timer job will run on.
Example Code 1 – Add Job to single Server:
The code below is for a Web Application scoped which will register a job definition on a single server. As Web Application scoped features are activated from Central Administration, it will use the current SPServer (i.e. the Central Admin server).
This is useful for code which modified content in the database, as you only want it to execute a single time.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
SPJobDefinition job = new SPJobDefinition("CustomJobDef", webApp);
}
Example Code 2 – Add Job to All Servers:
The code below is for a Web Application scoped which will register a job definition on all web front end servers in the farm.
This is useful for code which modifies files or server settings, as you need it to execute separately for each server.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
foreach (SPServer server in SPFarm.Local.Servers)
{
if (server.Role == SPServerRole.WebFrontEnd)
{
SPJobDefinition job = new SPJobDefinition("CustomJobDef", webApp, server, SPJobLockType.None);
}
}
}
Hope this helps! Enjoy!
Tuesday, 4 August 2009
Turning off Audience Targeting on Page Libraries - Operation is not valid due to the current state of the object
public static void SetTargeting(SPList list, bool enabled)
{
if (list == null)
throw new SPException("List was not found.");
SPField targetingField = GetTargetingField(list);
if (enabled && (targetingField == null))
{
string createFieldAsXml = CreateFieldAsXml();
list.Fields.AddFieldAsXml(createFieldAsXml);
list.Update();
}
else if (!enabled && (targetingField != null))
{
// make sure the field can be deleted!
targetingField.AllowDeletion = true;
targetingField.Sealed = false;
targetingField.Update();list.Fields.Delete(targetingField.InternalName);
list.Update();
}
}
Thursday, 30 July 2009
SharePoint 2010 SDK Publicly Available
Monday, 6 July 2009
The call to SearchServiceInstance.Provision failed ... resolved!
The problem came when I wanted to turn them back on again. I was creating a new SSP and got the rather spurious error "no indexers".
This was a little odd, but I quickly realised that it meant the Index service was disabled. (annoying, because I only wanted an SSP for user profile development, but c'est la vie).
So I went to start the Windows SharePoint Services Search and *wham*... "Error"
I had a bit of a poke around the log files and found a reference to:
The call to SearchServiceInstance.Provision ("<name of server>") failed.
Well .. it took me a while to work this out but I did finally crack it. You see, I was doing this on a local virtual machine, so I rarely if ever use the full domain name. I found that I could only start the Search Service using the fully qualified "Domain\UserName" designation.
If you use just the "Username" then it didn't work and you got the odd error above!
Very strange, another one for the archives I guess.
Wednesday, 1 July 2009
FireFox 3.5 Released...
Version 3.5 includes HTML 5 support, "Private Browsing" modes (similar to what Google, Microsoft and Apple have been offering) and an upgrade to a faster JavaScript engine.
You can check all of the release notes here.
Tuesday, 23 June 2009
Resource files in SharePoint done properly ..
The message I really want to get across ... Don’t use Properties/Resources.resx
SharePoint resource files should be stored in one of 2 places (there are other places, but they are not commonly used):
· 12
o Config
§ Resources ß Location 1 – use this for all Pages, Controls and Web Parts
o Resources ß Location 2 – use this for all Features, Site Definitions, List Definition, Content Types (i.e. all CAML)
If you need to access those resources from code, then use the following:
C# (programmatically)
String strValue = System.Web.HttpContext.GetGlobalResourceObject(“NameOfResourceFile”, “NameOfProperty”).ToString();
ASPX Markup
<%$Resources: NameOfResourceFile, NameOfProperty%>
XML (CAML)
$Resources: NameOfResourceFile, NameOfProperty;
How to setup Internet Connection Sharing and a VPN connection at the same time!
- Connect to the VPN
- Share the VPN connection
This effectively gives your virtual machine it's own private access to the corporate network .. great for those TFS check-ins and server builds :)
*sigh* another one for midnight oil.