Part 3 : Multiple Attachment Custom Control - XML File Creation

Now,we are going to talk about the xml file that defines our control , this xml defines the dll that will be loaded when we create an instance of our control , which means when we create a new column with our field type , and also this xml file defines all the additional options we want the user to set when creating this new column , such as additional lists or document libraries needed to continue our control logic.

In our control we need to define some external fields to be set by the user and they are :

1. The Images Document library Text box at which the Multiple attachment control will upload its file in, it will be entered by the user.
2. The Videos and Pdfs document libraries text boxes to define them also.
3. For each List we will also want to define the maximum number of uploads we want the user to enter at each item, so we need to define 3 number fields will be managed by the users also , for ex; if he set the max number of image uploads to 3 , after that he wont be able to upload any other image file to the document library he had set.
The following is the Xml file we have used to define the previous fields and the control we will add.
<?xml version="1.0" encoding="utf-8" ?>
<FieldTypes>
// defining the File Uploader Control
// The TypeName is the name of the Class representing the file uploder.
// The ParentType will be Text which means that we will react with the control as Text field (SpFieldText).
<FieldType>
<Field Name="TypeName">FileUploader</Field>
<Field Name="ParentType">Text</Field>
<Field Name="TypeDisplayName">Multiple File Uploader</Field>
<Field Name="TypeShortDescription">Multiple File Uploader</Field>
<Field Name="UserCreatable">TRUE</Field>
<Field Name="FieldTypeClass">SpCustomFields.FileUploader,SpCustomFields, Version=1.0.0.0, Culture=neutral, PublicKeyToken=1a277eba047c831e</Field>
<PropertySchema>
<Fields>
<Field Name="ImagesList"
DisplayName="Images List Name"
Required="TRUE"
MaxLength="30"
DisplaySize="30"
Type="Text">
<Default></Default>
</Field>
<Field Name="ImagesMaximumLength"
DisplayName="No. of Image files"
Required="TRUE"
MaxLength="2"
DisplaySize="4"
Type="Number">
<Default></Default>
</Field>
<Field Name="VideosList"
Required="TRUE"
DisplaySize="30"
MaxLength="30"
DisplayName="Videos List Name"
Type="Text">
<Default></Default>
</Field>
<Field Name="VideosMaximumLength"
DisplayName="(Max)no. of Video files"
Required="TRUE"
MaxLength="2"
DisplaySize="4"
Type="Number">
<Default></Default>
</Field>
<Field Name="PdfsList"
DisplaySize="30"
MaxLength="30"
Required="TRUE"
DisplayName="Pdfs List Name"
Type="Text">
<Default></Default>
</Field>
<Field Name="PdfsMaximumLength"
DisplayName="(Max)no. of Pdf files"
MaxLength="2"
DisplaySize="4"
Required="TRUE"
Type="Number">
<Default></Default>
</Field>
</Fields>
</PropertySchema>
</FieldType>
</FieldTypes>
// The following link contains all the field types you may need to use :
in the coming post you will have the code (asp.net) that will handle the classes of the multiple file uploader we are going to make...
note: to deploy this file , just copy and paste it in the following directory:
system root:\\program files\common files\microsoft shared\web server extensions\12 \templates\Xml