Workflow, Collaboration, Enterprise Content Management

SharePoint Sessions at Microsoft PDC 2008

by John Holliday 9. October 2008 13:34

pdc2008 hard driveBack in the day, I would never miss a PDC.  It was always a great experience, and I'm sure this year will not disappoint.  Unfortunately, I won't be able to attend this time and I'm kind of bummed about it.  If you're planning to be there, then be sure to check out the following SharePoint sessions. 

Also, I just learned that everyone will get their own PDC 2008 hard drive loaded with software that will include a pre-configured VPC with 10 hands-on SharePoint developer labs! 

Now I'm really bummed. :(

 

Here is a list of the SharePoint sessions I'll be missing...

  • SharePoint 2007: Creating SharePoint Applications with Visual Studio 2008

Chris Johnson will be talking about how to use Microsoft Silverlight and SharePoint together.

  • SharePoint Online: Extending your Service

Troy Hopwood will discuss ways to access and manipulate SharePoint files and data remotely with Web Services along with other extensibility points for SharePoint Online.

  • SharePoint 2007: Advanced Asynchronous Workflow Messaging

Alex Malek will build an employee on-boarding application that depends on a server located inside another company by constructing a document workflow and have it asynchronously message a business service hosted behind another company's firewall.

  • FAST: Building Search-Driven Portals with MOSS and Silverlight

Jan Helge Sageflåt, and Stein Danielsen will do a deep dive into FAST search and the FAST ESP Search Web Parts, including the use of Silverlight to deliver unique search experiences.

So, if you're gonna be there and you don't really need that extra hard drive...

Oh, nevermind!

Technorati Tags: ,,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Microsoft | SharePoint Development | Silverlight

JOG Meeting Reminder for September 2008: Enterprise Content Management - Document Retention

by John Holliday 16. September 2008 01:56

Jacksonville Office Geeks

Thursday, September 18th, 2008; 6p-8p

Bank of America, Building 500, 9000 Southside Blvd; 2nd Fl; Sea Oats Rm

Map: Meeting Logistics

RSVP: http://www.clicktoattend.com/?id=130639

Enterprise Content Management - Document Retention

Document retention is an important part of content management.  SharePoint provides out-of-the-box support for managing document retention using the built-in expiration policy feature of the information management policy framework.  The built-in expiration policy feature includes the ability to define expiration formulas based on document metadata, but there are many scenarios in which the expiration date depends on conditions external to a given document.  In this session, we'll explore the information management policy architecture in detail and learn how to extend the expiration policy feature by writing custom document expiration formulas that calculate the expiration date based on data pulled from elsewhere in the SharePoint farm.

Speaker: John Holliday, MVP Office SharePoint Server

 

Technorati Tags: ,,

Currently rated 5.0 by 1 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Content Management | Jax Office Geeks | SharePoint Development

SharePoint Permission Dependency Chart

by John Holliday 6. September 2008 13:16

When it comes to content management in SharePoint, half the battle is figuring out the best angle of attack.  Why?  Well, because there are so many options and combinations of options that come into play when designing a solution.

Take the SharePoint permissions architecture, for example.  There are 33 different permission masks divided into 3 categories: personal, list and site permissions.  These are combined into role definitions (permission levels) which may be assigned to users and groups and then associated with sites, lists and list items.   Often, you need to create a custom role definition for a particular user or group.  When doing so, it is important to understand permission dependencies, because that will determine the effective permissions being granted.

With the exception of the "Open" permission, which grants the ability to open Web sites, lists and folders to access their contents, every SharePoint permission depends on one or more of the other permissions.  This means, for example, that if you grant the "Manage Alerts" site permission, you are also automatically granting the "Create Item Alerts", "View List Items", and "Open List Items" list permissions as well as the "View Site Pages" and "Open" site permissions.

If you're like me, with so much information to digest and process, and so little time to do it in, a simple diagram can go a long way towards sharpening your focus.  To that end, here is a little chart I created for my ECM401 course (all praise to the Visio gods!) that you may find useful.

