Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm adding some custom forms to a list instance by using the <AllUsersWebPart> element in the list schema. It basically configures a WebPart.

My question is, what are all the possible tags I can use in there. What's in the http://schemas.microsoft.com/WebPart/v2 namespace?

There are also variations of this, like http://schemas.microsoft.com/WebPart/v2/ListForm.

Where can I find a reference?

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

I think it's allways an XML-serialized webpart or something very similar. Look for ListFormWebpart class definition from MSDN:

[DesignerAttribute(typeof(SPControlDesigner))] 
[XmlRootAttribute(Namespace="http://schemas.microsoft.com/WebPart/v2/ListForm")] 
[SupportsAttributeMarkupAttribute(false)] 
[AspNetHostingPermissionAttribute(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] 
[SharePointPermissionAttribute(SecurityAction.LinkDemand, ObjectModel=true)] 
public sealed class ListFormWebPart : WebPart, IDesignTimeHtmlProvider, IDesignerEventAccessor

Note the namespace. So I think it may be any of webparts in Microsoft.SharePoint.WebPartPages at least (in XML-serialized form). And look at example:

<AllUsersWebPart WebPartZoneID="Right" WebPartOrder="1">
         <![CDATA[
            <WebPart xmlns="http://schemas.microsoft.com/WebPart/v2" xmlns:iwp="http://schemas.microsoft.com/WebPart/v2/Image">
               <Assembly>Microsoft.SharePoint, Version=11.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c</Assembly>
               <TypeName>Microsoft.SharePoint.WebPartPages.ImageWebPart</TypeName>
               <FrameType>None</FrameType>
               <Title>Site Image</Title>
               <iwp:ImageLink>/_layouts/images/homepage.gif</iwp:ImageLink>
            </WebPart>
          ]]>
      </AllUsersWebPart>

Note "CDATA" - it means that there's no any XML scheme or other way to view a list of all available elements inside AllUsersWebPart tag because there's no such explicit restriction.

share|improve this answer
    
I figured as much, but something checks for the XML validity (even if inside CDATA). So It must be a schema or some rules somewhere. I can't imagine it just tries to deserialize the XML as a webpart and hope it sticks... –  JohnDoDo Feb 10 '12 at 12:46
    
Please examine for example SPSolutionExplorer.GetFilesInFolderTree method. For example, note this line: limitedWebPartManager.ExportWebPart(webPart, (XmlWriter) new XmlTextWriter((TextWriter) stringWriter). The output is used as serialized string. And if you look for details of SPLimitedWebPartManager.ExportWebPart method you'll see - it seems there's no explicit restrictions. I think SHarePoint relies on XML serialization, if it works - OK. So it seems there's no hardcoded range of available elements inside AllUsersWebPart element. –  Alex Boev Feb 10 '12 at 13:17
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.