Dev Team Assemble

Evil beware!
Add to Technorati Favorites

Archive

Category: Uncategorized

Here are some great resources on finding and determining the different versions of SharePoint available:

All available versions on SharePoint

Microsoft Office SharePoint Server 2007

Microsoft SharePoint 2010

Here is the information that I really needed on SharePoint 2007 (I feel like I am stealing it but all props to the author of the first link for putting it together....thank you):

THE INFORMATION BELOW IS TAKEN DIRECTLY FROM (WORD FOR WORD) : All available versions on SharePoint

Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0

For additional download information and detailed descriptions visit the Updates Resource Center for SharePoint Products and Technologies and Update Center for Microsoft Office, Office Servers, and Related Products.

Using SharePoint Central Administration Web site SharePoint HTML Site Settings admin pages will show the following version numbers:

Note: Microsoft has released a WSS 3.0 SP1 Developer evaluation virtual machine on the Microsoft download site.

12.0.0.6557    WSS 3.0 or MOSS 20071 SP2  + Apr 11 cumulative Update (KB2512783 + KB2512782)
12.0.0.6554    WSS 3.0 or MOSS 20071 SP2  + Feb 11 cumulative Update (KB2475886 + KB2475885)
12.0.0.6550    WSS 3.0 or MOSS 20071 SP2  + Dec 10 cumulative Update (KB2458606 + KB2458605)
12.0.0.6548    WSS 3.0 or MOSS 20071 SP2  + Oct 10 cumulative Update (KB2412268 + KB2412267)
12.0.0.6545    WSS 3.0 or MOSS 20071 SP2  + Aug 10 cumulative Update (KB2276474 + KB2276472)
12.0.0.6539    WSS 3.0 or MOSS 20071 SP2  + June 10 cumulative Update (KB983311 + KB983310)
12.0.0.6535    WSS 3.0 or MOSS 20071 SP2  + April 10 cumulative Update (KB981043 + KB981042)
12.0.0.6529    WSS 3.0 or MOSS 20071 SP2  + February 10 cumulative Update (KB978396 + KB978395)
12.0.0.6524    WSS 3.0 or MOSS 20071 SP2  + December 09 cumulative Update (KB977027 + KB977026)
12.0.0.6520    WSS 3.0 or MOSS 20071 SP2  + October 09 cumulative Update (KB974989 + KB974988)
12.0.0.6514    WSS 3.0 or MOSS 20071 SP2  + August 09 cumulative Update (KB973400 + KB973399)
12.0.0.6510    WSS 3.0 or MOSS 20071 SP2  + June 09 cumulative Update (KB971538 + KB971537)
12.0.0.6504    WSS 3.0 or MOSS 20071 SP2  + April 09 cumulative Update (KB968850 + KB968851)
12.0.0.6421    WSS 3.0 or MOSS 20071 SP2 (KB953338 + KB953334)
[Updated 1st Aug 09: SP2 download now includes the hotfix (KB971620) that corrects the activation issue more information on the Microsoft SharePoint team blog]

If you are running SP1 after 13/Jul/2010 then you are running an un-supported environment, see "Be aware of upcoming SP1 retirement for WSS V3 and MOSS 2007"
12.0.0.6341    WSS 3.0 or MOSS 20071 February 09 cumulative Update (KB961755 + KB961756)
12.0.0.6335    WSS 3.0 or MOSS 20071 December 08 cumulative Update (KB960010 + KB960011)
12.0.0.6331    WSS 3.0 or MOSS 20071 October 08 cumulative Update (KB957691 + KB957693,KB958567 and KB958569)
12.0.0.6327    WSS 3.0 or MOSS 20071 August 08 cumulative update (KB956056 & KB956057)
12.0.0.6318    WSS 3.0 or MOSS 20071 Infrastructure Update (KB951695 & KB951297)
12.0.0.6303    WSS 3.0 or MOSS 20071 post-SP1 hotfix (KB948945)
12.0.0.6301    WSS 3.0 or MOSS 20071 post-SP1 hotfix (KB941274)
12.0.0.6300    WSS 3.0 or MOSS 20071 post-SP1 hotfix (KB941422)