SharePoint Permissions

Enjoy.

Currently rated 5.0 by 2 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Content Management | SharePoint Development

Announcing MOSS 2007 ECM Developer Training

by John Holliday 28. August 2008 01:02

Let's face it, SharePoint is a huge development platform no matter what angle you approach it from.   As most of you know, I've spent the past year or so traveling and teaching SharePoint developer courses for the Ted Pattison Group, and my focus has been pretty broad, covering topics ranging from features to content types to workflow and everything in between. 

Now, as the platform continues to mature and as developers become more and more familiar with the basics of SharePoint development, it is increasingly evident that more specialized training is needed, particularly in the area of Enterprise Content Management (ECM).  To that end, I'm pleased to announce the immediate availability of two new courses I've developed that are being offered through the Ted Pattison Group:

  • ECM401 - Enterprise Content Management with SharePoint Server 2007 (hands-on)
  • WC-ECM401 - Enterprise Content Management with SharePoint Server 2007 (online)

Both versions of the course are available for immediate registration.  The online version is a great option for those unable to attend the hands-on course.

  • The hands-on version includes 12 modules instead of 10 with a deeper treatment of content modeling and using workflow to drive ECM solutions.
  • The hands-on course is 4 full days with lectures, demos and labs.  The online version is 5 days with about 3 hours of lectures and demos each day plus labs assigned as homework.
  • The online version is conducted via Live Meeting and students may submit questions during the lecture which are answered at the end of each session.  Questions may also be submitted directly to the instructor via email or live chat.
  • Students attending the hands-on course receive a student workbook with slides and labs.  Online students receive the workbook in electronic format.

Feel free to contact me directly with any questions you may have about either version of the course.  For additional details and to review the course outline, please visit the Ted Pattison Group website using the following links.

Here is the upcoming course schedule, with links to the registration form.

Course Dates Location Availability
WC-ECM401 Sept 15-19,2008 Your Desk Register
ECM401 Oct 20-23, 2008 Reston, VA Register
Technorati Tags: ,,,

Currently rated 4.0 by 1 people

  • Currently 4/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Content Management | Records Management | SharePoint Development | SharePoint Training

Jacksonville Office Geeks, June 2008: Adding Custom Field Types and Content Types to your MOSS Installation

by John Holliday 13. June 2008 08:41

JOG SmallEver wished you could use a MOSS List as a mechanism for storing business data, but found yourself limited by the built-in WSS field types?  WSS 3.0 includes the ability to define your own custom field types.  Custom field types allow you to control the initialization, rendering and data validation behind your columns.  In this session, Dylan will walk you through creating and deploying custom field types and content types.





Meeting Details:

Technorati Tags: , , , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Jax Office Geeks | SharePoint Development

Dealing with Security in SharePoint Apps

by John Holliday 20. May 2008 23:12

[ via Reza Alirezaei ]

Fellow MVP Reza Alirezaei has written a great article that provides a systematic approach to securing SharePoint applications.  What I like about this article is that Reza includes a well-written section on how to apply Threat Model Analysis to determine the appropriate level of protection for a given application.  Then he proceeds to lay out the different tools and coding techniques we have at our disposal to deal with the threat.

This is such an important topic, I highly recommend reading this article and then add it to your offline collection to refer back to again and again.  You can read the full article here:

http://www.microsoft.com/technet/community/columns/secmvp/sv0408.mspx

 

Technorati Tags: ,,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SharePoint Development

SharePoint Developer Webcast Series

by John Holliday 20. May 2008 00:08

If you want to beef up your Sharepoint developer skills, then here is something you shouldn't miss.  A new 10-part series of Live Meeting Webcasts by Andrew Connell and Robert Bogue covering the fundamentals of SharePoint development.  They will be broadcast every Tuesday and Wednesday from May 20 to June 18 at 9:00AM PST. 

