@Override
public int doEndTag() throws JspException {
final ServletRequest request = pageContext.getRequest();
MediaCopyright copyright;
if (request.getAttribute("content") != null
&& request.getAttribute("content") instanceof MediaContent) {
copyright = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.COPYRIGHT);
} else if (request.getAttribute("group") != null
&& request.getAttribute("group") instanceof MediaGroup) {
copyright = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.COPYRIGHT);
} else if (request.getAttribute("entry") != null
&& request.getAttribute("entry") instanceof Entry) {
copyright = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.COPYRIGHT);
} else {
copyright = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.COPYRIGHT);
}
// set the body content
copyright.setText(getBodyContent().getString());
// set the scheme
if (url != null) copyright.setUrl(url);
return super.doEndTag();
}