WebApi Part II
My previous post explored the plumbing of creating a WebApi service within Sitefinity. It was long enough, and so I left the optional enhancements for this follow-up post.
Welcome to my articles on Sitefinity and the and experiences I have had. I do love helping others out and it gives me a real thrill when people approach me for help and second when I actually help them out. So here I not only hope to help others out but also hope that others take the time to help me out. I don't mind being wrong but I do hate being wrong for a long time. So call me out if you can, help me to avoid writing another Doh story.
My previous post explored the plumbing of creating a WebApi service within Sitefinity. It was long enough, and so I left the optional enhancements for this follow-up post.
Out-of-the-box Sitefinity offers built-in REST and OData data services for you to consume. It's officially a fully fledge Headless CMS now. But sometimes, you just need to build your own API, customised to get and format the data you want in the way you want it, and the first choice for doing that is often using an MVC WebApi solution.
I have been using version two of Google Recaptcha for a while and this month I thought I should update that to version 3. Little did I know that version 3 was now also yesterday's tech and today we have Google Recaptcha Enterprise. Is it any better? That I don't know but I do have the starting of an implementation of it to use in Sitefinity.
It is quite well documented how to customise Sitefinity's 'content widgets'. But customising the 'layout widgets', well, that's a little less talked about. It's easy to add your own layout widgets but these are static HTML files. Often I see a dozen options created for every scenario and/or instructions about adding speciality classes in the designer to achieve effects. This is not a good experience for the content editor.
I am always one for upgrading Sitefinity to the latest release and reviewing and improving the whole environment. Development, Source control, Builds deployment and of course actual code.
Once I had used the Sitefinity CLI tool to upgrade a project I was hooked. This was way simpler than the manual process. Not only does it update your packages but it's smart enough to sort out and correct some misconfigurations. But there was something missing for me. There was no option to create a new project. The good news is that the Sitefinity team have this code as open-source meaning I could download and look to add that functionality myself. So, that is what I have done.
Upgrading Sitefinity to 14.0 was straight forward but a dumb mistake had me giving myself an uppercut. Despite my shame and for your convenience I will write out the steps I went through which may help you when trying to find live site issues.
Its easy for users to create forms through Sitefinity. But the storage is a simple list and most people want some cool analytics and management of their form data such as provided by Salesforce or ActOn. In this post I look at an easy way to push our forms data to these third party services.
The add link dialogue could do with a few more options such as 'noreferrer' and nofollow.
When creating a new user I got an error, 'A user with this nickname already exists'. That didn't seem right to me. In my family, all three brothers have the same nickname.
This is my third post of ideas to consider to help make your pages load and run faster. Some will help some projects while others may not be quite relevant. There will be some that contradict previous tips. But hopefully, you will find a few to improve your sites perfromance.
Sitefinity has added a security check named as the Signing Certificate. It is used to verify the issuer of the authentication token to enhance the safety of the site. But currently, the documentation is missing an important piece of configuration to allow this to work for Azure hosted sites.
Recently I came across (another) incorrect implementation of async code which has prompted me to write this post. Async methods are an encouraged code/design implementation but it is important to understand how it works and have some guidelines about using it. If you use it incorrectly, it will slow your application down rather than improving it.
Sitefinity comes with a background scheduler service which is really handy for peridoic processes. A design I have regular used is to actually create two tasks for every one job. Sound silly? Let me tell you what I do.