07.07.08
Posted in General, Programming, SharePoint, Visual Studio 2005 at 5:26 pm by Reginald
I’ve been quite naughty recently and I’ve been taking the easy way out when it comes to putting code upgrades in. It’s very easy to drag the DLL from the dev environment and just drop it into either the Gac or the local Bin, without any thought to what happens if someone comes along and re-uses the .WSP file in future!!
So today I actually spent some time figuring out the stsadm -o UpgradeSolution command and testing it on my live environment to perform some upgrades to live code. The result, it worked quite nicely thank you and I’ve documented this into our ongoing procedures.
So, How does it work, Well in reality, it’s no different from deploying a solution for the first time. You copy your WSP file into the holding area, in my case it’s D:\InboundProjects.
Then enter the following command (tailored to fit your deployment options of course..)
stsadm -o UpgradeSolution -name MYSOLUTION.WSP -filename D:\inboundprojects\MYSOLUTION.WSP -immediate -allowcaspolicies
Follow this with a quick stsadm -o execadmsvcjobs to force the time job to run and bingo, the code is live. And just for my own happiness, I had an explorer window open to the local webserver wpcatalog directory just to be certain it updated the deployedf files correctly, which it did.
Reginald.
Permalink
06.25.08
Posted in General, SharePoint at 8:32 pm by Reginald
Since my last post at the end of May, my SharePoint immersion has tailed off heavily due to urgent server builds that had to meet heavy deadlines. The upshot of this is I’ve hardly touched any code this month. That coupled with a week in Gran Canaria has meant a very lean SharePoint month for me and I’ve actually missed it. Today is the first day in a whole month that i’ve actually had VS2005 open and done some coding.
This situation is unfortunatly a hazard of working in a role that requires SharePoint to be a very secondary part of my role and it’s also one of the key reasons that I handed my notice in this morning much to my Boss’s dismay.
I recently interviewed for a Developer role in a London based company focusing primarily on SharePoint and I’m very pleased to say that I landed the post, So as of the start of August you can expect to see a lot more posts from me both here and in the SUGUK forums and maybe even a white paper or two?.. who knows.. The world is my crustacean!
Permalink
05.29.08
Posted in General, Programming, SharePoint, Visual Studio 2005 at 3:31 pm by Reginald
As with a lot of the sharePoint API, the SPUtility class and more importantly the sendEMail method lacks a decent amount of documentation on its use.
After a little bit of playing around with a console session, I’ve found what seems to be the best way to use this function. (For me at least.. feel free to disagree!!)
Requires:
using System.Collections.Specialized;
For the purposes of my test code, I used a console sessions and wrapped the send email process inside two using statements to populate site and web with the test sharepoint site.
StringDictionary headers = new StringDictionary();
headers.add("to","reginald@myfatblog.co.uk");
headers.add("cc","thisiscopy@myfatblog.co.uk");
headers.add("bcc","thisistheblindcopy@myfatblog.co.uk");
headers.add("from","MySharePointEmail@myfatblog.co.uk");
headers.add("subject","How to use SendEMail from SPUtility");
headers.add("content-type","text/html"); //This is the default type, so isn't neccessary.
string bodyText ="
This is the body of my email, in html format.“;
SPUtility.SendEmail(web, headers, bodyText);
The SendEmail method makes it very easy to pop emails out using your SharePoint sites current SMTP configuration, the only downside is that this does not allow you to use attachments. If you need to do this, then you’ll need to look down the .Net mail methods.. (I found a decent post on David Fekkes blog on how to do this using the .Net methods. I haven’t tried it yet, but it’s a good starting point. Email with attachments from SharePoint code.
Permalink
05.08.08
Posted in Infopath, SharePoint, Workflow at 4:33 pm by Reginald
We’ve hit an unusual problem in our estate with the SharePoint implementation. Around a month ago, a number of our users had their machines upgraded to Office 2007. Today when they tried to edit a workflow task assigned to them, the page loaded, but the browser based infopath form failed to display and IE showed the Errr on Page icon in the bottom left hand corner.
When you click on the error and choose show detail, You’ll see, “Line: 1935 Char: 4 Error: Library not registered. Code: 0 URL: http://server/site/page.aspx?list=etc…”
Not the most useful of errors you’ll agree. The resolution is to run Word 2007, click on the Office Button, choose Word options, Resources and then run the Office Diagnostics. Once this has run through, restart IE and it all seems to work!
Reg.
Permalink
Posted in Programming, SharePoint, Visual Studio 2005 at 10:29 am by Reginald
I’ve been making some changes to the Summaries webPart this week following the successful beta with the users. The key problem I hit was an unexpected error when changing one of the selected views in the web part. I received a very helpful
“One or more field types are not installed properly. Go to the list settings page to delete these fields.”
Well this is a very useful error, Resolve the problem by deleting the fields causing the issue? in this instance however, there isn’t actually a problem, The issue is caused by the CAML used to return the data for the webpart. In Dev, it was looking for “Projects_x0020_Task_x0020_Complete” and in Live it should have been “Projects_x0020_Involvement_x0020_Complete”. Simple schoolboy error and easily solved, but not helped by the error message, so one to watch out for in future.
Update: This came about because the column had been renamed long ago, therefore the program I used to extract the column name showed the internal name of Project Tasks Complete, whereas I had renamed it to Projects Involvement Complete before porting the whole lot to live!
Permalink
04.23.08
Posted in Infopath, Programming, SharePoint, Visual Studio 2005, Workflow at 1:32 pm by Reginald
Well almost, Had a minor break from the work this morning to have a cracked tooth looked at, Unfortunatley it was too badly damaged and it’s had to come out.. Well the novocain or whatever they use nowadays has well and truly worn out and yours truly is hitting the Ibuprofen hard!!
So, to ease the pain, I’ve focussed on some issues around the workflow edit form today. The users want to be able to set a status on an item using a drop down menu. This is nice and easy as we’re pre-setting the values in the form, just Yes, No and Not Applicable.
All well and good, I’ve built the new area on the form and added the drop down, the value is being passed happily to the backend and the previously selected value is being placed into the ItemMetaData by the workflow.
The issue I have now, is how do we take this returned value once the workflow is underway and ensure that the user is presented with the correct value when the form loads.. The dropdown list doesn’t let you map to the ows_ItemMetaDatalable like a text box does..
I’m busy re-searching this now and have placed a few posts on some dev forums, watch this space for a resolution..
Reg.
Permalink
04.18.08
Posted in Uncategorized at 4:04 pm by Reginald
Well I’ve had some fun doing the layout of the workflow onto the state machine designer page. It’s certainly a very different feel to building the Sequential style of workflows and I can understand why anyone who has developed the state machine workflows always says, ‘mess around with Sequential ones first”.
There is a very different feel to the designer when working on the State Machine WF, it feels quite disconnected once you start drilling down into the various state containers and can be a little hard to picture until you return to the top down view and can see the various state changes in line form on the designer.
In order to try the SM workflows out, I’ve decided to port the Finalisaton workflow from our current system into the SM way of working. This fits with the project as the finalisation never reached live owing to the repeated changes requested by our finance team. therefore I’m almost at the blank canvas stage which is a great place to start.
Well so far I have the basic workflow design layed out on the canvas, I’ve got the initialisation underway pulling in both association data and initiation data from the XML data in the workflow, The task logic is almost complete and the task creation is almost there. I’ve had to leave it at the point with copious notes in the code ready for when I can return to it next week.
Watch this space for a report on how the first deployment goes and what I’ve learned about state machines!
Permalink
04.17.08
Posted in Uncategorized at 8:51 am by Reginald
The library summary webpart that I’ve been working on over the last week is now at a point where I can put it in front of the UAT board and show them the different flavours. Flexibility was the key with this part as I wanted to avoid having to keep re-writing webparts for each different team.
I’ve used personalisation menus quite heavily with this one and it’s working quite nicely, even if some of the logic within the code has to be quite convoluted.
Anyways, the UAT meeting isn’t until this afternoon, so yesterday I decided to take a look at a state machine workflow.
I found a fairly good walkthrough on the net that seems to cover the ground quite nicely, available here:- Matt Morse - State Machine
I’m adapting the basic walkthrough to meet my requirements, Hopefully I’ve built up enough knowledge on the workflows to get this working without doing a sandbox first, but we’ll see.
Permalink
04.08.08
Posted in Installation, Programming, SUGUK, SharePoint, Visual Studio 2005 at 2:57 pm by Reginald
I’ve been writing my own SharePoint webparts for a few months now and have been quite happy using personalisation options to provide a certain degree of control during runtime from the Edit Shared Webpart properties menu.
All of these controls have either been using a text box entry or a tick box boolean, Until now that is. I realised that I needed to have some form of control over what was being entered by the admin. After all, whilst it’s always good to make sure that you validate any user input, it makes sense to restrict that input to selected options when possible.
In my case, I want the admin to be able to choose between which teams to filter the inbound data on, this in turn was then fed into a CAML query to return the correct data for the webpart.
After much reading of logs and blogs, I posted a quick question on the SUGUK forum and one of the readers, Paul Leigh suggested I look at using an Enum to provide the drop down.
Quite intrigued, I brushed off my c# text book to remind me how to define an enum, and set off on the following code.
First we define the enum within the webpart class boundary.
Public enum resourceTypes : int
{
NR,
Projects,
Windows,
Networks,
Unix,
snipped……
FirstAssist
};
Now we need to define the public and private members of the class, You don’t have to do this, but it’s best practice!
private resourceTypes m_resourceFilter;
[Personalizable(PersonalizationScope.Shared), Category("ESSOP"), WebBrowsable(true), WebDisplayName("Select team to filter results by")
, WebDescription("Use NR value when not required.")]
public resourceTypes resourceFilter
{
get {return m_resourceFilter;}
set {m_resourceFilter = value;}
}
Thats really all there is to it, in my case, i evaluate the enumeration using the ToString method and push that into my query string.
NB: You can only use a single word in the enum, spaces aren’t allowed, so in order to get around some of my teams that have double barrelled names, I put a Select statement further down the code at the injection point into the CAML query….
switch (m_resourceFilter.ToString())
{
case "StorageBackup":
resourceSelection = "Storage & Backup";
break;
case "TechOps":
resourceSelection = "Tech Ops";
break;
case "FirstAssist":
resourceSelection = "First Assist";
break;
case "BusinessAssurance":
resourceSelection = "Business Assurance";
break;
default:
resourceSelection = m_resourceFilter.ToString();
break;
}
Hopefully this might give you some pointers to solve a similar issue in your projects.
Regards
Reg.
Permalink
04.04.08
Posted in General at 1:52 pm by Reginald
I’ve been somewhat remiss recently with updating the blog, so those of you looking forward to another installment of Workflow issues and resolutions are I’m afraid out of luck this week.. The workload here at the normal place of work has gone sky high as our various clients tried to beat the end of the financial year.
The last week or so has seen me returning to my previous duties of building physical and virtual servers for various clients, and more importantly, actually becoming a user of the system that I’ve spent the last 9 months building.
And this is quite key, I would suggest that any of you writing such a system, should definately walk a mile in the users shoes.. it gives you an interesting perspective on the system that you thought you were familiar with. As a result of this, I’ve come up with a couple of screen improvements that should make our users lives just a little bit easier.. I’ll be building these next week, right now, I have to go and finish unpacking 250 HP disk boxes ready to install into the 57 servers we’ve just installed in the racks today.
We’ve filled 7 recycling bins with corrugated cardboard, and probably have enough for another 7.. Does each individual disk really need this much packaging?
Reg.
Permalink
« Previous entries