Some useful links to things to remember in testing in Coding Horror. I agree; developers are poor testers, and the guy who wrote it is the worst person to do testing.
Author: Andy Burns
Making MOSS a Search Provider in IE7
Described on Mark Harrison’s Blog (notice the typo mentioned)
Edit: And more about integrating with a website’s own search
Dealing with data concurrency using the ADO.net Dataset object
So I’m not really familiar yet with .NET, and the Dataset object had the Java programmer in me a bit puzzled – but this article is actually quite good at highlighting some of the potential issues and dealing with them.
Heatmaps
Heatmaps are apparently the next thing in web site statistics – and what a clever idea. For a while I worked on a JS file that would report the mouse moving over, out, and clicking on DOM elements in a page, but to be honest, that was a bit excessive – and much harder to visualise.
When attaching forms to workflow tasks…
Follow the correct procedure… …it makes a difference.
STILL trying to update the Task Assignee
Right, so I had a suggestion from Nick Swan, and it was a good one, so I gave it a try.
What he said was:
With OnTaskChanged there is the BeforeProperties and AfterProperties variables.
In the event can’t you set the AssignedTo in the AfterProperties?
This seemed perfectly reasonable – and I hadn’t thought of it already, so it was worth a try (wood/trees obscuration).
I created a workflow that consisted of 3 steps – a Create Task step, a While Loop (that is always true) and in the While, I put an onTaskChanged event step.
Creating the task, you set the assignee using an SPWorkflowTaskProperties object. Here is my line for doing that:
TaskProperties.AssignedTo = "MOSS\Domain Users";
That’s pretty clear. I then wrote code to set the AfterProperties of the onTaskChanged event:
TaskAfterProperties.AssignedTo = e.Identity;
Typically, e.Identity is something link “MOSS\burnsa”. I’ve checked. And that’s what I’d expect it to be.
So, the workflow enters the while loop – which as I say, deliberately never exits – an the workflow awaits a change in the task. When that change comes, I’m going to look at the AssignedTo field of both the BeforeProperties, and AfterProperties. Oh, yeah, and I deliberately WASN’T changing the assignee within the task.
BeforeProperties – Expected: “MOSS\Domain Users” – Actual: null
AfterProperties – Expected: “MOSS\Domain Users” – Actual: “16”
…and setting the AfterProperties with e.Identity did damn all. WTF?
I could understand that setting AfterProperties with e.Identity might not work – although it seems a reasonable thing to try and do – but the AssignedTo fields being null, and then 16? Don’t make no sense.
Oh, further – I tried again, but this time setting the assignee as my change to fire the onTaskChanged event. This time the AfterProperties assignedTo field was ’13’, so clearly it is some sort of identity – just not an obvious or particularly useful one.
Records management in SharePoint, and a drink or two in Soho
Before I went on holiday last week, I attended the SharePoint user group meeting that was happening in London. A couple of guys from Cap Gemini were doing a presentation on records management (RM) in SharePoint 2007. This will describe my impressions (my memory ain’t so good, so these are my notes…), and how it appears to work. I’ll start with my conclusions, and then move on to how the thing actually works. Continue reading “Records management in SharePoint, and a drink or two in Soho”
Even more on Updating SharePoint Workflow Tasks
Okay, so having tried the programmatic route and got stuck, and investigated it, I realised that I’d been dumb.
There is an UpdateTask workflow activity
Okay, so I missed the obvious – that to update a task would require an activity if it is to work in SharePoint Designer. However, I tried adding this to a workflow. When I went to the workflow code, I got the error:
Code generation for property ‘PercentComplete’ failed. Error was: ‘Property accessor ‘PercentComplete’ on object ‘Microsoft.SharePoint.Workflow.SPWorkflowTaskProperties’ threw the following exeception: ‘Object reference not set to an instance of an object’
Phew. Nice error. Then, sometimes, I managed to get the Designer view to have errors – it couldn’t draw the workflow. And build failed – the workflow designer.cs file lacked the line defining the private variable referencing the UpdateTask object. Oh, and trying to set properties of the task to update – more errors.
The short is, in Beta 2, Update Task doesn’t seem to work. I don’t think that there is a lot I can do to fix this…
Using CSS to underline text in a textbox
As used in SharePoint 2007 – putting a red wavy line below text in a text box. Neat.
Just in case I ever need this (and the page goes missing):
<style>
.squiggle
{
background-image:url("squiggle.gif");
background-repeat:repeat-x;
background-position:left bottom;
padding-bottom:2px;
vertical-align:text-top;
font-style:italic;
}
.container
{
border:1px solid #a5a5a5;
overflow-x: hidden;
width: 100%;
color: windowtext;
height: 18px;
background-color: window
}
</style>
<div class="container" contenteditable="true" tabindex="0">
<span class="squiggle" contenteditable="false" tabindex="-1">
<div style="DISPLAY: none" displaytext="here"></div>
<span contenteditable="true" tabindex="-1">unresolved!</span>
</span>
</div>
Configuration Information for Workflows
In the workflow I’m working on, some xPaths. I don’t want to hard code them, as this is the sort of crap that always changes. However, I’m not sure where a good place to store such properties would be. I’d figured the workflow.xml file, or even features.xml, but I didn’t find information about doing this. All it’d need is a series of properties and values, but neither seems to do that.
I guess I could write an association form – but given that this workflow will only be used on one list, and that the settings shouldn’t change very often, this would be like using an anti-aircraft gun to kill a mosquito.
It is really frustrating to have simple tasks, no documentation, and no answers. I mean, come on guys, all I want to know is the right way to install a config data, and access it.