Package com.sun.syndication.feed.synd

Examples of com.sun.syndication.feed.synd.SyndContent


        entry.setPublishedDate(new Date(message.getJMSTimestamp()));
        return entry;
    }

    protected SyndContent createEntryContent(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndContent description = new SyndContentImpl();
        description.setType(entryContentType);

        if (message instanceof TextMessage) {
            String text = ((TextMessage)message).getText();
            description.setValue(text);
        }
        return description;
    }
View Full Code Here


    private List<SyndEntry> getEntries( List<RssFeedEntry> dataEntries )
    {
        List<SyndEntry> entries = new ArrayList<SyndEntry>();

        SyndEntry entry;
        SyndContent description;

        for ( RssFeedEntry dataEntry : dataEntries )
        {
            entry = new SyndEntryImpl();
            entry.setTitle( dataEntry.getTitle() );
            entry.setPublishedDate( dataEntry.getPublishedDate() );

            description = new SyndContentImpl();
            description.setType( "text/plain" );
            description.setValue( dataEntry.getDescription() );
            entry.setDescription( description );

            entries.add( entry );
        }
View Full Code Here

    private List<SyndEntry> getEntries( List<RssFeedEntry> dataEntries )
    {
        List<SyndEntry> entries = new ArrayList<SyndEntry>();

        SyndEntry entry;
        SyndContent description;

        for ( RssFeedEntry dataEntry : dataEntries )
        {
            entry = new SyndEntryImpl();
            entry.setTitle( dataEntry.getTitle() );
            entry.setPublishedDate( dataEntry.getPublishedDate() );

            description = new SyndContentImpl();
            description.setType( "text/plain" );
            description.setValue( dataEntry.getDescription() );
            entry.setDescription( description );

            entries.add( entry );
        }
View Full Code Here

    public void renderMessage(PrintWriter writer, HttpServletRequest request, HttpServletResponse response, QueueBrowser browser, Message message) throws JMSException {
        SyndFeed feed = getFeed(browser, request);

        List<SyndEntry> entries = feed.getEntries();
        SyndEntry entry = createEntry(browser, message, request);
        SyndContent description = createEntryContent(browser, message, request);
        entry.setDescription(description);
        entries.add(entry);
    }
View Full Code Here

        entry.setPublishedDate(new Date());
        return entry;
    }

    protected SyndContent createEntryContent(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndContent description = new SyndContentImpl();
        description.setType(entryContentType);

        if (message instanceof TextMessage) {
            String text = ((TextMessage)message).getText();
            description.setValue(text);
        }
        return description;
    }
View Full Code Here

                } catch (IOException e) {
                    Debug.logError(e, module);
                }
                if (sub != null) {
                    String thisLink = entryLink + "?articleContentId=" + v.getString("contentId") + "&blogContentId=" + contentId;
                    SyndContent desc = new SyndContentImpl();
                    desc.setType("text/plain");
                    desc.setValue(sub);

                    SyndEntry entry = new SyndEntryImpl();
                    entry.setTitle(v.getString("contentName"));
                    entry.setPublishedDate(v.getTimestamp("createdDate"));
                    entry.setDescription(desc);
View Full Code Here

          tags.add(cat);
        }
        entry.setCategories(tags);
      }

      SyndContent content = new SyndContentImpl();
      if (StringUtils.isEmpty(entryModel.contentType)
          || entryModel.contentType.equalsIgnoreCase("text/plain")) {
        content.setType("text/html");
        content.setValue(StringUtils.breakLinesForHtml(entryModel.content));
      } else {
        content.setType(entryModel.contentType);
        content.setValue(entryModel.content);
      }
      entry.setDescription(content);

      entries.add(entry);
    }
View Full Code Here

                } catch (IOException e) {
                    Debug.logError(e, module);
                }
                if (sub != null) {
                    String thisLink = entryLink + "?articleContentId=" + v.getString("contentId") + "&blogContentId=" + contentId;
                    SyndContent desc = new SyndContentImpl();
                    desc.setType("text/plain");
                    desc.setValue(sub);

                    SyndEntry entry = new SyndEntryImpl();
                    entry.setTitle(v.getString("contentName"));
                    entry.setPublishedDate(v.getTimestamp("createdDate"));
                    entry.setDescription(desc);
View Full Code Here

   
    String entryDateWithLoggerName = logEntryLines.remove(0),
      entryLevelWithCustomPrefix = logEntryLines.remove(0);
   
    SyndEntry entry = new SyndEntryImpl();
    SyndContent  description = new SyndContentImpl();
   
    try {
      entry.setPublishedDate(parseLogEntryDate(entryDateWithLoggerName));
      entry.setTitle(parseLogEntryTitle(entryLevelWithCustomPrefix));   
     
      logEntryLines.add(0, parseLogMessage(entryLevelWithCustomPrefix));
     
          description.setType(ENTRY_FORMAT);
          description.setValue(StringUtils.join(logEntryLines, '\n'));
         
          entry.setDescription(description);
         
          entries.add(entry);         
    } catch (ParseException e) {
View Full Code Here

  }
 
  protected void verifyLogEntry(SyndEntry entry, String dateTime, String title, String description) throws ParseException {
    assertEquals(LOG_DATE_PARSER.parse(dateTime), entry.getPublishedDate());
    assertEquals(title, entry.getTitle());
    SyndContent content = entry.getDescription();
   
    assertEquals("text/plain", content.getType());
    assertEquals(description, content.getValue());
  }
View Full Code Here

TOP

Related Classes of com.sun.syndication.feed.synd.SyndContent

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.