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

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


        return entry;
    }

    private SyndEntry createEntry(String bookmarkId, String content, UriInfo uriInfo) {
        SyndEntry entry = new SyndEntry();
        entry.setId(bookmarkId);
        entry.setTitle(new SyndText("My Bookmark " + bookmarkId));
        entry.setPublished(new Date());
        entry.setBase(uriInfo.getAbsolutePath().toString());

        if (content != null) {
            entry.setContent(new SyndContent(content));
        }
        return entry;
    }
View Full Code Here


        SystemLinksBuilder entryLinksBuilder = linkBuilders.createSystemLinksBuilder();
        for (String key : bookmarks.keySet()) {
            // set the sub-resource state of the builder for this entry
            entryLinksBuilder.subResource(key);
            SyndEntry entry = createEntry(key, bookmarks.get(key), entryLinksBuilder, null);
            feed.addEntry(entry);
        }
        // generate collection links in the response
        linkBuilders.createSystemLinksBuilder().build(feed.getLinks());
        return feed;
View Full Code Here

        String bookmarkId = BookmarkStore.getNewId();
        BookmarkStore.getInstance().putBookmark(bookmarkId, bookmark);

        SystemLinksBuilder entryLinksBuilder =
            linkBuilders.createSystemLinksBuilder().subResource(bookmarkId);
        SyndEntry entry = createEntry(bookmarkId, bookmark, entryLinksBuilder, uriInfo);

        URI location = uriInfo.getAbsolutePathBuilder().segment(bookmarkId).build();
        return Response.created(location).entity(entry).build();
    }
View Full Code Here

    private SyndEntry createEntry(String bookmarkId,
                                  String content,
                                  SystemLinksBuilder entryLinksBuilder,
                                  UriInfo uriInfo) {
        SyndEntry entry = new SyndEntry();
        entry.setId(bookmarkId);
        entry.setTitle(new SyndText("My Bookmark " + bookmarkId));
        entry.setPublished(new Date());

        if (content != null) {
            entry.setContent(new SyndContent(content));
        }

        if (uriInfo != null) {
            entry.setBase(uriInfo.getAbsolutePath().toString());
        }

        entryLinksBuilder.build(entry.getLinks());
        return entry;
    }
View Full Code Here

    @WebDAVMethod.PROPFIND
    @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML})
    @Produces(MediaType.APPLICATION_XML)
    public Response findProperties(String body, @PathParam("defect") String defectId)
        throws IOException {
        SyndEntry entry = super.getDefect(defectId).getSyndEntry(providers, uriInfo, linkProcessor);
        return WebDAVResponseBuilder.create(uriInfo).propfind(entry,
                                                              body,
                                                              new DefectPropertyHandler());
    }
View Full Code Here

                                             DefectBean.class,
                                             MediaType.APPLICATION_XML_TYPE);
            asset.setDefect(defect);
        } else if (body.startsWith("<entry")) {
            // read the incoming entity as an atom entry
            SyndEntry entry =
                ProviderUtils.readFromString(providers,
                                             body,
                                             SyndEntry.class,
                                             MediaType.APPLICATION_ATOM_XML_TYPE);
            asset.setSyndEntry(entry, providers);
View Full Code Here

    @WebDAVMethod.PROPFIND
    @Consumes( {MediaType.APPLICATION_XML, MediaType.TEXT_XML})
    @Produces(MediaType.APPLICATION_XML)
    public Response findProperties(String body, @PathParam("test") String testId)
        throws IOException {
        SyndEntry entry = super.getTest(testId).getSyndEntry(providers, uriInfo, linkProcessor);
        return WebDAVResponseBuilder.create(uriInfo).propfind(entry, body);
    }
View Full Code Here

        // need to set content
        // here)
        Map<String, String> bookmarks = BookmarkStore.getInstance().getBookmarks();

        for (String key : bookmarks.keySet()) {
            SyndEntry entry = createEntry(key, bookmarks.get(key), linkProcessor, null);
            feed.addEntry(entry);
        }
        // generate collection links in the response
        linkProcessor.createSystemLinksBuilder().build(feed.getLinks());
        return feed;
View Full Code Here

        }

        String bookmarkId = BookmarkStore.getNewId();
        BookmarkStore.getInstance().putBookmark(bookmarkId, bookmark);

        SyndEntry entry = createEntry(bookmarkId, bookmark, linkProcessor, uriInfo);

        URI location = uriInfo.getAbsolutePathBuilder().segment(bookmarkId).build();
        return Response.created(location).entity(entry).build();
    }
View Full Code Here

    private SyndEntry createEntry(String bookmarkId,
                                  String content,
                                  LinkBuilders linkProcessor,
                                  UriInfo uriInfo) {
        SyndEntry entry = new SyndEntry();
        entry.setId(bookmarkId);
        entry.setTitle(new SyndText("My Bookmark " + bookmarkId));
        entry.setPublished(new Date());

        if (content != null) {
            entry.setContent(new SyndContent(content));
        }

        if (uriInfo != null) {
            entry.setBase(uriInfo.getAbsolutePath().toString());
        }

        linkProcessor.createSystemLinksBuilder().subResource(bookmarkId).build(entry.getLinks());
        return entry;
    }
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.