Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Mark Radford 7 posts 30 karma points
    Feb 28, 2012 @ 19:39
    Mark Radford
    0

    Implementing custom MediaFactories in DMU 2.1.0

    Hi there,

    I'm using DMU 2.1.0 and I'm trying to implement a custom Media Factory (as per this discussion thread).  I'm unsure how to register my new custom media factory so that the DMU picks it up.  In previous versions there was the desktopMediaUploader.config file, but this doesn't seem to be used in version 2.1?

    I've created my new class in its own assembly and it's in the site's bin folder.  Do I have to register it anywhere?

    Also I've gone on the assumption that factories that use the same extension (I'm trying to capture jpg files) are chosen based on the highest priority, not the lowest?  So setting the priority to something greater than the default value (1000) should work?

    Thanks in advance!

    Mark

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Feb 28, 2012 @ 20:49
    Tom Fulton
    1

    Hi Mark,

    Wow, I can't believe I just found an old conversation on twitter from almost 1 year ago when I asked Matt the same question!

    Check out this tweet, pasting here for future reference:

    it doesn't use one [config file] anymore, instead you need to implement the IMediaFactory interface http://umbraco.codeplex.com/SourceControl/changeset/view/a117c8d644bb#umbraco%2fcms%2fbusinesslogic%2fmedia%2fIMediaFactory.cs

    and this one regarding the priorities (you should set yours LOWER than 1000, not higher)

    yes, just set a higher priority, defaults have a priority of 1000 so anything less than that will get checked first.

    HTH,
    Tom

  • Mark Radford 7 posts 30 karma points
    Feb 29, 2012 @ 10:45
    Mark Radford
    0

    That's brilliant Tom!  Thanks very much for going to all that troube for me.

    I was inheriting from UmbracoMediaFactory rather than the iMediaFactory interface.  I'll try that one instead  :)

  • Mark Radford 7 posts 30 karma points
    Feb 29, 2012 @ 12:09
    Mark Radford
    1

    And it worked!  Thanks very much indeed for all of your help.  :)

    Mark

Please Sign in or register to post replies

Write your reply to:

Draft