Skip to content

Commit

Permalink
+ Add AdvancedSearchBoxDefinition - support AdvancedSearchBox webpart…
Browse files Browse the repository at this point in the history
… provision #857

+ CSOM impl and tests
  • Loading branch information
SubPointSupport committed Oct 9, 2016
1 parent c5f6b32 commit 2ec7d0e
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public static void Cleanup()
public static bool UseSubWebs = true;

public static bool UseApps = false;

#endregion

#region pre-generated tests
Expand Down Expand Up @@ -284,6 +284,15 @@ public void CanDeploy_XsltListViewWebPartDefinition_To_AllPageTypes()
}


[TestMethod]
[TestCategory("Regression.DefinitionCoverage.WebpartDefinitions")]
[SiteCollectionIsolation]
public void CanDeploy_AdvancedSearchBoxDefinition_To_AllPageTypes()
{
DeployWebpartOnSupportedHosts<AdvancedSearchBoxDefinition>();
}


[TestMethod]
[TestCategory("Regression.DefinitionCoverage.WebpartDefinitions")]
[SiteCollectionIsolation]
Expand Down
1 change: 1 addition & 0 deletions SPMeta2/SPMeta2/SPMeta2.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@
<Compile Include="Utils\ConvertUtils.cs" />
<Compile Include="Utils\CultureUtils.cs" />
<Compile Include="Utils\IndexedPropertyUtils.cs" />
<Compile Include="Utils\AdvancedSearchBoxWebPartXmlExtensions.cs" />
<Compile Include="Utils\PageViewerWebPartXmlExtensions.cs" />
<Compile Include="Utils\ListViewWebPartXmlExtensions.cs" />
<Compile Include="Utils\ContentEditorWebPartXmlExtensions.cs" />
Expand Down
39 changes: 39 additions & 0 deletions SPMeta2/SPMeta2/Utils/AdvancedSearchBoxWebPartXmlExtensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System.Xml.Linq;

namespace SPMeta2.Utils
{
/// <summary>
/// Helper class to work with AdvancedSearchBoxWebPart xml properties.
/// Allows to props with xmlns="urn:schemas-microsoft-com:AdvancedSearchBox"
/// </summary>
public static class AdvancedSearchBoxWebPartXmlExtensions
{
#region properties

private const string XmlNs = "urn:schemas-microsoft-com:AdvancedSearchBox";

#endregion

#region methods

public static string GetAdvancedSearchBoxWebPartProperty(this XDocument webpartXmlDocument, string propName)
{
return webpartXmlDocument.GetProperty(propName, XmlNs);
}

public static XDocument SetOrUpdateAdvancedSearchBoxWebPartProperty(this XDocument webpartXmlDocument,
string propName,
string propValue)
{
return SetOrUpdateAdvancedSearchBoxWebPartProperty(webpartXmlDocument, propName, propValue, false);
}

public static XDocument SetOrUpdateAdvancedSearchBoxWebPartProperty(this XDocument webpartXmlDocument, string propName,
string propValue, bool isCData)
{
return webpartXmlDocument.SetOrUpdateProperty(propName, propValue, "string", XmlNs, isCData);
}

#endregion
}
}

0 comments on commit 2ec7d0e

Please sign in to comment.