Permalink
Browse files

Use external commons-pdb module

  • Loading branch information...
shred committed Nov 16, 2017
1 parent 6251e89 commit 98bdcd3b59740cda78b21ff112270817929b1f1e
Showing with 118 additions and 2,795 deletions.
  1. +6 −0 pom.xml
  2. +0 −98 src/main/java/org/shredzone/pdbconverter/CalendarFactory.java
  3. +1 −0 src/main/java/org/shredzone/pdbconverter/PdbConverter.java
  4. +2 −2 src/main/java/org/shredzone/pdbconverter/export/AbstractExporter.java
  5. +5 −5 src/main/java/org/shredzone/pdbconverter/export/AddressXmlExporter.java
  6. +3 −3 src/main/java/org/shredzone/pdbconverter/export/Exporter.java
  7. +3 −3 src/main/java/org/shredzone/pdbconverter/export/MemoXmlExporter.java
  8. +3 −3 src/main/java/org/shredzone/pdbconverter/export/NotepadExporter.java
  9. +9 −9 src/main/java/org/shredzone/pdbconverter/export/ScheduleExporter.java
  10. +3 −3 src/main/java/org/shredzone/pdbconverter/export/TodoXmlExporter.java
  11. +6 −6 src/main/java/org/shredzone/pdbconverter/export/VCardExporter.java
  12. +4 −4 src/main/java/org/shredzone/pdbconverter/export/XmlHelper.java
  13. +3 −3 src/main/java/org/shredzone/pdbconverter/export/ZipExporter.java
  14. +2 −2 src/main/java/org/shredzone/pdbconverter/export/filter/CategoryExportFilter.java
  15. +1 −1 src/main/java/org/shredzone/pdbconverter/export/filter/ChainedExportFilter.java
  16. +1 −1 src/main/java/org/shredzone/pdbconverter/export/filter/DatedExportFilter.java
  17. +1 −1 src/main/java/org/shredzone/pdbconverter/export/filter/ExportFilter.java
  18. +1 −1 src/main/java/org/shredzone/pdbconverter/gui/ConverterPanel.java
  19. +11 −11 src/main/java/org/shredzone/pdbconverter/handler/AbstractCategoryExportHandler.java
  20. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/AddressXmlHandler.java
  21. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/ICalendarHandler.java
  22. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/MdbICalendarHandler.java
  23. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/MemoXmlHandler.java
  24. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/NotepadHandler.java
  25. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/TodoXmlHandler.java
  26. +4 −4 src/main/java/org/shredzone/pdbconverter/handler/VCardHandler.java
  27. +5 −5 src/main/java/org/shredzone/pdbconverter/handler/ZipHandler.java
  28. +3 −3 src/main/java/org/shredzone/pdbconverter/mdb/AbstractMdbReader.java
  29. +3 −3 src/main/java/org/shredzone/pdbconverter/mdb/MdbReader.java
  30. +12 −12 src/main/java/org/shredzone/pdbconverter/mdb/ScheduleMdbReader.java
  31. +0 −128 src/main/java/org/shredzone/pdbconverter/pdb/PdbDatabase.java
  32. +0 −365 src/main/java/org/shredzone/pdbconverter/pdb/PdbFile.java
  33. +0 −56 src/main/java/org/shredzone/pdbconverter/pdb/appinfo/AddressAppInfo.java
  34. +0 −29 src/main/java/org/shredzone/pdbconverter/pdb/appinfo/AppInfo.java
  35. +0 −126 src/main/java/org/shredzone/pdbconverter/pdb/appinfo/CategoryAppInfo.java
  36. +0 −50 src/main/java/org/shredzone/pdbconverter/pdb/appinfo/RawAppInfo.java
  37. +0 −136 src/main/java/org/shredzone/pdbconverter/pdb/converter/AddressConverter.java
  38. +0 −90 src/main/java/org/shredzone/pdbconverter/pdb/converter/Converter.java
  39. +0 −62 src/main/java/org/shredzone/pdbconverter/pdb/converter/MemoConverter.java
  40. +0 −188 src/main/java/org/shredzone/pdbconverter/pdb/converter/NotepadConverter.java
  41. +0 −58 src/main/java/org/shredzone/pdbconverter/pdb/converter/RawConverter.java
  42. +0 −178 src/main/java/org/shredzone/pdbconverter/pdb/converter/ScheduleConverter.java
  43. +0 −74 src/main/java/org/shredzone/pdbconverter/pdb/converter/TodoConverter.java
  44. +0 −71 src/main/java/org/shredzone/pdbconverter/pdb/record/AbstractRecord.java
  45. +0 −102 src/main/java/org/shredzone/pdbconverter/pdb/record/AddressRecord.java
  46. +0 −40 src/main/java/org/shredzone/pdbconverter/pdb/record/DatedRecord.java
  47. +0 −54 src/main/java/org/shredzone/pdbconverter/pdb/record/MemoRecord.java
  48. +0 −100 src/main/java/org/shredzone/pdbconverter/pdb/record/NotepadRecord.java
  49. +0 −53 src/main/java/org/shredzone/pdbconverter/pdb/record/RawRecord.java
  50. +0 −56 src/main/java/org/shredzone/pdbconverter/pdb/record/Record.java
  51. +0 −392 src/main/java/org/shredzone/pdbconverter/pdb/record/ScheduleRecord.java
  52. +0 −108 src/main/java/org/shredzone/pdbconverter/pdb/record/TodoRecord.java
  53. +0 −70 src/test/java/org/shredzone/pdbconverter/CalendarReaderExample.java
  54. +2 −2 src/test/java/org/shredzone/pdbconverter/mdb/ScheduleMdbReaderTest.java
