Try our conversational search powered by Generative AI!

Marthin Freij
Feb 11, 2010
  6451
(0 votes)

Configuring page provider capabilities

Page providers requires some configuration. In addition to the obvious ones like name, type and entryPoint you should also define what capabilities your page provider supports, such as Create, Edit, Delete and Search. If you, for example, specify that your provider does not support delete, all delete related ui in edit mode will be disabled for your providers pages. More details on capabilities can be found in the Configuration section of the Page Provider Tech Note.

In almost all examples I have seen for page provider configuration, capabilities are specified in web.config. In my opinion, capabilities should not be defined in configuration. This could lead to, by accident, specifying more capabilities than what is actually implemented in code. I think the best place for this kind of configuration is code. Fortunately, the Capabilities property in PageProviderBase is virtual, which means you can override it and configure it there.

public override PageProviderCapabilities Capabilities
{
    get
    {
        return PageProviderCapabilities.Create | 
            PageProviderCapabilities.Edit | 
            PageProviderCapabilities.Search;
    }
}
Feb 11, 2010

Comments

Sep 21, 2010 10:33 AM

Good one Martin! I totally agree with you.
/ Tom Stenius

Sep 21, 2010 10:33 AM

This is not as good if you want to provide some reusable provider. When you override Capabilities property web.config settings have no effect at all. So someone else won't be able to suppress for example Delete or Create later. I think implementation should be like this:

Math.Min( base.Capabilities & (int)PageProviderCapabilities.Create,
(int)PageProviderCapabilities.Create ) |
Math.Min( base.Capabilities & (int)PageProviderCapabilities.Edit,
(int)PageProviderCapabilities.Edit ) ...
/ Vlad

Please login to comment.
Latest blogs
Optimizely and the never-ending story of the missing globe!

I've worked with Optimizely CMS for 14 years, and there are two things I'm obsessed with: Link validation and the globe that keeps disappearing on...

Tomas Hensrud Gulla | Apr 18, 2024 | Syndicated blog

Visitor Groups Usage Report For Optimizely CMS 12

This add-on offers detailed information on how visitor groups are used and how effective they are within Optimizely CMS. Editors can monitor and...

Adnan Zameer | Apr 18, 2024 | Syndicated blog

Azure AI Language – Abstractive Summarisation in Optimizely CMS

In this article, I show how the abstraction summarisation feature provided by the Azure AI Language platform, can be used within Optimizely CMS to...

Anil Patel | Apr 18, 2024 | Syndicated blog

Fix your Search & Navigation (Find) indexing job, please

Once upon a time, a colleague asked me to look into a customer database with weird spikes in database log usage. (You might start to wonder why I a...

Quan Mai | Apr 17, 2024 | Syndicated blog