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

Forums / Developing with Sitefinity / Library Module - Providers

Library Module - Providers

4 posts, 0 answered
  1. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    02 Mar 2010
    Link to this post
    Hi, I have used the Image and Documents module extensively in one of my latest projects, and the module is getting cluttered with the different libraries etc, so I would like to break these out into different modules in the module tool bar.

    That is I would like to create 3 different providers for the image and documents module and either create a drop down selection in the command panel to select the provider or create three modules that extend from images and documents, but specify a different default provider that uses the Telerik.Libraries.Data.DefaultProvider provider class, but stores the data using a different application name, thus breaking this information up into neat little compartments. However, after spending most of the day on this I can not seem to get this working. Could you please point me in the right direction.

    Thanks heaps
    Nigel
  2. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    02 Mar 2010
    Link to this post
    Disregard that, sorry, After writing this post I stumbled on the answer. I will outline below all the places where you want to add to the web.config to make the genuis module automaticly add the provider drop down :)

    <cmsEngine defaultProvider="Generic_Content">
                <providers>
                    <clear />
    ....
    <add name="Libraries" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].sflb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/Libraries" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />                
    <add name="LibrariesDownload" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name].sflb.ashx" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/ResourceLibrary" allowVersioning="False" allowLocalization="False" localizationProviderName="" allowWorkflow="False" securityProviderName="" versioningProviderName="" connectionStringName="GenericContentConnection" type="Telerik.Libraries.Data.DefaultProvider, Telerik.Libraries.Data" tagEditorTemplate="~/Sitefinity/Admin/ControlTemplates/Libraries/BatchTagsEditor.ascx" />...         </providers>
    ...
    <libraries defaultGenericProvider="Libraries">
                <genericContentProviders>
                    <add providerName="Libraries" publicationDateField="Publication_Date" />
                    <add providerName="LibrariesDownload" publicationDateField="Publication_Date" />
                </genericContentProviders>
                <libraryInfo>
    ....

    Obvious once you see it :)

    Thanks heaps SiteFinity Team
  3. Nigel
    Nigel avatar
    49 posts
    Registered:
    07 Jul 2008
    02 Mar 2010
    Link to this post
    I have added the following to the web.config
    <add key="LibraryEntityFiles.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Width" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Height" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Size" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Extension" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.AlternateText" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Description" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.PermaLink" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Publish_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Signed" valueType="Boolean" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Signed_Date" valueType="DateTime" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Signed_By" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Aggreement_Text" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="LibraryEntityFiles.Content_Extract" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Width" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Height" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Size" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Extension" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.AlternateText" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Description" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
    <add key="ResourceLibrary.Content_Extract" valueType="LongText" visible="True" searchable="True" sortable="True" defaultValue="" />

    to define the meta data for the new applications that I have created with the new providers, however I am getting the following error when I try to add anything to a library in these new providers:

    KeyNotFoundException: The given key was not present in the dictionary.]
       System.ThrowHelper.ThrowKeyNotFoundException() +36
       System.Collections.Generic.Dictionary`2.get_Item(TKey key) +10373221
       Telerik.Cms.Engine.StagedContent.GetMetaData(String key) +16
       Telerik.Libraries.WebControls.Admin.LibraryItemEdit.get_Title() +120
       Telerik.Cms.Web.UI.Backend.BackendBreadcrumb.AddBreadcrumbNode(IViewModeControl modeControl, Boolean generateRoute, String parameter, String parentId) +155
       Telerik.Cms.Web.UI.Backend.ControlPanel`1.HandleLoadedView(IViewModeControl viewModeControl) +148
       Telerik.Cms.Web.UI.ViewModeControl`1.HandleLoadedView(IViewModeControl viewModeControl) +116
       Telerik.Cms.Web.UI.ViewModeControl`1.LoadCurrentView(Control owner) +166
       Telerik.Cms.Web.UI.ViewModeControl`1.InitializeControls(Control viewContainer) +64
       Telerik.Cms.Web.UI.ViewModeControl`1.CreateChildControls() +144
       System.Web.UI.Control.EnsureChildControls() +146
       System.Web.UI.Control.PreRenderRecursiveInternal() +61
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Control.PreRenderRecursiveInternal() +224
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3394
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    02 Mar 2010
    Link to this post
    Hi Nigel,

    You are getting this error because one of providers you use LibraryEntityFiles or ResourceLibrary does not exist or one of the metakeys you are trying to set/get is not declared.

    The stack shows that the code fails on Telerik.Cms.Engine.StagedContent.GetMetaData(String key) +

    Greetings,
    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.
Register for webinar
4 posts, 0 answered