Package org.apache.wink.common.model.synd

Examples of org.apache.wink.common.model.synd.SyndEntry


                return header.toArray(EMPTY_ARRAY);
            }

            // send the entire table base on the iterator
            // first, fetch the entry using original iterator
            SyndEntry entry = iterator.next();

            // second, fetch data from entry
            String base = entry.getBase();
            String id = entry.getId();
            String lang = entry.getLang();

            String authors =
                entry.getAuthors() != null && !entry.getAuthors().isEmpty() ? entry.getAuthors()
                    .get(0).getName() : "";
            String title = entry.getTitle() != null ? entry.getTitle().getValue() : "";
            String content = entry.getContent() != null ? entry.getContent().getValue() : "";
            String published =
                entry.getPublished() != null ? String.valueOf(entry.getPublished()) : "";
            String updated = entry.getUpdated() != null ? String.valueOf(entry.getUpdated()) : "";
            String summary = entry.getSummary() != null ? entry.getSummary().getValue() : "";

            // to improve the search, convert categories to Map
            Map<String, String> categoriesMap = new HashMap<String, String>();
            List<SyndCategory> categories = entry.getCategories();
            if (categories != null) {
                for (SyndCategory bean : categories) {
                    categoriesMap.put(bean.getScheme(), bean.getTerm());
                }
            }
View Full Code Here


                    return;
                }
            }

            if (synd instanceof SyndEntry) {
                SyndEntry entry = (SyndEntry)synd;
                if (property instanceof Creationdate) {
                    if (entry.getPublished() != null) {
                        ((Creationdate)property).setValue(entry.getPublished());
                        response.setPropertyOk(property);
                        return;
                    }
                } else if (property instanceof Resourcetype) {
                    response.setPropertyOk(property);
View Full Code Here

    @GET
    @Produces(MediaType.APPLICATION_ATOM_XML)
    public SyndEntry getGreeting() {
        String text = this.simpleTestService.createGreeting("CDI");
        return new SyndEntry(new SyndText(text), "hello-cdi:1", new Date());
    }
View Full Code Here

    @GET
    @Produces(MediaType.APPLICATION_ATOM_XML)
    public SyndEntry getGreeting() {
        // create and return a syndication entry with a "Hello World!" title,
        // some ID and the current time.
        SyndEntry synd = new SyndEntry(new SyndText("Hello World!"), ID, new Date());
        return synd;
    }
View Full Code Here

     *
     * @throws IOException
     */
    public void testAtomTo() throws Exception {

        SyndEntry entry1 = new SyndEntry();
        entry1.setId("12345");
        entry1.setBase("base1");
        entry1.setContent(new SyndContent("content"));
        entry1.setLang("en");
        entry1.addAuthor(new SyndPerson("Moshe Moshe"));
        entry1.addCategory(new SyndCategory("severity", "high", null));
        entry1.addCategory(new SyndCategory("author", "Moshe Moshe", null));

        SyndEntry entry2 = new SyndEntry();
        entry2.setId("54321");
        entry2.setBase("base2");
        entry2.setContent(new SyndContent("no content"));
        entry2.setLang("iw");
        entry2.addAuthor(new SyndPerson("Yosi Yosi"));
        entry2.addCategory(new SyndCategory("severity", "low", null));
        entry2.addCategory(new SyndCategory("author", "Yosi Yosi", null));
        entry2.addCategory(new SyndCategory("control", "No Control", null));

        SyndFeed syndFeed = new SyndFeed();
        syndFeed.getEntries().add(entry1);
        syndFeed.getEntries().add(entry2);

View Full Code Here

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

    @Produces(MediaType.APPLICATION_XML)
    public Response findProperties(@Context UriInfo uriInfo,
                                   @PathParam("entry") String id,
                                   String body) throws IOException {

        SyndEntry entry = entries.get(id);
        if (entry != null) {
            return WebDAVResponseBuilder.create(uriInfo).propfind(entry, body);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

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

    @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML})
    @Produces(MediaType.APPLICATION_XML)
    public Response findProperties(@Context UriInfo uriInfo,
                                   @PathParam("entry") String id,
                                   String body) throws IOException {
        SyndEntry entry = entries.get(id);
        if (entry != null) {
            return WebDAVResponseBuilder.create(uriInfo).propfind(entry, body);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

    @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML})
    @Produces(MediaType.APPLICATION_XML)
    public Response findProperties(@Context UriInfo uriInfo,
                                   @PathParam("entry") String id,
                                   String body) throws IOException {
        SyndEntry entry = entries.get(id);
        if (entry != null) {
            return WebDAVResponseBuilder.create(uriInfo).propfind(entry, body);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND);
        }
View Full Code Here

TOP

Related Classes of org.apache.wink.common.model.synd.SyndEntry

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.