Coverage Report - com.buckosoft.PicMan.dom.MosaicManDom
 
Classes in this File Line Coverage Branch Coverage Complexity
MosaicManDom
0%
0/17
0%
0/2
1.5
 
 1  
 /******************************************************************************
 2  
  * MosaicManDom.java - XML Sets for PicMan's SetMan
 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 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  
 /** XML for MosaicDisplay
 21  
  * @author Dick Balaska
 22  
  * @since 2007/12/28
 23  
  * @see <a href="http://cvs.buckosoft.com/Projects/java/PicMan/PicMan/src/com/buckosoft/PicMan/dom/MosaicManDom.java">MosaicManDom.java</a>
 24  
  */
 25  0
 public class MosaicManDom {
 26  
 
 27  
         /** Return the Mosaic runtime status as a Document
 28  
          * @param pmf The PicMan Facade
 29  
          * @param user Who is connected to the browser? (Not used)
 30  
          * @return A DOM Document
 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  
 }