12.0.0.6219    WSS 3.0 or MOSS 20071 SP1
12.0.0.6039 WSS 3.0 or MOSS 20071 October public update
12.0.0.6036    WSS 3.0 or MOSS 20071 August 24, 07 hotfix package
12.0.0.4518    WSS 3.0 or MOSS 20071 RTM
12.0.0.4407    WSS 3.0 or MOSS 20071 Beta 2 TR
12.0.0.4017    WSS 3.0 or MOSS 20071 Beta 2
12.0.0.3111    Office 12 (PDC image - pre-beta) - This version of Office does not have a support link in the Add/Remove programs dialog box.

1To confirm that a particular service pack/hotfix is install on SharePoint Server you must either check the version numbers of specific dlls as specified in the related Microsoft Knowledge Based article or:

  • On Server 2003, select the Show Updates check box in Add and Remove Programs.
  • On Server 2008, select View installed updates on the Control Panel/Programs and Features page

Version numbers of SharePoint Server 2007 can also be found:

  • Server 2003, go to Control Panel -> Add and Remove Programs
    Select the product and then click: Click here for support.
  • Server 2008, go to Control Panel -> Program and Features
    If the Version column is not visible, click Views -> Choose Details, and select Version, click OK.

The versions will be displayed as follows:

Windows SharePoint Services 3.0 Microsoft Office SharePoint Server 2007
SP2 12.0.6425.1000
post-SP1 hotfix ( KB948945 ) 12.0.6303.5000 12.0.6303.5000
SP1 12.0.6219.1000 12.0.6219.1000
RTM 12.0.4518.1016 12.0.4518.1016
Beta 2 TR 12.0.4407.1005 12.0.4407.1005
Beta 2 12.0.4017.1006 12.0.4017.1006

Up arrow Back to the top

- OLD SCHOOL ALERT -

I was setting up Visual Studio 2005 and Web Service Extensions 3.0. My problem was getting the WSE 3.0 Settings to appear on the context menu of the project. Turns out when you install it you need to select the Visual Studio Tools option in the installer.

Here is something I always forget....when a page fails to load because of a web part that has gone awry you can enter the maintenance mode by adding the ?contents=1 to the end of the address.

Simple...just the way I like it!

Technorati Tags:

Yesterday started with a hangover...for me.  On Sunday there was a SharePint event at the Eye Candy bar in the middle of Mandalay Bay and I was one of the  unfortunate souls whohappened to have drank too much :|   The Keynotes were pretty cool...nothing overly stand out there was a lot of talk about the new product and moving forward and a couple of demos that probably were a little too long.  Truth be told my butt hurt from sitting through almost 3 hours of Keynotes so I was happy when it was done.

In the afternoon the actual session began.  for me it was the Whats New For Developer Overview, Visual Studio 2010 Tools Overview and Web Content Management in SharePoint 2010.  We covered a lot of ground in the first two and and they were very much an overview of all the features available.  Things like running SP on the desktop client (x64 win7 or vista), visual studio 2010 build, debug, deploy, the developer dashboard, Linq to SharePoint (YES), the ribbon and sandboxed solutions.

The final session (the web content management one) was a bit of a disappointment.  It was a level 300 session and seemed like they dumbed it down for beginners, i mean they were teaching us how to make web pages via the UI.   There was some interesting stuff in the presentation but at no point did they really dive in and demo things like the variation model improvements or content deployment fixes they have made.  It was just alluded to.

Either way it was a pretty good day...met some great people from all over the world so far and I hope that continues.

Technorati Tags: , ,

Sometimes when I am working with SharePoint I really feel like I got it.  You now that feeling you get when you know exactly what you are doing and have no problems implementing it...then there are times when I really just want to smash something.  And it really doesn't matter what...it could be anything!  This is the feeling I got in the last couple of days working with custom field types in SharePoint.

It seems there are lots of blogs and articles out there talking about how to do it, but from what I could see (and to be fair I did not read them all so if you know of some good posts that would be great) it felt like most of the time I was only getting half the story.  I just finished putting together a very basic Custom Field Type that will display a multi line textbox in edit/new mode and simply display the value in a literal control in display mode.  In the grand scheme of things I am building a base XML Field Type to use for a series of additional Custom field types so essentially I want to store a string (yes I could use the XmlDocument)...but alas thats a story for another day.

