Dev Team Assemble

Evil beware!
Add to Technorati Favorites

Archive

Category: SharePoint 2007

I was trying to install install SharePoint 2007 onto Windows 2008 r2 and was getting a strange error referencing KB article 962935. Funny enough this article is not live yet so it left me a little unhappy. Apprarently Microsoft does not support the distributed SP1 installation package of SharePoint for this version of the OS. Turns out Jei Li posting on his msdn blog detailing how to go about creating a slipstreamed installation for SP2 on this server Click here for the article. Basically the steps are (pretty much word for word from Jei Li's blog):

  • Install .Net Framework 3.5 SP1 in the features applet
  • Copy the installtion media contents to a folder on the computer (c:\install)
  • Download the WSS x64 SP package and the MOSS 2007 SP2 x64
  • Delete everything inside Updates folder in the install folder you setup.
  • Open a command prompt,  change directory to the folder you put the downloaded patches, and run the following two commands: 
    • wssv3sp2-kb953338-x64-fullfile-en-us.exe /extract:[Path to installation bits]\Updates /quiet
    • officeserver2007sp2-kb953334-x64-fullfile-en-us.exe /extract: [Path to installation bits]\Updates /quiet
  • Delete the wsssetup.dll filein the updates dir. This is a very important step so please don’t miss it.
  • If you also need the Cumulative Updates to be applied when install SharePoint, download the latest Windows SharePoint Services 3.0 and SharePoint Server 2007 Cumulative Update packages and extract them into Updates folder like step 4.
  • Your slipstream build of SharePoint Server 2007 is done!
  • Go and install it on your Windows Server 2008 R2 box, after the installation, the site version will show 12.0.0.6421 or possibly a higher version.

Please reference Jei Li's post for furthur instuctions.  I only posted all the steps here because things have a mysterious way of dissappearing or not appearing at all on Microsofts site.

After doing all of this everything seems to be fine...seems to be :)  

Links

Technorati Tags: , , , , ,

One of the things I was working on today was trying to get an actual image from the library was that initially I was expecting to get a PublishingImage.  All the samples on MSDN and the ones strewn about the web refer to using the ImageFieldValue and getting it from a field in the SPListItem.  Like outlined on MSDN :

  // Retrieve the current value from an SPListItem with a
  // column of the ImageField type with the name imageFieldName
  ImageFieldValue currentFieldValue =
        listItemWithImageField[imageFieldName] as ImageFieldValue;

The problem is this only works for images that are in a list, like the PublishingRollupImage of a page that links to an image in the Site Collection Images library.  The actual images in the library are stored as documents (Referenced using SPFile) so in order utilize them I need to extract the information out and create an image tag for it...like so:

 
     ImageFieldValue imageValue = new ImageFieldValue(
          string.Format("<img src=\"{0}\" alt=\"{1}\" />",
          file.Url, file.Title == null ? string.Empty : file.Title));
 

Now that I had the ImageFieldValue it was easy to work with. I could manipulate many aspects of the image using this object and then save it for rendering using ToString(). Funny thing is for my purposes (ImageGallery xml generation) I didn't even end up needing this code after all...frustrating but a good learning experience.

Props to Phanat Chan as he did the initial development on this.

Technorati Tags: , ,

So I got this error the other day when putting together a dev site collection usign varations:

An error was encountered performing this operation. You may re-try the operation, and you may need to clean up the half-created data first before re-trying. If the problem persists, please contact your system administrator

This was actually a fairly easy fix for me.  I simply had to enable the publishing features in my site.  Which is funny...because they should have been on but I must have overlooked that.  :)

Technorati Tags: , , , ,

Day three was a lot of fun as I got to spend three hours in the labs and ran through some pretty cool stuff.  Linq to Sharepoint, Upgrading sites, REST API etc.

As far as the sessions went I was hoping the MultiLingual sites session was going to make me happy with some great news about variations.  Instead it seems to be status quo on that system with MS playing the line that you need to plan ahead for this...makes sense but not always possible.  The multi language user interface or MUI for all the chrome is available in every site now and you can switch languages off the site actions bar.