Here is the list of topics and registration links:

Date Topic Registration Link
May 20 Web Parts Register today!
May 21 Data Lists Register today!
May 27 Silverlight and SharePoint Register today!
May 28 Using Event Handlers Register today!
June 3 Page Branding Register today!
June 4 Workflow Register today!
June 10 Web Services Register today!
June 11 Page Navigation Register today!
June 17 User Management Register today!
June 18 Custom Content Types Register today!

 

Technorati Tags: ,,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SharePoint Development

Getting Ready for TechEd 2008

by John Holliday 18. May 2008 00:34

Well, we're just a couple weeks away from TechEd 2008.  This year, I'm giving four presentations - three breakout sessions and one TLC session, so it should be a lot of fun.  Here are the dates and times:

  • OFC10 - TLC 6/3/2008 3:00PM - 4:15PM
    Building Custom Routers for Records Management in Microsoft Office SharePoint Server 2007

    This talk discusses developer aspects of records management in Microsoft Office SharePoint Server 2007. Custom routers are an important extensibility point for records management and this talk details the requirements for these components. It provides a demo of building a custom router, including deploying it to a SharePoint Server environment.

  • OFC318 6/4/2008 8:30AM - 9:45AM
    XOML, XOML, Everywhere: Building Custom Workflow Editors for SharePoint

    XOML is the markup language behind Windows Workflow Foundation and is the same language used by Microsoft Office SharePoint Designer 2007 to attach declarative, no-code workflows to SharePoint lists and document libraries. This session takes a deep dive into Workflow Markup and explores how you can use it to generate custom workflows from any client application, including Office clients like Word and Excel. The session also shows how to attach custom workflow markup to SharePoint lists using the websvcWebPartPages Web service provided by Windows SharePoint Services.

  • OFC309 6/4/2008 4:30PM - 5:45PM
    Building Document Management Solutions Using SharePoint Content Types

    Windows SharePoint Services 3.0 introduces a new concept called "Content Types" that will dramatically alter the Enterprise Content Management landscape. On the surface, Content Types make it easier to encapsulate field definitions into a nice neat package, but there is a lot more going on under the covers. In this session, we take a deep dive into the world of content types and see how to declare them using XML and how to create them programmatically. Then we use content types to create a real-world document management solution with custom policies that we can use to control every stage of the document lifecycle. At the end of this session, you will have a thorough understanding of what content types are, with a deeper appreciation of the value they bring to document management solution development.

  • OFC404 6/5/2008 10:15AM - 11:30AM
    Turning SharePoint Data into Microsoft Office Documents: A Deep Dive into SharePoint Document Assembly Using Open XML

    Windows SharePoint Services 3.0 introduces a new concept called "Content Types" that will dramatically alter the Enterprise Content Management landscape. On the surface, Content Types make it easier to encapsulate field definitions into a nice neat package, but there is a lot more going on under the covers. In this session, we take a deep dive into the world of content types and see how to declare them using XML and how to create them programmatically. Then we use content types to create a real-world document management solution with custom policies that we can use to control every stage of the document lifecycle. At the end of this session, you will have a thorough understanding of what content types are, with a deeper appreciation of the value they bring to document management solution development.

See you in Orlando!

Technorati Tags: ,,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

Content Management | Office System | SharePoint Development | SharePoint Workflow

Great Article about SharePoint Timer Jobs on MSDN

by John Holliday 26. April 2008 03:37

SharePoint guru Andrew Connell does it again with a great MSDN article that shows you how to create custom timer jobs in WSS 3.0.  Timer jobs are a great way to schedule long-running or periodic tasks in such a way that they are automatically coordinated with the server farm topology and can therefore take advantage of load balancing or can be directed to specific servers that are running the services they require.   Read about it on the MSDN site at http://msdn2.microsoft.com/en-us/library/cc406686.aspx.

 

Technorati Tags: , , ,

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

SharePoint Development

SharePoint Reflection - Working with Content Types

