Excellent work from Ton Stegeman – Adding a custom action to the MOSS expiration policy. Also, MOSS Custom policies parts One, Two and Three. I was particularly interested in Part 2, ‘cos it is programmatically submitting an item to the Records Repository (via a web service. I guess that’s okay, but I was surprised that this didn’t appear to be in the Object Model. Or maybe it is and I just can’t find it!)
SP2007 Development
Creating Site Templates
Note that Site Templates aren’t the same as Site Definitions. Good article about how to do this here. Or read Creating a Custom SharePoint 2007 Portal Site Definition using the PortalProvisioningProvider Class for ‘portals’ (I agree – that’s the most over-used word in SharePoint, along with confuse over what a ‘site’ is (sometimes a collection, sometimes just a site…)).
It’s worth considering the differences between (more here). Some of the differences demystified (note – about Beta 2). Info on how to create a custom site definition (hint – copy an existing one – bit more here). And information on which existing templates are right for me.
Get around workflow version issues – and better ways to start workflows
Workflow versioning in SharePoint by Daniel Herzog. Yeah, it’s a problem that I’ve been wondering about, and his suggestions are valid. I was interested by the link to Start workflows from the context menu – to me, this is a much more natural place to start a workflow from.
Found from Julie’s Blog
Excelllent – A CAML query generating library
To those of you who’ve never written a CAML query, this won’t seem exciting. For those of you have have spent hours digging through reams of XML searching for a fault in your query, this will be heaven sent:
CAML.NET assembly – write your queries in C# – and you can find it on Codeplex.
Queries are now as simple as:
string s = CAML.Query(
CAML.Where(
CAML.Eg(
CAML.FieldRef("SomeField"),
CAML.Value(someValue)
)
)
)
This is such a blatantly good idea that I’m giving it a ![]()
Comments from my old blog:
Now that *is* a good idea…
Workflows with Null Pointer Exceptions
A note to myself – don’t ever use TaskProperties properties in your workflow class. Just use a public variable. Using properties causes some weird null pointer exception. I know, that makes no sense, but it’s true…
Content Query Web Parts and Site Categories
Here’s a thought – wouldn’t it be cool to have a way of getting content from Sites in a Site Collection, but filtered by their category data?
At the moment, the Content Query Web Part gives you 3 options as to what sites it queries:
- A specific site
- This site and its children
- All sites in the collection
Wouldn’t it be great, though, to form that list of target sites based on a category? For example, in a big company it may have a number of divisions, each with their own ‘Finance’ department. A content query web part that could show content from all the ‘Finance’ category sites across the organisation would be very cool.
Can’t see a way of doing it at the moment though. I suppose I could write my own web-part – but the Content Query Web Part gives you so much already, I don’t want to have to replicate that.
The format of Dates in CAML
So, a colleague asked me about what format dates should be put into the where clause of a CAML query as. I’d had a lot of problems finding this out myself, and ultimately I found that a .ToString(“u”) on a DateTime object did the trick. The produces a time of the form 2006-04-17 21:29:09Z
For example, using a StringBuilder to create my CAML query (for my SPQuery object), this might look like:
caml.Append("<Leq>");
caml.Append("<FieldRef Name='MyDueDate'/>");
caml.Append("<Value Type='DateTime'>");
caml.Append(System.DateTime.Today.ToString("u"));
caml.Append("</Value>");
caml.Append("</Leq>");
(This query contains the date contained in the MyDueDate column with the current date and time).
Building a Base Web Part Class
Custom activities in SharePoint Workflow
Custom SharePoint aware Workflow Activities
Don’t forget to add into the System.Workflow.ComponentModel.WorkflowCompiler section of the web.config file.
The Week in Pictures Library webpart
Just had a look at this web part. I was looking for a way to have a page display a random image in a web part. I wanted to select from just some library. This web part sounded ideal.
Well, it’s not ideal. It seems that it will only select images from a picture library called ‘This Week in Pictures Library’. That’s right, I had to change the picture library name. I’m hoping that I’ve missed something obvious, ‘cos that seems really dumb if I’ve not. I mean, what if I want ‘Local Images’ as my library? Does that mean I can’t use this web-part?
I suppose that one possibility is that it’s matching the name of the web part with the library, so I could change them both to ‘Local Images’. I shall test and report back.
My mistake. You can specify another name for the picture library. It’s under the ‘Slideshow > Image Library Name’ option. Kind of obvious. Wonder why this didn’t work at first? Must have had a typo
Comments from my old blog:
Have you figured out how to get it to randomly pick a picture from the library? As far as I can tell, it just picks the last picture added to the library. That’s not very helpful to me.
That’s a good point, I’m not sure. I shall check.
There is an issue with this WebPart. If you have two of them on the same page, and have them pointing to different picture libraries. Then you go and click slideshow on both of them, they both point to the first inital library. Is this a bug?
I don’t know, it could well be. I’ve got to be honest, I spent a half hour looking at one once. I try and take a look, when I get a moment…