Examples of MediaText


Examples of org.apache.abdera.ext.media.MediaText

    @Override
    public int doEndTag() throws JspException {
        final ServletRequest request = pageContext.getRequest();

        MediaText text;

        if (request.getAttribute("content") != null
            && request.getAttribute("content") instanceof MediaContent) {
            text = ((MediaContent) request.getAttribute("content")).addExtension(MediaConstants.TEXT);
        } else if (request.getAttribute("group") != null
            && request.getAttribute("group") instanceof MediaGroup) {
            text = ((MediaGroup) request.getAttribute("group")).addExtension(MediaConstants.TEXT);
        } else if (request.getAttribute("entry") != null
            && request.getAttribute("entry") instanceof Entry) {
            text = ((Entry) request.getAttribute("entry")).addExtension(MediaConstants.TEXT);
        } else {
            text = ((Feed) request.getAttribute("feed")).addExtension(MediaConstants.TEXT);
        }

        // set the body content
        text.setText(getBodyContent().getString());
        // set the scheme
        if (start != null) text.setStart(start);
        if (end != null) text.setEnd(end);
        if (lang != null) text.setLang(lang);
        if (type != null) text.setType(Type.valueOf(type));

        return super.doEndTag();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.