by John Holliday 19. March 2008 13:39

For the past several months, I've been experimenting with ways to use .NET reflection with the SharePoint API.  As I've mentioned before, I believe that .NET attributes can not only make it easier to build great SharePoint applications, but can also provide a foundation for building better development tools.

In this series of posts about the evolving SharePoint Reflection Framework, I'll continue to share the results of my research and I'll include links to sample code directly within each post.  As the code matures, I'll consider making it available on CodePlex so that others may contribute.  For now, let's just treat it as a "thought experiment" as my friend Andrew Connell likes to call it.

The sample code and the framework assembly can be downloaded here:

http://www.johnholliday.net/downloads/JohnHolliday.SharePoint.ContentTypes.zip.

There is also a short screencast (27 minutes) that shows how to use the framework which you can view here:

 

Now let's take a closer look at how we can apply .NET attributes to simplify working with content types. 

Some have asked, and you might also be wondering "Why do we need this?   Why not just use CAML to declare the content types and then simply publish them using a feature?  Why go to all the trouble of using this non-traditional approach?"

Well, there's nothing wrong with the traditional CAML-based approach.  There is ample support for it and with a few simple tools, it's pretty straight-forward once you get the hang of it.  But there are a number of limitations with the "code + markup" paradigm when it comes to reusability and extensibility.  The markup is "brittle" in the sense that subtle mistakes are hard to find.  True, you can preload the schema to help you remember what attributes go where, but there is no true intellisense and no strong typing to prevent those mistakes.  If you want to extend an existing content type, you have to  visit multiple files and switch back and forth between your event handler code and the markup.  You have to spend a good deal of time making sure that the code matches the properties that have been defined in the markup.

The unfortunate reality is that working directly with XML still requires a significant paradigm shift in the way most developers think.  With all the buzz about improving the SharePoint "developer experience", I keep thinking there must be a better way.

So, there are several goals for this experiment:

  1. We want to make it easier to declare content types in code.
  2. We want to eliminate the need to work directly in CAML or XML.
  3. We want to use the same coding idioms we are used to when working with other code.
  4. We want to make it easier to write custom event receivers for our content types.
  5. We want to make it easier to associate sub-components like document templates and XML documents with our content types.
  6. We want to be able to build libraries of reusable components that can be leveraged across multiple projects easily.
  7. We want to enable DRM for content type components at the assembly level so that developers can protect their intellectual property.

 

The SharePoint Reflection Framework

For this experiment, we'll construct a content type for an expense report in C#.  But we also want to work with the expense report content type in the same way we might work with other C# classes.  For instance, we might want to create a library of reusable content type classes for use in financial solutions. 

To achieve this, we need to have a set of attributes that we can attach to a class to "declare" the content type and its properties.

