Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Thursday, July 17, 2008

Provisioning monthly folder structure in a SharePoint list

Recently I wrote an article about folder content types in SharePoint and how they can be leveraged to improve the document management in a SharePoint document library. The comments to the article show that there is definitely interest and potential in using folder content types, but they also point out some serious omissions. SharePoint MVP Ivan Wilson has taken things to the next level in a project he independently started on CodePlex. It is a console application that allows you to generate a folder structure within a document library. It will create a folder in the root of the document library using the current year-month (e.g. "2008-05"). 

Check out Ivan's post and the project's home page, this really makes the provisioning of the folders much easier.

Dovizhdane!

Pre-order on Amazon: Developing Service-Oriented AJAX Applications on the Microsoft® Platform

For all the AJAX and ASP.NET fans out there I wanted to point out the upcoming book by Daniel Larson (SharePoint MVP). Daniel has an impressive knowledge about what's going on in .Net 3.5 and the coming SP1. The book will guide intermediate as well as advanced developers in the ASP.NET AJAX inroads. I already had a glimpse at some of the chapters and they are impressive and easy to comprehend.

The first to send proof of pre-order purchase, will receive a free book with Daniel's signature!

Developing Service-Oriented AJAX Applications on the Microsoft® Platform (PRO-Developer)
by Daniel Larson

The book is available for pre-order on Amazon.

Cannot wait to see this one in print!

Dovizhdane!

Monday, May 12, 2008

SharePoint Folders Need More Love

Folder Content Types for IT Professionals

Published in the May 12, 2008 edition of To The SharePoint

Most of you SharePoint enthusiasts probably know quite a bit about content types in SharePoint. They provide the means to organize metadata in an extremely flexible manner and provide the context for workflows, custom menus, and document templates. However, due to the document centric nature of Microsoft Office and SharePoint, the most commonly used and discussed content types are the document content types. Well, there is another lesser-known character in the content type story of SharePoint--it is the folder content type.

One reason why the folder content type is less popular is that the default SharePoint installation comes with only one of them--the Folder content type. Compared to dozens of out-of-the-box document content types, the Folder is clearly outnumbered. So let's have a closer look at this lonely hero and create a couple of folder content types so that we can find out how to use them to further enhance the user experience and data management of a document library.

To put things into perspective, let's look at how the fictional environmental foundation Rain Forest can use folder content types to improve its excising document library. The foundation staff stores all documents in a document library and they already use several document content types to support their activities. The document types are separated into two functional groups:

  • Project Documents (Additional Fields: Due Date, Assigned To)
    • Application for Grant (Word document)
    • Financial Memorandum (Excel document)
    • Formal Acceptance Document (Word document)
  • Internal Documents (Additional Fields: Contact, Status)
    • Purchase Order (Word document)
    • Invoice (Excel document)

The document library looks very familiar, and all document types are listed in the New menu:

The IT team of Rain Forest also defined some views based on document content type to make the filtering of each document type group easier and to be able to display content type specific fields such as Due Date and Assigned To:

If you are not familiar with document content types, this article shows the basics. For more information on how to create views, check out the following article.

All documents are stored in the root and occasionally employees will create folders at their discretion. However with time the clutter of folders makes locating documents really hard. All users also notice considerable slow down in view performance. After a few months, the root folder contains more than 4000 documents and is expected to grow. What can be done? This is when the little known character from our SharePoint story--the folder content type--comes in to help.

One reason for the performance hit is that folders in SharePoint have some limitations by design. For details on how the number of items affects performance, check out this article. Nevertheless if we partition the documents by financial quarters or other perpetual attributes, we can keep the total number of documents in a given folder within the high performance zone. That’s why we decide to create a folder for internal documents and project documents using the respective folder content types for every quarter of the year.

Furthermore we can provide some structure and boundaries for the employees, so that they cannot create folders anywhere in the document library. To help users locate documents, we’ll use a great feature of SharePoint, which allows us to bind views to a specific folder content type. This will provide context for each folder, so that when a user enters a folder with internal documents, the view will automatically change to display relevant metadata.

First let’s create a folder content type for each of our document groups. The steps are no different than creating any other content type. The only difference is that our content type will inherit from the Folder content type.

You can add specific metadata to each of the newly created content types, but for this walk-through, we’ll use the existing columns.

Next, let’s add the folder content types to our document library:

In addition, we would like to remove the default Folder command in the New menu, so that only our custom folder options are available. To do that, open the advanced settings of the document library and disable the New Folder option.

After these changes we will add our two new folder entries to the New menu.

Now, when a user wants to create a new folder for the next quarter, he or she will select the appropriate folder types from the New menu, and give the folder a descriptive name such as Internal Q1 2008. The process of provisioning a new folder can be automated and extended by using calculated fields or other programming techniques.

To provide the appropriate views, we create one view for the root folder and separate, unique views for each folder content type. The root view will display only folders from the newly defined content types.

Each custom folder content type will have a view that displays metadata specific to the type of document contained in the folder. These folder views are marked as default but are assigned to the specific folder content type.

Let’s see the result by creating a folder of each type.

You’ll notice that if you click the folder Internal Q1 2008, the view automatically will change to the Internal Documents view; similarly opening the folder Project Q1 2008 will change the view to the view Project Documents.

To add additional context sensitive behavior, you can also limit the New menu items displayed for each individual folder, so that only Internal documents show in the New menu of the corresponding folder. From the drop down menu of each folder select Change New Button Order, and hide the appropriate document types.

When you enter the folder you’ll notice that only the contextually correct New menu items exist.

Similarly you can hide the documents from the new menu of the root folder. Open the document library settings and in the content type section click Change new button order and default content type. Hide all but the folder content types.

From now on, the dedicated volunteers of Rain Forest can rest assured that they can locate documents easily and that the performance of their document library is going to be stable. Furthermore, the IT Pro of the foundation has some great ideas about how to add custom menus for each folder content type, so that actions applicable to all documents in a folder can be executed faster and in the proper context. There are also many opportunities to use item event handlers and the SharePoint DOM and workflow with folder content types to further extend the application. This SharePoint story certainly does not end here.

Mikhail Dikov is a senior software engineer at Global 360 (www.global360.com) and MVP for Microsoft Office SharePoint Server with background in CMS and BPM software. Mikhail brings more than 8 years experience in Microsoft technologies such as .NET, ASP.NET and more than 12 years of IT experience. Current interests include BPM, BI, SharePoint, .Net and AJAX. Mikhail is frequent speaker at code camps in Florida and an active member of the Space Coast Dot Net User Group (www.scdnug.org). Email: mdikov at gmail dot com Blog: www.mikhaildikov.com

Tuesday, April 22, 2008

MVP Summit 2008 simply a different type of conference

After a week in Seattle attending the 2008 MVP Summit I needed a break of couple of days before I can get get back to normal. The Summit is certainly a very different type of a conference. Here are couple of variations I would like to point out.

Regular conferences dive directly from day one into regular sessions. Slide decks, presentations, code samples etc. At the MVP Summit on the contrary /I can speak only for the SharePoint track/ we started with some rigorous physical, tactical and strategic training. The master of ceremonies <Lawrence/> got us on a bus and in the woods (short from traveling blindfolded) and whoever did not pass the test of running and shooting paint potions for hours could not go to the next level. The good news is that everybody was fit enough to make it :) . Due to strict NDA some call it "Paintball", but believe me it was more than that. Thinking about it, this will be the first conference ever, where I may lose weight rather than put some pounds. Here is me (right) with John Holliday and Kit Kai loading potions in special buckets:

Another huge difference is that MVP Summit has several keynotes. One to begin with and two at closing. One of the closing keynotes came from the Boss (Ray Ozzie) and the next one from the Big Boss (Steve Ballmer). Ray Ozzie spoke about the value of building and supporting product communities once a star product reaches critical mass. Steve Balmer electrified the audience with his energetic performance. More about what they said here.

The third difference is that what happens in between the agility training (aka Paintball) and the keynotes is very interesting and intensive, but also cannot be shared freely. The event itself was organized flawlessly and facilitated its purpose to get closer product teams and the community.

Talking about sharing, the best part of all is that I met a lot of talented and opinionated people with a mindset of sharing their knowledge with others. Some contribute primarily by answering questions in MSDN groups, others speaking at conferences and code camps, writing books or supporting community software projects.

Thanks to the organizers and the sponsors, who made this a truly remarkable experience.

Different conference indeed...

Dovizhdane!

Thursday, March 20, 2008

MOSSMOSIS - Orlando

This Month: Intro to SharePoint Designer

When / Where?
Wednesday, April 2, 2007   - 6:30 PM EST

