Examples of SyndEntryImpl


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

            List<SyndEntry> entries = new ArrayList<SyndEntry>();
            for (SummaryStatBean.StatDataBean dataBean : bean.getData())
            {
                Date date = dataBean.getDate();

                SyndEntry entry = new SyndEntryImpl();
                entries.add(entry);

                // all the feed has the same url... details on the statistics
                // page
                entry.setLink(bean.getStatURL() + "&freq=" + bean.getFreq()
                        + "&date=" + date.getTime());
                // entry.setUri();

                entry.setTitle(MessageFormat
                        .format(localize(msgs, MSG_ENTRY_TITLE, freq, type,
                                null, null), bean.getObjectName(), dataBean
                                .getDate()));

                Calendar c1 = Calendar.getInstance();
                c1.setTime(date);
                if (bean.getFreq() != StatSubscription.FREQUENCY_MONTHLY)
                {
                    c1.add(Calendar.DAY_OF_MONTH, 1);
                }
                else
                {
                    c1.add(Calendar.MONTH, 1);
                }
                date = c1.getTime();
                entry.setPublishedDate(date);
                // date of last change to Item
                entry.setUpdatedDate(dataBean.getDate());

                SyndContent desc = new SyndContentImpl();
                desc.setType("text/html");

                String tmpMessage = "";

                tmpMessage += MessageFormat
                        .format(localize(msgs, MSG_ENTRY_DESCRIPTION, freq,
                                type, AStatComponentService._SELECTED_OBJECT,
                                "view"), dataBean.getPeriodSelectedView(),
                                dataBean.getTotalSelectedView());

                if (dataBean.isShowSelectedObjectDownload())
                {
                    tmpMessage += MessageFormat.format(
                            localize(msgs, MSG_ENTRY_DESCRIPTION, freq, type,
                                    AStatComponentService._SELECTED_OBJECT,
                                    "download"), dataBean
                                    .getPeriodSelectedDownload(), dataBean
                                    .getTotalSelectedDownload());
                }

                for (String key : dataBean.getPeriodAndTotalTopView().keySet())
                {
                    if (dataBean.getPeriodAndTotalTopView().get(key) != null)
                    {
                        if (dataBean.getPeriodAndTotalTopView().get(key).size() > 0)
                        {
                            tmpMessage += MessageFormat.format(
                                    localize(msgs, MSG_ENTRY_DESCRIPTION, freq,
                                            type, key, "view"), dataBean
                                            .getPeriodAndTotalTopView()
                                            .get(key).get(0), dataBean
                                            .getPeriodAndTotalTopView()
                                            .get(key).get(1));
                        }
                        if (dataBean.getPeriodAndTotalTopDownload().get(key) != null)
                        {
                            if (dataBean.getPeriodAndTotalTopDownload()
                                    .get(key).size() > 0)
                            {
                                tmpMessage += MessageFormat.format(
                                        localize(msgs, MSG_ENTRY_DESCRIPTION,
                                                freq, type, key, "download"),
                                        dataBean.getPeriodAndTotalTopDownload()
                                                .get(key).get(0), dataBean
                                                .getPeriodAndTotalTopDownload()
                                                .get(key).get(1));
                            }
                        }

                    }

                }

                String message = MessageFormat.format(
                        localize(msgs, MSG_ENTRY_DESCRIPTION, freq, type, null,
                                null), bean.getObjectName(),
                        dataBean.getDate(), tmpMessage);

                desc.setValue(message);
                entry.setDescription(desc);

                entry.setAuthor(ConfigurationManager
                        .getProperty("webui.feed.stats.authors"));
            }
            feed.setEntries(entries);
        }
    }
View Full Code Here

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

        Object key = entry.getKey();
        Object data = entry.getData();
        if (data instanceof Item) {
            Item item = (Item)data;
           
            SyndEntry feedEntry = new SyndEntryImpl();
            feedEntry.setUri(key.toString());
            feedEntry.setTitle(item.getTitle());
   
            String value = item.getContents();
            if (value != null) {
                SyndContent content = new SyndContentImpl();
                content.setType("text/xml");
                content.setValue(value);
                List<SyndContent> contents = new ArrayList<SyndContent>();
                contents.add(content);
                feedEntry.setContents(contents);
            }
   
            String href = item.getLink();
            if (href == null) {
                href = key.toString();
            }
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(href);
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(href);
            feedEntry.getLinks().add(link);
   
            Date date = item.getDate();
            if (date == null) {
                date = new Date();
            }
            feedEntry.setPublishedDate(date);
            return feedEntry;
           
        } else if (data != null) {
            SyndEntry feedEntry = new SyndEntryImpl();
            feedEntry.setUri(key.toString());
            feedEntry.setTitle("item");
   
            // Convert the item to XML
            String value = mediator.mediate(data, itemClassType, itemXMLType, null).toString();
           
            SyndContent content = new SyndContentImpl();
            content.setType("text/xml");
            content.setValue(value);
            List<SyndContent> contents = new ArrayList<SyndContent>();
            contents.add(content);
            feedEntry.setContents(contents);
   
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref(key.toString());
            feedEntry.getLinks().add(link);
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref(key.toString());
            feedEntry.getLinks().add(link);
   
            feedEntry.setPublishedDate(new Date());
            return feedEntry;
        } else {
            return null;
        }
    }
