<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>IT-Idea</title>
	<atom:link href="http://www.itidea.nl/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.itidea.nl</link>
	<description>All about SharePoint</description>
	<lastBuildDate>Mon, 01 Apr 2013 10:41:43 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to show column properties on a pagelayout</title>
		<link>http://www.itidea.nl/index.php/how-to-show-column-properties-on-a-pagelayout/</link>
		<comments>http://www.itidea.nl/index.php/how-to-show-column-properties-on-a-pagelayout/#comments</comments>
		<pubDate>Mon, 01 Apr 2013 10:41:43 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1527</guid>
		<description><![CDATA[When digging around in the SharePoint WebControls on showing some field properties on a pagelayout I found some interesting stuff.
FieldDescription
First of all I thought the SharePoint webcontrol &#8216;FieldDescription&#8217; would show the description of the field. At MSDN the FieldDescription class was described as
&#8216;Represents the description metadata of a field.&#8217;
Any context is missing here.
After looking around [...]]]></description>
			<content:encoded><![CDATA[<p>When digging around in the SharePoint WebControls on showing some field properties on a pagelayout I found some interesting stuff.</p>
<h3>FieldDescription</h3>
<p>First of all I thought the SharePoint webcontrol &#8216;FieldDescription&#8217; would show the description of the field. At <a href="http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.webcontrols.fielddescription%28v=office.14%29.aspx" target="_blank">MSDN </a>the FieldDescription class was described as</p>
<blockquote><p>&#8216;Represents the description metadata of a field.&#8217;</p></blockquote>
<p>Any context is missing here.<br />
After looking around a little bit more some context was found at the description of the Render method:<br />
This member overrides TemplateBasedControl.Render(HtmlTextWriter).<br />
Ah, so this webcontrol is used in template based controls. In the SharePoint root folder some references to this control were found in DefaultTemplates.ascx and SharePoint_Publishing_defaultformtemplates.ascx.<br />
Stubborn as I am I just put this control on a page layout to check if anything will be rendered, but nothing was.</p>
<h3>FieldProperty</h3>
<p>The FieldProperty control</p>
<blockquote><p>&#8216;Represents a property of a field; that is, a column, on a list.&#8217;</p></blockquote>
<p>This is what I&#8217;m actually looking for!<br />
The control is very easy to use:</p>
<pre class="brush: xml;">&lt;SharePointWebControls:FieldProperty FieldName=&quot;Title&quot; PropertyName=&quot;Required&quot; runat=&quot;server&quot; /&gt;</pre>
<p>The FieldName is the static (internal) field name and the PropertyName can any of the properties of a field.<br />
The FieldProperty control will return the values set in the UI or in XML, dependent on how the field is created.</p>
<p>In the picture below the results are shown of the property values of three columns:</p>
<ul>
<li>SingleLineOfTextField: single line of text field, created in xml, not required, created in a group, ShowInNewForm set to TRUE.</li>
<li>UICreated: single line of text field, manually created directly at list level, required</li>
<li>UICreatedSiteColumn: single line of text field, manually created in the site columns gallery and added to the list, required and stored in a group</li>
</ul>
<p><a href="http://www.itidea.nl/wp-content/uploads/2013/04/Blog-Column-properties-01.png"><img class="alignnone size-full wp-image-1528" title="Column properties" src="http://www.itidea.nl/wp-content/uploads/2013/04/Blog-Column-properties-01.png" alt="" width="513" height="491" /></a></p>
<p>The value of the ShowInNewForm attribute isn&#8217;t returned, so probably not all <a href="http://msdn.microsoft.com/en-us/library/ms437580%28v=office.14%29.aspx" target="_blank">field elements</a> can be used.</p>
<h3>Summary</h3>
<p>The FieldProperty control can be used to show values of field properties on a page, but not all. In the above example the ShowInNewForm isn&#8217;t exactly useful to show on a page, but ok.<br />
Be aware of the value of the description property returned: this is the value on the list, not the site columns itself.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/how-to-show-column-properties-on-a-pagelayout/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The value of the property &#8216;SearchEnsureSOD&#8217; is null or undefined, not a Function object</title>
		<link>http://www.itidea.nl/index.php/the-value-of-the-property-searchensuresod-is-null-or-undefined-not-a-function-object/</link>
		<comments>http://www.itidea.nl/index.php/the-value-of-the-property-searchensuresod-is-null-or-undefined-not-a-function-object/#comments</comments>
		<pubDate>Sun, 17 Mar 2013 14:06:12 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1513</guid>
		<description><![CDATA[Fixing bugs is the nicest thing to do!
The javascript exception was thrown by a page:
The value of the property &#8216;SearchEnsureSOD&#8217; is null or undefined, not a Function object
by just clicking in the page&#8230;
Hmm, according to the name of the function it seemed it has something to do with search and after investigating the page it [...]]]></description>
			<content:encoded><![CDATA[<p>Fixing bugs is the nicest thing to do!<br />
The javascript exception was thrown by a page:</p>
<blockquote><p>The value of the property &#8216;SearchEnsureSOD&#8217; is null or undefined, not a Function object</p></blockquote>
<p>by just clicking in the page&#8230;</p>
<p>Hmm, according to the name of the function it seemed it has something to do with search and after investigating the page it seemed there was a custom Coreresults webpart on the page when there was no searchbox on the same page&#8230;<br />
To make sure this was it I added a searchbox to the masterpage and the javascript exception didn&#8217;t occur again.</p>
<p>No big deal, just checked the difference in script files loaded with the developer tools between the page where the error occurred and a page where the searchbox was present: search.js is missing.</p>
<p>After adding a reference to the search.js file in the masterpage another exception was thrown when the page loaded:</p>
<blockquote><p>The value of the property &#8216;NotifyScriptLoadedAndExecuteWaitingJobs&#8217; is null or undefined, not a Function object</p></blockquote>
<p>Ok, this function is defined in init.js, which actually was loaded already&#8230;</p>
<p>Maybe init.js was loaded later than the function NotifyScriptLoadedAndExecuteWaitingJobs was called. Just to be sure a reference to init.js was added in the masterpage and the initial exception was thrown again:<br />
The value of the property &#8216;SearchEnsureSOD&#8217; is null or undefined, not a Function object</p>
<p>It seemed the function SearchEnsureSOD wasn&#8217;t loaded when the body (body element in masterpage) was loaded. By adding a function to the _spBodyOnLoadFunctionNames array, the onload eventhandler of the body will execute each function loaded in this array. So by adding the SearchEnsureSOD function to this array it will run when the onload event of the body fires.</p>
<p>To be very minimalistic and a lazy programmer I added an empty SearchEnsureSOD function to the _spBodyOnLoadFunctionNames array:</p>
<pre class="brush: jscript;">&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
function SearchEnsureSOD() {
}
_spBodyOnLoadFunctionNames.push('SearchEnsureSOD');
&lt;/script&gt;
</pre>
<p>and the javascript error didn&#8217;t occur again.</p>
<p>So what about deleting the reference to search.js? That won&#8217;t work, because this is the statement the error occurs on:</p>
<pre class="brush: jscript;">$addHandler(window.document.documentElement, 'click', function(evt){SearchEnsureSOD();SearchNavigate(evt);});//]]&gt;</pre>
<p>and it uses the function SearchNavigate, which is actually defined in search.js</p>
<p>So the full code to add to the masterpage:</p>
<pre class="brush: jscript;">&lt;SharePoint:ScriptLink name=&quot;init.js&quot; runat=&quot;server&quot;/&gt;
&lt;SharePoint:ScriptLink name=&quot;/_layouts/search.js&quot; runat=&quot;server&quot;/&gt;
&lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
function SearchEnsureSOD() {
}
_spBodyOnLoadFunctionNames.push('SearchEnsureSOD');
&lt;/script&gt;</pre>
<p>On a search result page the function is defined as:</p>
<pre class="brush: jscript;">
function SearchEnsureSOD() {
   EnsureScript('search.js',typeof(GoSearch)); }
_spBodyOnLoadFunctionNames.push('SearchEnsureSOD');
</pre>
<p>Where GoSearch is present when the searchbox control is.</p>
<h3>Summary</h3>
<p>The Coreresults webpart is a great thing, but it apparently needs some work when there is no searchbox present at the page. In this post the solution is provided to make it all work.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/the-value-of-the-property-searchensuresod-is-null-or-undefined-not-a-function-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Attempted to read or write protected memory. This is often an indication that other memory is corrupt.</title>
		<link>http://www.itidea.nl/index.php/attempted-to-read-or-write-protected-memory-this-is-often-an-indication-that-other-memory-is-corrupt/</link>
		<comments>http://www.itidea.nl/index.php/attempted-to-read-or-write-protected-memory-this-is-often-an-indication-that-other-memory-is-corrupt/#comments</comments>
		<pubDate>Thu, 25 Oct 2012 14:30:45 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1482</guid>
		<description><![CDATA[Once in a while some annoying exceptions occur…
The exception

Exception in SearchBoxEx::CreateChildControls:System.TypeInitializationException: The type initializer for 'Microsoft.SharePoint.Portal.WebControls.LocStringIdLookupTable' threw an exception. ---&#62; System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 at Microsoft.SharePoint.Portal.WebControls.LocStringIdLookupTable..cctor()

And the inner exception stack trace gave me more info:

at Microsoft.SharePoint.Portal.WebControls.StringResourceManager.ConvertLocStringIdToStringFast(LocStringId lsid)
 at Microsoft.SharePoint.Portal.WebControls.StringResourceManager.GetString(LocStringId lsid)
 at [...]]]></description>
			<content:encoded><![CDATA[<p>Once in a while some annoying exceptions occur…</p>
<h3>The exception</h3>
<pre class="brush: csharp;">
Exception in SearchBoxEx::CreateChildControls:System.TypeInitializationException: The type initializer for 'Microsoft.SharePoint.Portal.WebControls.LocStringIdLookupTable' threw an exception. ---&gt; System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
 at Microsoft.SharePoint.Portal.WebControls.LocStringIdLookupTable..cctor()
</pre>
<p>And the inner exception stack trace gave me more info:</p>
<pre class="brush: csharp;">
at Microsoft.SharePoint.Portal.WebControls.StringResourceManager.ConvertLocStringIdToStringFast(LocStringId lsid)
 at Microsoft.SharePoint.Portal.WebControls.StringResourceManager.GetString(LocStringId lsid)
 at Microsoft.SharePoint.Portal.WebControls.SiteInfo.get_IsUICultureRTL()
 at Microsoft.SharePoint.Portal.WebControls.SearchBoxEx.CreateChildControls()
</pre>
<h3>Investigation</h3>
<p>So the exception occurred in the <em>SearchBoxEx </em>control, method <em>CreateChildControls</em>. Since this is a stack trace of standard SharePoint Server code I decompiled the standard SharePoint Server assemblies which I needed. This is necessary because this is no custom code belonging to an application we created. After analyzing the code it seems that when creating the SearchBoxEx control a context is created to build the control and its properties. During the creation of this context a SPSite and SPWeb are needed.<br />
SharePoint is lacking to dispose these objects.<br />
Another site is also using this SearchBoxEx control and no memory leaks have been reported here. The searchbox control used at this site is the same, but the context is different. The searchbox in this site uses its own SPWeb as context and this SPWeb object doesn’t need any disposal.</p>
<p>The SearchBoxEx control can be found at the top of the pages on the right hand side and in the Search center. The PeopleSearchBoxEx is a different control and doesn’t leak any memory.</p>
<h4>How does the SearchBoxEx control get its context?</h4>
<p>This is the code:</p>
<pre class="brush: csharp;">

private SPWeb GetSpWeb()
{
  using (new SPMonitoredScope(&quot;SearchBoxEx.GetSpWeb&quot;))
  {
    SPWeb personalWeb = null;
    if ((this.m_strCtxScopeFromGetOverride == SearchCommon.GetLocResourceString(LocStringId.SearchBox_ThisSite_Label)) &amp;&amp; !string.IsNullOrEmpty(this.m_strSearchWithInUrlGetOverride))
    {
      if (this._PropertiesOverrideableBySite.EffectiveSearchResultPageUrl.EndsWith(&quot;/_layouts/OssSearchResults.aspx&quot;, StringComparison.OrdinalIgnoreCase))
      {
        personalWeb = SPContext.GetContext(HttpContext.Current).Web;
      }
      if (personalWeb == null)
      {
        SPSite site;
        try
        {
          site = new SPSite(this.m_strSearchWithInUrlGetOverride);
        }
        catch (FileNotFoundException exception)
        {
          site = null;
          ULS.SendTraceTag(0x66673974, ULSCat.msoulscat_SEARCH_Query, ULSTraceLevel.Medium, string.Concat((string[]) new string[] { &quot;The SearchBox was passed an invalid site url in the query parameter: url={&quot;, this.m_strSearchWithInUrlGetOverride, &quot;} Exception Detail: message={&quot;, exception.get_Message(), &quot;} name={&quot;, exception.get_FileName(), &quot;}&quot; }));
        }
        if (site != null)
        {
          personalWeb = site.OpenWeb();
        }
      }
    }
    if (personalWeb == null)
    {
      if (this.Page is MySitePublicWebPartPage)
      {
        IPersonalPage page = this.Page as IPersonalPage;
        personalWeb = page.PersonalWeb;
      }
      if (personalWeb == null)
      {
        personalWeb = SPContext.GetContext(HttpContext.Current).Web;
      }
      if (personalWeb == null)
      {
        throw new ArgumentNullException(&quot;SPSite is null. No contextual scopes will be added&quot;);
      }
    }
    return personalWeb;
  }
}
</pre>
<p>The code explicitly checks if the result page ends with &#8220;/_layouts/OssSearchResults.aspx&#8221; to use the current context or to create an SPSite/SPWeb.</p>
<p>The personalWeb in the above code is returned by this method to the calling method but the SPSite <em>site</em> isn’t disposed!</p>
<p>This method returns the personalWeb to the calling method ‘HandleContextualScoping’. This SPWeb is used in the method, but not disposed!</p>
<h3>Summary</h3>
<p>Oeps.</p>
<p>Microsoft, would you be so kind to fix this?</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/attempted-to-read-or-write-protected-memory-this-is-often-an-indication-that-other-memory-is-corrupt/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Office 365 Enterprise Preview &#8211; Permissions on list type in an app</title>
		<link>http://www.itidea.nl/index.php/office-365-enterprise-preview-permissions-on-list-type-in-an-app/</link>
		<comments>http://www.itidea.nl/index.php/office-365-enterprise-preview-permissions-on-list-type-in-an-app/#comments</comments>
		<pubDate>Tue, 04 Sep 2012 09:04:04 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[SharePoint 2013]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1462</guid>
		<description><![CDATA[When developing an app for SharePoint permissions can be set on items in the host web, such as access to lists. The host web is the website to which an app for SharePoint is installed.
An app for SharePoint has its own identity and is associated with a security principal, called an app principal. Like users [...]]]></description>
			<content:encoded><![CDATA[<p>When developing an app for SharePoint permissions can be set on items in the host web, such as access to lists. The host web is the website to which an app for SharePoint is installed.</p>
<p>An app for SharePoint has its own identity and is associated with a security principal, called an app principal. Like users and groups, an app principal has certain permissions and rights. The app principal has full control rights to the app web so it only needs to request permissions to SharePoint resources in the host web or other locations outside the app web.</p>
<p>Using Microsoft Napa Office 365 Developer Tools these permissions can be set in the properties of the app using some kind of slider.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/01-SP2013-Permissions-Slider.png"><img class="alignnone size-full wp-image-1475" title="01 SP2013 Permissions Slider" src="http://www.itidea.nl/wp-content/uploads/2012/08/01-SP2013-Permissions-Slider.png" alt="" width="577" height="222" /></a></p>
<p>After installing the app this is the result:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/02-SP2013-Permissions-Trust-Napa-app.png"><img class="alignnone size-full wp-image-1474" title="02 SP2013 Permissions Trust Napa app" src="http://www.itidea.nl/wp-content/uploads/2012/08/02-SP2013-Permissions-Trust-Napa-app.png" alt="" width="536" height="276" /></a></p>
<p>The user can select one list out of all available lists the user has access to.</p>
<p>A better approach would be to help the user pick a specific (kind of) list, not letting the user pick from all lists in the web. This can be accomplished by editing the AppManifest in Visual Studio through a nice looking designer:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/03-SP2013-Permissions-AppManifest-designer.png"><img class="alignnone size-full wp-image-1473" title="03 SP2013 Permissions AppManifest designer" src="http://www.itidea.nl/wp-content/uploads/2012/08/03-SP2013-Permissions-AppManifest-designer.png" alt="" width="586" height="481" /></a></p>
<p>At the <em>Permission requests</em> section the column <em>Properties</em> a BaseTemplateId can be filled in to filter the lists the user can choose from. The BaseTemplateId is the numerical equivalent of the list base template, for example 100 represents a generic list, 101 a document library.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/04-SP2013-Permissions-AppManifest-BaseTemplateId.png"><img class="alignnone size-full wp-image-1472" title="04 SP2013 Permissions AppManifest BaseTemplateId" src="http://www.itidea.nl/wp-content/uploads/2012/08/04-SP2013-Permissions-AppManifest-BaseTemplateId.png" alt="" width="713" height="118" /></a></p>
<p>In xml this looks like:</p>
<pre class="brush: xml;">
  &lt;AppPermissionRequests&gt;
    &lt;AppPermissionRequest Scope=&quot;http://sharepoint/content/sitecollection/web/list&quot; Right=&quot;Read&quot; &gt;
      &lt;Property Name=&quot;BaseTemplateId&quot; Value=&quot;101&quot; /&gt;
    &lt;/AppPermissionRequest&gt;
  &lt;/AppPermissionRequests&gt;
</pre>
<p>This results in the following list:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/05-SP2013-Permissions-Trust-VS-app.png"><img class="alignnone size-full wp-image-1471" title="05 SP2013 Permissions Trust VS app" src="http://www.itidea.nl/wp-content/uploads/2012/08/05-SP2013-Permissions-Trust-VS-app.png" alt="" width="367" height="146" /></a></p>
<p>It looks like multiple properties can be defined, and you can:</p>
<p>but an additional BaseTemplateId won’t recognized and the filter of list types isn’t amended to the property settings.</p>
<p>You aren’t able to add another List scoped permission request in the designer, other scoped items can be added, also once per AppManifest.</p>
<p>The xml can be amended with another List scoped permission request, but only the first one defined is active.</p>
<p>One gotcha: Once the app is installed and permissions link is selected there is no possibility to view the list its current permission setting. The first list in the dropdown is selected&#8230;</p>
<p>For example Trust library Site Assets:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/07-SP2013-Permissions-Trust-Site-Assets-library.png"><img class="alignnone size-full wp-image-1469" title="07 SP2013 Permissions Trust Site Assets library" src="http://www.itidea.nl/wp-content/uploads/2012/08/07-SP2013-Permissions-Trust-Site-Assets-library.png" alt="" width="531" height="257" /></a></p>
<p>Request permissions of the app:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/08-SP2013-Permissions-link.png"><img class="alignnone size-full wp-image-1468" title="08 SP2013 Permissions link" src="http://www.itidea.nl/wp-content/uploads/2012/08/08-SP2013-Permissions-link.png" alt="" width="388" height="272" /></a><br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/09-SP2013-Permissions-library-selected1.png"><img class="alignnone size-full wp-image-1467" title="09 SP2013 Permissions library selected" src="http://www.itidea.nl/wp-content/uploads/2012/08/09-SP2013-Permissions-library-selected1.png" alt="" width="649" height="252" /></a><a href="http://www.itidea.nl/wp-content/uploads/2012/08/09-SP2013-Permissions-library-selected.png"></a></p>
<p>And the first library is selected&#8230; hope Microsoft is going to fix this one…</p>
<p><span style="color: #ff0000;">Disclaimer: SharePoint 2013 is in preview at time of this writing, so things may change between now and release date.</span></p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/office-365-enterprise-preview-permissions-on-list-type-in-an-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office 365 Developer Site &#8211; Enterprise Preview</title>
		<link>http://www.itidea.nl/index.php/office-365-developer-site-enterprise-preview/</link>
		<comments>http://www.itidea.nl/index.php/office-365-developer-site-enterprise-preview/#comments</comments>
		<pubDate>Tue, 28 Aug 2012 11:41:22 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2013]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1457</guid>
		<description><![CDATA[In my previous post I signed up for an Office 365 Developer Site to investigate some new functionalities of SharePoint 2013. After some browsing around I wanted to give another user different permissions to log in with and I realized the Developer Site is one license only.
Office 365 Enterprise Preview gives you 25 licenses, so&#8230;
 [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post I signed up for an Office 365 Developer Site to investigate some new functionalities of SharePoint 2013. After some browsing around I wanted to give another user different permissions to log in with and I realized the Developer Site is one license only.<br />
Office 365 Enterprise Preview gives you 25 licenses, so&#8230;</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/office-365-developer-site-enterprise-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Office 365 developer site – add or request an app</title>
		<link>http://www.itidea.nl/index.php/office-365-developer-site-add-or-request-an-app/</link>
		<comments>http://www.itidea.nl/index.php/office-365-developer-site-add-or-request-an-app/#comments</comments>
		<pubDate>Fri, 03 Aug 2012 12:32:17 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2013]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1418</guid>
		<description><![CDATA[An Office 365 Developer Site is a preconfigured SharePoint 2013 Preview site that can be used to create, test, and deploy apps for Office and SharePoint.
This post is about a very small piece: adding an app.
From the Site Contents menu (or other places&#8230;) an app can be added.
The quick launch menu shows a couple of [...]]]></description>
			<content:encoded><![CDATA[<p>An Office 365 Developer Site is a preconfigured SharePoint 2013 Preview site that can be used to create, test, and deploy apps for Office and SharePoint.<br />
This post is about a very small piece: adding an app.</p>
<p>From the Site Contents menu (or other places&#8230;) an app can be added.</p>
<p>The quick launch menu shows a couple of options:</p>
<ul>
<li>Your Apps
<ul>
<li>Apps you can add</li>
</ul>
</li>
<li>Manage Licenses</li>
<li>Your Requests</li>
<li>SharePoint Store</li>
</ul>
<p>Default <em>Apps You Can Add</em> is selected, showing you.. the apps you can add! Be surprised. The <em>default</em> SharePoint lists and libraries are shown when you just started with this site collection.</p>
<h3>Your Apps</h3>
<p><em>Your Apps</em> shows all your apps, including the ones already installed. When there is something ‘wrong’ with the app SharePoint will tell you so. Let’s take a look at the “Napa” app.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Cannot-add-app-here.png"><img class="alignnone size-full wp-image-1428" title="SP2013 apps Cannot add app here" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Cannot-add-app-here.png" alt="" width="195" height="195" /></a></p>
<p>It shows <em>You can’t add this app here.</em> And <em>Find out why</em>. The last sentence is a link and redirects you to the app properties(‘About’ the app or the App Details) which tells you why you can’t add the app: <em>Good news – you already have this on your site</em>.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Cannot-add-app-here-Find-out-why.png"><img class="alignnone size-full wp-image-1429" title="SP2013 apps Cannot add app here Find out why" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Cannot-add-app-here-Find-out-why.png" alt="" width="669" height="198" /></a></p>
<p>Another option could be some prerequisites are missing (specified by the developer of the app), which would be the content of the message shown.</p>
<h3>Manage Licenses</h3>
<p>This item shows a list of apps to manage licenses for. When selecting an app details will be shown about license management, such as the user who purchased the app, people with a license, options to recover or remove the license, view the item in the SharePoint Store (public marketplace) and the license managers.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-App-license-management.png"><img class="alignnone size-full wp-image-1430" title="SP2013 apps App license management" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-App-license-management.png" alt="" width="487" height="398" /></a></p>
<h3>Your Requests</h3>
<p>Your Requests has no actual use, beside searching for an app, which is standard available in the <em>Add an app</em> page, when appropriate governance controls aren’t enabled.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Your-Requests-No-Governance.png"><img class="alignnone size-full wp-image-1431" title="SP2013 apps Your Requests No Governance" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Your-Requests-No-Governance.png" alt="" width="616" height="232" /></a></p>
<p>With appropriate governance controls I mean settings for App Purchases and App Requests available in SharePoint Administration Center. But before anything can be done about these settings an app catalog site collection has to be created.</p>
<p>In SharePoint Administration Center go to <em>apps</em> and select <em>App Catalog</em>. Here apps can be made available to the organization and requests for apps can be managed.<br />
App Catalog &#8216;prescreen&#8217;:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Create-App-Catalog-prescreen.png"><img class="alignnone size-full wp-image-1432" title="SP2013 apps Create App Catalog prescreen" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Create-App-Catalog-prescreen.png" alt="" width="559" height="168" /></a></p>
<p>Properties for the App Catalog Site:</p>
<p><a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Create-App-Catalog.png"><img class="alignnone size-full wp-image-1433" title="SP2013 apps Create App Catalog" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Create-App-Catalog.png" alt="" width="768" height="457" /></a></p>
<p>Once the site collection has been created the  App Catalog &#8216;prescreen&#8217; is not shown again when selecting the link, but the App Catalog site collection created earlier will be shown.</p>
<p>At <em>Configure Store Settings</em> (SharePoint Administration Center; apps) the App Purchases and App Requests can be managed.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Configure-store-settings.png"><img class="alignnone size-full wp-image-1434" title="SP2013 apps Configure store settings" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Configure-store-settings.png" alt="" width="810" height="384" /></a></p>
<p>With the above settings users are able to get apps from the SharePoint Store. When they go to the Store and find an app of their choice they can <em>Add it</em>.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Add-it.png"><img class="alignnone size-full wp-image-1435" title="SP2013 apps Store Add it" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Add-it.png" alt="" width="681" height="411" /></a></p>
<p>When App Purchases are disabled users can <em>request</em> the app:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Request-it.png"><img class="alignnone size-full wp-image-1436" title="SP2013 apps Store Request it" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Request-it.png" alt="" width="687" height="416" /></a></p>
<p>And fill out a simple form about user licenses and a justification.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Request-it-Actual-Request.png"><img class="alignnone size-full wp-image-1437" title="SP2013 apps Store Request it Actual Request" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Store-Request-it-Actual-Request.png" alt="" width="569" height="384" /></a></p>
<p>After this, <em>Your Requests</em>, lists the requested app in a pending state.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Your-Requests-With-Governance.png"><img class="alignnone size-full wp-image-1438" title="SP2013 apps Your Requests With Governance" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Your-Requests-With-Governance.png" alt="" width="470" height="315" /></a></p>
<p>In the App Catalog site collection the list <em>App Requests</em> lists the app requested:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Requested-app-new.png"><img class="alignnone size-full wp-image-1439" title="SP2013 apps Requested app new" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Requested-app-new.png" alt="" width="510" height="574" /></a></p>
<p>With the Status column the user can keep track of the request. Once approved, the app can be installed and can be added by the user. The new app appears in the <em>Your Apps</em> section.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Apps-you-can-add-with-new-app.png"><img class="alignnone size-full wp-image-1440" title="SP2013 apps Apps you can add with new app" src="http://www.itidea.nl/wp-content/uploads/2012/08/SP2013-apps-Apps-you-can-add-with-new-app.png" alt="" width="543" height="219" /></a></p>
<h3>SharePoint Store</h3>
<p>The SharePoint Store link redirects you to the store where all kinds of apps are listed, where you can search for a particular app or browse by category,  install or request an app dependent of the setting previously explained.</p>
<h3>Summary</h3>
<p>In this post I tried to explain some items available at <em>Add an app</em> and how you can add or request an app based on governance settings available in SharePoint Administration Center.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/office-365-developer-site-add-or-request-an-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Export functions, variables and aliases with wildcards</title>
		<link>http://www.itidea.nl/index.php/powershell-export-functions-variables-and-aliases-with-wildcards/</link>
		<comments>http://www.itidea.nl/index.php/powershell-export-functions-variables-and-aliases-with-wildcards/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 12:30:32 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1406</guid>
		<description><![CDATA[In my previous post &#8216;PowerShell Export-ModuleMember vs Export keys in manifest&#8216; I wrote about ways to export various items from a module.
Trevor Sullivan read my post and suggested in his comment to analyze the use of wildcards to export functions, variables or aliases using the manifest file.
After trying this I got enthusiastic about it, read [...]]]></description>
			<content:encoded><![CDATA[<p>In my previous post &#8216;<a href="http://www.itidea.nl/index.php/powershell-export-modulemember-vs-export-keys-in-manifest/">PowerShell Export-ModuleMember vs Export keys in manifest</a>&#8216; I wrote about ways to export various items from a module.</p>
<p>Trevor Sullivan read my post and suggested in his comment to analyze the use of wildcards to export functions, variables or aliases using the manifest file.</p>
<p>After trying this I got enthusiastic about it, read further&#8230;</p>
<p>As well in the manifest file as with the use of Export-ModuleMember in the module wildcards can be used.</p>
<p>This can be (very) helpful when naming the function in the module according to a certain structure.<br />
In C# accessibility levels are used to restrict or limit access to certain methods. There is no such thing in PowerShell, but this can be achieved by (not) exporting the functions from a module. In C# reserved accessibility levels as public and private are used. We can use this &#8216;technique&#8217; in PowerShell by naming the functions in a module according to a standard: use for example -public or _public at the end of a functionname or variable in a module and use the same string literal as wildcard to export functions.</p>
<p>Practically this means defining Export-ModuleMember in the module like:<br />
Export-ModuleMember -Function &#8220;*&#8221;<br />
Export-ModuleMember -Variable &#8220;*&#8221;<br />
Export-ModuleMember -Alias &#8220;*&#8221;<br />
to export all functions, variables and aliases.<br />
Then restrict the exported items in the module manifest like:<br />
FunctionsToExport = &#8216;*-Public&#8217;<br />
VariablesToExport = &#8216;*_Public&#8217;<br />
AliasesToExport = &#8216;*-Public&#8217;</p>
<h3>Module (psm1)</h3>
<pre class="brush: powershell;">
$msgText_Public = 'Hello world!'
$anotherVariable = 'more here'

function Say-HelloWorld() { Write-Host $msgText }
function Calc-Numbers-Public([int] $a,[int] $b) { $a + $b }
function I-Am-Public() { Write-Host &quot;Public&quot; }

Set-Alias Add Calc-Numbers
Set-Alias Hello-Public Say-HelloWorld

Export-ModuleMember -Function &quot;*&quot; #Say-HelloWorld, Calc-Numbers
Export-ModuleMember -Variable &quot;*&quot; #msgText, anotherVariable
Export-ModuleMember -Alias &quot;*&quot;  #Hello, Add
</pre>
<h3>Manifest (psd1)</h3>
<pre class="brush: powershell;">
# Functions to export from this module
FunctionsToExport = '*-Public'

# Variables to export from this module
VariablesToExport = '*_Public'

# Aliases to export from this module
AliasesToExport = '*-Public'
</pre>
<p>And the result:</p>
<p><a href="http://www.itidea.nl/wp-content/uploads/2012/04/PSModuleImproved1.png"><img class="alignnone size-full wp-image-1411" title="PSModuleImproved" src="http://www.itidea.nl/wp-content/uploads/2012/04/PSModuleImproved1.png" alt="" width="459" height="165" /></a></p>
<h3>Summary</h3>
<p>In my previous post I wrote in the summary:<br />
&#8216;The export keys in the manifest can be seen as an export override of the Export-ModuleMember used in a module&#8230; When trying to control the exports of variables and aliases it all comes clear: export them in the module at all times!&#8217;</p>
<p>After analyzing the wildcard options to export I still agree on the above statements, but I would like to nuance it a bit: export all items in the module and restrict the exported items in the module manifest by using wildcards in the module manifest and using a naming convention when defining functions, variables and aliases.</p>
<p>When approaching exporting the items from a module as described above you can not forget to export a function, variable or alias, you just have to follow this naming convention.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/powershell-export-functions-variables-and-aliases-with-wildcards/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PowerShell Export-ModuleMember vs Export keys in manifest</title>
		<link>http://www.itidea.nl/index.php/powershell-export-modulemember-vs-export-keys-in-manifest/</link>
		<comments>http://www.itidea.nl/index.php/powershell-export-modulemember-vs-export-keys-in-manifest/#comments</comments>
		<pubDate>Wed, 28 Mar 2012 13:46:46 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1385</guid>
		<description><![CDATA[In PowerShell there are two ways to export functions, cmdlets, variables and aliases from a script module file for use by the calling context:
1. By using Export-ModuleMember and specify what resources need to be exported like:
Export-ModuleMember -Function  or Export-ModuleMember -Variable
2. By using a module manifest and specifiy what resources need to be exported like:
@{
&#8230;.
FunctionsToExport [...]]]></description>
			<content:encoded><![CDATA[<p>In PowerShell there are two ways to export functions, cmdlets, variables and aliases from a script module file for use by the calling context:<br />
1. By using Export-ModuleMember and specify what resources need to be exported like:<br />
Export-ModuleMember -Function  or Export-ModuleMember -Variable</p>
<p>2. By using a module manifest and specifiy what resources need to be exported like:<br />
@{<br />
&#8230;.<br />
FunctionsToExport = &#8216; VariablesToExport = &#8221;<br />
&#8230;.<br />
}</p>
<p>By seeing this I got a little confused on which method to use and why: Export-ModuleMember or the manifest way, so it was time to dig into this matter.<br />
By creating a small module, a manifest and a script file the different options can be tested.</p>
<h4>Module (psm1)</h4>
<p>In the module three functions, two with an alias and two variables are defined and exported:</p>
<pre class="brush: powershell;">
$msgText = 'Hello world!'
$anotherVariable = 'more here'

function Say-HelloWorld() { Write-Host $msgText }
function Calc-Numbers([int] $a,[int] $b) { $a + $b }
function I-Am-Private() { Write-Host &quot;private&quot; }

Set-Alias Add Calc-Numbers
Set-Alias Hello Say-HelloWorld

Export-ModuleMember -Function Say-HelloWorld, Calc-Numbers
Export-ModuleMember -Variable msgText, anotherVariable
Export-ModuleMember -Alias Hello, Add
</pre>
<h4>Manifest (psd1)</h4>
<p>The export variables of the manifest are (default) set to &#8216;*&#8217;:</p>
<pre class="brush: powershell;">
# Functions to export from this module
FunctionsToExport = '*'

# Cmdlets to export from this module
CmdletsToExport = '*'

# Variables to export from this module
VariablesToExport = '*'

# Aliases to export from this module
AliasesToExport = '*'
</pre>
<h4>Script (ps1)</h4>
<p>The script file imports the module and displays information about the module. This is an excellent way to test what resources are exported:</p>
<pre class="brush: powershell;">
Import-Module ExportFunctions -Force
Get-Module -Name ExportFunctions | fl
</pre>
<h4>Tests</h4>
<p>Running this script results in the following output:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules01.png"><img class="size-full wp-image-1388 alignnone" title="PSModules01" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules01.png" alt="" width="457" height="166" /></a></p>
<p>As can be seen two functions, the aliases and variables are exported as defined in Export-ModuleMember in the module.</p>
<p>The Export-ModuleMembers lines are now removed to test the default settings in the manifest file (all &#8216;*&#8217; for the export keys). Running the same script now results in:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules02.png"><img class="alignnone size-full wp-image-1389" title="PSModules02" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules02.png" alt="" width="532" height="170" /></a></p>
<p>All the functions are exported, but none of the alias or variables. At first sight this seems a bit strange, because the generated comment of the export keys of the manifest say &#8216; to export from this module&#8217;. This seems only the case for the functions.</p>
<p><a href="http://technet.microsoft.com/en-us/library/dd878297%28v=VS.85%29.aspx">TechNet </a>documentation for FunctionsToExport key:</p>
<blockquote><p>Specifies the functions that the module exports (wildcard characters are permitted) to the caller’s session state. By default, all functions are exported. You can use this key to restrict the functions that are exported by the module&#8230;</p></blockquote>
<p>And the TechNet documentation for VariableToExport key:</p>
<blockquote><p>Specifies the variables that the module exports (wildcard characters are permitted) to the caller’s session state. By default, all variables are exported. You can use this key to restrict the variables that are exported by the module&#8230;</p></blockquote>
<p>The statement don&#8217;t differ, but the behavior is.</p>
<h5>The &#8216;*&#8217; at the FunctionsToExport key means the restriction is:</h5>
<p><span style="text-decoration: underline;">If Export-ModuleMember -Function in the module is used, the functions listed there are exported:</span><br />
In module:</p>
<pre class="brush: powershell;">Export-ModuleMember -Function Say-HelloWorld, Calc-Numbers</pre>
<p>In manifest:</p>
<pre class="brush: powershell;">FunctionsToExport = '*'</pre>
<p>Result:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules03.png"><img class="alignnone size-full wp-image-1390" title="PSModules03" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules03.png" alt="" width="412" height="179" /></a></p>
<p><span style="text-decoration: underline;"> If Export-ModuleMember -Function is NOT used in the module and in manifest &#8216;*&#8217; is used all functions are exported: </span><br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules03a.png"><img class="alignnone size-full wp-image-1391" title="PSModules03a" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules03a.png" alt="" width="532" height="170" /></a></p>
<h5>The &#8216;*&#8217; at the VariablesToExport key means: By default none of the variables are exported, unless variables are exported by the Export-ModuleMember in the module.</h5>
<p>In module: No Export-ModuleMember -Variable<br />
In manifest:</p>
<pre class="brush: powershell;">VariablesToExport = '*'</pre>
<p>Result:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules04.png"><img class="alignnone size-full wp-image-1392" title="PSModules04" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules04.png" alt="" width="421" height="175" /></a></p>
<p>In module: No Export-ModuleMember -Variable<br />
In manifest:</p>
<pre class="brush: powershell;">VariablesToExport = 'anotherVariable'</pre>
<p>Result:<br />
<a href="../wp-content/uploads/2012/03/PSModules04.png"><img title="PSModules04" src="../wp-content/uploads/2012/03/PSModules04.png" alt="" width="421" height="175" /></a></p>
<p>In module:</p>
<pre class="brush: powershell;">Export-ModuleMember -Variable msgText, anotherVariable</pre>
<p>In manifest:</p>
<pre class="brush: powershell;">VariablesToExport = '*'</pre>
<p>Result:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules05.png"><img class="alignnone size-full wp-image-1393" title="PSModules05" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules05.png" alt="" width="424" height="173" /></a></p>
<p>In module:</p>
<pre class="brush: powershell;">Export-ModuleMember -Variable msgText, anotherVariable</pre>
<p>In manifest:</p>
<pre class="brush: powershell;">VariablesToExport = 'anotherVariable'</pre>
<p>Result:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules06.png"><img class="alignnone size-full wp-image-1394" title="PSModules06" src="http://www.itidea.nl/wp-content/uploads/2012/03/PSModules06.png" alt="" width="423" height="176" /></a></p>
<h3>Summary</h3>
<p>The export keys in the manifest can be seen as an export override of the Export-ModuleMember used in a module. When testing this behavior with functions alone it can be confusing &#8211; at least it confused me &#8211; which method to use &#8211; manifest export key or Export-ModuleMember &#8211; to restrict function exports. When trying to control the exports of variables and aliases it all comes clear: export them in the module at all times!</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/powershell-export-modulemember-vs-export-keys-in-manifest/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Empty tooltip in refinement panel</title>
		<link>http://www.itidea.nl/index.php/empty-tooltip-in-refinement-panel/</link>
		<comments>http://www.itidea.nl/index.php/empty-tooltip-in-refinement-panel/#comments</comments>
		<pubDate>Wed, 08 Feb 2012 11:13:13 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1352</guid>
		<description><![CDATA[Sometimes when hovering over a fieldvalue in the refinementpanel the tooltip displays only &#8216;Refine By:&#8217; without displaying any value.

While another displays an actual value:
Actual term in a tree

or just a &#8216;parent&#8217; term

Why?
When the fieldvalue is less than 19 characters the tooltip stays empty. Well empty.. it displays &#8216;Refine By:&#8217;. Every fieldvalue with more than 19 [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes when hovering over a fieldvalue in the refinementpanel the tooltip displays only &#8216;Refine By:&#8217; without displaying any value.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel01.png"><img class="alignnone size-full wp-image-1353" title="EmptyTooltipRefinementPanel" src="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel01.png" alt="EmptyTooltipRefinementPanel" width="140" height="157" /></a></p>
<p>While another displays an actual value:<br />
Actual term in a tree<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel02.png"><img class="alignnone size-full wp-image-1354" title="Actual term in a tree" src="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel02.png" alt="Actual term in a tree" width="248" height="163" /></a></p>
<p>or just a &#8216;parent&#8217; term<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel03.png"><img class="alignnone size-full wp-image-1355" title="Parent term" src="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel03.png" alt="Parent term" width="501" height="168" /></a></p>
<h3>Why?</h3>
<p>When the fieldvalue is less than 19 characters the tooltip stays empty. Well empty.. it displays &#8216;Refine By:&#8217;. Every fieldvalue with more than 19 characters is displayed in the tooltip. A &#8216;parent&#8217; term or a whole path.</p>
<h3>How to solve?</h3>
<p>This behavior can be solved by adjusting the xslt.</p>
<p>Original xslt:</p>
<pre class="brush: xml;">
&lt;a href=&quot;{$SecureUrl}&quot; title=&quot;{$RefineByHeading}: {$UrlTooltip}&quot;&gt;
&lt;xsl:value-of select=&quot;Value&quot;/&gt;
&lt;/a&gt;
</pre>
<p>Adjusted xslt:</p>
<pre class="brush: xml;">
&lt;xsl:variable name=&quot;UrlTooltipAdjusted&quot;&gt;
 &lt;xsl:call-template name=&quot;format-tooltip&quot;&gt;
 &lt;xsl:with-param name=&quot;tooltip&quot; select=&quot;$UrlTooltip&quot; /&gt;
 &lt;xsl:with-param name=&quot;string&quot; select=&quot;Value&quot; /&gt;
 &lt;/xsl:call-template&gt;
&lt;/xsl:variable&gt;

&lt;a href=&quot;{$SecureUrl}&quot; title=&quot;{$RefineByHeading}: $UrlTooltipAdjusted}&quot;&gt;
&lt;xsl:value-of select=&quot;Value&quot;/&gt;
&lt;/a&gt;

&lt;xsl:template name=&quot;format-tooltip&quot;&gt;
 &lt;xsl:param name=&quot;tooltip&quot; /&gt;
 &lt;xsl:param name=&quot;string&quot; /&gt;
 &lt;xsl:choose&gt;
 &lt;xsl:when test=&quot;$tooltip != ''&quot;&gt;
 &lt;xsl:value-of select=&quot;$tooltip&quot; /&gt;
 &lt;/xsl:when&gt;
 &lt;xsl:otherwise&gt;
 &lt;xsl:value-of select=&quot;$string&quot; /&gt;
 &lt;/xsl:otherwise&gt;
 &lt;/xsl:choose&gt;
&lt;/xsl:template&gt;
</pre>
<p>The &#8216;format-tooltip&#8217; template checks if the tooltip is empty and replaces the tooltip value with the actual fieldvalue if so.<br />
By doing this the tooltip will never be empty and will always show the value of the fieldvalue.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel04.png"><img class="alignnone size-full wp-image-1356" title="Tooltip shows value" src="http://www.itidea.nl/wp-content/uploads/2012/02/EmptyTooltipRefinementPanel04.png" alt="Tooltip shows value" width="198" height="153" /></a></p>
<h3>Summary</h3>
<p>Besides the fieldvalues also the tooltip values suffer from a character limitation. The values of the refinement panel have a 19 character display limit, the tooltip doesn&#8217;t display the value when the fieldvalue is less than 19 characters.<br />
This and the <a href="http://www.itidea.nl/index.php/refinement-panel-character-display-limitation/">previous post</a> solve these issues by making minor adjustments to the OOTB xslt.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/empty-tooltip-in-refinement-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Refinement panel character display limitation</title>
		<link>http://www.itidea.nl/index.php/refinement-panel-character-display-limitation/</link>
		<comments>http://www.itidea.nl/index.php/refinement-panel-character-display-limitation/#comments</comments>
		<pubDate>Mon, 06 Feb 2012 14:51:39 +0000</pubDate>
		<dc:creator>Anita</dc:creator>
				<category><![CDATA[SharePoint 2010]]></category>
		<category><![CDATA[xslt]]></category>

		<guid isPermaLink="false">http://www.itidea.nl/?p=1333</guid>
		<description><![CDATA[Search refiners can contain managed metadata fields to refine the results. Sometimes the display mode of the values look a bit weird in the refinement panel.
Suppose a sitecolumn of a library is a managed metadata column bound to a global termset. The termset is the parent of a few terms and all of these terms [...]]]></description>
			<content:encoded><![CDATA[<p>Search refiners can contain managed metadata fields to refine the results. Sometimes the display mode of the values look a bit weird in the refinement panel.</p>
<p>Suppose a sitecolumn of a library is a managed metadata column bound to a global termset. The termset is the parent of a few terms and all of these terms have one or more children itself. A termtree.<br />
The display format of the column is set to &#8216;Display the entire path to the term in the field&#8217;.<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner01.png"><img class="alignnone size-full wp-image-1338" title="Managed metadata column" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner01.png" alt="Managed metadata column" width="414" height="397" /></a></p>
<p>A few documents are uploaded to the library and the metadata column is set to one of the terms.<br />
A full crawl is completed and the refinement panel shows the metadata refiner.<br />
The refinement panel now looks like this:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner02.png"><img class="alignnone size-full wp-image-1340" title="Refinement panel with child terms" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner02.png" alt="Refinement panel with child terms" width="166" height="147" /></a></p>
<p>As can be seen, not the whole fieldvalue is displayed. That&#8217;s weird. How do I know which one to use if not the whole value can be seen?<br />
Maybe it&#8217;s a css issue or the left column of the screen isn&#8217;t wide enough? Starting up Firebug and checking out the value:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner03.png"><img class="alignnone size-full wp-image-1341" title="Firebug shows value" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner03.png" alt="Firebug shows value" width="697" height="171" /></a></p>
<p>The whole value isn&#8217;t present as text to display in the panel! I was seriously surprised!<br />
SharePoint returns only the first 19 characters and three dots&#8230;</p>
<p>But&#8230; hover over de terms and the whole path is displayed. But that&#8217;s not a satisfactory solution, the values have to be displayed properly!</p>
<p>Ok, I agree displaying the whole term tree path isn&#8217;t that useful in this case, but it&#8217;s needed somewhere else in the site, so the display format of the site column has to stay &#8216;Display the entire path to the term in the field&#8217;.<br />
It would be great to have on option to show only the last term value despite the column display format. An excellent configuration place would be an extra attribute in the filter categories definition xml.</p>
<h3>Displaying the last term value</h3>
<p>The xslt of the refinementpanel can be adjusted to display the last term value now we know the tooltip does know the whole value.</p>
<p>Original xslt:</p>
<pre class="brush: xml;">
 &lt;a href=&quot;{$SecureUrl}&quot; title=&quot;{$RefineByHeading}: {$UrlTooltip}&quot;&gt;
  &lt;xsl:value-of select=&quot;Value&quot;/&gt;
 &lt;/a&gt;
</pre>
<p>The new xslt looks a little bit different than that.<br />
First the fieldvalue has to be analyzed if it contains &#8216;:&#8217;. The &#8216;:&#8217; means the value is a child term and the whole tree path is displayed.<br />
From the value which contains the whole tree path the last term is filtered by a recursive xslt template ´substring-after-last´.<br />
Then a check has to be performed if the last term value contains the three dots. If it does, the last term value should be taken from the tooltip value, because the xslt Value doesn&#8217;t contain this value. Confusing, isn&#8217;t it?</p>
<pre class="brush: xml;">
&lt;xsl:variable name=&quot;PartOfValue&quot;&gt;
 &lt;xsl:call-template name=&quot;substring-after-last&quot;&gt;
  &lt;xsl:with-param name=&quot;string&quot; select=&quot;Value&quot; /&gt;
  &lt;xsl:with-param name=&quot;delimiter&quot; select=&quot;':'&quot; /&gt;
 &lt;/xsl:call-template&gt;
&lt;/xsl:variable&gt;

&lt;xsl:variable name=&quot;PartOfTooltip&quot;&gt;
 &lt;xsl:call-template name=&quot;substring-after-last&quot;&gt;
  &lt;xsl:with-param name=&quot;string&quot; select=&quot;$UrlTooltip&quot; /&gt;
  &lt;xsl:with-param name=&quot;delimiter&quot; select=&quot;':'&quot; /&gt;
 &lt;/xsl:call-template&gt;
&lt;/xsl:variable&gt;

&lt;xsl:choose&gt;
 &lt;xsl:when test=&quot;($FilterCategoryType = 'Microsoft.Office.Server.Search.WebControls.TaxonomyFilterGenerator') and ($PartOfValue != '')&quot;&gt;
  &lt;xsl:if test=&quot;not(contains($PartOfValue, '…'))&quot;&gt;
   &lt;xsl:value-of select=&quot;$PartOfValue&quot;/&gt;
  &lt;/xsl:if&gt;
  &lt;xsl:if test=&quot;contains($PartOfValue, '…')&quot;&gt;
   &lt;xsl:value-of select=&quot;$PartOfTooltip&quot;/&gt;
  &lt;/xsl:if&gt;
 &lt;/xsl:when&gt;
 &lt;xsl:otherwise&gt;
  &lt;xsl:value-of select=&quot;Value&quot;/&gt;
 &lt;/xsl:otherwise&gt;
&lt;/xsl:choose&gt;
</pre>
<p>If the fieldvalue contains less than 19 characters, no dots are displayed and the value can be used, but in that case the urltooltip is empty&#8230; To solve an empty tooltip, check out <a href="http://www.itidea.nl/index.php/empty-tooltip-in-refinement-panel/">my next post</a>.</p>
<p>After the xslt has been implemented the refinementpanel looks like the picture below<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner041.png"><img class="alignnone size-full wp-image-1345" title="Adjusted refinementpanel" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner041.png" alt="Adjusted refinementpanel" width="148" height="148" /></a></p>
<p>And the tooltip displays the whole term tree:<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner06.png"><img class="alignnone size-full wp-image-1346" title="Tooltip" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner06.png" alt="Tooltip" width="256" height="148" /></a></p>
<p>SharePoint returns only the first 19 characters, so what happens when a term itself exists of 19 or more characters?<br />
<a href="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner05.png"><img class="alignnone size-full wp-image-1343" title="Refinement panel with long term" src="http://www.itidea.nl/wp-content/uploads/2012/02/MMDRefiner05.png" alt="Refinement panel with long term" width="201" height="148" /></a></p>
<p>On the one hand it&#8217;s great the 19 character limitation of displaying a whole termtree isn&#8217;t applied to this term, on the other hand, it doesn&#8217;t look very nice when the text continues outside the refinement panel.</p>
<h3>Summary</h3>
<p>The values of the refinement panel have a 19 character display limit. When displaying a whole termtree it&#8217;s likely this limitation will be exceeded. Just a few xslt adjustments are necessary to display the fieldvalues correct again.</p>
 ]]></content:encoded>
			<wfw:commentRss>http://www.itidea.nl/index.php/refinement-panel-character-display-limitation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
