Package org.apache.wink.common.model.atom

Examples of org.apache.wink.common.model.atom.AtomContent


        return false;
    }

    public static boolean isValueActuallyXml(Object source) {
        if (source instanceof AtomContent) {
            AtomContent content = (AtomContent)source;
            String type = content.getType();
            if (ModelUtils.isTypeXml(type)) {
                return true;
            }
        } else if (source instanceof AtomText) {
            AtomText text = (AtomText)source;
View Full Code Here


        return false;
    }

    public static boolean isValueActuallyXml(Object source) {
        if (source instanceof AtomContent) {
            AtomContent content = (AtomContent)source;
            String type = content.getType();
            if (ModelUtils.isTypeXml(type)) {
                return true;
            }
        } else if (source instanceof AtomText) {
            AtomText text = (AtomText)source;
View Full Code Here

        AtomEntry entry = new AtomEntry();
        AtomPerson author = new AtomPerson();
        author.setName("Blog Admin");
        author.setEmail("winkblogadmin@wink.blog.com");
        entry.getAuthors().add(author);
        AtomContent content = new AtomContent();
        content.setType("text");
        content.setValue("This is a new entry in the blog");
        entry.setContent(content);
        entry.setTitle(new AtomText(("New blog entry")));

        ClientResponse uri =
            resource.accept("application/atom+xml").contentType("application/atom+xml").post(entry);
View Full Code Here

        AtomEntry entry = new AtomEntry();
        AtomPerson author = new AtomPerson();
        author.setName("Wink Coder");
        author.setEmail("winkcoder@mybusiness.com");
        entry.getAuthors().add(author);
        AtomContent content = new AtomContent();
        content.setType("text");
        content.setValue("I was able to set up the Wink development environment!");
        entry.setContent(content);
        entry.setTitle(new AtomText(("Success")));

        ClientResponse uri =
            resource.accept("application/atom+xml").contentType("application/atom+xml").post(entry);
View Full Code Here

        AtomPerson author = entry.getAuthors().get(0);
        author.setName(author.getName() + "Updated");
        author.setEmail(author.getEmail() + "Updated");
        AtomText title = entry.getTitle();
        title.setValue(title.getValue() + "Updated");
        AtomContent content = entry.getContent();
        content.setValue(content.getValue() + "Updated");

        resource = client.resource(BASE_URI + "/blogs/0/entries/0");
        AtomEntry updated =
            resource.accept("application/atom+xml").contentType("application/atom+xml")
                .put(AtomEntry.class, entry);
View Full Code Here

        AtomPerson author = entry.getAuthors().get(0);
        author.setName(author.getName() + "Updated");
        author.setEmail(author.getEmail() + "Updated");
        AtomText title = entry.getTitle();
        title.setValue(title.getValue() + "Updated");
        AtomContent content = entry.getContent();
        content.setValue(content.getValue() + "Updated");

        resource = client.resource(BASE_URI + "/blogs/0/entries/1/comments/0");
        AtomEntry updated =
            resource.accept("application/atom+xml").contentType("application/atom+xml")
                .put(AtomEntry.class, entry);
View Full Code Here

        return false;
    }

    public static boolean isValueActuallyXml(Object source) {
        if (source instanceof AtomContent) {
            AtomContent content = (AtomContent)source;
            String type = content.getType();
            if (ModelUtils.isTypeXml(type)) {
                return true;
            }
        } else if (source instanceof AtomText) {
            AtomText text = (AtomText)source;
View Full Code Here

        return toAtomEntry();
    }
   
    public AtomEntry toAtomEntry() {
        AtomEntry entry = new AtomEntry();
        AtomContent content = new AtomContent();
        content.setValue(this.content);
        content.setType("text");
        entry.setContent(content);
        entry.getAuthors().add(this.author.toAtomPerson());
        entry.setTitle(new AtomText(this.title));
        return entry;
    }
View Full Code Here

        return false;
    }

    public static boolean isValueActuallyXml(Object source) {
        if (source instanceof AtomContent) {
            AtomContent content = (AtomContent)source;
            String type = content.getType();
            if (ModelUtils.isTypeXml(type)) {
                return true;
            }
        } else if (source instanceof AtomText) {
            AtomText text = (AtomText)source;
View Full Code Here

         * We have to be careful to use the real Providers list instead of the one from the injected
         * local providers field in this class.  The injected object may be a "proxy" to the real
         * providers, and could cause an infinite loop when ModelUtils.readValue calls back through
         * the providers.
         */
        AtomContent content = atomEntry.getContent();
        if (content != null) {
            content.setProviders(RuntimeContextTLS.getRuntimeContext().getAttribute(Providers.class));
        }

        return atomEntry;
    }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.atom.AtomContent

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.