Package org.apache.abdera.model

Examples of org.apache.abdera.model.Content

Per RFC4287:

 The "atom:content" element either contains or links to the content of the entry.  The content of atom:content is Language-Sensitive. atomInlineTextContent = element atom:content { atomCommonAttributes, attribute type { "text" | "html" }?, (text) } atomInlineXHTMLContent = element atom:content { atomCommonAttributes, attribute type { "xhtml" }, xhtmlDiv } atomInlineOtherContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, (text|anyElement) } atomOutOfLineContent = element atom:content { atomCommonAttributes, attribute type { atomMediaType }?, attribute src { atomUri }, empty } atomContent = atomInlineTextContent | atomInlineXHTMLContent | atomInlineOtherContent | atomOutOfLineContent 

     * @throws IRISyntaxException
     */
    public Content setContent(IRI uri, String mediatype) {
        try {
            FOMFactory factory = (FOMFactory)this.factory;
            Content content = factory.newContent(new MimeType(mediatype));
            content.setSrc(uri.toString());
            setContentElement(content);
            return content;
        } catch (javax.activation.MimeTypeParseException e) {
            throw new org.apache.abdera.util.MimeTypeParseException(e);
        }
View Full Code Here


        Link link = getSelfLink();
        return (link != null) ? link.getResolvedHref() : null;
    }

    public String getContent() {
        Content content = getContentElement();
        return (content != null) ? content.getValue() : null;
    }
View Full Code Here

        Content content = getContentElement();
        return (content != null) ? content.getValue() : null;
    }

    public InputStream getContentStream() throws IOException {
        Content content = getContentElement();
        DataHandler dh = content.getDataHandler();
        return dh.getInputStream();
    }
View Full Code Here

        DataHandler dh = content.getDataHandler();
        return dh.getInputStream();
    }

    public IRI getContentSrc() {
        Content content = getContentElement();
        return (content != null) ? content.getResolvedSrc() : null;
    }
View Full Code Here

        Content content = getContentElement();
        return (content != null) ? content.getResolvedSrc() : null;
    }

    public Type getContentType() {
        Content content = getContentElement();
        return (content != null) ? content.getContentType() : null;
    }
View Full Code Here

        Text text = getTitleElement();
        return (text != null) ? text.getTextType() : null;
    }

    public MimeType getContentMimeType() {
        Content content = getContentElement();
        return (content != null) ? content.getMimeType() : null;
    }
View Full Code Here

        String customerName = "Fred Farkle";
        Entry entry = factory.newEntry();
        entry.setTitle("customer " + customerName);
        entry.setUpdated(new Date());
        entry.addAuthor("Apache Tuscany");
        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
View Full Code Here

        entry.addAuthor("Apache Tuscany");
        // ID created by collection.
        // entry.setId(id); // auto-provided
        // entry.addLink("" + id, "edit"); // auto-provided
        // entry.addLink("" + id, "alternate"); // auto-provided
        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
View Full Code Here

        entry.addAuthor("Apache Tuscany");
        String id = eTag.substring( 1, eTag.length()-1);
        entry.setId(id); // auto-provided
        // entry.addLink("" + id, "edit"); // auto-provided
        // entry.addLink("" + id, "alternate"); // auto-provided
        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
View Full Code Here

        Entry entry = factory.newEntry();
        entry.setTitle("customer " + customerName);
        entry.setUpdated(new Date());
        entry.addAuthor("Apache Tuscany");
        // ID created by collection.
        Content content = abdera.getFactory().newContent();
        content.setContentType(Content.Type.TEXT);
        content.setValue(customerName);
        entry.setContentElement(content);

        RequestOptions opts = new RequestOptions();
        final String contentType = "application/atom+xml; type=entry";
        opts.setContentType(contentType);
View Full Code Here

TOP

Related Classes of org.apache.abdera.model.Content

Copyright © 2018 www.massapicom. 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.