Orlando Public Schools Administrative Offices
445 West Amelia Street
Orlando, FL 32801 – 1129

How to sign up?
http://www.clicktoattend.com/?id=126847

Who Should Attend?

Developers, designers, power users, architects,
administrators.

What will be covered?
In this session we will dive into SharePoint Designer. 

Who will be speaking?
Scott Schwarze

Disappearing web.config entries

How many times have you experienced a chilling moment when something goes terribly wrong with the system you just touched and you don't have any clue what would've caused it?

In a SharePoint installation with multiple web applications and several custom solutions there may be a lot of action going on in web.config files. Even the slightest validation error in these files will bring the web application to a halt. This and the fact that the SPWebConfigModification class has a will on its own make the task of coordinating web.config modifications a very touchy business.

Recently one of my colleagues reported that after installing one of the SharePoint solutions, entries installed by another solution were disappearing, leaving the web application in chaos. Logically I started poking the features in the SharePoint solution, which was "causing" the issue, but this lead me to no where.  I only learned that when you call:

webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

The web.config files for all web applications get rewritten, regardless of which web application is being updated. But this turned out to be a "feature" of SharePoint. Then I started investigating what other web.config modifications are being created by the rest of the solutions on this server. Luckily most of these belong to our company, so I was able to pull up the code. All features worked correctly when executed separately, but still in a particular sequence some of the web.config modifications were disappearing. And there it was ... one of the features was adding the modifications correctly:

SPWebConfigModification modification = new SPWebConfigModification();
modification.Path = "...some path..."
modification.Name = "Example"
modification.Value = value;
modification.Owner = "Owner"
modification.Sequence = 0;
modification.Type = SPWebConfigModification.SPWebConfigModificationType.EnsureChildNode;
webApp.WebConfigModifications.Add(modification);

then applying the changes to update the web.config:

webApp.Farm.Services.GetValue<SPWebService>().ApplyWebConfigModifications();

But there was no webApp.Update() to persist the changes in the SP database!

It turns out it is very easy to omit this part, because when you develop or debug such feature all will work fine until something does not flush the application pool thus disposing off the newly created SPWebConfigModification. The next solution or feature that calls ApplyWebConfigModifications will force reapply all modifications pulling them from the SharePoint database. For some features this actually might be a welcome side effect, but unless this is not the case you need to call webApp.Update() to permanently save the modifications to the SharePoint database.

One mystery solved. Next, please!

Dovizhdane!

Orlando Code Camp - Sold Out!

Just noticed that the Orlando Code Camp is sold out. This is going to be another super-charged and totally free event organized by our friends at ONETUG.org. I signed up as a speaker with my two sessions from South Florida Code Camp. They were very well received in South Florida, so after some adjustments I decided to give them one more run. Come with your experience and ideas and lets talk about how we can avoid some common frustrations in SharePoint development.

I'll be carpooling with some Brevard developers, so if you need a ride or you want to save on gas contact me today or tomorrow to give you the details.

For details: http://www.orlandocodecamp.com/

Dovizhdane!

Tuesday, March 04, 2008

Unable to add selected web part(s).

Every once in a while when you create a web part or upgrade web part, or do some of things developers do when developing web parts, there comes the chilling moment, when you see an error message such as the one below:

So the question is what do we do in this case? Before you hit the discussion boards, or worse, start pulling your hair, here are couple of tips you can use to troubleshoot the issue:

  1. Make sure the control is registered as safe in the web.config (duh...actually the error says what it means, right)
  2. Make sure the assembly is accessible and in the [port]bin folder. (obvious, but worth mentioning)
  3. Make sure the assembly name in the *.webpart definition file, matches the assembly name in the safe control element in web.config
  4. Make sure you don't have more than one *.webpart file for the same web part in the web part catalog. This may happen if you changed the name of the *.webpart file.
  5. Restart IIS to start clean. Attach the debugger to the w3wp.exe process and try to load the page with the rogue web part. This way you can determine the exact location of the assembly you are loading.
  6. Check if the web part class exists by opening the assembly with reflector. This might sound funny, but in a bigger team, when different versions of assemblies are flying around it is very easy to overlook something and to use the wrong version, which so happens does not contain the web part class at all.
  7. If you have other tips or suggestions, please add them as comments.

Phew, I think I dodged that one... It turned out I got an older version of the assembly and my web part class was not even there.

