XPathTool is a really great online XPath utility. It’s free, doesn’t need to be installed and has more features than a lot of the utilities that you find on CodePlex.
Author Archives: Merill Fernando
Making SharePoint JSon calls from PowerShell in SharePoint 2013
The Invoke-RestMethod in PowerShell 3 doesn’t send the appropriate header required by SharePoint 2013 to return JSon results. It took me a while to figure out this workaround.
$parameter = "my search text"
$encParam = [System.Web.HttpUtility]::UrlEncode("'$parameter'")
$url = "http://mysp2013site/_api/search/query?querytext=$encParam"
$wc = new-object System.Net.WebClient
$wc.UseDefaultCredentials = $true
$wc.Headers.Add("Accept", "application/json; odata=verbose")
$res = $wc.DownloadString($url)
$res
Mobile Apps: Native or Web?
When building for mobile there isn’t a silver bullet. Instead we have a myriad of compromises to make. If your an enterprise wanting to build apps here are four broad options.
Native code (Objective C for iOS, Java for Android, C#/Xaml for Windows)
Pros:
- Build the best experience in each platform (Native UI, Performance)
- Discoverable in app stor
Cons:
- Cost (3 codebases)
- Dev skills
- Publishing to each app store, wait for approvals etc
Native with re-usable code (C# for platforms -> MonoTouch for iOS, Mono for Android, C#/Xaml for Windows) http://xamarin.com
Pros:
- Build the best experience in each platform (Native UI, Performance)
- Discover-able in app store
- Code reuse (except for the presentation layer in each platform the rest of the business logic, web service calls etc are reusable)
Cons:
- Cost (Cheaper than 100% native but will cost more than plain html)
- Dev skills (Devs still need to understand the UI APIs for each platform e.g. CocoaTouch, UIKit…
- Publishing to each app store, wait for approvals (e.g. you find a bug fix it and submit to app store, it will then take 5 business days before the bug fix is available for end users to download).
HTML but deployed natively (PhoneGap, Sencha, etc…)
Pros
- Javascript (Use frameworks /tools such as jQuery mobile, TypeScripts etc)
- Costs less to build (one code base across platforms)
Cons:
- Performance issues with iOS webkit (Only Apple apps and Safari browser can use the hardware accelerated Nitro JavaScript engine, everyone else is forced to use the slower js engine. This is why Facebook ditched HTML5 and wrote a native iOS app). If the apps we’re building are not going to be flashy and don’t rely on animations then this is a non-issue.
- UI is not native to each OS
- App updates need to go through approval process for each App Store
HTML only: Basically a web site (ASP.NET MVC or a SharePoint app / application page with responsive layout to adapt to a mobile browser)
Pros:
- Javascript (Use frameworks /tools such as jQuery mobile, TypeScripts etc)
- Costs less to build (one code base across platforms)
- Performance will be better (but not as good as native) since the site runs in Safari and can use hardware acceleration
- Updates to app is just a matter of pushing update to website (user doesn’t need to upload etc)
- Option #1 and #2 will anyway need a website to host the webservice
Cons:
- UI is not native to each OS
- Discover-ability: No app store. User needs to bookmark app url. Enterprises can work around this by having a single Web App Store that lists all their web apps (ala http://www.apple.com/webapps). Or build a shell native app that acts as a launcher for the web apps.
Need more options/tool choices? See http://en.wikipedia.org/wiki/Mobile_application_development
Another disadvantage with the native options. You need to build and publish a mobile and a tablet version of the app.
My view is that while native apps are the better choice for companies that build and sell services/products, the web option gives the best ROI for enterprises. Even when it comes to product/service companies a strong case can be made for going web only. Ask the guys who built Basecamp.
Creating a BCS Content Source using PowerShell
You can use the following command to create a content source to crawl a Business Data Connectivity Service (BDCS).
$lobSystems = @("LOBSystemName1","LOBSystemNameInstance1")
New-SPEnterpriseSearchCrawlContentSource -name "My Content Source Name" -searchapplication "My Search Service Application Name" -Type Business -LOBSystemSet $lobSystems
If the LOBSystemName is not correct the content source gets created but the model you want to search is not checked.
To figure out the right values for the LOBSystemName and LOBSystemInstanceName look no further than the bdcm file in your solution. Open the .bdcm file in notepad and use the Name attributes of the LobSystem and LobSystemInstance nodes.
SharePoint Health Monitor App
Tips for working with BCS and FAST Search
When building a FAST search solution to crawl external entities through BCS it can get very frustrating if you deploy a change and it doesn’t get updated in all the right places.
After much trial and error I have come up with the following checklist to keep your sanity.
Rule #1: If you change the BCS model manually (i.e. using a text editor instead of Visual Studio) you need to change the Version attribute of the Entity node in the entity that you make the change in. If you don’t do this any update you make will not be applied. This can lead to very confusing behaviour since the change you made will get reflected at some point down the line.
Apart from that here goes the checklist
- Delete the BCS content source
- Restart the SharePoint Server Search service
- Using Task Manager kill off any mssdmn.exe that are running
- Deploy your updated solution
- Recreate the content source and run a full crawl.
If your working in a multi-farm scenario where the Search service is in a different farm to that of the BCS service then you need to do steps #2 & #3 in the server running the Search crawls. This is important because any assemblies that you have built for the entity are dynamically copied into that server and loaded into Server Search & mssdmn.exe.
If you don’t do steps #2 & #3 Search will end up using the older version of your assembly and not the one that you just deployed.
On Ode To My Father
Hi Dadda,
I’ve wanted to write this note to you for a very long time. To let you know how much you’ve taught and inspired me with your life. I know that I don’t have a really close relationship with you like I do with Mummy. That most of our time together is spent in awkward silence while we search for something to talk about. But I want to let you know today that you have been the cornerstone of my life.
Thank you Dadda for teaching me the true meaning of love. In your 35+ years of marriage I have never seen or heard you show any hatred to Mom.
Thank you for showing me that true love means sticking with and taking care of darling Mummy who is ill with Parkinson’s.
Thank you for teaching me how to respect women by never ever raising your hand against Mummy.
Thank you for teaching me how to forgive and forget. Many people have wronged you but you never hold a grudge against anyone. You would forgive them in a heartbeat and let bygones be bygones.
You taught me morality. About always doing the right thing and to always be honest even when it is difficult. You went from being a very successful businessman to someone who doesn’t have much for which the main reason was because of your honesty and refusal to bribe or cheat anyone.
You taught me the joy of giving and sharing what little you have with others, about going out of your way to help someone who can never repay you.
You taught me not to waste anything in life. Whether it be finances or the environment around you.
You taught me what it was to work hard. I was privileged enough to work under you. Although I hated it at that time as a teenager, I now value and cherish the work ethic that you instilled in me.
You didn’t have it easy in life. Your mother died when you were just three. I can only imagine how hard it must have been to grow up without a mother’s love.
You were a promising student in school but were robbed off your education when Grandpa had you leave school and start work in the family business. Because of this you made sure that your kids got the best education possible even when it was beyond your means. I didn’t understand then but having my own family now I realise that you sacrificed quite a lot to send us to the best school possible.
You believed in me. Thinking back, if I ever showed an interest in something you made sure that I explored it. From playing the guitar and organ (which I can’t do to this day) to karate lessons, soccer and basketball lessons.
It took a lot of courage for you to let me drop out of school and follow my dream. You gave me the freedom to go after what I was passionate for. You believed in me and supported me.
One of my most favourite childhood memories is going for a swim after Sunday school. It took you less than two months to teach me how to do it. Oh the wonderful times we had.
Thank you dad for showing me that it takes a lot of courage, strength and self-control to stand by your convictions. That it takes more man to stay away from the vices of drinking and smoking.
Thank you for loving me unconditionally to this day.
Thank you for showing me how to live a life of service to others. You now dedicate your time to helping people. From running errands for various non-profits like the Little Sisters of the Poor, to visiting those who are sick or in prison and praying with them, to writing daily devotionals and sharing the Good News.
Thank you for showing me that it’s never too late to make your dreams come true, at 53 your now reading for a Bachelors in Theology and kicking ass by coming out on top in class!
Above everything else I want to thank you for the deep, personal and meaningful relationship you have with your Saviour and friend Jesus. You paved the way for me to find the one eternal treasure in life that is worth living for.
I love you Dadda.
Troubleshooting the ’403 Forbidden’ error for SharePoint & ASP.NET Apps
If your site bombs out with 403 Forbidden error one quick way to identify the root cause is to run ProcessMon on the web server and filter it out to only show entries where
Process Name = w3wp.exe
Result = ACCESS DENIED
Disable Windows Live Contacts from being synchronized to Windows Phone
One very useful Windows Phone feature is that it automatically adds all your Windows Live contacts to your Windows Phone when you sign in. This is all fine and dandy if that’s your master contact list but for me all of those contacts were carried over from MSN Messenger which I stopped using many years ago.
The most annoying bit is that there is no way to get rid of those contacts. As of WP 7.5 you only have two options either delete all your contacts from Windows Live or change your primary Windows Live ID (which required a hard reset).
There is a third option though and that is to filter out the Windows Live contacts from the People Hub.
To do so go to the People Hub -> Settings -> Filter -> Uncheck Windows Live
Tada a quick and painless way to remove the Windows Live contacts and keep your address book tidy.
Windows 8 – New Folder
To create a new folder in windows explorer pre Win8 was Alt+F, N.
In Windows 8 it’s Alt+H, N
There are many new shortcuts like Alt+F,S to start PowerShell etc.. The neat advantage with the ribbon bar is that you press Alt and can see the shortcut letters displayed so you don’t need to memorise these things.
