String viewerClassName = null;
ERAttachment attachment = attachment();
if (attachment != null) {
if (attachment.available().booleanValue()) {
ERMimeType mimeType = attachment.erMimeType();
if (mimeType != null) {
viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." + mimeType.mimeType() +".viewer");
if (viewerClassName == null) {
viewerClassName = ERXProperties.stringForKey("er.attachment.mimeType." + mimeType.globMimeType().mimeType() +".viewer");
}