Sharepoint, searching for a Solution

Recently I was asked to find a solution for the problem that the ContentEditorWebPart creates absolute links instead of relative ones. A common problem, and I started searching for code to use. I found a few solutions:

http://blog.mastykarz.nl/inconvenient-content-editor-web-part/
http://www.devcow.com/blogs/jdattis/archive/2007/09/27/11463.aspx
http://blogs.msdn.com/maximeb/archive/2008/12/23/fixing-absolute-urls-for-all-alternate-access-mappings-aam-of-content-editor-web-part-with-a-control-adapter.aspx

I chose the solution containing the ControlAdapter because existing content had to be filtered. For my purpose the third extended version with a list of urls to replace was the preferred solution.

Then I started to create my own Sharepoint solution containing this as a feature, but deployment of the .browser file was not a task that could be done out of the box (manifest file). Again I started searching for solutions, I found a few articles that interested me.

http://geekswithblogs.net/bjackett/archive/2009/05/06/deploy-files-to-sharepoint-web-application-virtual-directories-at-feature.aspx
http://stsadm.blogspot.com/2009/07/deploying-sharepoint-files-not-handled.html

The article by Gary Lapoint was excellent and seemed to me the best starting point. I incorporated the looping of the zones of the first article and added an code that loops through files in the files folder, and subfolders, located in the feature folder, so no hard coding is needed. I commented all lines of logging code of the original code by Gary Lapoint, because I was a bit too lazy to Implement simple logging.

For deployment in similar situations I can now reuse this code and just add folders and files to the files folder of the feature containing this code, and they will be deployed. Files in the root of the files folder will be placed in the root of the web application. Subdirectories are created on the fly if they don't exist, and files contained in those subfolders are copied.

You can download the sources and solution here. I have tested this code, but not as extensively as I would have liked.

So searching for a Solution, keep all interesting articles/blogs in mind and think about combining the parts to a solution that suits your need. That is, of course, if you have not found a complete solution already. Happy searching...