| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
package com.buckosoft.PicMan.dom; |
| 9 | |
|
| 10 | |
import java.util.List; |
| 11 | |
|
| 12 | |
import org.dom4j.Document; |
| 13 | |
import org.dom4j.DocumentHelper; |
| 14 | |
import org.dom4j.Element; |
| 15 | |
|
| 16 | |
import com.buckosoft.PicMan.business.PicImporterImpl.PossibleDates; |
| 17 | |
import com.buckosoft.PicMan.domain.Pic; |
| 18 | |
|
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | 0 | public class ImportAnalyzeDom { |
| 23 | |
|
| 24 | |
static public Document createDocument(List<Pic> possibleDups, PossibleDates pds) { |
| 25 | 0 | Document document = DocumentHelper.createDocument(); |
| 26 | 0 | Element root = document.addElement("ImportAnalysis"); |
| 27 | 0 | if (possibleDups != null && !possibleDups.isEmpty()) { |
| 28 | 0 | Element ele = root.addElement("PossibleDuplicates"); |
| 29 | 0 | for (Pic pic : possibleDups) { |
| 30 | 0 | ele.addElement("pic").addText(pic.getName()); |
| 31 | 0 | } |
| 32 | |
} |
| 33 | 0 | if (pds.getFileDate() != null) |
| 34 | 0 | root.addElement("fileDate").addText("" + pds.getFileDate().getTime()); |
| 35 | 0 | if (pds.getTakenDate() != null) |
| 36 | 0 | root.addElement("takenDate").addText("" + pds.getTakenDate().getTime()); |
| 37 | 0 | if (pds.getCustomDate() != null) |
| 38 | 0 | root.addElement("customDate").addText("" + pds.getCustomDate().getTime()); |
| 39 | 0 | return(document); |
| 40 | |
} |
| 41 | |
|
| 42 | |
} |