MindSharp had an awesome evangelistical session in the big room on Developiong with REST and LINQ in Sharepoint 2010.  This was another really great session on developing against the new Client Object Model, the Server OM, the ListData.svc REST service.

All in all it was another good day...If I didn't have to spend thenight doing homework it actually would haev been mouch more fun :|

Technorati Tags: , ,

The second day of the conference was great and a couple of sessions really stood out above the others in my mind....there was a great session in the morning on web part development and some of the new things coming up in that.  AJAX is baked into SP now which is great but there is also a bit of a learning curve surrounding XSS and making sure we understand cross-site scripting and how SharePoint really cracks down on this.

There was an amazing session on SharePoints new COM or client object model that exposes all sharepoint objects to the client (.NET CLR, silverlight and javascript).  Essentially we will be able to a LOT more work on the client side which makes me feel warm inside.

I finally got to play around with SharePoint 2010 in the labs which was great.  I was dying to get a feel for the product because it feels weird listening to all these sessions without actually having your hands on it.  I definitely will be spending more time in the labs.

The Huey Lewis and the News Beach Party was a lot of fun but I left there feeling a little...drunk for lack of a better word.  Good times in vegas...

Technorati Tags: , ,

I came across this problem recently. Its a little strange and only happened once I changed my base webpart class to inherit from Microsoft.SharePoint.WebPartPages.WebPart. There seems to be two fixes for this problem that I implemented:

  • remove the XMlNamespace from class declaration
  • Use a .dwp file instead of a .webpart file in your feature folder

Technorati Tags: , ,

For the last little bit I have been working on learning how to package up all site infrastructure into a single feature.  All of this is pretty straight forward and I didn't really have any issues.....UNTIL  I tried to get lookup columns working.

Using CAML

I did some reading on the subject and apparently you can do all of this using CAML alone.  I came across a post from Josh Gaffery supporting this claim, but I simply could not get this working...so i gave up after spinning my wheels on it for longer than I wanted to.  Josh's approach is to use the list URL as opposed to the GUID that links the column to the source list and he has put up an update explaining it further.  Nonetheless....didn't work for me.

Using Feature Receiver

I knew that at this point I would have to take the feature reciever approach and modify the fields in place or create them.  I found two sources that both take different approachs to this problem.

  • Chris O'Brien has put together the a project on CodePlex that will create the lookup columns at activation time.  This actully sounds like a pretty good approach but unfortunately it didn't work for me.  I dont know if there is something wrong with my environment but I encountered a few errors doing this...things like the fields not rendering on the page layouts and getting the "The local device name is already in use. (Exception from HRESULT: 0x80070055)" error.
  • Waldek Mastykarz has a great post on creating the columns via code here.

Basically I took a hybrid approach to doing this by mixing the two approaches mentioned above.  I created a custom XML file that I deploy into the layouts directory and then use a feature reciever to read the xml content and create lookup columns based on this.  I also added a deactiving event to remove the fields when the feature is deactivated.  Heres the feature reciever code:

public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            using (SPSite site = properties.Feature.Parent as SPSite)
            {
                string contentTypes = null;
                string listName = null;
                string fieldName = null;
                string groupName = null;
                string staticName = null;
                string lookupFieldName = "Title";
                bool mult = false;
                bool required = false;
                string filePath = properties.Feature.Properties[
                   "ColumnDefinitionPath"].Value;
 
                XmlTextReader xReader = new XmlTextReader(
                  HttpContext.Current.Server.MapPath(@"~\_layouts\" + filePath));
                while (xReader.Read())
                {
                    if (xReader.LocalName == "Field")
                    {
                        #region Get values from attributes
                        if (xReader.MoveToAttribute("List"))
                        {
                            listName = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("Name"))
                        {
                            fieldName = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("StaticName"))
                        {
                            staticName = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("Group"))
                        {
                            groupName = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("LookUpField"))
                        {
                            lookupFieldName = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("ExistInContentTypes"))
                        {
                            contentTypes = xReader.Value;
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("Mult"))
                        {
                            bool.TryParse(xReader.Value, out mult);
                            xReader.MoveToElement();
                        }
                        if (xReader.MoveToAttribute("Required"))
                        {
                            bool.TryParse(xReader.Value, out required);
                            xReader.MoveToElement();
                        }
 
                        #endregion
 
                        SPFieldLookup lookup = CreateLookupField(
                          fieldName, groupName, required, mult, site.RootWeb,
                          site.RootWeb.Lists[listName], lookupFieldName, staticName);
                        if (contentTypes != null)
                            foreach (string s in contentTypes.Split(','))
                            {
                                LinkFieldToContentType(s.Trim(), (SPField)lookup);
                            }
                    }
                }
 
                xReader.Close();
 
            }
        }
 
        public static SPFieldLookup CreateLookupField(
          string fieldName, string group, bool required, bool allowMultipleValues,
          SPWeb w, SPList lookupList, string lookupField, string staticName)
        {
            w.Fields.AddLookup(fieldName, lookupList.ID,
               lookupList.ParentWeb.ID, required);
            SPFieldLookup lookup = (SPFieldLookup)w.Fields[fieldName];
            lookup.AllowMultipleValues = allowMultipleValues;
            lookup.LookupField = lookupField;
            lookup.StaticName = staticName;
            lookup.Group = group;
            lookup.Update(true);
            return lookup;
        }
 
        public static void LinkFieldToContentType(string contentType, SPField field)
        {
            using (SPSite site = SPContext.Current.Web.Site as SPSite)
            {
                SPContentType ct = site.RootWeb.ContentTypes[contentType];
                ct.FieldLinks.Add(new SPFieldLink(field));
                ct.Update(true); // will update children
            }
        }

As you can read from the above code the xml file would need to have a node like below for each lookup column:

 
<Field
         Type="Lookup"
         List="Access Type"
         Name="AccessTypeColumn"
         StaticName="Access_x0020_Type"
         Group="Infrastructure"
         ExistInContentTypes="THIS IS A COMMA DELIMITED LIST OF CONTENT NAMES"
         LookUpField="Title"
         Mult="TRUE"
         Required="FALSE"
        />
 

The Final Project

So here are all the pieces of my infrastructure project. Notice the placement of the lookupfields xml file...this is because the layouts directory is setup as a virtual directory for every sharepoint site and we can read files from there without a permissions problem.

12/TEMPLATES/FEATURES/myfeature/lists.xml this contains the source lists for the lookup fields
12/TEMPLATES/FEATURES/myfeature/contenttypes.xml this contains the content type definitions MINUS the lookup fields
12/TEMPLATES/FEATURES/myfeature/sitecolumns.xml this contains all the other fields included in the content types
12/TEMPLATES/FEATURES/myfeature/feature.xml the feature def
12/TEMPLATES/LAYOUTS/myfeature/lookupfields.xml this contains all the lookup fields that need to be provisioned

Hopefully this helps anyone who's been having problems getting this going. And a big thanks to Waldek, Chris and Josh for their posts.

Technorati Tags: , , , ,

I started getting this error recently on my development box after I started using WSP Builder.  I really like this program but I was a little put off by this error.  Obvisouly it is recycling  the worker process or something along those lines (too lazy to look it up).  I am fine with it when it comes back online after a few seconds but I was having instances where it was hanging there...stuck in 503 limbo. 

Turns out the problem is the application pool is stuck in a stopped state and the fix is simply enough to restart it.

Technorati Tags: , , ,

While working on my sharepoint development machine today I was mucking about with variations and doing a proof of concept.  Now I know they worked before but for some reason when I created a new page in the source site they were not being propagated through to the variation label sites.  In Centeral Admin under the Timer Status I found that the Variations Propagate Page Job Definition and the Variations Propagate Site Job Definition were both stuck at 0% and Initialized, see below:

variations

Seeing this, I now knew that the Timer service was not creating my variation pages and sites so a quick check under the windows services control panel applet  revealed that the Windows SharePoint Services Timer Service had been shut off.  Turning this back fixed my problem.

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:

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

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: , , , ,