Examples of MediaRestriction


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

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

        MediaRestriction restriction;

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

        // set the body content
        restriction.setText(getBodyContent().getString());
        // set the scheme
        if (relationship != null)
            restriction.setRelationship(Relationship.valueOf(relationship));
        if (type != null) restriction.setType(RestrictionType.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.