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

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


        @GET
        @Path("atomentryelement")
        @Produces("application/json")
        public JAXBElement<AtomEntry> getAtomEntryElement() throws IOException {
            AtomEntry entry = AtomEntry.unmarshal(new StringReader(ENTRY_STR));
            org.apache.wink.common.model.atom.ObjectFactory of =
                new org.apache.wink.common.model.atom.ObjectFactory();
            return of.createEntry(entry);
        }
View Full Code Here


        @GET
        @Path("atomsyndentry")
        @Produces("application/json")
        public SyndEntry getSyndEntry() throws IOException {
            AtomEntry entry = AtomEntry.unmarshal(new StringReader(ENTRY_STR));
            return entry.toSynd(new SyndEntry());
        }
View Full Code Here

         */
        String charset =
            MediaType.valueOf(response.getContentType()).getParameters().get("charset");
        response.setCharacterEncoding(charset);

        AtomEntry entry = AtomEntry.unmarshal(new StringReader(response.getContentAsString()));
        String id = entry.getId();
        assertEquals("entry id", HelloWorld.ID, id);
    }
View Full Code Here

        .versionAsInProject()));
  }

  @Test
  public void testClassResolves() {
    new AtomEntry();
  }
View Full Code Here

            throw new WebApplicationException(e);
        }
    }

    public AtomEntry toAtomEntry(UriInfo uriInfo) {
        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();
            link.setHref(uriInfo.getBaseUri() + "blogservice/blogs/"
                + parent.getId()
                + "/entries/"
                + this.id
                + "/comments/"
                + i);
            entry.getLinks().add(link);
            ++i;
        }
        return entry;
    }
View Full Code Here

        setContent(comment.getContent().getValue());
        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

                                                        MediaType.APPLICATION_ATOM_XML_TYPE);
        request.addParameter(RestConstants.REST_PARAM_ABSOLUTE_URLS, "");
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AtomEntry entry = AtomEntry.unmarshal(new StringReader(contentString));
        AtomLink link = entry.getLinks().get(0);
        assertTrue("ipv6 URI: " + link, link.getHref().startsWith(http));
    }
View Full Code Here

        request.setSecure(true);
        request.addParameter(RestConstants.REST_PARAM_ABSOLUTE_URLS, "");
        MockHttpServletResponse response = invoke(request);
        assertEquals("status", HttpStatus.OK.getCode(), response.getStatus());
        String contentString = response.getContentAsString();
        AtomEntry entry = AtomEntry.unmarshal(new StringReader(contentString));
        AtomLink link = entry.getLinks().get(0);
        assertTrue("ipv6 URI: " + link, link.getHref().startsWith(https));
    }
View Full Code Here

        @GET
        @Produces("application/atom+xml")
        public AtomEntryAsset getAsset() {
            AtomEntryAsset asset = new AtomEntryAsset();
            AtomEntry ae = new AtomEntry();
            ae.setId("id");
            ae.setTitle(new AtomText("title", AtomTextType.text));
            asset.setEntity(ae);
            return asset;

        }
View Full Code Here

        @GET
        @Path("jaxbelement")
        @Produces("application/atom+xml")
        public AtomEntryJaxbAsset getAssetAsJaxbElement() {
            AtomEntryJaxbAsset asset = new AtomEntryJaxbAsset();
            AtomEntry ae = new AtomEntry();
            ae.setId("id");
            ae.setTitle(new AtomText("title", AtomTextType.text));
            ObjectFactory of = new ObjectFactory();
            asset.entry = of.createEntry(ae);
            return asset;
        }
View Full Code Here

TOP

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

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.