So a bit of a primer, or rehash so I don't forget, when developing custom field types there are many pieces to it....not all of them required.  Here is a list of the items and what they do:

  • Field Type class - this class acts as the controller and hooks the rendering control, field type xml definition and the value class together.  It also provides validation at the field level via the GetValidatedString() method of the SPField object
  • Field Control class - this is the rendering engine and gives you the power to display your control in any manner you wish as well as perform validation on the data being saved via the UI.
  • Field Value class - allows for custom logic to be put around mutiple column fields and different data structures that will be storing data for your field type.
  • .ascx file in CONTROLTEMPLATES directory - this supplies rendering markup via a user control and hooks into the field control class
  • fldtypes_* - this file that gets installed into the 12/TEMPLATES/XML directory and contains the information that SharePoint requires in order to load your field type into the system.  Such as the assembly to use, the parent type and other information.  This is required if the type is going to be applied to content types and become a field on a list.

So for my requirements I only needed the field type, the field control and the fldtypes_xxx.xml file.  Lets look at the field type class I built

public class XmlFieldType : SPField
   {
        public XmlFieldType(SPFieldCollection fields, string fieldName) : base(fields, fieldName) { }
        public XmlFieldType(SPFieldCollection fields, string fieldName, string displayName) : base(fields, fieldName, displayName) { }
 
        public override BaseFieldControl FieldRenderingControl
        {
            get
            {
                BaseFieldControl fldControl = new XmlFieldControl();
                fldControl.FieldName = InternalName;
                return fldControl;
            }
        }
 
        public override object GetFieldValue(string value)
        {
            if (string.IsNullOrEmpty(value))
                return null;
            return value;
        }
 
        public override Type FieldValueType
        {
            get { return typeof(string); }
        }
 
        public override string DefaultValue
        {
            get
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(this.SchemaXml);
                XmlNode nodeInFieldSchema = doc.SelectSingleNode("Field/Default");
                if (nodeInFieldSchema != null)
                    return nodeInFieldSchema.InnerXml;
                return null;
            }
            set { base.DefaultValue = value; }
        }
 
        public override string GetValidatedString(object value)
        {
            base.GetValidatedString(value);
            if (value == null)
            {
                if (this.Required) throw new SPFieldValidationException("Invalid value for required field.");
                return string.Empty;
            }
            else
            {
                return value.ToString();
            }
        }
}

Lets review

  • The two constructors are required...don't even bother
  • FieldRenderingControl() method tells the field type which control to use
  • GetFieldValue() method returns the value of the field....if we were using a custom type you would cast that to the appropriate type here
  • FieldValueType() - get the type of the Value class
  • DefautValue() - this gets the default value from the field if one is defined
  • GetValidatedString() - perform field level validation

The Field Control Class is fairly simple as well:

public class XmlFieldControl : BaseFieldControl
{
        protected Literal _values;
        protected TextBox _editor;
 
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            EnsureChildControls();
        }
 
        protected override void CreateChildControls()
        {
 
            if (this.Field == null || this.ControlMode == SPControlMode.Invalid)
                return;
 
            Controls.Clear();
            base.CreateChildControls();
            _editor = new TextBox();
            _editor.TextMode = TextBoxMode.MultiLine;
            _editor.Height = new Unit(300);
            _editor.Width = new Unit(500);
            Controls.Add(_editor);
 
            if (ControlMode == SPControlMode.Display)
            {
                _values = new Literal();
                _values.Text = Convert.ToString(ItemFieldValue);
                Controls.Add(_values);
            }
        }
 
        protected override void Render(HtmlTextWriter output)
        {
 
            EnsureChildControls();
            if (ControlMode == SPControlMode.Display)
            {
                if (_values != null)
                    _values.RenderControl(output);
            }
            else
            {
                if (_editor != null)
                    _editor.RenderControl(output);
            }
        }
 
        public virtual string Text
        {
            get
            {
                this.EnsureChildControls();
                if (this._editor == null)
                {
                    return null;
                }
                return this._editor.Text;
            }
 
            set
            {
                this.EnsureChildControls();
                if (this._editor != null)
                {
                    this._editor.Text = value;
                }
            }
        }
 
        public override object Value
        {
            get
            { return this.Text; }
            set
            {
                if (base.Field != null)
                {
                    this.Text = base.Field.GetFieldValueForEdit(value);
                    base.Value = (string)value;
                    base.UpdateFieldValueInItem();
                }
            }
        }
    }

