SharePoint : How to filter an external data XsltListViewWebPart in SharePoint Designer ?

sharepoint 2013
sharepoint 2013
Context : You use Business Data Connectivity to retrieve external data in SharePoint, and you wish to display a filtered view of this data in a page.
In SharePoint Designer, you insert a Data View of that external data.

Then, there are 2 ways to filter it :

  • By using the “Filter” button in the office ribbon :
SharePoint Designer Filter
SharePoint Designer Filter

This actually generates a CAML query :


  • By passing a parameter to the finder method of the BDC Model. You can do this manually or by using the “Search” button :


It generates this code in the View element :


You should use the second solution. Why ? We could consider the CAML query as a “front-end” filter. It means that ALL the records are sent by the BDC, and then the CAML query filter it.
If you retrive thousands of records, it can affect performances.

If you pass a parameter directly to the BDC (finder method), the request sent to the external source will be filtered, and SharePoint will have to deal with less data.

Maybe you will have to create a new finder method in your BDC, but it worth the time spent on it !

SharePoint 2013 : How to repair a broken Search component at low cost

sharepoint 2013
sharepoint 2013
Once upon a time, after a whole server farm reboot, one of my search component was broken. Content crawling was taking forever, and the ULS were not very explicit. In the central administration, I could see this :

SharePoint Components
SharePoint Components

My application server was unable to run the “Content Processing Component”, even if I restart the whole search service (net stop / start OSearch15).

I noticed 2 things that drove me to the solution :
– First, a noderunner.exe process was missing. This confirmed the red cross in the central administration. There was 2 processes instead of 3 (the crawler doesn’t spawn a noderunner.exe process) :

SharePoint Search Processes
SharePoint Search Processes

– On the second hand, there was strictly no logs in the “\15.0\Data\Office Server\Applications\Search\Nodes\\ContentProcessingComponent” directory !

It was like the search topology was ignoring this component. So I decided to re-install the search topology, just by cloning it, and activating it :

$searchApp = Get-SPEnterpriseSearchServiceApplication

$initialTopology = Get-SPEnterpriseSearchTopology -SearchApplication $searchApp -Active

$cloneTopology = New-SPEnterpriseSearchTopology -SearchApplication $searchApp -Clone -SearchTopology $initialTopology

Set-SPEnterpriseSearchTopology -Identity $cloneTopology -SearchApplication $searchApp

And it works, without any service interruption !

SharePoint Components
SharePoint Components

Azure : Faire cohabiter du PHP et du .NET sur un même site, c’est possible !

azure_logo Dans Azure, le cloud de Microsoft, il est possible de faire héberger un site web qui contient des pages .NET et PHP.
Avec le recul, ça peut paraître évident. Mais j’ai été surpris au premier abord.

Dans l’onglet “Configuration” du site, il suffit de vérifier si les 2 frameworks sont activés :


(Désolé, c’est une capture de l’ancien portail Azure, mais je ne peux pas encadrer le nouveau portail avec son UX horrible)

Du côté de Visual Studio, ça se présente ainsi, pas besoin d’installer une extension du genre PHP Tools, il suffit d’ajouter ses fichiers PHP à la solution :


Je me suis aperçu de tout cela en implémentant un back-end web-services en C# sur ma vieille appli PHP des années 90. Et ça marche nickel !

NB : Je ne serai pas étonné qu’on puisse également ajouter du JAVA et du Python, afin d’obtenir une application web œcuménique où les langages cohabiteraient en paix.

SharePoint 2013 : Email notifications are not sent (from My Site’s newsfeed)

sharepoint2013 Context : Users of your SharePoint web applications can receive email alerts, but they are never notified by all the “My Site” activities, such as “Someone has started following you” or “Someone has mentioned you”.

In the SharePoint logs (ULS), you can see errors like:

Failed attempt x sending mail to recipients: Mail Subject: NAME Surname mentioned you in a conversation. Error: SmtpException while sending email: System.Net.Mail.SmtpException: Mailbox unavailable. The server response was: 5.7.1 Client does not have permissions to send as this sender

Solution : These notifications seem to be sent in an authenticated way, by the app pool service account (unlike the standard emails (alerts) that use the address defined in the “outcoming email” in central administration, in an anonymous way). So you have to add the right “Send-As” to this account in Exchange.

NB : If it doesn’t work, grant this right to the SharePoint Timer service account as well. I still have a doubt on this one :/

Source : Technet forum