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

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


            : null);
        value.setIcon(getIcon());
        value.setId(getId());
        value.setItemsPerPage(getItemsPerPage());
        value.setLogo(getLogo());
        value.setRights(getRights() != null ? getRights().toSynd(new SyndText()) : null);
        value.setStartIndex(getStartIndex());
        value.setSubtitle(getSubtitle() != null ? getSubtitle().toSynd(new SyndText()) : null);
        value.setTitle(getTitle() != null ? getTitle().toSynd(new SyndText()) : null);
        value.setTotalResults(getTotalResults());
        value.getAuthors().addAll(getAuthorsAsSynd());
        value.getCategories().addAll(getCategoriesAsSynd());
        value.getLinks().addAll(getLinksAsSynd());
        value.getEntries().addAll(getEntriesAsSynd());
View Full Code Here


    public SyndEntry toSynd(SyndEntry syndEntry) {
        if (syndEntry == null) {
            return syndEntry;
        }
        if (getTitle() != null) {
            syndEntry.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate"); //$NON-NLS-1$
            syndEntry.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndEntry.setSummary(new SyndText(getDescription()));
        }
        if (getAuthor() != null) {
            SyndPerson syndAuthor = new SyndPerson();
            String authorEmail = getAuthor();
            syndAuthor.setEmail(authorEmail);
View Full Code Here

            return value;
        }
        super.toSynd(value);
        value.setId(getId());
        value.setPublished(getPublished());
        value.setSummary(getSummary() != null ? getSummary().toSynd(new SyndText()) : null);
        value.setTitle(getTitle() != null ? getTitle().toSynd(new SyndText()) : null);
        value.setUpdated(getUpdated());
        value.setContent(getContent() != null ? getContent().toSynd(new SyndContent()) : null);
        value.getAuthors().addAll(getAuthorsAsSynd());
        value.getCategories().addAll(getCategoriesAsSynd());
        value.getLinks().addAll(getLinksAsSynd());
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

    public SyndFeed toSynd(SyndFeed syndFeed) {
        if (syndFeed == null) {
            return syndFeed;
        }
        if (getTitle() != null) {
            syndFeed.setTitle(new SyndText(getTitle(), SyndTextType.text));
        }
        if (getLink() != null) {
            SyndLink syndLink = new SyndLink();
            syndLink.setHref(getLink());
            syndLink.setRel("alternate"); //$NON-NLS-1$
            syndFeed.getLinks().add(syndLink);
        }
        if (getDescription() != null) {
            syndFeed.setSubtitle(new SyndText(getDescription(), SyndTextType.text));
        }
        if (getLanguage() != null) {
            syndFeed.setLang(getLanguage());
        }
        if (getCopyright() != null) {
            syndFeed.setRights(new SyndText(getCopyright()));
        }
        if (getManagingEditor() != null) {
            SyndPerson syndAuthor = new SyndPerson();
            String authorEmail = getManagingEditor();
            syndAuthor.setEmail(authorEmail);
View Full Code Here

        if (messageBodyWriter != null) {
            se.setId(ID_PREFIX + UUID.randomUUID());
            se.setUpdated(new Date(System.currentTimeMillis()));
            se.setPublished(new Date(System.currentTimeMillis()));
            se.setTitle(new SyndText(localizedMessage));
            SyndContent syndContent = new SyndContent();
            syndContent.setType(MediaType.TEXT_PLAIN);
            syndContent.setValue(ExceptionHelper.stackTraceToString(t));
            se.setContent(syndContent);
            se.setSummary(new SyndText(localizedMessage));
            messageBodyWriter.writeTo(se,
                                      rawType,
                                      genType,
                                      null,
                                      mediaType,
View Full Code Here

     */
    public static SyndFeed createSyndFeed() {
        SyndFeed feed = new SyndFeed();
        feed.setId(COL_ID);
        feed.setUpdated(CURRENT_DATE);
        feed.setTitle(new SyndText(COL_TITLE));
        SyndLink syndLink = new SyndLink();
        syndLink.setHref(COL_LINK_HREF);
        syndLink.setType(COL_LINK_TYPE);
        syndLink.setRel(COL_LINK_REL);
        feed.addLink(syndLink);
        SyndCategory category = new SyndCategory();
        category.setScheme(COL_CATEGORY_SCHEME);
        category.setTerm(COL_CATEGORY_TERM);
        feed.addCategory(category);
        SyndPerson person = new SyndPerson();
        person.setName(COL_OWNER);
        feed.addAuthor(person);
        feed.setSubtitle(new SyndText(COL_SUB_TITLE));
        return feed;
    }
View Full Code Here

     *
     * @return DocumentResource<Object>
     */
    public static SyndEntry createSyndEntry() {
        SyndEntry syndEntry = new SyndEntry();
        syndEntry.setTitle(new SyndText(TITLE));
        syndEntry.setId(ID);
        syndEntry.setUpdated(CURRENT_DATE);
        syndEntry.setPublished(CURRENT_DATE);
        SyndPerson person = new SyndPerson();
        person.setName(OWNER);
        syndEntry.addAuthor(person);
        syndEntry.setSummary(new SyndText(SUMMARY));
        SyndCategory syndCategory = new SyndCategory();
        syndCategory.setScheme(CATEGORY_SCHEME);
        syndCategory.setTerm(CATEGORY_TERM);
        syndEntry.addCategory(syndCategory);
        SyndLink syndLink = new SyndLink();
View Full Code Here

     * @return SyndFeed syndication feed
     */
    private SyndFeed createUsersSyndFeed(Collection<User> users, LinkBuilders linkBuilders) {
        SyndFeed usersSyndFeed = new SyndFeed();
        usersSyndFeed.setId("urn:com:hp:users");
        usersSyndFeed.setTitle(new SyndText("Users"));
        usersSyndFeed.addAuthor(new SyndPerson("admin"));
        usersSyndFeed.setUpdated(new Date());

        // 1. Generate collection system links: "edit", "alternate"
        linkBuilders.createSystemLinksBuilder(). // Create SystemLinksBuilder
View Full Code Here

    private SyndEntry createUserSyndEntry(User user) {
        SyndEntry entry = new SyndEntry();
        entry.setId(Integer.toString(user.getId()));
        entry.setPublished(new Date(System.currentTimeMillis()));
        entry.setUpdated(new Date(System.currentTimeMillis()));
        entry.setTitle(new SyndText(user.getLastName() + " " + user.getFirstName()));
        return entry;
    }
View Full Code Here

TOP

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

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.