Package gov.nysenate.openleg.model

Examples of gov.nysenate.openleg.model.Section


                logger.error("Unable to parse relDate for supplement=" + xmlSupp.getId(),e);
            }
        }

        if (xmlSupp.getSections()!=null) {
            Section section = null;

            // Get the existing set of sections if available.
            if (supplemental.getSections() == null)
                supplemental.setSections(new ArrayList<Section>());
            List<Section> sections = supplemental.getSections();
View Full Code Here


     */
    public Section parseSection (Storage storage, Supplemental supplemental, XMLSection xmlSection) {
        String sectionId = supplemental.getId() + "-sect-" + xmlSection.getName();

        // Create a new section
        Section section = new Section();
        section.setId(sectionId);
        section.setCd(xmlSection.getCd());
        section.setName(xmlSection.getName());
        section.setType(xmlSection.getType());
        section.setSupplemental(supplemental);

        // New section entry list!
        List<CalendarEntry> calendarEntries = section.getCalendarEntries();

        // Loop through the entries
        for(XMLCalno xmlCalno:xmlSection.getCalnos().getCalno()) {
            CalendarEntry cEntry = null;
            try  {
                // Add each entry with a parent reference
                cEntry = parseCalno(storage, section.getId(), xmlCalno, supplemental.getCalendar().getSession());
                cEntry.setSection(section);

                // But don't add things twice
                if (!calendarEntries.contains(cEntry))
                    calendarEntries.add(cEntry);
            }
            catch (Exception e) {
                if (cEntry != null)
                    logger.error("Error adding CalenderEntry: " + cEntry.getOid(), e);
                else {
                    logger.error("Error adding CalenderEntry: ", e);
                }
            }
        }

        // Save our entry list
        section.setCalendarEntries(calendarEntries);
        return section;
    }
View Full Code Here

                        if (supp.getSections() != null) {
                            Iterator<Section> itSections = supp.getSections()
                                    .iterator();
                            while (itSections.hasNext()) {
                                Section section = itSections.next();

                                summary += section.getName() + ": ";
                                summary += section.getCalendarEntries().size() + " items;";
                            }
                        }
                    } else if (supp.getSequences() != null && supp.getSequences().size() > 0) {

                        fields.put("date", DATE_FORMAT_CUSTOM.format(supp.getSequences().get(0).getActCalDate()));
View Full Code Here

    {
        if (node.isNull()) {
            return null;
        }
        else {
            Section section = new Section();
            section.setId(node.get("id").asText());
            section.setName(node.get("name").asText());
            section.setType(node.get("type").asText());
            section.setCd(node.get("cd").asText());
            section.setCalendarEntries((List<CalendarEntry>)makeList(CalendarEntry.class, node.get("calendarEntries")));
            for(CalendarEntry calendarEntry : section.getCalendarEntries()) {
                calendarEntry.setSection(section);
            }
            return section;
        }
    }
View Full Code Here

TOP

Related Classes of gov.nysenate.openleg.model.Section

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.