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

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


                    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


    private List<SyndEntry> getEntriesAsSynd() {
        List<SyndEntry> authors = new ArrayList<SyndEntry>();
        for (AtomEntry value : getEntries()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndEntry()));
            }
        }
        return authors;
    }
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

        if (getImage() != null && getImage().getUrl() != null) {
            syndFeed.setLogo(getImage().getUrl());
        }
        syndFeed.getEntries().clear();
        for (RssItem rssItem : getItems()) {
            SyndEntry syndEntry = new SyndEntry();
            syndEntry = rssItem.toSynd(syndEntry);
            syndFeed.getEntries().add(syndEntry);
        }
        return syndFeed;
    }
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

    @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

        @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

    private List<SyndEntry> getEntriesAsSynd() {
        List<SyndEntry> authors = new ArrayList<SyndEntry>();
        for (AtomEntry value : getEntries()) {
            if (value != null) {
                authors.add(value.toSynd(new SyndEntry()));
            }
        }
        return authors;
    }
View Full Code Here

                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() : ""; //$NON-NLS-1$
            String title = entry.getTitle() != null ? entry.getTitle().getValue() : ""; //$NON-NLS-1$
            String content = entry.getContent() != null ? entry.getContent().getValue() : ""; //$NON-NLS-1$
            String published =
                entry.getPublished() != null ? String.valueOf(entry.getPublished()) : ""; //$NON-NLS-1$
            String updated = entry.getUpdated() != null ? String.valueOf(entry.getUpdated()) : ""; //$NON-NLS-1$
            String summary = entry.getSummary() != null ? entry.getSummary().getValue() : ""; //$NON-NLS-1$

            // 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

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.