Dovizhdane!

Unable to add selected webpart(s). A Web Part or Web Form Control on this page cannot be displayed or imported. The type could not be found or it is not registered as safe.

Monday, February 04, 2008

South Florida Code Camp 2008 - Recap

What a great event that was! The FlaDotNet user groups put together their 4th code camp with absolute ease (or at least they made it look like this) and with lots of sessions to choose from.

For those who came to my sessions, one big "Thank You!". Please follow the link at the end of the post to download the presentation slide deck and the sample code.

After I finished with my "work", which was in the first two time slots, I stayed in the SharePoint track for a presentation from Michael Lotter - InfoPath 2007 and Visual Studio 2008. This was a very well prepared and presented session and it gave me a good understanding of the moving parts involved in an InfoPath based solution.

In the afternoon I ventured in a non SharePoint waters. First Mark Miller got me hooked on CodeRush and Refactor with High Speed Development in Visual Studio with CodeRush and Refactor. Then Bill Reiss did a great preview on Silverlight 2.0 with some cool videos. I finished with the passionate presentation by Larry Port on Continuous Integration with CruiseControl.Net and Nant.

The after-party was a hit. Lot's of good food, drinks and smart people to talk to.

So, here are the links:

Slide deck 1

Slide deck 2

Code Sample

Dovizhdane!

Friday, January 25, 2008

South Florida Code Camp 2008

