}
String key = outputName + "." + contentName; //$NON-NLS-1$
if ( outputs.get( key ) != null ) {
return outputs.get( key );
} else {
IContentOutputHandler output = PentahoSystem.getOutputDestinationFromContentRef( contentName, session );
// If the output handler wasn't found with just the content name. Try to look it up with the output name as
// well.
// (This mirrors HttpOutputHandler's lookup logic)
if ( output == null ) {
output = PentahoSystem.getOutputDestinationFromContentRef( outputName + ":" + contentName, session ); //$NON-NLS-1$
}
if ( output != null ) {
output.setInstanceId( instanceId );
output.setMimeType( localMimeType );
output.setContentRef( contentName );
if ( contentName.indexOf( ":" ) != -1 ) {
output.setSolutionPath( contentName.substring( contentName.indexOf( ":" ) + 1 ) );
} else {
output.setSolutionPath( null );
}
return output.getFileOutputContentItem();
}
}
return null;
}