Package gov.nysenate.openleg.model

Examples of gov.nysenate.openleg.model.Sequence


        }

        // Handle sequences when available
        XMLSequence xmlSequence = xmlSupp.getSequence();
        if (xmlSequence != null) {
            Sequence sequence = parseSequence(storage, supplemental, xmlSequence);
            supplemental.addSequence(sequence);

            // TODO: new removal objects? how/why?
            setRemoveObject(sequence, sequence.getId());
        }


        return supplemental;
    }
View Full Code Here



    public Sequence parseSequence (Storage storage, Supplemental supplemental, XMLSequence xmlSequence)  {
        String sequenceId = supplemental.getId() + "-seq-" + xmlSequence.getNo();

        Sequence sequence = new Sequence();
        sequence.setId(sequenceId);
        sequence.setNo(xmlSequence.getNo());

        // Attempt to set the Actcal Date
        //  TODO: what is actcal date?
        if (xmlSequence.getActcaldate()!=null) {

            try {
                Date actCalDate = LRS_DATE_ONLY_FORMAT.parse(xmlSequence.getActcaldate().getContent());
                sequence.setActCalDate(actCalDate);
            }
            catch (ParseException e) {
                logger.error("unable to parse sequence actCalDate",e);
            }
        }

        // Set release date time if possible
        if (xmlSequence.getReleasedate()!=null && xmlSequence.getReleasetime()!=null) {
            try {
                Date relDateTime = LRS_DATETIME_FORMAT.parse(xmlSequence.getReleasedate().getContent() + xmlSequence.getReleasetime().getContent());
                sequence.setReleaseDateTime(relDateTime);
            }
            catch (ParseException e) {
                logger.error("unable to parse sequence release date/time format",e);
            }
        }

        // Notes?
        if (xmlSequence.getNotes()!=null)
            sequence.setNotes(xmlSequence.getNotes().replaceAll("\n", ""));

        // Sequence Entries, just like a section?
        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);
            }
        }
        sequence.setCalendarEntries(calendarEntries);
        return sequence;
    }
View Full Code Here

    {
        if (node.isNull()) {
            return null;
        }
        else {
            Sequence sequence = new Sequence();
            sequence.setNo(node.get("no").asText());
            sequence.setId(node.get("id").asText());
            sequence.setActCalDate(makeDate(node.get("actCalDate")));
            sequence.setReleaseDateTime(makeDate(node.get("releaseDateTime")));
            sequence.setNotes(node.get("notes").asText());
            sequence.setCalendarEntries((List<CalendarEntry>)makeList(CalendarEntry.class, node.get("calendarEntries")));
            for(CalendarEntry calendarEntry : sequence.getCalendarEntries()) {
                calendarEntry.setSequence(sequence);
            }
            return sequence;
        }
    }
View Full Code Here

TOP

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

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.