Lets take a look at what this class is doing:

  • OnInit() - come on, do I have to explain?
  • CreateChildControls() - initialize your controls and add to the Controls collection
  • Render() - writes the controls to the HtmlTextWriter
  • Text - This sets/gets the value in the controls
  • Value - this sets the value in the Text property and notice the base.UpdateFieldValueInItem(); statement...this oushes the value from Value to ItemFieldValue and allows you to access this value in display mode because Value returns null (which i did not find the documentation on M$ thank you very much).

So that leaves the last piece of the pie for my simple implementation the fldtypes file:

<FieldTypes>
<FieldType>
<Field Name="TypeName">XmlFieldType</Field>
<Field Name="ParentType"></Field>
<Field Name="InternalType">Note</Field>
<Field Name="SQLType">ntext</Field>
<Field Name="TypeDisplayName">Xml Field</Field>
<Field Name="TypeShortDescription">Xml controls</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="ShowOnListCreate">TRUE</Field>
<Field Name="Sortable">FALSE</Field>
<Field Name="AllowBaseTypeRendering">FALSE</Field>
<Field Name="Filterable">FALSE</Field>
<Field Name="FieldTypeClass">Website.CustomFields.XmlFieldType, Website.CustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=346fcdd567259ee6</Field>
<RenderPattern Name="HeaderPattern">
<Property Select="DisplayName" HTMLEncode="TRUE"/>
</RenderPattern>
<RenderPattern Name="DisplayPattern">
<Column/>
</RenderPattern>
</FieldType>
</FieldTypes>

So there you have it.  All I need to do in order to inherit from this is to remove the rendering (which i dont need anyway  as this is going to be a base type) and it should be good to go.  Those three pieces of code can be installed into your SharePoint environment and should help you get started to understanding custom field types.

Don't forget to add the SafeControl entry, Adjust your trust level and move the .dll into your bin folder as well.

Download the code here

Resources I found useful:

  • I did work through the example in Andrew Connell's book (Professional SP 2007 WCM development) and that worked fine and he actually does a great job of explaining most of whats going on here.
  • MSDN...where else
  • Charlie Holland has a pretty good article series on this stuff but unfortunately I couldn't get it working.  I also wanted a simple bare bones implementation.
Sometimes when I am working with SharePoint I really feel like I got it.  You now that feeling you get when you know exactly what you are doing and have no problems implementing it...then there are times when I really just want to smash something.  And it really doesn't matter what...it could be anything!  This is the feeling I got in the last couple of days working with custom field types in SharePoint.  It seems there are lots of blogs and articles out there talking about how to do it, but from what I could see (and to be fair I did not read them all so if you know of some good posts that would be great) it felt like most of the time I was only getting half the story.  I just finished putting together a very basic Custom Field Type that will display a multiline textbox in edit/new mode and simply display the value in a literal control in display mode.  In the grand scheme of things I am building a base XML Field Type to use for a series of additional Custom field types so essentially I want to store a string (yes I could use the XmlDocument)...but alas thats a story for another day.

So a bit of a primer, or rehash so I don't forget, when developing custom field types there are many pieces to it....not all of them required.  Here is a lit of the items and what they do:

