More servicesWindows Live
HomeHotmailSpacesOneCare
 
MSN
Sign in
 
 
Spaces home  Gudjon's bloggingsPhotosProfileFriendsMore Tools Explore the Spaces community

Gudjon's bloggings

Professional and personal weblog of GOTH :-)
April 19

Capture html tag with its full content in regular expressions

Interesting regular expression that i use from time to tome but never seams to be easy to locate.
 
This regular expression will capture the HTML tag and the contents of it even it the contents has line breaks.
 
<TAG(.|\n)+?(?:</TAG>)
 
 
C#

public static Regex regex = new Regex("<w:Sdt(.|\\n)+?(?:</w:Sdt>)",RegexOptions.IgnoreCase| RegexOptions.CultureInvariant| RegexOptions.Compiled);

 
javascript:
 
var regExp = new RegExp('<script(.|\n)+?(?:</script>)','mig');
 
June 15

Problem with user not found after moving a site to another server

I had a small issue the other day while transfering a sharepoint site from one server to another. Server a was on domain A and Server B on domain B. The site it self was an internet facing publishing site and had been almost completed with design, branding, some cstom features and most of the content.
 
The method of transfering the sites was by backing it up using STSADM and then transfering the backup to the other server.
 
By this time all is great and no large problems. so i do a little cleanup that i would not dare to do in a few days when the site had gone live and one of the things that i did was deleting the users from the old domain as they where now orphaned and not needed any more.
 
deleting the users = bad...
 
The problem:
When going to Page > Page Settings in the page editing toolbar i would get a user not found error and i could by no means work with or edit settings of pages created before the transfer. After some research i found that the failure was the Last Modified By: and or Created By: where set to the user that had been removed.
To my best knowledge there is no "official" way of recovering a deleted user in sharepoint, no recycle bin and no way to add the same user if it is not on a domain so like i said.. bad..
 
The solution:
The only solusion i could find was to
A) locate the user table in the SQL database
B) Locate the record for the deleted user
C) Change the deleted field value from 1 to 0
 
This will recover the deleted user and the "user not found" error is gone
 
:-)
I hope this post may be of some help to anyone with a similar problem :-)

Change navigation options in site defininitions / onet.xml

I was wondering the other day how to make changes to the navigation by default while creating new sites in MOSS.
 
After some digging and a little research i found this great post by Vesa (http://blogs.msdn.com/vesku/archive/2007/03/23/controlling-navigation-options-from-the-onet-xml.aspx) and just wanted to make it a little bit more findable for me, my collegues and others.
 
February 26

Resources on Web Content Management in MOSS 2007

 
Enterprise Content Management (ECM) Team Blog
http://blogs.msdn.com/ecm/
 
Andrew Connells's (MVP) Blog
 
Patrick Tisseghem's Blog [MVP SharePoint] 
 
Jan Tielens' Bloggings
 
 
A few online sites powered by MOSS 2007

 

January 29

Workflow designer problems in Visual Studio

This is a problem only with Sharepoint Workflows and not standard workflows. and is commonly just that the sharepoint DLL's can not be found.
 
The problem seams to occur if you are developing on a workstation that does not have Sharepoint installed.
 
Update/NOTE:
For most people i strongly reccomend the use of a Windows 2003 Server with Sharepoint installed for development. That is to install Visual studio on a server with WSS or MOSS . A common practice is to use VMWare or Microsoft VPC and run your personal development server in a virtual machine on your workstation (if it is powerfull enough) .
 
This will make life so much easier in all aspects when it comes to problems with the development environment and expecially when debugging and publishing.
 
One small trick on debuggin this error is to create a standard non-sharepoint sequential workflow and then drag a onWorkflow Activated activity into the designer, this seams to give a much more descriptive error message.
 
 
Problem one
The type initializer for 'Microsoft.SharePoint.WorkflowActions.OnWorkflowActivated' threw an exception.  
 
The way i set up my machine for development is to:
 
A) copy the DLL's from C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\ISAPI on the server to the same folder on my development machine.
B) Register the following in the GAC (Just drag drop from the ....\ISAPI folder to C:\WINDOWS\assembly)
  • Microsoft.SharePoint.dll
  • Microsoft.SharePoint.Security.dll
  • microsoft.sharepoint.WorkflowActions.dll
  • microsoft.office.workflow.tasks.dll

Note: If you already installed the next two you do not need to uninstall/reinstall, just skip the next two

C) Install the Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation)

D) Install the SharePoint Server 2007 SDK: Software Development Kit and ECM Starter Kit (RTM version)

 
 
Now for the second error that i only encountered after upgrading the ECM Starter kit to RTM
 
Could not load file or assembly 'Microsoft.SharePoint.WorkflowActions.intl, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified. 
 
The difference is that the RTM starter kit inherits the activity from SharePointSequentialWorkflowActivity instead of SequentialWorkflowActivity
 
As i have not found any official solution from microsoft on this issue here is how i fixed it.
 
A) Locate the Microsoft.SharePoint.WorkflowActions.intl.dll in the GAC of a server with Sharepoint installed using command prompt
     Run > CMD (Note: using the commandline to be able to extract the DLL from GAC)
     cd \WINDOWS\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowActions.intl\12.0.0.0__71e9bce111e9429c
     > copy microsoft.sharepoint.WorkflowActions.intl.dll c:\
     cd \WINDOWS\assembly\GAC_MSIL\Microsoft.SharePoint.WorkflowActions.intl.resources\12.0.0.0__71e9bce111e9429c
    
copy microsoft.SharePoint.workflowactions.intl.resources.dll c:\
B) Move the two dlls to your development computer and register them in the GAC
 
View more entries