wt.clients.doc
Class DocumentTaskLogic

java.lang.Object
  extended bywt.clients.doc.DocumentTaskLogic
Direct Known Subclasses:
UpdateDocumentTaskLogic, ViewDocumentTaskLogic

public class DocumentTaskLogic
extends Object

Contains static methods which support manipulating WTDocument objects.

Supported API: false

Extendable: false


Field Summary
private static String MESSAGES_RESOURCE
           
 
Constructor Summary
DocumentTaskLogic()
           
 
Method Summary
static void delete(WTDocument document)
          Method delete deletes the given Document object from the database.
static Timestamp getCreationDate(WTDocument doc)
          Returns the creation timestamp of the given WTDocument.
static String getCurrentUserName()
          Returns the string name of the current user.
static DepartmentList[] getDepartments()
           Return the array of DepartmentLists for a WTDocument.
static WTDocument getDocumentInstance(DocumentType type, String name, String number)
           
static Timestamp getUpdatedDate(WTDocument doc)
          Returns the timestamp on which the given WTDocument was most recently modified.
static WTDocument refreshDocument(WTDocument stale_doc)
          Return a refreshed copy of the given WTDocument.
static WTDocument save(WTDocument doc)
          Persists the given WTDocument in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MESSAGES_RESOURCE

private static String MESSAGES_RESOURCE
Constructor Detail

DocumentTaskLogic

public DocumentTaskLogic()
Method Detail

getDepartments

public static DepartmentList[] getDepartments()
Return the array of DepartmentLists for a WTDocument.

Returns:
an array of DepartmentList objects.
See Also:
DepartmentList

refreshDocument

public static WTDocument refreshDocument(WTDocument stale_doc)
                                  throws WTException
Return a refreshed copy of the given WTDocument.

Parameters:
stale_doc - the document to be refreshed
Returns:
the refreshed document
Throws:
WTException - if an error occurs retrieveing the refreshed WTDocument from the database.

getCreationDate

public static Timestamp getCreationDate(WTDocument doc)
Returns the creation timestamp of the given WTDocument.

Parameters:
doc - the WTDocument whose timestamp is returned
Returns:
the timestamp on which the given document was created.

getUpdatedDate

public static Timestamp getUpdatedDate(WTDocument doc)
Returns the timestamp on which the given WTDocument was most recently modified.

Parameters:
doc - the WTDocument whose last update timestamp is returned.
Returns:
the timestamp on which the given document was last updated.

getDocumentInstance

public static WTDocument getDocumentInstance(DocumentType type,
                                             String name,
                                             String number)
                                      throws WTPropertyVetoException,
                                             WTException
Throws:
WTPropertyVetoException
WTException

save

public static WTDocument save(WTDocument doc)
                       throws WTException
Persists the given WTDocument in the database.

Parameters:
doc - the WTDocument to be saved in the database
Returns:
the saved document
Throws:
WTException - if an error occurs attempting to save the given document.

getCurrentUserName

public static String getCurrentUserName()
                                 throws WTException
Returns the string name of the current user.

Returns:
the string name of the current user
Throws:
WTException - if an error occurs retrieving the name of the current user.

delete

public static void delete(WTDocument document)
                   throws WTException
Method delete deletes the given Document object from the database.

Parameters:
document - the Document object to be deleted
Throws:
WTException