In this post I would like to share an example of implementing a custom SqlAuthorizationProvider
for a Sitecore solution. First things first, you have to really consider using it for a large solution, it’s a customization for accessing items for users and roles and it’s a core functionality of Sitecore XM – this provider is called every time (if no cache hit), when anyone tries to get access to an item – with Experience Editor, Content Editor, Sitecore Item API, etc.).
Category: .net
Sitecore Headless – How to reuse Layout Service serialization in custom API Controllers
On one of our current project we have a close deadline, therefore we need to simplify implementation and cut from the scope as much as possible to roll out the MVP with the full functionality but without Experience Editor support – as it’s not priority for now. We had a long discussion about this, the main reason of cutting scope is to keep the frontend simple as possible and focus on business logic functionality instead of editing experience. Therefore on the Sitecore side we are providing a few APIs for the frontend and not creating any layout, rendering and placeholders; only pure templates and content.
Continue reading “Sitecore Headless – How to reuse Layout Service serialization in custom API Controllers”Sitecore Headless – Wildcard item with datasource content resolver
On one of my first Sitecore Headless project I got a requirement to implement a dynamic URL resolving to display product data from a different root of the Sitecore tree. If it would have been a traditional Sitecore solution I could implement a custom item resolver but in the headless world we need a different kind of mindset to solve problems like this.
Continue reading “Sitecore Headless – Wildcard item with datasource content resolver”Update NuGet packages in multiple repositories
On my current project we are struggling of updating multiple repositories after we are pushing a new version of our custom NuGet packages. A solution could be to use floating versions but I wanted more control over the versions, because there could be cases where I need different versions on each solutions. Therefore I went in the direction to update the versions manually on a developer machine. This way, pull requests needs to be opened for each package updates, but this is great because I want all developers aware of the changes.
Continue reading “Update NuGet packages in multiple repositories”Sitecore default Save command post action usage
Long time no posts about Sitecore Content Editor, but recently I got the following requirement on a project:
Continue reading “Sitecore default Save command post action usage”Creating a new Save button in Content Editor to perform synchronization – with other items in the tree – of specific fields on the selected item.
Using Sitecore configuration API from Service Configurator
OR when you are facing with the following exception:
[LockRecursionException: A read lock may not be acquired with the write lock held in this mode.] | |
System.Threading.ReaderWriterLockSlim.TryEnterReadLockCore(TimeoutTracker timeout) +1347 | |
System.Threading.ReaderWriterLockSlim.TryEnterReadLock(TimeoutTracker timeout) +44 | |
Sitecore.DependencyInjection.ServiceLocator.get_ServiceProvider() +176 | |
Sitecore.Configuration.<>c.<.cctor>b__360_0() +9 | |
System.Lazy`1.CreateValue() +734 | |
System.Lazy`1.LazyInitValue() +189 | |
Sitecore.Configuration.Settings.GetSetting(String name) +48 |
Sitecore 9.3 CM with reverse proxy and Identity Server
I published my last post a long time ago, but I faced new challenges while upgrading a Sitecore infrastructure from 9.0.1 to 9.3. As you all probably know, Identity Server is used as primary authenticator for CM environments by default.
Continue reading “Sitecore 9.3 CM with reverse proxy and Identity Server”Glass Mapper – SitecoreContext.Database is null
In the last days I had to discover why on first load of the IIS site SitecoreContext.Database
is null.
Template dependent field validator WITHOUT Sitecore rules engine
A year ago I have posted about how to create template dependent field validator with rules engine. But it requires too many modifications, so I have decided to write this post about how to do the similar functionality without rules engine.
So at first I have implemented a base class which should be used by all validators which want to be dependent on a template or a base template. This class does the following steps:
- Checks the template ID and base template ID of the current item
- If it is true then the main part is called, this is the following line:
return evaluate();
This is the injected specific validation method which is passed as a parameter.
Continue reading “Template dependent field validator WITHOUT Sitecore rules engine”
WebEdit.AffectWorkflowForDatasourceItems – collect datasource children items
This feature appeared in Sitecore 8.2, which is changing the workflow state value for datasource items together with the context page item (only in Experience Editor). Here is a great summary article related to these improvements.
I was not fully satisfied with this because by default this only collects the datasource items and does not the children items of a datasource. This is an issue when you have something like a list component which shows the children items. What I have found is:
<command name="webedit:workflowwithdatasourceitems" type="Sitecore.ExperienceEditor.WebEdit.Commands.WorkflowWithDatasourceItems, Sitecore.ExperienceEditor" />
Continue reading “WebEdit.AffectWorkflowForDatasourceItems – collect datasource children items”