* Field Type class - this class acts as the controller and hooks the rendering control, field type xml definition and the value class together.  It also provides validation at the field level via the GetValidatedString() method of the SPField object
* Field Control class - this is the rendering engine and gives you the power to display your control in any manner you wish as well as perform validation on the data being saved via the UI.
* Field Value class - allows for custom logic to be put around mutiple column fields and different data structures that will be storing data for your field type.
* .ascx file in CONTROLTEMPALTES directory - this supplies rendering markup via a usercontrol and hooks into the field control class
* fldtypes_* - this file that gets installed into the 12/TEMPLATES/XML directory and contrains the information that SharePoint requires in order to load your field type into the system.  Such as the assembly to use, the parent type and other information.  This is required if the type is going to be applied to content types and become a field on a list.

So for my requirements I only needed the field type, the field control and the fldtypes_xxx.xml file.  Lets look at the field type class I built

public class XmlFieldType : SPField
{
public XmlFieldType(SPFieldCollection fields, string fieldName) : base(fields, fieldName) { }
public XmlFieldType(SPFieldCollection fields, string fieldName, string displayName) : base(fields, fieldName, displayName) { }
 
public override BaseFieldControl FieldRenderingControl
{
get
{
BaseFieldControl fldControl = new XmlFieldControl();
fldControl.FieldName = InternalName;
return fldControl;
}
}
 
public override object GetFieldValue(string value)
{
if (string.IsNullOrEmpty(value))
return null;
return value;
}
 
public override Type FieldValueType
{
get { return typeof(string); }
}
 
public override string DefaultValue
{
get
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(this.SchemaXml);
XmlNode nodeInFieldSchema = doc.SelectSingleNode("Field/Default");
if (nodeInFieldSchema != null)
return nodeInFieldSchema.InnerXml;
return null;
}
set { base.DefaultValue = value; }
}
 
public override string GetValidatedString(object value)
{
base.GetValidatedString(value);
if (value == null)
{
if (this.Required) throw new SPFieldValidationException("Invalid value for required field.");
return string.Empty;
}
else
{
return value.ToString();
}
}
}

Lets review

* The two constructors are required
* FieldRenderingControl() method tells the field type which control to use
* GetFieldValue() method returns the value of the field....if we were using a custom type you would cast that to the appropriate type here
* FieldValueType() - get the type of the Value class
* DefautValue() - this gets the default value from the field if one is defined
* GetValidatedString() - perform field level validation

The Field Control Class is fairly simple as well:

public class XmlFieldControl : BaseFieldControl
{
protected Literal _values;
protected TextBox _editor;
 
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
EnsureChildControls();
}
 
protected override void CreateChildControls()
{
 
if (this.Field == null || this.ControlMode == SPControlMode.Invalid)
return;
 
Controls.Clear();
base.CreateChildControls();
_editor = new TextBox();
_editor.TextMode = TextBoxMode.MultiLine;
_editor.Height = new Unit(300);
_editor.Width = new Unit(500);
Controls.Add(_editor);
 
if (ControlMode == SPControlMode.Display)
{
_values = new Literal();
_values.Text = Convert.ToString(ItemFieldValue);
Controls.Add(_values);
}
}
 
protected override void Render(HtmlTextWriter output)
{
 
EnsureChildControls();
if (ControlMode == SPControlMode.Display)
{
if (_values != null)
_values.RenderControl(output);
}
else
{
if (_editor != null)
_editor.RenderControl(output);
}
}
 
public virtual string Text
{
get
{
this.EnsureChildControls();
if (this._editor == null)
{
return null;
}
return this._editor.Text;
}
 
set
{
this.EnsureChildControls();
if (this._editor != null)
{
this._editor.Text = value;
}
}
}
 
public override object Value
{
get
{ return this.Text; }
set
{
if (base.Field != null)
{
this.Text = base.Field.GetFieldValueForEdit(value);
base.Value = (string)value;
base.UpdateFieldValueInItem();
}
}
}
}

sdfsdf

    XmlFieldType
 
    Note
    ntext
    Xml Field
    Xml controls
    TRUE
    TRUE
    FALSE
    FALSE
    FALSE
    Website.CustomFields.XmlFieldType, Website.CustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=346fcdd567259ee6

I did work through the example in Andrew Connell's book (Professional SP 2007 WCM development) and that worked fine and he actually does a great job of explaining most of whats going on here.

http://msdn.microsoft.com/en-us/library/ms446361.aspx

Technorati Tags: , , , ,