Yet another totally free event organized by developers for developers in South Florida will take place next Saturday, February 2nd, 2008. Dave Noderer and crew filled up the agenda with 72 sessions (That's right 72!) divided in 12 tracks. For full information go to http://codecamp08.fladotnet.com/.

On this code camp I have two sessions. One topic, split in two parts. The somewhat clunky name Utilizing Visual Studio 2008 capabilities for better SharePoint Development comes as a result my work on several projects in the last months and some of the exiting new features of Visual Studio 2008. I tried to find an answer to questions such as:

  • How to use Visual Studio Web Designer to create certain types of SharePoint UI elements?
  • How to structure my projects, so that I can easily test the components outside of SharePoint?
  • How to structure my projects and what community tools to use, so that I have to think less about the process of creating SharePoint solution files?

These are all big questions when it comes to the transformation of SharePoint to an actual development platform. To answer these an other challenges of Sharepoint development I am going to demonstrate how to integrate an existing information system with SharePoint without compromising quality or scalability. The four topics I am going to address are:

Part 1

  • SharePoint infrastructure, or how to reduce the time and maintenance of SharePoint specific deployment and plumbing.
  • UI design, or how to use Visual Studio 2008 web designer and new CSS features to easily create SharePoint layouts pages and web parts.

Part2

  • Testing SharePoint solutions, or how to take most out of the newly added testing capabilities in Visual Studio 2008 Professional.
  • ASP.NET AJAX Extensions in SharePoint, or how to use it and how to automate the configuration of this ASP.NET extension.

To spice things up Apress provided several copies of Workflow in the 2007 Microsoft Office System by David Mann.

So if you are in the area come and join the geek crowd. Here is the location:

Devry University
Maps.live.com
2300 SW 145th Avenue Miramar,

FL 33027

Dovizhdane!

Thursday, January 03, 2008

Microsoft MVP Award

A day ago I received an E-mail from Microsoft that I have received the 2008 MVP Award for Microsoft Office SharePoint Server. What a great start of the new year! This award is a great recognition for my SharePoint sessions on several code camps in Florida, my blog and other work I have done in the developer community. It is also a great motivation for what I have in mind for the upcoming 2008.

I would like to thank Ken Tucker, Joe Healy and the Florida developer community for organizing many great events and ultimately giving an opportunity to local developers like me to grow professionally and have fun doing it.

In the next couple of months I plan to build upon my experience in 2007 and attend several code camps as attendee and speaker. In addition I'll be looking into opportunities to write more extensively as a book reviewer, technical editor or author. Apress and other publishers have great user group programs, which I hope will bring me closer to this goal. I also plan to work on the much needed makeover of my site. I was postponing this for a while, but finally I am going to take Verio's generous web hosting offer for Microsoft developers and create a site that better meets the needs of my work.

Looks like a lot of fun, doesn't it!

For more information about the MVP Award visit: http://mvp.support.microsoft.com/gp/mvpintro

Dovizhdane!

Thursday, December 13, 2007

Comprehensive guide for MS Office and SharePoint integration developers

The book Pro SharePoint solution Development, Combining .Net, SharePoint, and Office 2007 written by Microsoft insiders Ed Hill, Susie Adams is an indebt review of how to utilize SharePoint in the Microsoft Office ecosystem. This book from the Pro series of Apress delivers a variety of advanced examples, richly illustrated with sample code, downloadable from Apress, and step by step instructions and illustrations in the book itself.

The organization of the book is very convenient and the first four chapters allow the reader to brush up his knowledge about MS Offices and SharePoint with abundant external links. Each consecutive chapter after that represents a standalone example based on a simplified real-world scenario. The examples are focused on the integration with a particular MS Office product. For example Chapter 5 demonstrates a scenario where MS Word integrates with SharePoint and Chapter 9 shows how to construct PowerPoint slides using content stored in a SharePoint list. Every example starts with an introduction and walkthrough, which allows the reader to start reading the chapter directly without losing context.

The complexity of integrating products of the MS Office family in enterprise solutions requires quite a bit of knowledge and experience thus I do not recommend this book to beginners in SharePoint and MS Office programming. While this book has a plenty of introductory and historical information about MS Office development and SharePoint customization, it does not emphasize on important steps of professional SharePoint development such as creation of SharePoint solutions, list and site template customization and provisioning. However if you are already familiar with SharePoint (WSS 3, MOSS 2007) concepts such as solutions, features, workflow etc., this is the book to put all these features in the context of enterprise applications. Since I started working on an integration project with MS Office and SharePoint at the time I was reading the book, I took away plenty of ideas to use in my project.

The software and hardware requirements for the examples in this book are quite high, so if you want to be able to implement them on your own you need to allocate some time to prepare a system with MOSS 2007, MS Office 2007 Enterprise, VS 2008 Professional or Team Edition and for the first example MS Office 2003. In addition there are several manual actions, which require a bit more time. Something, which may not be obvious from the title, is the heavy use of the new MS Office document standard - Office Open XML (commonly referred to as OOXML or OpenXML). This was my first exposure to this format specification and I found its use throughout the book very useful.

Overall this book is of great value to intermediate and advanced developers, working on enterprise applications based on the MS Office system or integration projects with third party vendors. The examples can be read independently and each one of them not only demonstrates the implementation of a particular scenario, but also provokes ideas for other projects.

Dovizhdane!

1590598083, 978-1590598085

Tuesday, November 20, 2007

Support multiple scopes in SPEventReceiver class

Quite often when I create a feature SPEventReceiver I am not certain what would be the best scope to use it. In other situations I am copying existing code from a feature scoped differently than the newly created one. After couple of these you get tired of trying to find out what is the actual meaning of the properties parameter, as it changes with the scope change.

So here is a little snippet that I started using to save some time and effort. In this particular case I am fetching the current web application from the feature properties:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
SPWebApplication app = null;

if (properties.Feature.Parent is SPSite)

{

SPSite siteCollection = properties.Feature.Parent as SPSite;

app = siteCollection.WebApplication;

}

else if (properties.Feature.Parent is SPWeb)

{

SPWeb web = properties.Feature.Parent as SPWeb;

app = web.Site.WebApplication;

}

else if (properties.Feature.Parent is SPWebApplication)

{

app = properties.Feature.Parent as SPWebApplication;

}

else if (properties.Feature.Parent is SPFarm)

{

throw new Exception("Not supported as farm feature.");

}

}

This code can be used in some of my previous posts:

SharePoint Resources, Types, Use and Deployment (Update)

SharePoint Resources, Types, Use and Deployment

Dovizhdane!

Thursday, November 01, 2007

Using ASP.NET AJAX extensions in SharePoint WebParts

As I mentioned in my previous post I a while ago I started working on a project with AJAX enabled WebParts. I already have been playing with AJAX and also working with SharePoint and WebParts in my previous projects at G360 and in the .Net community. Nevertheless I did not get a chance to work with both technologies in one project, so there you go, all my wishes came true.