We can start simply by deriving a ContentType class from System.Attribute.  To control where and how it is used, we can mark it so that it can only be applied to classes and only once per class.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]public class ContentType : Attribute{    public string Name { get; set; }    public string BaseType { get; set; }    public string Description { get; set; }    public string DocumentTemplate { get; set; }    public string Group { get; set; }    public bool Hidden { get; set; }    public bool Sealed { get; set; }    // ...}
Within this attribute class, we have properties that specify the various well-known components of a content type, such as its name, group, base type, etc.  These properties then show up as named properties of the attribute whenever it is applied to another class used to declare the content type itself.  For our expense report experiment, that class might look something like this:
namespace JohnHolliday.SharePoint.SampleContentTypes{    [ContentType(Name = "Expense Report",        BaseType = "Document",        Description = "A worksheet for recording expenses.",        Group = "SharePoint Reflection Framework Samples",        Hidden = false]    public class ExpenseReport    {    }}

Notice that we are basically specifying the same properties we would have to add to a <ContentType> element in CAML.  The difference is that here we get strong typing and intellisense support.  Notice also that we don't have to worry about constructing the content type identifier.  Instead, we just supply the base type and let the framework handle the details.

Next, within the content type declaration, we need to specify the fields that make up the type.  Here again, .Net reflection comes to our aid to make things easier.  What we really want is to declare the fields of the content type in the same way that we might declare properties for any C# class.  So, if we wanted to add a description field to the expense report content type, we would naturally want to do something like this:

[ContentType(Name = "Expense Report",    BaseType = "Document",    Description = "A worksheet for recording expenses.",    Group = "SharePoint Reflection Framework Samples",    Hidden = false]public class ExpenseReport{    private string m_description=string.Empty;    [FieldRef("Description")]    public string Description {        get { return m_description; }        set { m_description=value; }    }}

Here, we can simply make use of a second attribute included in the framework to markup the properties we want to map to SharePoint fields.  The FieldRef attribute is provided for this purpose.  The framework supplies the necessary code to examine the ExpenseReport class, locate the mapped properties, determine their field types and link them automatically to the content type on creation.  For instance, if we add a DateTime property to the ExpenseReport class, we want it to surface in SharePoint not as text, but as a date field.   Similarly, the other field types can be automatically determined from the underlying property type.

Enumerations

We can extend this idea further to include built-in support for CHOICE fields if an enumerated type is mapped to a field.  For example, we might need to declare a ProjectTypeEnum enumeration and then map it to a ProjectType property as shown below. 

public enum ProjectTypeEnum{    Consulting,    Training,    Programming,    Sales,}private ProjectTypeEnum m_projectType;[FieldRef("ProjectType", DisplayName = "Project Type", Required = true,    Description = "The project type for which expenses are being submitted.",    Group = "Sales")]public ProjectTypeEnum ProjectType{    get { return m_projectType; }    set { m_projectType = value; }}

 

In this case, the framework detects that the underlying data type of the property is an enumerated type and it then generates the appropriate choices automatically, as shown here.

Choice Fields

We can do a lot more with field references, but let's move on to the question of how to create the actual content type within the SharePoint environment.

Creating Instances

Typically, we'll be writing a FeatureActivated feature receiver or building a command-line utility, and we need to create a content type as part of the solution.  Ideally, we'd like to end up with an instance of SPContentType that we can work with.  So we really only need the framework to handle the dirty work of talking to the SharePoint API and then returning a properly constructed SPContentType object.  One way to implement this pattern is to provide a factory method on the ContentType attribute class that takes a reference to our implementation class and then gives us back an SPContentType object.  For the expense report content type, we might call it like this:

using (SPSite site = new SPSite("http://litwareinc.com")) {    using (SPWeb web = site.OpenWeb()) {        // Create the expense report content type.        SPContentType ctExpenseReport = ContentType.Create(web, typeof(ExpenseReport));        if (ctExpenseReport != null) {            // do something with it        }    }}

Note that the ExpenseReport class is completely independent of the SPContentType object it was used to create.  It can be implemented in a separate assembly.  Using this approach, we can easily build libraries of content types that can be reused across multiple solutions.  But there are still a couple of additional requirements we need to fulfill.  Namely, how do we handle item event receivers?  And what to do about the nested sub-components of a content type, such as document templates and XML documents?  These are critical requirements, because we want to apply the same coding paradigm we are used to for other C# classes.  We don't want to have to revert to using XML markup in order to specify event receivers and other elements.

Item Event Receivers

To specify event receivers for a content type in code, we need to add the appropriate entries to the EventReceivers collection of the SPContentType object.  When working with XML markup, this is done by creating a special XML document that specifies which event we want to capture and the assembly and class in which the event receiver method is implemented. 

To deal with event receivers in our ContentType attribute, we can take advantage of the fact that SharePoint provides an abstract class called SPItemEventReceiver that declares all of the event receiver methods.  By simply deriving our ExpenseReport class from SPItemEventReceiver, we get the correct method declarations in the base class and then we can selectively override the ones we want.  Instead of telling the framework explicitly which methods we are implementing as we would have to do with CAML, we can let the framework do the work for us and infer which methods have been implemented by examining the class via reflection.  So all we have to do to handle the ItemAdded event, for example, is add the derivation and override the ItemAdded method as shown in the following code.

 

[ContentType(Name = "Expense Report",    BaseType = "Document",    Description = "A worksheet for recording expenses.",    Group = "SharePoint Reflection Framework Samples",    Hidden = false)]public class ExpenseReport : SPItemEventReceiver{    // ...properties    public override void ItemAdded(SPItemEventProperties properties)    {        base.ItemAdded(properties);        string message = string.Format("Expense report added to list: {0}",              properties.ListTitle);        EventLog.WriteEntry("SharePoint Reflection", message);    }}

Still, no CAML.  We are working entirely within a C# class and we have captured all of the information needed to create the content type and to install an event receiver for the ItemAdded event.  The framework looks at the ExpenseReport class and sees that only one of the abstract classes was implemented, so it creates an event receiver for that method only.  It knows which assembly the class is declared in, so it automatically assigns the assembly and class names.  If we want to add an event receiver for another event, such as ItemUpdated, we can simply add another override and implement the method.  The framework automatically registers it for us.

Document Templates and XML Documents

The thing about document templates and other kinds of files that we might need to associate with a content type is that they are files.  Ideally, we'd like to work with them as files without having to jump through hoops just to get SharePoint to recognize them.  Fortunately, Visual Studio has a nice feature that lets us access and work with files easily from within our code.  These are embedded resources.  If we change the build action for any given file within our project to EmbeddedResource we can reference it using a path expression of the form <folder name>.<sub folder name>.<...>.<filename>.<extension>.  So if we have a project folder named "DocumentTemplates" and a file in that folder named "ExpenseReport.xlsx", and both are part of a project named "SampleContentTypes", we could refer to the resource using the path "SampleContentTypes.DocumentTemplates.ExpenseReport.xlsx".

By extending the ContentType attribute to recognize and locate embedded resources, we can easily add document templates and other resources directly to our class declaration without having to worry about how they actually get copied into SharePoint.  Here again, we can delegate that responsibility to the framework and just focus on the content type implementation.

For consistency and to distinguish document templates specified as embedded resources from those specified with legitimate urls, I've added a "res://" prefix which the framework recognizes.  It then treats the url as a reference to an embedded resource and copies the file into the proper location when the content type is created.  Since it already knows where the resource is located, we can drop the assembly name and just specify the assembly-relative path to the resource file.  We end up with a declaration that looks like this:

[ContentType(Name = "Expense Report",    BaseType = "Document",    Description = "A worksheet for recording expenses.",    Group = "SharePoint Reflection Framework Samples",    Hidden = false,    DocumentTemplate = "res://DocumentTemplates.ExpenseReport.xlsx")]public class ExpenseReport : SPItemEventReceiver{    //...}

Future Directions

As you can see, there is a lot of promise to this approach, but we've only begun to scratch the surface.  I'm currently working on one-way data binding of list items to properties in the implementation class whenever an event receiver method is called.  This would essentially let you reference the mapped properties just like other properties in your event receiver methods.  It would be one-way only because there might be times when you don't want those properties to get copied back into the list item automatically.  For that, you can always call into the SharePoint API.

There is a lot more we can do with content types as well as with other SharePoint objects that can really make our lives easier as SharePoint developers.  Give the code a spin and tell me what you think.  In the coming weeks, look for additional posts that will go into more capabilities of the framework. 

Stay tuned.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Tags:

CAML | Code Generation | SharePoint Development

Copyright © 2005-2008, John F. Holliday
This work is licensed under a Creative Commons License Powered by BlogEngine.NET 1.4.0.0

About Me

John Holliday

Independent author, consultant, trainer, and software developer specializing in enterprise content management, collaboration, workflow and business process automation. SharePoint training for developers and administrators

 

Recent comments

Comment RSS