Q:

On DD4T, how to output URL of MMC which Resource Type is“Exernal”

I'm using Tridion 2013 SP1, and DD4T(Java version). 
I'd like to put binary file outside Tridion, and manage it as multimedia component. So I did following procedure.

Create multimedia component.
Select "External" on "Resource Type".
Input URL of binary file which is outside Tridion(e.g. http://image.com/img.jpg).
Assign the multimedia component to a component's mulitimedia link field.
Publish the component.

But published binary file's URL is not same value as multimedia component's external URL.
(While publishing, Tridion seems to download binary file from the URL, and publish it.)
My desirable behaviour is that Tridion doesn't download binary file, but just output the URL of multimedia component.
<a href="http://image.com/img.jpg">

So I customized DD4T's default TBB, by modifying "PublishItem" method of "DD4T.Templates.Base.Utils.BinaryPublisher".
My customized  source code is following.
        if (mmComp.BinaryContent.IsExternal)
        {
            publishedPath = mmComp.BinaryContent.ExternalBinaryUri.AbsoluteUri;
        }
        else
        {
            Binary binary = engine.PublishingContext.RenderedItem.AddBinary(mmComp);
            publishedPath = binary.Url;
        }

This customization seems to work, but I'm not sure there is no "side effect".
Is this customization correct?
Is there any other TBB code I must modify?
Regards,

A:

The modification looks ok to me. I don't think there's anything else that you'll need to change for this to work.
This will affect publishing of ALL multimedia components where you have used an external URL... Perhaps you'd prefer to control this functionality with metadata on the multimedia components to trigger the publishing method to give you more flexibility?