With the release of ASP.NET AJAX and the expected support in SharePoint SP1 it makes good sense to continue using this technology instead of other alternatives such as AJAX.NET. One of the biggest advantages is that ASP.NET developers have the choice to use UpdatePanel and the control toolkit to upgrade existing applications or develop new one without a major learning curve requirements. The UpdatePanel control encapsulates a lot of functionality and allows developers to continue to use the ASP.NET controls and programming style, but overrides the post-back events with an asynchronous call and partial update of the area covered by the UpdatePanel. Developers also have the option to go into more sophisticated AJAX development techniques using directly the client and server side AJAX libraries. With coming support for JavaScript Intellisense and debugging in Visual Studio 2008, this option will be increasingly more attractive, but in Visual Studio 2005 these luxuries are not available.

When it comes to using ASP.NET AJAX in SharePoint nothing is written in stone, but one big chunk of the mystery is solved in this post from Mike Ammerlaan - http://sharepoint.microsoft.com/blogs/mike/Lists/Posts/Post.aspx?ID=3. In his post Mike describes the steps, but there is still some work to make this function properly in a solution that can be deployed to a customer. One of the issues is how to make the web.config changes using SharePoint Feature. The solution comes from the SharePoint 2007 Features project on CodePlex, which contains a feature that does exactly that. Another issue is that to add the script manager we don't really want to edit to the master pages. Even though some don't recommend this technique, I found that adding the ScriptManager dynamically worked well for my project and greatly simplified the deployment. This is the code I used:

protected override void OnInit(EventArgs e)
{
base.OnInit(e);

// Let's find if the ScriptManager exists and add it if not
scriptManager = ScriptManager.GetCurrent(Page);
if (scriptManager == null)
{
scriptManager = new ScriptManager();
if (Page.Form != null)
{
// Insert script manager after the web part manager
for (int controlIndex = 0; controlIndex < Page.Form.Controls.Count; controlIndex++)
{
if (Page.Form.Controls[controlIndex].GetType() == WebPartManager.GetType())
{
Page.Form.Controls.AddAt(controlIndex + 1, scriptManager);
}
}
}
}
}

Using ASP.NET AJAX Control Toolkit was also very straightforward. Most of the controls worked properly in SharePoint. I did not have the chance to test all of them, but it looks like controls that iterate many objects on the page and make style modifications to many controls work somewhat slower, if at all, in the default SharePoint page. The validation extender, for example, sometimes does not position well the call out next to the field, or the modal pop-up mocks up the whole page and causes high CPU utilization. Nevertheless there are plenty controls that work well. One of the controls I use frequently is the tabbed control, which is very handy for configuration pages.

One thing I found cumbersome is to use UpdatePanel and some of the other AJAX enabled template controls directly from server side code. I know a lot of web control and WebPart developers have long forgotten the design-time environment of the web forms, but would it be nice to be able to use a visual tool to design WebParts and to be able to easily test them? I hope I'll find some time to write about the solution I worked out for my projects. Until then ...

Dovizhdane!

Thursday, October 11, 2007

MOSSMOSIS Orlando

Recently Scott Schwarze from the Orlando chapter of MOSSMOSIS invited me to talk about SharePoint WebParts and related issues. I was trilled to do this since I already started an AJAX project and it was great to have an opportunity to share some of my experience. The title of the talk was "SharePoint Web Parts - from Hello World to ASP.NET AJAX extensions", in which I gradually build up an AJAX enabled SharePoint WebPart and functional web tests for it.

MOSSMOSIS secured a great venue for their meetings (the downtown Orlando building of the Orange County School System) and provided excellent snack.

In addition I would like to thank all the MOSSMOSIS members, who came to the yesterday's meeting. You can download the slide deck and the samples from the links below:

SharePoint Web Parts - from Hello World to ASP.NET AJAX extensions:

Presentation slide deck

Code Samples

Dovizhdane!

Friday, September 21, 2007

SharePoint Resources, Types, Use and Deployment (Update)

For sometime I wanted to make an update to the deployment method for RESX files I proposed in a previous post. Even though there is nothing wrong with using custom jobs to deploy any file from a WSP solution to a SharePoint farm, I found about another option, which is a bit easier to implement. The code used to copy the resource files from the feature directory to the App_GlobalResources is pretty much the same, but this time not in a custom job, but directly in the feature event receiver.

SPWebApplication webApp =

this.Parent as SPWebApplication;

foreach (SPUrlZone zone in webApp.IisSettings.Keys)

