3.1.4.2.2.1 AddWebPartToZone

The AddWebPartToZone element is defined as follows:

 <s:element name="AddWebPartToZone" xmlns:s="http://www.w3.org/2001/XMLSchema">
    <s:complexType>
       <s:sequence>
          <s:element name="pageUrl" type="s:string" minOccurs="1" maxOccurs="1"/>
          <s:element name="webPartXml" type="s:string" minOccurs="1" maxOccurs="1"/>
          <s:element name="storage" type="tns:Storage" minOccurs="1" maxOccurs="1"/>
          <s:element name="zoneId" type="s:string" minOccurs="0" maxOccurs="1"/>
          <s:element name="zoneIndex" type="s:int" minOccurs="0" maxOccurs="1"/>
       </s:sequence>
    </s:complexType>
 </s:element>

pageUrl: The location of the page. MUST be formatted as either an absolute URL, a server-relative URL, or a site-relative URL. The location specified MUST be in the current site (2) or any child site (2) of the current site (2) that is also in the current site collection.

webPartXml: An XML-encoded string that, after decoding, MUST be in one of the formats supported by the server.<13> This is the contents of the Web Part being added.

storage: Specifies whether the operation adds Web Parts to the public view or the current user’s personal view. MUST be set to either "Shared" or "Personal".

zoneId: The Web Part zone identifier to which to add the Web Part.<14> If this element is omitted or refers to a Web Part zone that does not exist in the page, the server can add the Web part to any Web Part zone in the page, but the server MUST add the Web Part to a Web Part zone in the page and SHOULD ignore the zoneIndex attribute. If there are no Web Part zones in the page, the server SHOULD<15> store the Web Part, but not add it to the page.

zoneIndex: A non-negative Web Part zone index that indicates the position at which the Web Part is to be inserted in the Web Part zone. If this value is omitted, the server MUST treat this as if it were set to zero. The new Web Part MUST be inserted directly before the existing Web Part with the lowest Web Part zone index that is greater than or equal to zoneIndex. If there is no such existing Web Part (such as if zoneIndex is greater than the index of all Web Parts in the zone or there are no Web Parts in the Web Part zone), the new Web Part MUST<16> be inserted at the end of the Web Part zone.