Package gov.nysenate.openleg.model

Examples of gov.nysenate.openleg.model.CalendarEntry


        // 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);
                }
            }
        }
View Full Code Here


        List<CalendarEntry> calendarEntries = new ArrayList<CalendarEntry>();
        if (xmlSequence.getCalnos()!=null) {


            for(XMLCalno xmlCalno:xmlSequence.getCalnos().getCalno()) {
                CalendarEntry cEntry = parseCalno(storage, sequence.getId(),xmlCalno, supplemental.getCalendar().getSession());
                cEntry.setSequence(sequence);

                if (!calendarEntries.contains(cEntry))
                    calendarEntries.add(cEntry);
            }
        }
View Full Code Here

    public CalendarEntry parseCalno (Storage storage, String parentId, XMLCalno xmlCalNo, int sessionYear)
    {
        String calEntId = parentId + '-' + xmlCalNo.getNo();

        CalendarEntry calEntry = new CalendarEntry();
        calEntry.setOid(calEntId);

        // remove all the leading 0's
        calEntry.setNo(xmlCalNo.getNo().replaceAll("^0*", ""));

        // Set the motion date?
        // TODO: What is a motion date?
        if (xmlCalNo.getMotiondate()!=null)
        {
            try {
                Date motionDate = LRS_DATE_ONLY_FORMAT.parse(xmlCalNo.getMotiondate().getContent());
                calEntry.setMotionDate(motionDate);
            } catch (ParseException e) {
                logger.error("unable to parse calentry " + xmlCalNo.getNo() + " motiondate");
            }
        }

        // Get the bill for the entry, it may be marked has HIGH
        if (xmlCalNo.getBill() != null)
        {
            calEntry.setBillHigh(xmlCalNo.getBill().getHigh());

            // Get the bill from storage if possible, otherwise it makes a new one
            // TODO: should it be possible to not have the bill already?
            String billId = xmlCalNo.getBill().getNo();
            if (!billId.isEmpty()) {
                String sponsor = null;
                if (xmlCalNo.getSponsor()!=null)
                    sponsor = xmlCalNo.getSponsor().getContent();

                calEntry.setBill(getBill(storage, billId, sessionYear, sponsor));
            }
        }

        // Get the substituted bill from storage if possible, otherwise it makes a new one
        if (xmlCalNo.getSubbill()!=null)
        {
            String billId = xmlCalNo.getSubbill().getNo();
            if (!billId.isEmpty())
            {
                String sponsor = null;
                if (xmlCalNo.getSubsponsor()!=null)
                    sponsor = xmlCalNo.getSubsponsor().getContent();

                calEntry.setSubBill(getBill(storage, billId, sessionYear, sponsor));
            }
        }

        return calEntry;
    }
View Full Code Here

    {
        if (node.isNull()) {
            return null;
        }
        else {
            CalendarEntry entry = new CalendarEntry();
            entry.setOid(node.get("oid").asText());
            entry.setNo(node.get("no").asText());
            entry.setBill(makeBill(node.get("bill")));
            entry.setSubBill(makeBill(node.get("subBill")));
            entry.setBillHigh(node.get("billHigh").asText());
            entry.setMotionDate(makeDate(node.get("motionDate")));
            return entry;
        }
    }
View Full Code Here

TOP

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

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.