View Full Code Here

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

    public CustomerCollectionImpl() {

        for (int i = 0; i < 4; i++) {
            String id = "urn:uuid:customer-" + UUID.randomUUID().toString();

            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("customer " + "Jane Doe_" + String.valueOf(i));
            entry.setUri(id);

            SyndContent content = new SyndContentImpl();
            content.setValue("Jane Doe_" + String.valueOf(i));
            content.setType(Content.TEXT);
            entry.setContents(Collections.singletonList(content));

            List<SyndLink> links = new ArrayList<SyndLink>();
            SyndLink link = new SyndLinkImpl();
            link.setRel("edit");
            link.setHref("" + id);
            links.add(link);
            entry.setLinks(links);

            links = new ArrayList<SyndLink>();
            link = new SyndLinkImpl();
            link.setRel("alternate");
            link.setHref("" + id);
            links.add(link);
            entry.setLinks(links);

            entry.setPublishedDate(new Date());

            entries.put(id, entry);
            System.out.println(">>> id=" + id);
        }
    }
View Full Code Here

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

                    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);
                    entry.setLink(thisLink);
                    entry.setAuthor((v.getString("createdByUserLogin")));
                    entries.add(entry);
                }
            }
        }
View Full Code Here

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

        Iterator it = history.iterator();
        while(it.hasNext()){
            TransactionEvent e = (TransactionEvent) it.next();
            //SyncItem item = (SyncItem)it.next();
           
            SyndEntry entry = new SyndEntryImpl();
            entry.setTitle("Feature A");
            entry.setLink("http://geoserver.org/a");
            entry.setPublishedDate(DATE_PARSER.parse("2004-06-08"));
           
            //encode the content as the wfs transcation
            SyndContent description = new SyndContentImpl();
            description.setType("text/xml");
            description.setValue(encodeTransaction( e ));

            // GeoRSSModule geoInfo = new W3CGeoModuleImpl();
            // Polygon bounds = new Polygon();
            // PositionList exterior = new PositionList();
            // double minLat = 0, minLong = 0, maxLat = 0, maxLong = 0;
            // exterior.add(minLat, minLong);
            // exterior.add(minLat, maxLong);
            // exterior.add(maxLat, maxLong);
            // exterior.add(maxLat, minLong);
            // bounds.setExterior(new LinearRing(exterior));
            // geoInfo.setGeometry(bounds);
            // entry.getModules().add(geoInfo);
            // TODO: use real data for Geo output
            List contents = new ArrayList();
            contents.add(description);
            entry.setContents(contents);
            entries.add(entry);
        }

        return entries;
    }
View Full Code Here

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

        temp.addAll(entries);
        feed.setEntries(temp);
    }

    protected SyndEntry createEntry(MessageExchange exchange, NormalizedMessage message) throws MessagingException {
        SyndEntry entry = new SyndEntryImpl();

        entry.setTitle(ExpressionHelper.asString(getEntryTitle(), exchange, message, "ServiceMix Feed"));
        entry.setLink(getLink());
        entry.setPublishedDate(new Date());
        return entry;
    }
View Full Code Here

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

            out.output(feed, writer);   
        }
    }

    public SyndEntry eventToEntry(TransactionEvent evt) throws Exception{
        SyndEntry entry = new SyndEntryImpl();
        entry.setTitle("Changes to " + evt.getLayerName().getLocalPart());
        // entry.setLink("http://geoserver.org/a");
        entry.setPublishedDate(new Date());

        //encode the content as the wfs transcation
        SyndContent description = new SyndContentImpl();
        description.setType("text/xml");
        description.setValue(encodeTransaction( evt ));

        // attach the content to the entry
        List contents = new ArrayList();
        contents.add(description);
        entry.setContents(contents);

        // Add the georss info
        ReferencedEnvelope refenv = evt.getAffectedFeatures().getBounds();

        GeoRSSModule geoInfo = new GMLModuleImpl();
        double minLat = refenv.getMinimum(0),
               minLong = refenv.getMinimum(1),
               maxLat = refenv.getMaximum(0),
               maxLong = refenv.getMaximum(1);
        Envelope bounds = new Envelope(minLat, minLong, maxLat, maxLong);
        geoInfo.setGeometry(bounds);
        List modules = entry.getModules();
        modules.add(geoInfo);
        entry.setModules(modules);

        return entry;
    }
View Full Code Here

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

        }
        return feed;
    }

    protected SyndEntry createEntry(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndEntry entry = new SyndEntryImpl();
        String title = message.getJMSMessageID();
        entry.setTitle(title);
        String link = request.getRequestURI() + "?msgId=" + title;
        entry.setLink(link);
        entry.setPublishedDate(new Date());
        return entry;
    }
View Full Code Here

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

        }
        return feed;
    }

    protected SyndEntry createEntry(QueueBrowser browser, Message message, HttpServletRequest request) throws JMSException {
        SyndEntry entry = new SyndEntryImpl();
        String title = message.getJMSMessageID();
        entry.setTitle(title);
        String link = request.getRequestURI() + "/" + title;
        entry.setLink(link);
        entry.setPublishedDate(new Date());
        return entry;
    }
View Full Code Here

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

        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" );
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.