<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>SPNext</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/spnext/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/spnext/feed.xml</link>
    <description>Usually SharePoint, sometimes other stuff too</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:43:03 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Bulk moving data from the browser to Excel Services</title>
      <link>https://docs.microsoft.com/archive/blogs/spnext/bulk-moving-data-from-the-browser-to-excel-services</link>
      <pubDate>Fri, 17 Sep 2010 07:35:00 GMT</pubDate>
      <dc:creator><![CDATA[ChrisADM]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spnext/2010/09/17/bulk-moving-data-from-the-browser-to-excel-services/</guid>
      <description><![CDATA[Scenario: You need to&nbsp;interact with Excel Services from the browser, perhaps to access complex...]]></description>
      <content:encoded><![CDATA[<p><strong>Scenario:</strong> You need to&nbsp;interact with Excel Services from the browser, perhaps to access complex logic in a workbook or insert data into the EWA WebPart.&nbsp; This interaction needs to send more data than can reasonably be set cell by cell so there is a need to upload data in bulk.</p>
<p><strong>How To:</strong>&nbsp; Excel Services exposes it's functionality through a web service and this can be accessed from JavaScript running in the browser just as it can from other clients.&nbsp; The difficulty with JavaScript is the creation of the proxy to a service that isn't designed with technologies such as REST, oData, JSON etc.&nbsp; Excel Service's web service is ASMX so there is some work to do to make the needed calls.</p>
<p>There is an excellent post on Shahar Prish's blog which covers generating a proxy class to allow you to call Excel Services from JavaScript <a target="_blank" href="https://blogs.msdn.com/b/cumgranosalis/archive/2007/01/29/ajax-library-for-excel-services.aspx" title="here">here</a>.</p>
<p>What's needed for the scenario is the ability to get data into a workbook in bulk.&nbsp; If you examine the proxy you'll see logic catering for jagged arrays (where each element in an array is, in turn, another array) which is how Excel Services likes to pass around data in bulk.&nbsp; You can see this in the getRangeA1 method.&nbsp; To set data we need its partner method, setRangeA1.&nbsp; The proxy has decoding of jagged arrays for the get method but doesn't have the encoding or an implementation of the set&nbsp;method, so these need to be added.</p>
<p>The method signature can be added by copying the pattern used for other, similar methods in the code.&nbsp; The harder part is the encoding and serialising of a JavaScript jagged to array to the format the service expects which is how a .NET client would serialize it:</p>
<p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">rangeValues</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="ArrayOfAnyType"</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="xsd:int"</span><span class="kwrd">&gt;</span>0<span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="xsd:int"</span><span class="kwrd">&gt;</span>1<span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="ArrayOfAnyType"</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="xsd:int"</span><span class="kwrd">&gt;</span>1<span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">anyType</span> <span class="attr">xsi:type</span><span class="kwrd">="xsd:int"</span><span class="kwrd">&gt;</span>2<span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">anyType</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">rangeValues</span><span class="kwrd">&gt;</span></pre>
</p>
<p>To do this, add a property to the ExcelServicesWebMethodParam class holding a translatorCallback, which will ultimately be&nbsp;a function that&nbsp;gets invoked as the SOAP request is built, .&nbsp; The can be set as we build the parameters for the setRangeA1 method.&nbsp; When we come to build the SOAP request in the ExcelServicesWebMethodCall_createEnvevelope method, we can check to see if a translator has been set and call it to do the translation of the jagged array we need.&nbsp; This translation function would be as follows:</p>
<p>function translator_JaggedArray_out(param, parent, doc) {</p>
<p>&nbsp;&nbsp;&nbsp; var excelServicesNamespace = "<a href="https://schemas.microsoft.com/office/excel/server/webservices">https://schemas.microsoft.com/office/excel/server/webservices</a>";</p>
<p>&nbsp;&nbsp;&nbsp; for (var i = 0; i &lt; param.value.length; i++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var arrayXnode = doc.createNode(1, "anyType", excelServicesNamespace);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var arrayXattribute = doc.createNode(2, "xsi:type", "<a href="https://www.w3.org/2001/XMLSchema-instance">https://www.w3.org/2001/XMLSchema-instance</a>");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayXattribute.nodeValue = "ArrayOfAnyType";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayXnode.setAttributeNode(arrayXattribute);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; parent.appendChild(arrayXnode);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (var j = 0; j &lt; param.value[i].length; j++) {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var arrayYnode = doc.createNode(1, "anyType", excelServicesNamespace);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayYnode.text = param.value[i][j];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var arrayYattribute = doc.createNode(2, "xsi:type", "<a href="https://www.w3.org/2001/XMLSchema-instance">https://www.w3.org/2001/XMLSchema-instance</a>");<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayYattribute.nodeValue = "xsd:string";<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayYnode.setAttributeNode(arrayYattribute);</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arrayXnode.appendChild(arrayYnode);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; }<br />}</p>
<p>With this in place we can now move data in bulk to the workbook from the browser.&nbsp; We can then use other methods to recalculate the sheet, pull out single cells or further ranges or even update a session opened in an EWA WebPart.</p>]]></content:encoded>
    </item>
    <item>
      <title>Customising SharePoint 2010 Search Refiners</title>
      <link>https://docs.microsoft.com/archive/blogs/spnext/customising-sharepoint-2010-search-refiners</link>
      <pubDate>Mon, 09 Aug 2010 03:31:00 GMT</pubDate>
      <dc:creator><![CDATA[ChrisADM]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/spnext/2010/08/09/customising-sharepoint-2010-search-refiners/</guid>
      <description><![CDATA[Scenario: Your documents go through a series of steps (e.g. Started, Working, Complete, Cancelled)...]]></description>
      <content:encoded><![CDATA[<p><strong>Scenario:</strong> Your documents go through a series of steps (e.g. Started, Working, Complete, Cancelled) and you have a metadata column (e.g. Process Step) that tracks the status of a particular document.&nbsp; You have SharePoint Server 2010 and Enterprise Search you want users to be able to refine search results to a particular process step.</p>
<p><strong>How To:</strong>&nbsp; As the metadata column for tracking document status isn&rsquo;t managed metadata(<a href="https://technet.microsoft.com/en-us/library/ee424403.aspx">https://technet.microsoft.com/en-us/library/ee424403.aspx</a>) the search crawler needs to be made aware of your particular column so that we can use it to configure search.&nbsp; To this we need to create a Managed Property:</p>
<ul>
<li>Central Administration -&gt; Manage Service Applications -&gt; Search Service Application -&gt; Metadata Properties </li>
<li>New Managed Property -&gt; Complete the form adding in a mapping to the ows_ crawled property for your column (e.g. ows_Process_0x0020_Step) </li>
<li>Start an re-index against the content source to crawl the data for the managed property </li>
</ul>
<p>Now that search is aware of the column we can go ahead and use it in the search refiners.&nbsp; This is done by configuring the Refinement Panel WebPart that is included on search results pages:</p>
<ul>
<li>Put the results page in edit mode and edit the properties of the Refinement Panel WebPart </li>
<li>In the Refinement section -&gt; Filter Category Definition -&gt; Add the following to the XML definition modifying Title, Description and MappedProperty for your scenario: </li>
</ul>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">Category</span> <span class="attr">Title</span><span class="kwrd">="Process Step"</span> 
          <span class="attr">Description</span><span class="kwrd">="Process Step of the document"</span> 
          <span class="attr">Type</span><span class="kwrd">="Microsoft.Office.Server.Search.WebControls.ManagedPropertyFilterGenerator"</span>
          <span class="attr">MetadataThreshold</span><span class="kwrd">="5"</span>    
          <span class="attr">NumberOfFiltersToDisplay</span><span class="kwrd">="4"</span>    
          <span class="attr">MaxNumberOfFilters</span><span class="kwrd">="20"</span>    
          <span class="attr">SortBy</span><span class="kwrd">="Frequency"</span>    
          <span class="attr">SortByForMoreFilters</span><span class="kwrd">="Name"</span>    
          <span class="attr">SortDirection</span><span class="kwrd">="Descending"</span>    
          <span class="attr">SortDirectionForMoreFilters</span><span class="kwrd">="Ascending"</span>    
          <span class="attr">ShowMoreLink</span><span class="kwrd">="True"</span>    
          <span class="attr">MappedProperty</span><span class="kwrd">="ProcessStep"</span>    
          <span class="attr">MoreLinkText</span><span class="kwrd">="show more"</span>    
          <span class="attr">LessLinkText</span><span class="kwrd">="show fewer"</span> <span class="kwrd">/&gt;</span></pre>
<ul>
<li>Uncheck the Use Default Configuration option </li>
<li>Save the web part and then the page and issue a search query to see the refiner in action </li>
</ul>
<p>If you don&rsquo;t see the refiner showing your options and you didn&rsquo;t get any errors, there are a few things that will impact visibility of your custom refiner.&nbsp; Firstly, you need to make sure that you have re-indexed your content to make sure that there is data for the refiner to work with.&nbsp; Secondly, you need a big enough result set containing your column to make the refiner meaningful; if it&rsquo;s too small the panel won&rsquo;t display your refiner.&nbsp; Thirdly, the refiners are shown in the order they are defined in the XML so if you place yours at the end but configure the refinement panel to only show the first X, it won&rsquo;t appear in the panel.</p>]]></content:encoded>
    </item>
  </channel>
</rss>