Examples of ProblemBill


Examples of gov.nysenate.openleg.qa.model.ProblemBill

    }

    public void createOrUpdateProblemBill(ProblemBill problemBill, boolean merge, FieldName[] fieldNames) {
        logger.info("Updating " + problemBill.getOid() + ", merging: " + merge);

        ProblemBill temp = findByOid(problemBill.getOid());
        if(temp == null) {
            db.create(problemBill);
        }
        else {
            problemBill.setRevision(temp.getRevision());

            //before merge we want to remove existing fields from previous reports
            temp = ProblemBill.removeNonMatchingFields(temp, fieldNames);

            db.update(merge ? ProblemBill.merge(problemBill, temp) : problemBill);
View Full Code Here

Examples of gov.nysenate.openleg.qa.model.ProblemBill

        longSearch.query(builder.query());

        for(Bill bill:longSearch) {
            logger.warn(TextFormatter.append("found ", bill.getSenateBillNo()," missing ",field));

            ProblemBill problemBill = null;
            if ((problemBill = problemBillMap.get(bill.getSenateBillNo())) != null) {
                problemBill.addMissingField(field);

            } else {
                problemBill = new ProblemBill(bill.getSenateBillNo(), bill.getModified());
                problemBill.addMissingField(field);
                problemBillMap.put(bill.getSenateBillNo(), problemBill);
            }
        }
    }
View Full Code Here

Examples of gov.nysenate.openleg.qa.model.ProblemBill

                    //TODO we don't have it
                    continue;
                }
                else {
                    if(luceneBill.getMemo() == null || luceneBill.getMemo().matches("\\s*")) {
                        ProblemBill problemBill = new ProblemBill(
                                luceneBill.getSenateBillNo(), luceneBill.getModified());
                        problemBill.addNonMatchingField(new NonMatchingField(FieldName.MEMO, null, null));
                        problemBill.setLastReported(time);

                        ret.add(problemBill);
                    }
                }
            }
View Full Code Here

Examples of gov.nysenate.openleg.qa.model.ProblemBill

            if(luceneBill == null) {
                //TODO we don't have it
                continue;
            }
            else {
                ProblemBill problemBill = new ProblemBill(luceneBill.getSenateBillNo(), luceneBill.getModified());
                problemBill.setLastReported(time);

                if(valid(lbdcBill.getSponsor(), luceneBill.getSponsor())) {
                    if(!cln(lbdcBill.getSponsor().getFullname()).equalsIgnoreCase(
                            cln(luceneBill.getSponsor().getFullname().replaceAll("\\s*\\(MS\\)", "")))) {

                        problemBill.addNonMatchingField(
                                new NonMatchingField(
                                        FieldName.SPONSOR,
                                        luceneBill.getSponsor().getFullname(),
                                        lbdcBill.getSponsor().getFullname()));
                    }
                }

                doCollectionField(problemBill, FieldName.ACTIONS, luceneBill.getActions(), lbdcBill.getActions());
                doCollectionField(problemBill, FieldName.COSPONSORS, luceneBill.getCoSponsors(), lbdcBill.getCoSponsors());
                doStringField(problemBill, FieldName.SUMMARY, luceneBill.getSummary(), lbdcBill.getSummary(), ".*?");
                doStringField(problemBill, FieldName.TITLE, luceneBill.getTitle(), lbdcBill.getTitle(), null);
                doStringField(problemBill, FieldName.LAW_SECTION, luceneBill.getLawSection(), lbdcBill.getLawSection(), null);

                if(problemBill.getNonMatchingFields() != null && problemBill.getNonMatchingFields().size() != 0)
                    ret.add(problemBill);
            }
        }

        close();
View Full Code Here

Examples of gov.nysenate.openleg.qa.model.ProblemBill

        return ret;
    }

    private void updateList(String rawBillNo, String formattedBillNo, String lbdcPageCount, ArrayList<ProblemBill> list) {
        if(formattedBillNo != null) {
            ProblemBill problemBill = getProblemBill(rawBillNo, formattedBillNo, lbdcPageCount);

            if(problemBill != null) {
                list.add(problemBill);
            }
        }
View Full Code Here

Examples of gov.nysenate.openleg.qa.model.ProblemBill

        else {
            if(luceneBill.getFulltext() != null) {
                int pageNumber = getPageNumber(rawBillNo.replaceAll("^0*", ""), luceneBill.getFulltext());

                if(pageNumber != new Integer(lbdcPageCount)) {
                    ProblemBill problemBill = new ProblemBill(formattedBillNo, luceneBill.getModified());
                    problemBill.addNonMatchingField(new NonMatchingField(FieldName.FULLTEXT, pageNumber + "", lbdcPageCount + ""));
                    problemBill.setLastReported(time);
                    return problemBill;
                }
            }
        }
        return null;
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.