View
@@ -33,6 +33,7 @@
<ical4j.version>1.0.7</ical4j.version>
<jackcess.version>2.1.9</jackcess.version>
<jshred.version>19</jshred.version>
<pdb.version>1.0</pdb.version>
<swingx.version>1.6.5-1</swingx.version>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
</properties>
@@ -135,6 +136,11 @@
<artifactId>jshred-util</artifactId>
<version>${jshred.version}</version>
</dependency>
<dependency>
<groupId>org.shredzone.commons</groupId>
<artifactId>commons-pdb</artifactId>
<version>${pdb.version}</version>
</dependency>
<dependency>
<groupId>org.mnode.ical4j</groupId>
<artifactId>ical4j</artifactId>

This file was deleted.

Oops, something went wrong.
@@ -33,6 +33,7 @@
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.shredzone.commons.pdb.CalendarFactory;
import org.shredzone.pdbconverter.handler.ExportHandler;
import org.shredzone.pdbconverter.handler.ExportOptions;
@@ -19,9 +19,9 @@
*/
package org.shredzone.pdbconverter.export;
import org.shredzone.commons.pdb.appinfo.AppInfo;
import org.shredzone.commons.pdb.record.Record;
import org.shredzone.pdbconverter.export.filter.ExportFilter;
import org.shredzone.pdbconverter.pdb.appinfo.AppInfo;
import org.shredzone.pdbconverter.pdb.record.Record;
/**
* An abstract implementation of {@link Exporter} that handles filtering.
@@ -23,11 +23,11 @@
import java.io.OutputStream;
import java.util.List;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.AddressAppInfo;
import org.shredzone.pdbconverter.pdb.record.AddressRecord;
import org.shredzone.pdbconverter.pdb.record.AddressRecord.Field;
import org.shredzone.pdbconverter.pdb.record.AddressRecord.Label;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.AddressAppInfo;
import org.shredzone.commons.pdb.record.AddressRecord;
import org.shredzone.commons.pdb.record.AddressRecord.Field;
import org.shredzone.commons.pdb.record.AddressRecord.Label;
/**
* Writes a {@link AddressRecord} database as a single XML file.
@@ -22,10 +22,10 @@
import java.io.IOException;
import java.io.OutputStream;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.AppInfo;
import org.shredzone.commons.pdb.record.Record;
import org.shredzone.pdbconverter.export.filter.ExportFilter;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.AppInfo;
import org.shredzone.pdbconverter.pdb.record.Record;
/**
* Generic interface for a database exporter.
@@ -23,9 +23,9 @@
import java.io.OutputStream;
import java.util.List;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.record.MemoRecord;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.record.MemoRecord;
/**
* Writes a {@link MemoRecord} database as a single XML file.
@@ -27,9 +27,9 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.record.NotepadRecord;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.record.NotepadRecord;
/**
* Writes a {@link NotepadRecord} database as ZIP file.
@@ -23,6 +23,15 @@
import java.io.OutputStream;
import java.util.Calendar;
import org.shredzone.commons.pdb.CalendarFactory;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.record.ScheduleRecord;
import org.shredzone.commons.pdb.record.ScheduleRecord.Alarm;
import org.shredzone.commons.pdb.record.ScheduleRecord.Repeat;
import org.shredzone.commons.pdb.record.ScheduleRecord.ShortDate;
import org.shredzone.commons.pdb.record.ScheduleRecord.ShortTime;
import net.fortuna.ical4j.data.CalendarOutputter;
import net.fortuna.ical4j.model.Date;
import net.fortuna.ical4j.model.DateList;
@@ -52,15 +61,6 @@
import net.fortuna.ical4j.model.property.Version;
import net.fortuna.ical4j.util.UidGenerator;
import org.shredzone.pdbconverter.CalendarFactory;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.record.ScheduleRecord;
import org.shredzone.pdbconverter.pdb.record.ScheduleRecord.Alarm;
import org.shredzone.pdbconverter.pdb.record.ScheduleRecord.Repeat;
import org.shredzone.pdbconverter.pdb.record.ScheduleRecord.ShortDate;
import org.shredzone.pdbconverter.pdb.record.ScheduleRecord.ShortTime;
/*
* NOTE TO THE READER:
* This class uses ical4j for writing iCalendar output. ical4j uses classes that
@@ -23,9 +23,9 @@
import java.io.OutputStream;
import java.util.List;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.record.TodoRecord;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.record.TodoRecord;
/**
* Writes a {@link TodoRecord} database as a single XML file.
@@ -26,12 +26,12 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.AddressAppInfo;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo.Category;
import org.shredzone.pdbconverter.pdb.record.AddressRecord;
import org.shredzone.pdbconverter.pdb.record.AddressRecord.Field;
import org.shredzone.pdbconverter.pdb.record.AddressRecord.Label;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.AddressAppInfo;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo.Category;
import org.shredzone.commons.pdb.record.AddressRecord;
import org.shredzone.commons.pdb.record.AddressRecord.Field;
import org.shredzone.commons.pdb.record.AddressRecord.Label;
/**
* Writes an {@link AddressRecord} database as vCard file.
@@ -26,11 +26,11 @@
import java.util.List;
import java.util.TimeZone;
import net.shredzone.jshred.io.XMLWriter;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo.Category;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo.Category;
import net.shredzone.jshred.io.XMLWriter;
/**
* A helper class for writing XML content to the given output stream.
@@ -27,9 +27,9 @@
import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.appinfo.RawAppInfo;
import org.shredzone.pdbconverter.pdb.record.RawRecord;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.appinfo.RawAppInfo;
import org.shredzone.commons.pdb.record.RawRecord;
/**
* Writes a {@link RawRecord} database as ZIP file.
@@ -21,8 +21,8 @@
import java.io.IOException;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.record.Record;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.record.Record;
/**
* An {@link ExportFilter} that only accepts {@link Record} from the given category.
@@ -19,7 +19,7 @@
*/
package org.shredzone.pdbconverter.export.filter;
import org.shredzone.pdbconverter.pdb.record.Record;
import org.shredzone.commons.pdb.record.Record;
/**
* An {@link ExportFilter} that consists of a chain of other
@@ -22,7 +22,7 @@
import java.io.IOException;
import java.util.Calendar;
import org.shredzone.pdbconverter.pdb.record.DatedRecord;
import org.shredzone.commons.pdb.record.DatedRecord;
/**
* An {@link ExportFilter} that only accepts {@link DatedRecord} within the
@@ -19,7 +19,7 @@
*/
package org.shredzone.pdbconverter.export.filter;
import org.shredzone.pdbconverter.pdb.record.Record;
import org.shredzone.commons.pdb.record.Record;
/**
* A filter tells if a {@link Record} is accepted.
@@ -46,7 +46,7 @@
import javax.swing.filechooser.FileFilter;
import org.jdesktop.swingx.JXDatePicker;
import org.shredzone.pdbconverter.CalendarFactory;
import org.shredzone.commons.pdb.CalendarFactory;
import org.shredzone.pdbconverter.ConverterRegister;
import org.shredzone.pdbconverter.handler.ExportHandler;
import org.shredzone.pdbconverter.handler.ExportOptions;
@@ -27,17 +27,17 @@
import java.util.List;
import java.util.Set;
import org.shredzone.commons.pdb.PdbDatabase;
import org.shredzone.commons.pdb.PdbFile;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo;
import org.shredzone.commons.pdb.appinfo.CategoryAppInfo.Category;
import org.shredzone.commons.pdb.converter.Converter;
import org.shredzone.commons.pdb.record.Record;
import org.shredzone.pdbconverter.export.Exporter;
import org.shredzone.pdbconverter.export.filter.CategoryExportFilter;
import org.shredzone.pdbconverter.export.filter.ChainedExportFilter;
import org.shredzone.pdbconverter.export.filter.DatedExportFilter;
import org.shredzone.pdbconverter.export.filter.ExportFilter;
import org.shredzone.pdbconverter.pdb.PdbDatabase;
import org.shredzone.pdbconverter.pdb.PdbFile;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo;
import org.shredzone.pdbconverter.pdb.appinfo.CategoryAppInfo.Category;
import org.shredzone.pdbconverter.pdb.converter.Converter;
import org.shredzone.pdbconverter.pdb.record.Record;
/**
* Abstract superclass for {@link Category} exporters.
@@ -55,7 +55,7 @@ public void export(File infile, File outfile, ExportOptions options) throws IOEx
ExportFilter<T> filter = createExportFilter(database, options);
if (options.isSplit()) {
Set<String> catnameSet = new HashSet<String>();
Set<String> catnameSet = new HashSet<>();
List<Category> categories = database.getAppInfo().getCategories();
for (int ix = 0; ix < categories.size(); ix++) {
@@ -65,11 +65,11 @@ public void export(File infile, File outfile, ExportOptions options) throws IOEx
ExportFilter<T> catFilter;
if (filter != null) {
ExportFilter<T>[] filterChain = new ExportFilter[2];
filterChain[0] = new CategoryExportFilter<T>(ix);
filterChain[0] = new CategoryExportFilter<>(ix);
filterChain[1] = filter;
catFilter = new ChainedExportFilter<T>(filterChain);
catFilter = new ChainedExportFilter<>(filterChain);
} else {
catFilter = new CategoryExportFilter<T>(ix);
catFilter = new CategoryExportFilter<>(ix);
}
File catfile = computeFilename(outfile, cat, catnameSet);
@@ -103,7 +103,7 @@ public void export(File infile, File outfile, ExportOptions options) throws IOEx
} else if (filterList.size() == 1) {
return filterList.get(0);
} else {
return new ChainedExportFilter<T>(filterList.toArray(new ExportFilter[filterList.size()]));
return new ChainedExportFilter<>(filterList.toArray(new ExportFilter[filterList.size()]));
}
}
Oops, something went wrong.

0 comments on commit 98bdcd3

Please sign in to comment.