org.apache.abdera.ext.media.MediaTitle

Here are the examples of the java api class org.apache.abdera.ext.media.MediaTitle taken from open source projects.

1. MediaTitleTagHandler#doEndTag()

Project: sling
Source File: MediaTitleTagHandler.java
View license
@Override
public int doEndTag() throws JspException {
    final ServletRequest request = pageContext.getRequest();
    MediaTitle title;
    if (request.getAttribute("content") != null && request.getAttribute("content") instanceof MediaContent) {
        title = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.TITLE);
    } else if (request.getAttribute("group") != null && request.getAttribute("group") instanceof MediaGroup) {
        title = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.TITLE);
    } else if (request.getAttribute("entry") != null && request.getAttribute("entry") instanceof Entry) {
        title = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.TITLE);
    } else {
        title = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.TITLE);
    }
    // set the body content
    title.setText(getBodyContent().getString());
    // set the scheme
    if (type != null)
        title.setType(Type.valueOf(type));
    return super.doEndTag();
}