ex1
Class SaveXML

java.lang.Object
  extended byex1.SaveXML
All Implemented Interfaces:
org.xml.sax.EntityResolver, javax.xml.transform.URIResolver

public class SaveXML
extends java.lang.Object
implements org.xml.sax.EntityResolver, javax.xml.transform.URIResolver

This class handles saving crop and operation data back to XML files.


Constructor Summary
SaveXML(java.lang.String topdir, DefnFileParser names, WepsDBFile wfile, boolean isCrop)
          Creates a new instance of SaveXML class
 
Method Summary
 void cloneFile(java.lang.String fsource, java.lang.String fdest, boolean removeActions)
          Makes a copy of a file.
 boolean createFile(java.lang.String file)
          This builds a new XML file almost from scratch.
 javax.xml.transform.Source resolve(java.lang.String href, java.lang.String base2)
           
 org.xml.sax.InputSource resolveEntity(java.lang.String publicID, java.lang.String sysID)
          Called automatically by the loader to find where DTD's are located
 boolean saveFile(java.lang.String file)
          Save the specified file
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SaveXML

public SaveXML(java.lang.String topdir,
               DefnFileParser names,
               WepsDBFile wfile,
               boolean isCrop)
Creates a new instance of SaveXML class

Parameters:
topdir - directory where mcrew config files are found
names - all parameters read from DEFN file
wfile - WepsDBFile instance of file to save
isCrop - true if this is crop XML
Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicID,
                                             java.lang.String sysID)
Called automatically by the loader to find where DTD's are located

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver

saveFile

public boolean saveFile(java.lang.String file)
Save the specified file

Parameters:
file - the name to save the data to
Returns:
true if save was ok

createFile

public boolean createFile(java.lang.String file)
This builds a new XML file almost from scratch. This is only needed for operations files. The file is first loaded and then all the process data is stripped out.

Parameters:
file - the name of the file to create
Returns:
true if the file was created

cloneFile

public void cloneFile(java.lang.String fsource,
                      java.lang.String fdest,
                      boolean removeActions)
Makes a copy of a file. The actions can optionally be stripped out

Parameters:
fsource - starting file
fdest - name of new file
removeActions - true if all process info is stripped

resolve

public javax.xml.transform.Source resolve(java.lang.String href,
                                          java.lang.String base2)
                                   throws javax.xml.transform.TransformerException
Specified by:
resolve in interface javax.xml.transform.URIResolver
Throws:
javax.xml.transform.TransformerException