More in this section

Forums / General Discussions / Multiple Library Providers

Multiple Library Providers

19 posts, 0 answered
  1. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    18 Mar 2011
    Link to this post
    Hello,

    I am looking for a way to have multiple Library providers, so that certain users can only have permissions/access to their group's relevant docs/images.  I realize you can restrict the built in libraries to certain users, but that method wouldn't allow for users to create new libraries themselves (in the hopes of keeping attachments organized).

    I had this setup in SF3.7 and I'm looking to achieve something similar in SF4.  Here is the code I used in the web.config file back in 3.7 to achieve multiple libraries.  In this example this would create a dropdown titled GroupA in the SF backend under Images/Docs module, which can then be assigned permissions per user group:

    <add name="GroupA" urlRewriteFormat="~/{Provider}/{LibraryName}/[Name]{Extension}" urlDateTimeFormat="yy-MM-dd" urlWhitespaceChar="_" visible="False" defaultMetaField="Name" applicationName="/GroupA" 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 key="GroupA.Name" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Width" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Height" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Size" valueType="Integer" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Extension" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.AlternateText" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" /><br>
            <add key="GroupA.Author" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Description" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.Category" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />
            <add key="GroupA.PermaLink" valueType="ShortText" visible="True" searchable="True" sortable="True" defaultValue="" />

    <add providerName="GroupA" publicationDateField="Publication_Date" />


    I've tried to do something similar in SF4 under Admin / Settings / Libraries / Providers, but I'm not sure how to have the new library provider display in the user interface.  I see that under Settings / Libraries / Providers / Controls there are relevant controls and views, but there are so many to recreate, is there anyway to inherit or duplicate the ones that already exist?

    Can anyone describe the steps I would need to go through to complete this?  Any help is greatly appreciated, thanks!
  2. Boyan Barnev
    Boyan Barnev avatar
    1429 posts
    Registered:
    30 Oct 2017
    24 Mar 2011
    Link to this post
    Hello Brad,

    You can easily add another provider to libraries, and then select which is going to be the default one. Please see the attached video, showing how you can do that.

    Greetings,
    Boyan Barnev
    the Telerik team
  3. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    24 Mar 2011
    Link to this post
    Thank you Boyan!

    The method you outlined in the video will suit my needs perfectly if I can find a way to assign a default provider for each different Role.  Also, I will need to restrict access to the different providers (the ability to choose between the various providers in the backend gray bar) to any non-admins.

    The goal would be for a user in Role-A to upload documents using Provider-A by default, and a user in Role-B to upload documents using Provider-B.  I looked around the various settings in the Admin panel, but did not see where something like this could be achieved.

    Can this be done?

    Thanks!
    Brad
  4. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    24 Mar 2011
    Link to this post
    Yea sounds possible, i think you would just need to specify your provider when uploading. For example when uploading an image

    LibrariesManager albumManager = LibrariesManager.GetManager("MyProvider");

    And for user roles
    RoleManager.GetManager("Default")

    if you want a predefined role
    RoleManager.GetManager("AppRoles")
  5. Russell
    Russell avatar
    25 posts
    Registered:
    08 Apr 2009
    24 Mar 2011
    Link to this post
    Thanks Kristian!

    Do you know which file controls the Upload logic, or where I would add such code?

    Also, would I have a series of conditional statements, one for each role/provider (if user belongs to Role-A, then use Provider-A)?
  6. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    24 Mar 2011
    Link to this post
    You might want to take a look at the Sitefinity SDK on how to create a custom control to get started.

    Yes you would need to check the role of the currently logged in user, then based on the role upload the image to the desired provider. There is some good documentation here
    http://www.sitefinity.com/40/help/developers-guide/sitefinity-essentials-modules-media-modules-images-managing-images-creating-images.html
  7. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    29 Mar 2011
    Link to this post
    Is it possible to add a provider for users / roles as well?
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    29 Mar 2011
    Link to this post
    Hi Kristian,

    Yes, you can do this from the configurations - Administration >> Settings >> Advances >> Security.
    Support for ASP.NET Membership and Role provider comes with Q1 through wrappers.

    Regards,
    Ivan Dimitrov
    the Telerik team
  9. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    30 Mar 2011
    Link to this post
    I tried adding another provider under Membership Providers with type of Telerik.Sitefinity.Security.Data.OpenAccessMembershipProvider. I expected to see another tab showing my new provider under the user management page but don't see it there?
  10. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    01 Apr 2011
    Link to this post
    Hello Kristian,

    Try restarting the application and then check the providers. Make sure that your custom is enabled. Inside the view where you create it there is a check box "isEnabled"

    Regards,
    Ivan Dimitrov
    the Telerik team

  11. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    15 Apr 2011
    Link to this post
    I've been messing around with this and managed to botch the default provider, however my custom ones still show up.

    Is there a way to reset the default provider? I tried deleting it and re-adding it, but it never shows up in the settings.

    These providers contain content like images, documents, videos etc. What happens when you delete a provider in the backend?
  12. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    15 Apr 2011
    Link to this post
    Ok, ran into something else to. I thought we are allowed to get multiple data providers, not just 2? After I created the third it just displays the same data as the second one? I thought these were to be unique, is this a bug? will 4.1 cover this?

    http://screencast.com/t/Uwrd1sp58
  13. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    18 Apr 2011
    Link to this post
    Hello Kristian,

    Could you try to set parameter "applicationName" with different value for each of your providers. Then restart the application and try to upload an item.

    Regards,
    Ivan Dimitrov
    the Telerik team

  14. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    18 Apr 2011
    Link to this post
    Just tried that, doesn't seem to work.
  15. Neven Dinev
    Neven Dinev avatar
    43 posts
    Registered:
    24 Jan 2017
    20 Apr 2011
    Link to this post
    Hi Kristian,

    Currently we still have issue with custom data providers for libraries. The issue will be resolved in the next hotfix.

    Greetings,
    the Telerik team

  16. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    17 May 2011
    Link to this post
    Has something changed on how these work? I'm having some trouble. The default provider has a field to add a ProviderDecoratorType but the custom ones don't. So when trying to upload an image to a secondary provider i get

    No data provider decorator could be found for the provider 'DynamicModule.ns.Wrapped_OpenAccessLibrariesProvider_64501c48bf4747faae1f890f4f250a'. The method 'StorageProviderDecorator' has to be overridden and implemented.
  17. Milena
    Milena avatar
    75 posts
    Registered:
    27 Sep 2017
    18 May 2011
    Link to this post
    Hello Kristian,

    This bug is fixed at latest  sitefinity 4.1 sp 1, you need to upgrade and then add a provider settings of type StorageProviderSettings(see attached screenshot)

    All the best,
    Milena
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  18. Kristian
    Kristian avatar
    214 posts
    Registered:
    03 Jun 2010
    18 May 2011
    Link to this post
    I still have the issue of the same content appearing in the different providers as the video shows above.
  19. Milena
    Milena avatar
    75 posts
    Registered:
    27 Sep 2017
    25 May 2011
    Link to this post

    Hello Kristian,


    At the video below  there is no parameter "applicationName" with different value for each of your provider. I tested with suppling different value of "applicationName" parameter and everything went fine.

    Could you try to set parameter "applicationName" with different value for each of your providers. Then restart the application and try to upload an item(see attached file).

    Let us know if you still experience any problems with configuring libraries providers.

    All the best,
    Milena 
    the Telerik team
19 posts, 0 answered