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

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


        AtomEntry entry = new AtomEntry();
        entry.setId("" + this.id);
        entry.setTitle(new AtomText(this.title));
        entry.setUpdated(this.updated);
        entry.getAuthors().add(author.toAtomPerson());
        AtomContent content = new AtomContent();
        content.setType("text");
        content.setValue(this.posting);
        entry.setContent(content);
        AtomLink link = null;
        int i = 0;
        for (Comment comment : comments) {
            link = new AtomLink();
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

        @POST
        @Path("jaxbentry")
        public JAXBElement<AtomEntry> createWrappedElement(JAXBElement<AtomEntry> element) {
            AtomEntry atomEntry = new AtomEntry();
            atomEntry.setId(element.getValue().getId());
            AtomContent content = new AtomContent();
            content.setType(MediaType.APPLICATION_XML);
            Blob blob = new Blob();
            content.setValue(blob);
            atomEntry.setContent(content);
            JAXBElement<AtomEntry> wrappedEntry = new ObjectFactory().createEntry(atomEntry);
            return wrappedEntry;
        }
View Full Code Here

        return toAtomEntry();
    }
   
    public AtomEntry toAtomEntry() {
        AtomEntry entry = new AtomEntry();
        AtomContent content = new AtomContent();
        content.setValue(this.content);
        content.setType("String");
        entry.setContent(content);
        entry.getAuthors().add(this.author.toAtomPerson());
        entry.setTitle(new AtomText(this.title));
        return entry;
    }
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("String");
        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);
        String location = uri.getHeaders().getFirst("Location");
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("String");
        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);
        String location = uri.getHeaders().getFirst("Location");
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);
        assertNotNull(updated.getAuthors());
        assertEquals(1, updated.getAuthors().size());
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);
        assertNotNull(updated.getAuthors());
        assertEquals(1, updated.getAuthors().size());
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.