Search in sources :

Example 11 with StatusItem

use of org.onebusaway.enterprise.webapp.actions.status.model.StatusItem in project onebusaway-application-modules by camsys.

the class StatusUpdateAction method setAgencyMessages.

private void setAgencyMessages(List<SyndEntry> entries, String baseUrl) {
    // Add Agency Messages
    SyndEntry agencyMsgEntry = new SyndEntryImpl();
    agencyMsgEntry.setTitle("General Notices");
    agencyMsgEntry.setLink(baseUrl + "/rss/agency-messages-update");
    entries.add(agencyMsgEntry);
    StatusGroup agencyMsgGroup = _statusProvider.getAgencyMetadataStatus();
    if (agencyMsgGroup.getItems().size() == 0) {
        agencyMsgEntry = new SyndEntryImpl();
        agencyMsgEntry.setTitle("No Agency Messages");
        entries.add(agencyMsgEntry);
    } else {
        for (StatusItem agencyMsgItem : agencyMsgGroup.getItems()) {
            agencyMsgEntry = new SyndEntryImpl();
            agencyMsgEntry.setTitle(agencyMsgItem.getTitle());
            entries.add(agencyMsgEntry);
        }
    }
}
Also used : StatusItem(org.onebusaway.enterprise.webapp.actions.status.model.StatusItem) StatusGroup(org.onebusaway.enterprise.webapp.actions.status.model.StatusGroup) SyndEntry(com.rometools.rome.feed.synd.SyndEntry) SyndEntryImpl(com.rometools.rome.feed.synd.SyndEntryImpl)

Aggregations

StatusItem (org.onebusaway.enterprise.webapp.actions.status.model.StatusItem)11 StatusGroup (org.onebusaway.enterprise.webapp.actions.status.model.StatusGroup)10 SyndEntry (com.rometools.rome.feed.synd.SyndEntry)6 SyndEntryImpl (com.rometools.rome.feed.synd.SyndEntryImpl)6 SyndContent (com.rometools.rome.feed.synd.SyndContent)4 SyndContentImpl (com.rometools.rome.feed.synd.SyndContentImpl)4 ArrayList (java.util.ArrayList)4 SyndFeedImpl (com.rometools.rome.feed.synd.SyndFeedImpl)3 HttpServletRequest (javax.servlet.http.HttpServletRequest)3 IOException (java.io.IOException)2 InputStream (java.io.InputStream)2 HttpClient (org.apache.commons.httpclient.HttpClient)2 HttpMethod (org.apache.commons.httpclient.HttpMethod)2 GetMethod (org.apache.commons.httpclient.methods.GetMethod)2 ObjectMapper (org.codehaus.jackson.map.ObjectMapper)2 JsonNode (org.codehaus.jackson.JsonNode)1 AgencyMetadata (org.onebusaway.agency_metadata.model.AgencyMetadata)1 IcingaItem (org.onebusaway.enterprise.webapp.actions.status.model.IcingaItem)1 IcingaResponse (org.onebusaway.enterprise.webapp.actions.status.model.IcingaResponse)1 AgencyWithCoverageBean (org.onebusaway.transit_data.model.AgencyWithCoverageBean)1