More in this section

Forums / Developing with Sitefinity / Multiple GC Providers: filter ControlPanel List

Multiple GC Providers: filter ControlPanel List

5 posts, 0 answered
  1. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    30 Jan 2009
    Link to this post
    I've implemented multiple providers for Generic Content according to this article:

    http://www.sitefinity.com/support/knowledge-base/kb-article/b1154K-bach-b1154T-cmm.aspx

    Now I have the dropdown that shows my providers, but the list of content items in the ControlPanel includes all GC, not just the content from the selected provider.  How do I override this behavior?

    Thanks in advance!
    Mike
  2. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    30 Jan 2009
    Link to this post
    Also, what is more important is that when I select my provider from the drop down, and create content, I need to be sure it's being saved by that provider, so that I can differentiate it from other GC later one.  For example, when I use:

    contentManager.GetContent("MyCustomProvider")

    In this particular case, I'm simply cloning the OOTB generic content provider, so that I can store different content types separately.

    Mike
  3. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    30 Jan 2009
    Link to this post

    ContentManager managerContentType1 = new ContentManager("Provider1");
    ContentManager managerContentType2 = new ContentManager("Provider2");

    IList contentType1 = managerContentType1.GetContent();
    IList contentType2 = managerContentType2.GetContent();
           

    Ok, I guess when I added new providers in the web.config, I assumed the provider name would be used to scope the content, similar to how the ApplicationName scopes membership:
           
    But I just ran a short test, and when I run this:

    ContentManager managerContentType1 = new ContentManager("Provider1");
    ContentManager managerContentType2 = new ContentManager("Provider2");

    IList contentType1 = managerContentType1.GetContent();
    IList contentType2 = managerContentType2.GetContent();

    both contentType1 and contentType2 contain the same content items.

    In my web.config, I add the GC content providers like this:

    <add name="Articles"
        urlRewriteFormat="[Publication_Date]/[Name].aspx"
        urlDateTimeFormat="yy-MM-dd"
        urlWhitespaceChar="_"
        visible="True"
        defaultMetaField="Name"
        securityProviderName=""
        allowLocalization="False"
        allowVersioning="True"
        allowWorkflow="False"
        allowComments="false"
        commentsModeration="true"
        versioningProviderName=""
        connectionStringName="GenericContentConnection"
        type="Telerik.Cms.Engine.Data.Providers.DefaultProvider, Telerik.Cms.Engine.Data" />
    <add name="Biographies"
        [ etc ]
        />
    <add name="Presentations"
        [ etc ]
        />

    But since they're all using the same default provider, there's no difference between them.

    So my REAL question is, how can I separate my different kinds of content?  I'd rather not use Categories, because I'd like to use those to further subdivde/organize the content.

    Thanks,
    Mike
     

  4. Mike
    Mike avatar
    208 posts
    Registered:
    10 Dec 2007
    02 Feb 2009
    Link to this post
    I thought I'd follow up, in case someone else tries to do this.  A colleague pointed out that I was missing the applicationName attribute, which will scope the provider.  Once I added that, each of my GC content providers were separately scoped, including their associated categories.  (thanks Brandon!)

    Regards,
    Mike
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    03 Feb 2009
    Link to this post
    Hi Mike,

    Sorry for not being able to help you on time. This is the problem indeed. If the applicationName is the same, Sitefinity treats the two modules as one. Everything between them is shared.

    Best wishes,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
5 posts, 0 answered