{

// The settings of the IIS application to update

SPIisSettings oSettings = webApp.IisSettings[zone];

// Determine the source and destination path

sourcePath = string

.Format("{0}\FEATURES\{1}\",

SPUtility.GetGenericSetupPath(

"Template"),

featureName);

string destPath = Path.Combine(oSettings.Path.ToString(), "App_GlobalResources");

string[] filePaths = Directory.GetFiles(sourcePath, "*.resx");

// Copy the files

foreach (string filePath in filePaths)

{

string fileName = Path.GetFileName(filePath);

File.Copy(filePath, Path.Combine(destPath, fileName), true);

}

}

Then use feature stapling to activate the feature every time a new site from a given configuration is created. Feature stapling allows us to create associations between a feature and specific site configuration. To find out more about feature stapling have a look at this article: http://sharepointnutsandbolts.blogspot.com/2007/05/feature-stapling.html

Dovizhdane!

Monday, August 27, 2007

Jacksonville Code Camp 2007 summary

I would like to thank everybody who came to my session Developer's Introduction to SharePoint at Jacksonville Code Camp 2007. In this session I added an example of using RunWithElevatedPrivileges and a test code example based on WatiN, to create a functional test for the demo web part. You can download the slide deck and the code from here: JaxCodeCamp2007SiteContent.zip.

If you have questions about the code or the presentation post a comment to this message.

The code camp was packed with interesting sessions. The other sessions in the SharePoint track were:

  • What Every SharePoint Developer Should Know - Customization vs. Development by Andrew Connell (MVP & author)
  • Introduction to Web Content Management (WCM) in SharePoint 2007 by John Ross
  • Developing SharePoint 2007 with User Profiles, My Site and Social Networking by Brendon Schwartz (MVP)
  • Building Reusable CAML Queries in C# using CAML.NET by John Holliday (MVP & author)
  • Going Off Road With SharePoint - Using SharePoint from within your own application by Colin Borrowman

    Other session that I found interesting were:

  • Introduction to SQL Server 2005 Analysis Services by Brian Knight

  • The Role of an Architect by Jeff Barnes

  • And probably the most fun session of all to finish up the day was Robot Vision by Shawn Weisfeld. Shawn did a great job of explaining the algorithms for image analysis and finally set his I-Robot to chase Ken Tucker in the room. Very cool...

    Dovizhdane!

    Sunday, August 19, 2007

    Jacksonville Code Camp 2007

    Another code camp on the horizon. This is the first time I am going to be in Jacksonville and I am looking forward to meet the local geeks and to see one of the most beautiful cities in Florida. The area has very strong developer community and a lot of talented people. Some of them I already met at other code camps and TechEd and I expect to meet them and many others again. I am going to present an introductory session for SharePoint developers. There are still a lot of colleagues interested in exploring SharePoint and starting their first SharePoint project and I feel that the experience I gained in our last project has something to add to this topic. In addition to the usual starter samples I am adding an overview of all application development tools for SharePoint, emphasizing on the diversity of options and when to use them. In this session I am also adding one new topic - testing SharePoint applications. Since SharePoint applications can be very diverse, I am only scratching the surface by adding a sample about creating functional tests for SharePoint applications. It'll be a though week, with a trip to San Francisco and a whole week of meetings before that, but well worth the effort.

    Dovizhdane!

    Tuesday, July 24, 2007

    The new release of WSS SDK

    I was pleased to see some good additions to the WSS SDK in its latest release from 7/13. I am glad that Microsoft took into account a lot of community content and included information that was circulating blogs, CodeCamp sessions and newly released books for some time now. The articles, which explain how to create solutions and the principle of deploying and retracting solutions are much better. Since this is a topic I had to deal with couple of months ago, with almost no good resource of information, I find this new addition to the SDK of great value to developers that are starting with SharePoint.

    The additions to "What's New ...", "Technical Articles" and "Visual How Tos" make this a much better learning and reference tool. Check it out!

    Dovizhdane!

    Monday, July 16, 2007

    Tampa Code Camp

    One big Thank You to all of you that attended my Tampa Code Camp session "Developer's Introduction to SharePoint". The presentation and the code sample are available for download here : TampaCodeCamp2007.zip. If you have questions related to the sample post a comment to this message.

    The code camp was really big. The attendance was well above 300 and probably reaching 400. Keith Kabza and his team from the Tampa Bay .NET User Group did an amazing job organizing the event. The venue was loaded with modern AV and the logistics of the sessions, the lunch and ... the parties was flawless. Simply put, another great Florida code camp.

    Dovizhdane!