edu.uml.gui
Class UmlGui

java.lang.Object
  |
  +--edu.uml.gui.UmlGui

public class UmlGui
extends java.lang.Object

This class contains all the methods available in the edu.uml.gui package.

Version:
1.0, updated by JMH on October 05, 2002 at 11:15 AM
Author:
Jesse M. Heines, heines@cs.uml.edu

Field Summary
private static java.lang.String strServletURI
          location of umlguiStoreXML.jsp
 
Constructor Summary
UmlGui()
          Creates a new instance of UmlGui
 
Method Summary
static org.w3c.dom.Document openXMLDocument(java.lang.String strFilePath)
          This public static method opens and XML file and returns the Document object representing the XML document it contains.
static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName)
          This three-parameter public static method calls the four-parameter version with the file path set to null.
static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath)
          This four-parameter public static method parses the user name from Applet.getCodeBase() and then calls the five-parameter version of this same method.
static java.lang.String storeXMLDocument(java.applet.Applet app, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath, java.lang.String strUserName)
          This five-parameter public static method calls (Applet.getCodeBase()).getHost() to get the name of the host system on which the calling applet is running, which is required to store the host on which to the XML document, and then calls the private version of storeXMLDocument to do the actual save.
private static java.lang.String storeXMLDocument(java.lang.String strHost, org.w3c.dom.Document doc, java.lang.String strFileName, java.lang.String strFilePath, java.lang.String strUserName)
          This private static method saves an XML Document on a specified system.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

strServletURI

private static java.lang.String strServletURI
location of umlguiStoreXML.jsp

Constructor Detail

UmlGui

public UmlGui()
Creates a new instance of UmlGui

Method Detail

openXMLDocument

public static org.w3c.dom.Document openXMLDocument(java.lang.String strFilePath)
                                            throws UmlGuiException
This public static method opens and XML file and returns the Document object representing the XML document it contains.

If the file cannot be opened or parsed, a UmlGuiException is thrown. This is a checked exception derived from IOException, so this method must be called from within a try block.

Parameters:
strFilePath - full path to the XML file to be opened
Returns:
Document object for that file
Throws:
UmlGuiException

storeXMLDocument

private static java.lang.String storeXMLDocument(java.lang.String strHost,
                                                 org.w3c.dom.Document doc,
                                                 java.lang.String strFileName,
                                                 java.lang.String strFilePath,
                                                 java.lang.String strUserName)
                                          throws UmlGuiException
This private static method saves an XML Document on a specified system. It is the main version of this method that is called by all overloaded methods with the same name.

It works by calling the current version of umlguiStoreXML.jsp (specified in private static String strServletURI) on the system specified in the first parameter. Note that it will only work if the system specified in the first parameter is the same as that from which the calling applet was loaded.

The file is saved in the user area specified in the third parameter, under the name specified in the fourth parameter, and in the subdirectory specified in the fifth parameter.

Note that if a file exists with the same name in the same area and the same subdirectory, it is overwritten.

If an error occurs, a UmlGuiException is thrown. This is a checked exception derived from IOException, so this method must be called from within a try block.

Parameters:
strHost - name of host system on which to store the document
doc - XML document to save
strFileName - name under which to store the document
strFilePath - subdirectory of the user area in which to store the document
strUserName - name of user area in which to store the document
Returns:
a String indicating the full path to the XML document stored
Throws:
UmlGuiException

storeXMLDocument

public static java.lang.String storeXMLDocument(java.applet.Applet app,
                                                org.w3c.dom.Document doc,
                                                java.lang.String strFileName,
                                                java.lang.String strFilePath,
                                                java.lang.String strUserName)
                                         throws UmlGuiException

This five-parameter public static method calls (Applet.getCodeBase()).getHost() to get the name of the host system on which the calling applet is running, which is required to store the host on which to the XML document, and then calls the private version of storeXMLDocument to do the actual save.

Note that you do not usually want to call this version of this method because you will typically store your XML documents under the name in the directory from which the applet was run. This name can be extracted from the applet's code base by the four-parameter version of this method.

Parameters:
app - the calling applet
doc - XML document to save
strFileName - name under which to store the document
strFilePath - subdirectory of the user area in which to store the document
strUserName - name of user area in which to store the document
Returns:
a String indicating the full path to the XML document stored
Throws:
UmlGuiException

storeXMLDocument

public static java.lang.String storeXMLDocument(java.applet.Applet app,
                                                org.w3c.dom.Document doc,
                                                java.lang.String strFileName,
                                                java.lang.String strFilePath)
                                         throws UmlGuiException
This four-parameter public static method parses the user name from Applet.getCodeBase() and then calls the five-parameter version of this same method.

Parameters:
app - the calling applet
doc - XML document to save
strFileName - name under which to store the document
strFilePath - subdirectory of the user area in which to store the document
Returns:
a String indicating the full path to the XML document stored
Throws:
UmlGuiException

storeXMLDocument

public static java.lang.String storeXMLDocument(java.applet.Applet app,
                                                org.w3c.dom.Document doc,
                                                java.lang.String strFileName)
                                         throws UmlGuiException
This three-parameter public static method calls the four-parameter version with the file path set to null.

Parameters:
app - the calling applet
doc - XML document to save
strFileName - name under which to store the document
Returns:
a String indicating the full path to the XML document stored
Throws:
UmlGuiException