|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultTreeModel
edu.harvard.mgh.purcell.gCLINE.data.Record
public abstract class Record
This class manages the operation annotations. Notes: All files are identified by their full file names. All operation names are unique.
Nested Class Summary | |
---|---|
private static class |
Record.myHostKeyValidator
This is a host key validator that automatically accepts any host key sent but doesn't actually save any of them. |
Field Summary | |
---|---|
private SshClient |
conn
A String that holds the ssh connection. |
static java.lang.String |
DEFAULT_EDITOR
default editor |
StartFrame |
frame
A JFrame that holds the main GUI |
protected java.util.Properties |
globalConfig
Holds the global configuration data. |
private java.util.HashMap<java.lang.String,java.lang.String> |
globalFileNotes
A HashMap that carries the global file notes |
boolean |
isNew
|
protected java.util.Properties |
localConfig
Holds the local project configuration data. |
private static org.apache.log4j.Logger |
logger
Optionally log messages. |
Lock |
myLock
Locking information for the folder |
java.lang.String |
OP_LOG_EXT
A string that identifies the file extention for the operation log file. |
protected java.util.Properties |
remoteConfig
Holds the information for the remote connection. |
AutoUpdater |
update
Automatically checks the home directory for new files and updates the displays. |
Fields inherited from class javax.swing.tree.DefaultTreeModel |
---|
asksAllowsChildren, listenerList, root |
Fields inherited from interface edu.harvard.mgh.purcell.gCLINE.data.KeyWords |
---|
BROWSE_KEY, CLINE_KEY, COMMAND_KEY, COMMAND_PREFIX_KEY, FILE_KEY, FOLDER_KEY, GLOBAL_CONFIG, HOME_KEY, HOST_KEY, INFILE_KEY, LOCAL_DIR, LOCAL_FOLDER_KEY, LOCK_FILE, META_FILE, NAME_KEY, OP_KEY, OUTFILE_KEY, P1_KEY, P2_KEY, P3_KEY, P4_KEY, PORT_KEY, REMOTE_CONFIG_FILE, REMOTE_FOLDER_KEY, REMOTE_GLOBAL_CONFIG, TIMESTAMP_KEY, UPDATE_INTERVAL_KEY, USER_EDITOR_KEY, USER_KEY, VS_KEY |
Constructor Summary | |
---|---|
Record()
Create a Record with null or empty fields. |
|
Record(StartFrame f)
Create a Record initalized to a particular StartFrame. |
|
Record(StartFrame f,
java.lang.String localName)
Create a Record. |
|
Record(StartFrame f,
java.lang.String localName,
java.lang.String remoteFileName,
java.lang.String hostname,
java.lang.String username,
java.lang.String portnum,
SshClient c)
Create a Record. |
Method Summary | |
---|---|
boolean |
addOperation(java.lang.String opName,
java.lang.String opDisc,
java.lang.String cline,
java.lang.String createTime,
java.util.Vector<java.lang.String[]> infiles,
java.util.Vector<java.lang.String[]> outfiles)
Add an operation to the info document, if there is an operation of that name then replace it with this new one. |
boolean |
backupInfo()
|
boolean |
connect()
|
static SshClient |
connect(ErrorManager em,
javax.swing.JFrame frame,
java.lang.String host,
java.lang.String user,
int port)
Connect the ssh client. |
java.util.Vector<OperationInfo> |
getAllOp()
Get a list of all the operations |
java.lang.String |
getAltEditor()
Get the alternative editor |
SshClient |
getConn()
get the connection to the remote directory |
java.lang.String |
getGlobalNote(java.lang.String filename)
Get a specific file note |
java.util.Vector<java.lang.String> |
getHomeFiles()
Get a list of files that are in your working directory |
java.lang.String |
getHomeFolder()
Get the home folder that the data is stored in. |
java.io.File |
getLocalFolder()
Get the name of the local file |
OperationInfo |
getOp(java.lang.String opName)
Get the full information on an operation |
java.lang.String |
getP1()
Get the first project name |
java.lang.String |
getP2()
Get the second project name |
java.lang.String |
getP3()
Get the third project name |
java.lang.String |
getP4()
Get the forth project name |
java.lang.String |
getRemoteFolder()
Get the name of the remote file |
static boolean |
getSavedBrowse()
Get the what browse option is saved in the global config file. |
java.lang.String |
getStatusExt()
Get the log extention |
int |
getUpdateSec()
|
boolean |
isRemote()
Is this record tied to a remote directory? |
boolean |
loadData(java.io.File metaFile,
java.lang.String homefile,
boolean remote)
Load the info document from xml file, otherwise set as default. |
private void |
loadGlobalConfig()
Load the config values from a Properties formated file. |
protected abstract void |
loadRemoteConfig()
|
private void |
populateNodes(org.w3c.dom.Document info)
Populate the operations and global file notes from a Document. |
private org.w3c.dom.Document |
processNodes()
Create a Document from the operations and global file notes that we can then write as an xml document easily. |
void |
properClosing()
Close the Record up properly. |
int |
removeOperation(java.lang.String opName)
Remove an operation from the document. |
void |
saveConfig()
Save the config values |
boolean |
saveInfo()
|
boolean |
saveInfo(java.io.File metaFile)
Write the information to the project file of the xml format. |
protected abstract void |
saveRemoteConfig()
|
void |
setAltEditor(java.lang.String editor)
Set the alternative editor |
abstract void |
setAutoUpdater(AutoUpdater given)
This is mainly abstract to remind programers to initalize it |
void |
setConnData(SshClient c,
java.lang.String host,
java.lang.String port,
java.lang.String user)
Set the connection data |
void |
setGlobalFileDisc(java.lang.String fileName,
java.lang.String fileDisc)
Set a global file discriptor |
void |
setLastProject()
Add the current project to our list so that we can launch the recent projects quickly from the associated menu bar. |
void |
setLog(java.lang.String ext)
Set the log extention |
void |
setP1(java.lang.String name)
Set the first project name if it's not equal to null. |
void |
setP2(java.lang.String name)
Set the second project name if it's not equal to null |
void |
setP3(java.lang.String name)
Set the third project name if it's not equal to null |
void |
setP4(java.lang.String name)
Set the forth project name if it's not equal to null |
private void |
setSavedBrowse()
|
void |
setUpdateSec(int sec)
|
java.lang.String |
toString()
Print the home folder of the record. |
Methods inherited from class javax.swing.tree.DefaultTreeModel |
---|
addTreeModelListener, asksAllowsChildren, fireTreeNodesChanged, fireTreeNodesInserted, fireTreeNodesRemoved, fireTreeStructureChanged, getChild, getChildCount, getIndexOfChild, getListeners, getPathToRoot, getPathToRoot, getRoot, getTreeModelListeners, insertNodeInto, isLeaf, nodeChanged, nodesChanged, nodeStructureChanged, nodesWereInserted, nodesWereRemoved, reload, reload, removeNodeFromParent, removeTreeModelListener, setAsksAllowsChildren, setRoot, valueForPathChanged |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static java.lang.String DEFAULT_EDITOR
public java.lang.String OP_LOG_EXT
public StartFrame frame
protected java.util.Properties remoteConfig
protected java.util.Properties globalConfig
protected java.util.Properties localConfig
public boolean isNew
private java.util.HashMap<java.lang.String,java.lang.String> globalFileNotes
public Lock myLock
private SshClient conn
public AutoUpdater update
private static org.apache.log4j.Logger logger
Constructor Detail |
---|
public Record()
public Record(StartFrame f)
f
- The StartFrame we are attaching this Record to.public Record(StartFrame f, java.lang.String localName)
f
- The StartFrame w are attaching this Record to.localName
- A String that is the name of the local
project folder for this project.public Record(StartFrame f, java.lang.String localName, java.lang.String remoteFileName, java.lang.String hostname, java.lang.String username, java.lang.String portnum, SshClient c)
f
- The StartFrame w are attaching this Record to.localName
- A String that is the name of the local
project folder for this project.remoteFileName
- A String that is the name of the remote
project folder for this project.hostname
- A String that is the name of the remote hostusername
- A String that is the name of the user on the
remote host.portnum
- A String that is the port number we wish to
connect to.c
- A SshClient that is used to connect to the remote
host.Method Detail |
---|
public void setUpdateSec(int sec)
public abstract void setAutoUpdater(AutoUpdater given)
public void setLog(java.lang.String ext)
ext
- a string discribing the log extentionpublic void setConnData(SshClient c, java.lang.String host, java.lang.String port, java.lang.String user)
c
- the actual connectionhost
- a string holding the host nameport
- a string holding the port numberuser
- a string holding the user namepublic void setAltEditor(java.lang.String editor)
public void setLastProject()
public void setP1(java.lang.String name)
name
- The name of the projectpublic void setP2(java.lang.String name)
name
- The name of the projectpublic void setP3(java.lang.String name)
name
- The name of the projectpublic void setP4(java.lang.String name)
name
- The name of the projectprivate void setSavedBrowse()
public int getUpdateSec()
public java.lang.String getP1()
public java.lang.String getP2()
public java.lang.String getP3()
public java.lang.String getP4()
public java.lang.String getAltEditor()
public java.lang.String getStatusExt()
public SshClient getConn()
public java.lang.String getRemoteFolder()
public java.io.File getLocalFolder()
public java.lang.String getHomeFolder()
public java.util.Vector<java.lang.String> getHomeFiles()
public java.lang.String getGlobalNote(java.lang.String filename)
filename
- A string that is the file name
public java.util.Vector<OperationInfo> getAllOp()
public OperationInfo getOp(java.lang.String opName)
opName
- A string that is the name of the operation
public static boolean getSavedBrowse()
public boolean loadData(java.io.File metaFile, java.lang.String homefile, boolean remote)
metaFile
- the file that holds the xml documenthomefile
- the string that is our project root
private void populateNodes(org.w3c.dom.Document info)
info
- A document that holds all the global
discriptions and operatoin nodesprivate org.w3c.dom.Document processNodes()
private void loadGlobalConfig()
protected abstract void loadRemoteConfig()
protected abstract void saveRemoteConfig()
public void saveConfig()
public boolean addOperation(java.lang.String opName, java.lang.String opDisc, java.lang.String cline, java.lang.String createTime, java.util.Vector<java.lang.String[]> infiles, java.util.Vector<java.lang.String[]> outfiles)
opName
- The operation name.opDisc
- The discription of the operation.cline
- The command line that is tied to the operaitoninfiles
- A vector of the names of the input files.outfiles
- A vector of the names of the output files.
public int removeOperation(java.lang.String opName)
opName
- the name of the operation we are removing
public void setGlobalFileDisc(java.lang.String fileName, java.lang.String fileDisc)
fileName
- a string identifing the file (absolute path name)fileDisc
- a string for local file discriptionpublic boolean isRemote()
public boolean saveInfo()
public boolean backupInfo()
public boolean saveInfo(java.io.File metaFile)
public java.lang.String toString()
toString
in class java.lang.Object
public boolean connect()
public static SshClient connect(ErrorManager em, javax.swing.JFrame frame, java.lang.String host, java.lang.String user, int port)
public void properClosing()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |