View Javadoc
1   /******************************************************************************
2    * JobLogEntryDom.java - XML Status for PicMan
3    * 
4    * PicMan - The BuckoSoft Picture Manager in Java
5    * Copyright(c) 2007 - Dick Balaska
6    * 
7    */
8   package com.buckosoft.PicMan.dom;
9   
10  import org.dom4j.DocumentHelper;
11  import org.dom4j.Element;
12  
13  import com.buckosoft.PicMan.business.PicManFacade;
14  import com.buckosoft.PicMan.domain.JobLogEntry;
15  
16  /** XML for Job Logs
17   * @author Dick Balaska
18   * @since 2007/12/01
19   * @see <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/src/com/buckosoft/PicMan/dom/JobLogEntryDom.java">JobLogEntryDom.java</a>
20   */
21  public class JobLogEntryDom {
22  
23  	/** Return a {@link JobLogEntry} as a DOM Element
24  	 * @param pmf The PicMan Facade
25  	 * @param jle The {@link JobLogEntry} to convert
26  	 * @return A DOM Element
27  	 */
28  	static public	Element	getDomElement(PicManFacade pmf, JobLogEntry jle) {
29  		Element ele = DocumentHelper.createElement("JobLogEntry");
30  		ele.addElement("type").addText(jle.getTypeAsString());
31  		ele.addElement("name").addText(jle.getName());
32  		ele.addElement("note").addText(jle.getNote());
33  		ele.addElement("color").addText("" + jle.getColor());
34  		ele.addElement("startTime").addText(jle.getStartTimeAsString());
35  		ele.addElement("endTime").addText(jle.getEndTimeAsString());
36  		ele.addElement("duration").addText(jle.getDurationAsString());
37  		return(ele);
38  	}
39  	
40  }