To answer my own question I extended the
[code]info.magnolia.module.templatingkit.dam.handlers.InternalContentDAMHandler[/code]
class which by default handled the retrieval of assets from the magnolia repo
for uploaded assets (vs. DMS assets).
For the curious, here is my implementation:
[code]public class I18NContentDAMHandler extends InternalContentDAMHandler {
@Inject
public I18NContentDAMHandler(TemplatingFunctions aTemplatingFunctions) {
super(aTemplatingFunctions);
}
@Override
public NodeData getBinaryNodeData (final Content node, final String
nodeDataPrefix) throws AssetNotFoundException {
String nodeDataName = getNodeDataName(node, nodeDataPrefix);
String locale =
MgnlContext.getAggregationState().getLocale().toString();
NodeData nd = node.getNodeData(nodeDataName + "_" + locale);
if(!nd.isExist()){
nd = node.getNodeData(nodeDataName);
}
if(!nd.isExist()){
throw new AssetNotFoundException(node.getHandle() + "/" +
nodeDataPrefix + " has no binary stored");
}
return nd;
}
}[/code]
Last thing, don't forget to register it under:
[code]config/modules/standard-templating-kit/config/damSupport/handlers/upload[/code].
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=852a7ed0-3dcc-4809-96e8-7458beaf8749
----------------------------------------------------------------
For list details, see: http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------