+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Multiple Generic_Content providers

Multiple Generic_Content providers

8 posts, 0 answered
  1. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    03 Sep 2010
    Link to this post
    Hi,

    I've created two new providers, based on the Generic_Content provider.

    - WebText
    - EmailText

    I've changed the web.config to add these. Each provider has its own custom fields.
    I also have different templates for each provider.

    When I added one provider, all was working okay. I could select 'Generic_Content' and see no items. When I selected provider number 2 ('EmailText') I was seeing a list with a couple of items. So, that is working as expected.

    Now when I add a third provider, named 'WebText', it goes wrong. It doesn't matter which provider I select, I always see all items that are available, the filtering is just gone. So, the items I specifically added to the 'EmailText' provider, show up in every provider.

    I must have done something wrong inside the ControlsConfig.xml, but I don't know what.

    This is the code inside my ControlsConfig.xml
    <?xml version="1.0" encoding="utf-8" ?>
      
    <controlsConfig>
      
        <viewMap>
      
            <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemEdit`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]">
                <additionalTemplates>
                    <add key="Email" layoutTemplatePath="~/Custom/Templates/Admin/ControlTemplates/Email/ContentEditView.ascx" />
                    <add key="WebText" layoutTemplatePath="~/Custom/Templates/Admin/ControlTemplates/WebText/ContentEditView.ascx" />
                </additionalTemplates>
            </viewSettings>
      
            <viewSettings hostType="Telerik.Cms.Engine.WebControls.Admin.ContentItemNewt`1[[Telerik.Cms.Engine.WebControls.Admin.ContentItemsView, Telerik.Cms.Engine]]">
                <additionalTemplates>
                    <add key="Email" layoutTemplatePath="~/Custom/Templates/Admin/ControlTemplates/Email/ContentNewView.ascx" />
                    <add key="WebText" layoutTemplatePath="~/Custom/Templates/Admin/ControlTemplates/WebText/ContentNewView.ascx" />
                </additionalTemplates>
            </viewSettings>
      
            <viewSettings hostType="Telerik.Blogs.WebControls.Admin.PostsView">
                <views>
                    <remove name="PostEditView"></remove>
                    <remove name="PostNewView"></remove>
                    <add name="PostEditView" viewType="CustomPostEdit, App_Code"></add>
                    <add name="PostNewView" viewType="CustomPostNew, App_Code"></add>
                </views>
            </viewSettings>
      
        </viewMap>
      
    </controlsConfig>

    So, should I configure this different?

    Thanks,
    Daniel
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Sep 2010
    Link to this post
    Hello Daniel,

    Check the applicationName of the providers. The providers share data based on their applicationNames. If the applicationNames are different then you should not see all items. Another option is some code in the replaced views that gets all data instead of the required one.

    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    06 Sep 2010
    Link to this post
    Hi Ivan,

    I don't have an applicationName filled in?

    These are my settings:

    Providers
    <add name="Generic_Content" 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="Email" 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="WebText" 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"/>

    Metafields
    <add key="Generic_Content.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True"/>
                    <add key="Generic_Content.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here"/>
                    <add key="Generic_Content.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
                    <add key="Generic_Content.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
      
      
    <add key="Email.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True"/>
                    <add key="Email.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here"/>
                    <add key="Email.Subject" valueType="ShortText" visible="True" searchable="False" sortable="True" defaultValue="Add subject here"/>
                    <add key="Email.Code" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
                    <add key="Email.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
      
                    <add key="WebText.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="Name this content" mandatory="True"/>
                    <add key="WebText.Description" valueType="LongText" visible="True" searchable="False" sortable="True" defaultValue="Add description here"/>
                    <add key="WebText.Header" valueType="ShortText" visible="True" searchable="False" sortable="True" defaultValue="Add subject here"/>
                    <add key="WebText.Code" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>
                    <add key="WebText.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue=""/>

    What did I forget?

    Thanks,
    Daniel
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    06 Sep 2010
    Link to this post
    Hello Daniel,

    If there is no applicationName all providers will use the default one. You have to set applicationName

    Regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    06 Sep 2010
    Link to this post
    Hi Ivan,

    Thanks. Where should I fill in this applicationName?
    I am a little confused, because I want to store all this Generic Content in the same application? The only thing is that there are some different metafield per provider.

    Regards,
    Daniel
  6. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    13 Sep 2010
    Link to this post
    Hi Ivan or others,

    What should I do with this applicationName?
    Where to set this, and is it nessecary for what I want to achieve?

    Thanks!
    Daniel
  7. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    13 Sep 2010
    Link to this post
    Hello Daniel,

    Each provider has its own application name defined in web.config provider's declaration. The applicationName is used to determine each provider instance.

    <add name="News" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/News" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/>
     
    <add name="NewsCustom" urlRewriteFormat="[Publication_Date]/[Title].aspx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Title" securityProviderName="" allowVersioning="True" applicationName="/NewsCustom" versioningProviderName="" commentsModeration="true" connectionStringName="GenericContentConnection" type="Telerik.News.Data.DefaultNewsProvider, Telerik.News.Data"/>


    Best wishes,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  8. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    13 Sep 2010
    Link to this post
    Hi Ivan,

    You mean like this?

    <add name="Generic_Content" 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="Email" applicationName="/Email" 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="WebText" applicationName="/WebText" 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"/>

    Regards,
    Daniel
Register for webinar
8 posts, 0 answered