<%@ Assembly Name="Microsoft.SharePoint.ApplicationPages, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Page Language="C#" Inherits="Microsoft.SharePoint.WebControls.LayoutsPageBase" MasterPageFile="admin.master" %> <%@ Import Namespace="Microsoft.SharePoint.ApplicationPages" %> <%@ Import Namespace="Microsoft.SharePoint.Administration" %> <%@ Import Namespace="System.Collections" %> <%@ Import Namespace="System.Collections.Generic" %> <%@ Import Namespace="System.Collections.ObjectModel" %> <%@ Register TagPrefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Register TagPrefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Register TagPrefix="wssuc" TagName="LinksTable" src="/_controltemplates/LinksTable.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormSection" src="/_controltemplates/InputFormSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="InputFormControl" src="/_controltemplates/InputFormControl.ascx" %> <%@ Register TagPrefix="wssuc" TagName="LinkSection" src="/_controltemplates/LinkSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ButtonSection" src="/_controltemplates/ButtonSection.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ActionBar" src="/_controltemplates/ActionBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBar" src="/_controltemplates/ToolBar.ascx" %> <%@ Register TagPrefix="wssuc" TagName="ToolBarButton" src="/_controltemplates/ToolBarButton.ascx" %> <%@ Register TagPrefix="wssuc" TagName="Welcome" src="/_controltemplates/Welcome.ascx" %> Manage web.config modifications
<% if (selector.CurrentItem != null && selector.CurrentItem.WebConfigModifications.Count > 0) { %>

Current modifications

<% Hashtable ActiveWebConfigModifications = new Hashtable(); foreach (SPWebConfigModification m in selector.CurrentItem.WebConfigModifications) { string sKey = String.Format("{0}_{1}", m.Path, m.Name); object modExists = ActiveWebConfigModifications[sKey]; if(modExists==null) { ActiveWebConfigModifications.Add(sKey, m); } else { if (m.Sequence >= ((SPWebConfigModification) modExists).Sequence) { ActiveWebConfigModifications.Remove(sKey); ActiveWebConfigModifications.Add(sKey, m); } } } int c = 0; foreach (SPWebConfigModification m in selector.CurrentItem.WebConfigModifications) { string ActiveModification = "inactive-modification"; SPWebConfigModification mh = (SPWebConfigModification) ActiveWebConfigModifications[String.Format("{0}_{1}", m.Path, m.Name)]; if (m.Equals(mh) && m.Sequence == mh.Sequence) { ActiveModification = "active-modification"; } %><% c++; } %>
  Type Owner Path Name Value Sequence
<%=m.Type%> <%=m.Owner%> <%=m.Path%> <%=m.Name%> <%=m.Sequence%>

    Active modifications  |  Inactive modifications

<% } %> <% if (selector.CurrentItem != null) { %>
This is the type of the modification. Element or Attribute. This is the owner of the modification. The name does not have to be unique, but is it best not to use a name used by another feature. This is the path to the containing XML node. This is the name of the modification. If you are modifying an attribute this will be the name of the attribute. If you are modifying or adding an XML Element this wil be the XPath to uniquely identify the element within it's parent node. This is the value of the modification. If you are adding or modifying an attribute this will be the value of the attribute. If you are adding or modifying an Element this will be the entire element as you wish it to be added. This is the sequence of the modification.
Here are some sample entries to demonstrate how the entries are built.
Type Path Name Value Description
EnsureAttribute configuration/SharePoint/SafeMode CallStack true Enable SafeMode CallStack
EnsureChildNode configuration/appSettings add[@key="newKey"] <add key="newKey" value="new Value" /> Add new appSetting
EnsureAttribute configuration/system.web/customErrors mode Off Custom errors off
EnsureAttribute configuration/system.web/trust level Full Enable Full trust
<% } %> <% if (selector.CurrentItem == null) { %>

Please select a web application to modify

<% } %>