Package org.restlet.ext.atom

Examples of org.restlet.ext.atom.Content


                    this.state = State.FEED_ENTRY_LINK;
                } else if (this.state == State.FEED_ENTRY_SOURCE) {
                    this.state = State.FEED_ENTRY_SOURCE_LINK;
                }
                // Glean the content
                this.currentContent = new Content();
                // Content available inline
                initiateInlineMixedContent();
                this.currentLink.setContent(currentContent);
                startLink(this.currentLink);
            } else if (localName.equalsIgnoreCase("entry")) {
                this.state = State.FEED_ENTRY;
                startEntry(this.currentEntry);
            } else if (localName.equals("category")) {
                this.currentCategory = new Category();
                this.currentCategory.setTerm(attrs.getValue("", "term"));
                this.currentCategory.setScheme(new Reference(attrs.getValue("",
                        "scheme")));
                this.currentCategory.setLabel(attrs.getValue("", "label"));

                if (this.state == State.FEED_ENTRY) {
                    this.state = State.FEED_ENTRY_CATEGORY;
                } else if (this.state == State.FEED_ENTRY_SOURCE) {
                    this.state = State.FEED_ENTRY_SOURCE_CATEGORY;
                }
            } else if (localName.equalsIgnoreCase("content")) {
                if (this.state == State.FEED_ENTRY) {
                    contentType = getMediaType(attrs.getValue("", "type"));
                    String srcAttr = attrs.getValue("", "src");
                    this.currentContent = new Content();

                    if (srcAttr == null) {
                        // Content available inline
                        initiateInlineMixedContent();
                    } else {
View Full Code Here


                    this.state = State.FEED_ENTRY_LINK;
                } else if (this.state == State.FEED_ENTRY_SOURCE) {
                    this.state = State.FEED_ENTRY_SOURCE_LINK;
                }
                // Glean the content
                this.currentContent = new Content();
                // Content available inline
                initiateInlineMixedContent();
                this.currentLink.setContent(currentContent);
                startLink(this.currentLink);
            } else if (localName.equalsIgnoreCase("entry")) {
                if (this.state == State.FEED) {
                    this.currentEntry = new Entry();
                    this.state = State.FEED_ENTRY;
                }
                startEntry(this.currentEntry);
            } else if (localName.equals("category")) {
                this.currentCategory = new Category();
                this.currentCategory.setTerm(attrs.getValue("", "term"));
                this.currentCategory.setScheme(new Reference(attrs.getValue("",
                        "scheme")));
                this.currentCategory.setLabel(attrs.getValue("", "label"));

                if (this.state == State.FEED) {
                    this.state = State.FEED_CATEGORY;
                } else if (this.state == State.FEED_ENTRY) {
                    this.state = State.FEED_ENTRY_CATEGORY;
                } else if (this.state == State.FEED_ENTRY_SOURCE) {
                    this.state = State.FEED_ENTRY_SOURCE_CATEGORY;
                }
            } else if (localName.equalsIgnoreCase("content")) {
                if (this.state == State.FEED_ENTRY) {
                    contentType = getMediaType(attrs.getValue("", "type"));
                    String srcAttr = attrs.getValue("", "src");
                    this.currentContent = new Content();

                    if (srcAttr == null) {
                        // Content available inline
                        initiateInlineMixedContent();
                    } else {
View Full Code Here

                        }
                    };
                    Link editLink = new Link(getValueEditRef(entity),
                            Relation.EDIT_MEDIA, null);
                    result.getLinks().add(editLink);
                    Content content = new Content();
                    // Get the external blob reference
                    content.setExternalRef(getValueRef(entity));
                    content.setToEncode(false);
                    result.setContent(content);
                } else {
                    result = new Entry();
                    Content content = new Content();
                    content.setInlineContent(r);
                    content.setToEncode(false);

                    result.setContent(content);
                }
            }
        }
View Full Code Here

                    } else {
                        inlineEntryHandler.startEntry(entry);
                    }
                    inlineEntry = entry;
                } else if (localName.equalsIgnoreCase("content")) {
                    Content content = new Content();
                    MediaType type = getMediaType(attrs.getValue("", "type"));
                    String srcAttr = attrs.getValue("", "src");
                    if (srcAttr != null)
                        // Content available externally
                        content.setExternalRef(new Reference(srcAttr));
                    content.setExternalType(type);
                    if (association.isToMany()) {
                        inlineFeedHandler.startContent(content);
                    } else {
                        inlineEntryHandler.startContent(content);
                    }
View Full Code Here

    l.setRel(Relation.VIA);
    return l;
  }

  private Content getContent(String txt) {
    Content content = new Content();
    content.setInlineContent(new StringRepresentation(txt, MediaType.TEXT_PLAIN));
    return content;
  }
View Full Code Here

TOP

Related Classes of org.restlet.ext.atom.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.