Andrew Connell [MVP MOSS]
1351 Posts |  39 Articles |  3385 Comments
.NET  |  MCMS  |  SharePoint  |  Office System
PDCBling
SharePoint Quick Links
Article Categories
Archives
Post Categories

View Andrew Connell's profile on LinkedIn

Add to Technorati Favorites

In Part 1 of this series on these little tools I created for SharePoint developers I gave a bit of an overview of what they are all about and where you can get additional information. In this post I want to spend some time taking a look at some of the templates I think will be used the most.

Before you ask, yes, CodeRush (CR) templates are similar to Visual Studio (VS) snippets, except they have quite a bit more functionality. For example, I can embed functions within CR templates where I can't do that with snippets. Let's jump in and see one one of the more commonly used ones (least that I expect).

Creating Feature definition files (feature.xml) files is repetitive. After a few weeks as a SharePoint developer, I expect you'll be able to do this in your sleep. What do you always have to do? Create a new GUID, give it a title, scope, and mark it's visibility. There's new a CR template named fxml (for Feature XML) that once you type it and hit space... well fire off the following animation to see it in action (the "Keys" tool window shows what I'm pressing on the keyboard):

fxml

Cool? Notice the GUID automatically created. And notice how I'm hitting ENTER to jump between the different "fields" (indicated with orange boxes).

OK, cool... me like... you like? But wait, there's more!

Here's where the power of CR really starts to kick in. What if you had a Feature receiver class in your project? Wouldn't it be cool if it would automatically fill the ReceiverAssembly & ReceiverClass attributes? Uh-huh... sure would! So, check out the frxml (for Feature Receiver XML) template. Assuming the project is signed and has already been built:

frxml

Notice how it got the assembly's strong name (aka: 4-part name)? If the project wasn't signed and / or built, it would have simply added PublickKeyToken=[REPLACE_THIS] at the end.

You like now? Oh... before I go on, there are a TON of templates... over 45 of them! I created templates for the entire Feature schema, most of the Solution schema, field type definitions and a few others. All are listed, as well as links to screencasts demonstrating each (with a table-of-contents to jump to specific templates) on the main AC's VS CodeRush/Refactor Tools for SharePoint Devs page linked at the bottom of this post.

Before I go on, let me explain how the templates are named. Each one is created as a mnemonic to make it easier to remember. I fully expect it will take some folks some time to get used to them, but when you think about it, they are quite intuitive. Want to create the contents of a new feature.xml file: fxml. What about a Feature with receivers: frxml. OK, what about an element manifest file: exml. What about adding a site column (element site column) [esc], then a new content type [ect] and a few field references in the content type [ectfr]. Cool... what about a new manifest.xml [solution definition]: sxml. And adding assemblies [sa] with safe control entries [sasc] as well as a new Feature manifest declaration [sfm]. Just think about what you're trying to type and it should be fairly intuitive... or just watch the screencast / read the docs!

As a grand finale, check out the productivity gain once you get used to using these templates. This animation shows me creating a new Feature that contains a Feature receiver, add a new site column definition, and a new content type using the site column:

part2
There is a much better, and bigger, screencast available on the main page, linked below.

To get more information on the tools including documentation, links to detailed screencasts / demonstrations, and a history, check out the main page:

» AC's VS CodeRush/Refactor Tools for SharePoint Developers

Let me know what you think! Oh... and I didn't name this post "part 1 of 5" for some random reason. Over the next four days, I'll add another post related to these productivity enhancements.  :)

posted on Wednesday, August 22, 2007 9:25 AM

Feedback

No comments posted yet.

Post Feedback

Title:
Name:
Email:
(email will not be displayed)
Url:
Comments: 
Please add 7 and 6 and type the answer here:    
All Comments Are Filtered & Moderated
Unfortunately comment spammers are just too effecient and are constantly dirtying up blogs with irrelivant and unwanted comments trying to improve their standing on search engines. All comments on this blog are moderated. I do not censor comments, but I don't approve comments with vulger language or those soliciting products. Most of the time comments are approved within a few hours of being submitted with the only exception when I'm traveling.

Why are you asking for my email address?
The only reason I'm asking for your email address, which isn't required to submit a comment, is to provide a gravatar if you've created an account for yourself and associated your email address with a small image. If you have a gravatar created for the email address you submit, it will appear next to your comment. Otherwise nothing will appear.

What is a gravatar?
A gravatar is a "globally recognized avatar." You can get more information about gravatars, as well as create your own for free, at www.gravatar.com. You can also view my gravatar here.


Copyright © 2003 - 2008 Andrew Connell
Creative Commons License 
This work is licensed under a Creative Commons License
Site design by Heather Solomon.

 
 
MOSS WCM Training
Looking for MOSS 2007 WCM developer training? Look no further! I teach my 4-day hands-on and 5-day online WCM classes for developers I offer through the Ted Pattison Group.

Get more information on the WCM courses!


Upcoming Classes
 Hands-on WCM:
 » Atlanta, GA
   Sept 22-25, 2008
 Online WCM:
 » July 21-25, 2008
 » December 8-12, 2008


» Register today!

JAX Office Geeks
Jacksonville Office Geeks (JOG)
JOG is a special interest group in Jacksonville, FL dedicated to bringing the local SharePoint commnity together to share tips, tricks, ideas and best practices for developing solutions on the SharePoint platform.

Next meeting details...
When:
Thur. Sept 18th, 2008
  6-8p EDT
Topic:
Enterprise Content Management - Document Retention

Speaker:
John Holliday, MVP MOSS

RSVP Today!


» Subscribe to the JOG newsletter