| 1 | |
|
| 2 | |
|
| 3 | |
|
| 4 | |
|
| 5 | |
|
| 6 | |
|
| 7 | |
|
| 8 | |
package com.buckosoft.PicMan.dom; |
| 9 | |
|
| 10 | |
import java.util.Date; |
| 11 | |
|
| 12 | |
import org.dom4j.Document; |
| 13 | |
import org.dom4j.DocumentHelper; |
| 14 | |
import org.dom4j.Element; |
| 15 | |
|
| 16 | |
import com.buckosoft.PicMan.business.PicManFacade; |
| 17 | |
import com.buckosoft.PicMan.business.mosaic.MosaicEngine; |
| 18 | |
import com.buckosoft.PicMan.domain.User; |
| 19 | |
|
| 20 | |
|
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | 0 | public class MosaicManDom { |
| 26 | |
|
| 27 | |
|
| 28 | |
|
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
static public Document createDocument(PicManFacade pmf, User user) { |
| 34 | 0 | Document document = DocumentHelper.createDocument(); |
| 35 | 0 | Element root = document.addElement("MosaicMan"); |
| 36 | 0 | getDateElement(root); |
| 37 | 0 | MosaicEngine me = pmf.getMosaicMan().getMosaicEngine(); |
| 38 | 0 | if (me != null) { |
| 39 | 0 | root.addElement("masterPic").addText(me.getMasterPicName()); |
| 40 | 0 | root.addElement("lastMosaicUpdate").addText(me.getLastMosaicUpdate().toString()); |
| 41 | 0 | root.addElement("status").addText(me.getStatus()); |
| 42 | 0 | root.addElement("info").addText(me.getInfo()); |
| 43 | 0 | root.addElement("name").addText(me.getName()); |
| 44 | 0 | root.addElement("fileName").addText(me.getOutputFileName()); |
| 45 | 0 | root.addElement("duration").addText(me.getDurationAsString()); |
| 46 | |
} |
| 47 | 0 | return document; |
| 48 | |
} |
| 49 | |
|
| 50 | |
private static void getDateElement(Element ele) { |
| 51 | 0 | Date now = new Date(); |
| 52 | 0 | ele.addElement("date").addText(now.toString()); |
| 53 | 0 | } |
| 54 | |
|
| 55 | |
} |