@Test public void extractReferencedRegulations() { List<String> references = Lists.newArrayList("Ustawa z dnia 29 sierpnia 1997 r. o usługach turystycznych (Dz. U. z 1997 r. Nr 133, poz. 884 - art. 11 a; art. 11 a ust. 1; art. 14; art. 14 ust. 6; art. 14 ust. 7)", "Ustawa z dnia 17 listopada 1964 r. - Kodeks postępowania cywilnego (Dz. U. z 1964 r. Nr 43, poz. 296 - art. 230; art. 479(42); art. 479(44); art. 98; art. 99)", "Ustawa z dnia 28 lipca 2005 r. o kosztach sądowych w sprawach cywilnych (Dz. U. z 2005 r. Nr 167, poz. 1398 - art. 113; art. 113 ust. 1; art. 96; art. 96 ust. 1; art. 96 ust. 1 pkt. 3)", "Ustawa z dnia 23 kwietnia 1964 r. - Kodeks cywilny (Dz. U. z 1964 r. Nr 16, poz. 93 - art. 385; art. 385 ┬ž 2; art. 385(1); art. 385(1) ┬ž 1; art. 385(1) ┬ž 4; art. 385(3); art. 385(3) pkt. 13; art. 385(3) pkt. 2; art. 385(3) pkt. 9)", "Ustawa z dnia"); sJudgment.setReferences(references); List<LawJournalEntry> lawJournalEntries = createLawJournalEntries(references); List<JudgmentReferencedRegulation> refRegulations = sourceCcJudgmentExtractor.extractReferencedRegulations(sJudgment, correctionList); for (int i=0; i<references.size(); i++) { assertReferencedRegulation(refRegulations.get(i), lawJournalEntries.get(i), references.get(i)); } }
@Override public List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList) { List<JudgmentReferencedRegulation> regulations = Lists.newArrayList(); for (String reference : sourceJudgment.getReferences()) { JudgmentReferencedRegulation regulation = new JudgmentReferencedRegulation(); LawJournalEntryData entryData = lawJournalEntryExtractor.extractLawJournalEntry(reference); regulation.setRawText(reference); if (entryData != null) { LawJournalEntry lawJournalEntry = lawJournalEntryCreator.getOrCreateLawJournalEntry(entryData); regulation.setLawJournalEntry(lawJournalEntry); } regulations.add(regulation); } return regulations; }
SourceCcJudgmentExtractor implements JudgmentDataExtractor<CommonCourtJudgment, SourceCcJudgment> { @Override public List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList) { List<JudgmentReferencedRegulation> regulations = Lists.newArrayList(); for (String reference : sourceJudgment.getReferences()) { JudgmentReferencedRegulation regulation = new JudgmentReferencedRegulation(); LawJournalEntryData entryData = lawJournalEntryExtractor.extractLawJournalEntry(reference); regulation.setRawText(reference); if (entryData != null) { LawJournalEntry lawJournalEntry = lawJournalEntryCreator.getOrCreateLawJournalEntry(entryData); regulation.setLawJournalEntry(lawJournalEntry); } regulations.add(regulation); } return regulations; } }
SourceCcJudgmentExtractor implements JudgmentDataExtractor<CommonCourtJudgment, SourceCcJudgment> { @Override public List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList) { List<JudgmentReferencedRegulation> regulations = Lists.newArrayList(); for (String reference : sourceJudgment.getReferences()) { JudgmentReferencedRegulation regulation = new JudgmentReferencedRegulation(); LawJournalEntryData entryData = lawJournalEntryExtractor.extractLawJournalEntry(reference); regulation.setRawText(reference); if (entryData != null) { LawJournalEntry lawJournalEntry = lawJournalEntryCreator.getOrCreateLawJournalEntry(entryData); regulation.setLawJournalEntry(lawJournalEntry); } regulations.add(regulation); } return regulations; }  }
SourceCcJudgmentExtractor implements JudgmentDataExtractor<CommonCourtJudgment, SourceCcJudgment> { @Override public List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList) { List<JudgmentReferencedRegulation> regulations = Lists.newArrayList(); for (String reference : sourceJudgment.getReferences()) { JudgmentReferencedRegulation regulation = new JudgmentReferencedRegulation(); LawJournalEntryData entryData = lawJournalEntryExtractor.extractLawJournalEntry(reference); regulation.setRawText(reference); if (entryData != null) { LawJournalEntry lawJournalEntry = lawJournalEntryCreator.getOrCreateLawJournalEntry(entryData); regulation.setLawJournalEntry(lawJournalEntry); } regulations.add(regulation); } return regulations; }  @Override void convertSpecific(CommonCourtJudgment ccJudgment, SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override CommonCourtJudgment createNewJudgment(); @Override ArrayList<String> extractLegalBases(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractSummary(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractDecision(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override ArrayList<String> extractCourtReporters(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override LocalDate extractJudgmentDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<CourtCase> extractCourtCases(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentTextContent extractTextContent(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override SourceCode getSourceCode(); @Override String extractSourceJudgmentId(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractSourceJudgmentUrl(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractPublisher(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractReviser(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override DateTime extractPublicationDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override LocalDate extractReceiptDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<String> extractLowerCourtJudgments(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override MeansOfAppeal extractMeansOfAppeal(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentResult extractJudgmentResult(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<Judge> extractJudges(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentType extractJudgmentType(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Autowired void setCommonCourtRepository(CommonCourtRepository commonCourtRepository); @Autowired void setCcDivisionRepository(CcDivisionRepository ccDivisionRepository); @Autowired void setCcJudgmentKeywordCreator(JudgmentKeywordCreator ccJudgmentKeywordCreator); @Autowired void setLawJournalEntryCreator(LawJournalEntryCreator lawJournalEntryCreator); @Autowired void setLawJournalEntryExtractor(LawJournalEntryExtractor lawJournalEntryExtractor); @Autowired void setJudgeConverter(JudgeConverter judgeConverter); }
SourceCcJudgmentExtractor implements JudgmentDataExtractor<CommonCourtJudgment, SourceCcJudgment> { @Override public List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList) { List<JudgmentReferencedRegulation> regulations = Lists.newArrayList(); for (String reference : sourceJudgment.getReferences()) { JudgmentReferencedRegulation regulation = new JudgmentReferencedRegulation(); LawJournalEntryData entryData = lawJournalEntryExtractor.extractLawJournalEntry(reference); regulation.setRawText(reference); if (entryData != null) { LawJournalEntry lawJournalEntry = lawJournalEntryCreator.getOrCreateLawJournalEntry(entryData); regulation.setLawJournalEntry(lawJournalEntry); } regulations.add(regulation); } return regulations; }  @Override void convertSpecific(CommonCourtJudgment ccJudgment, SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override CommonCourtJudgment createNewJudgment(); @Override ArrayList<String> extractLegalBases(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractSummary(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractDecision(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override ArrayList<String> extractCourtReporters(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override LocalDate extractJudgmentDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<CourtCase> extractCourtCases(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentTextContent extractTextContent(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<JudgmentReferencedRegulation> extractReferencedRegulations(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override SourceCode getSourceCode(); @Override String extractSourceJudgmentId(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractSourceJudgmentUrl(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractPublisher(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override String extractReviser(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override DateTime extractPublicationDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override LocalDate extractReceiptDate(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<String> extractLowerCourtJudgments(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override MeansOfAppeal extractMeansOfAppeal(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentResult extractJudgmentResult(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override List<Judge> extractJudges(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Override JudgmentType extractJudgmentType(SourceCcJudgment sourceJudgment, ImportCorrectionList correctionList); @Autowired void setCommonCourtRepository(CommonCourtRepository commonCourtRepository); @Autowired void setCcDivisionRepository(CcDivisionRepository ccDivisionRepository); @Autowired void setCcJudgmentKeywordCreator(JudgmentKeywordCreator ccJudgmentKeywordCreator); @Autowired void setLawJournalEntryCreator(LawJournalEntryCreator lawJournalEntryCreator); @Autowired void setLawJournalEntryExtractor(LawJournalEntryExtractor lawJournalEntryExtractor); @Autowired void setJudgeConverter(JudgeConverter judgeConverter);  }