apollo.dataadapter.chadoxml
Class ChadoXmlAdapter

java.lang.Object
  extended by org.bdgp.io.AbstractDataAdapter
      extended by apollo.dataadapter.AbstractApolloAdapter
          extended by apollo.dataadapter.chadoxml.ChadoXmlAdapter
All Implemented Interfaces:
ApolloDataAdapterI, org.bdgp.io.DataAdapter, org.bdgp.io.VisualDataAdapter
Direct Known Subclasses:
FlyChadoXmlAdapter

public class ChadoXmlAdapter
extends AbstractApolloAdapter

A FlyBase-specific reader for Chado XML files. Currently handles only unmacroized Chado XML.


Field Summary
static java.lang.String FIELD_LABEL
          For labeling flat fields (which are stored as properties) so they can be written out properly.
protected static org.apache.log4j.Logger logger
           
 
Fields inherited from class apollo.dataadapter.AbstractApolloAdapter
curation_set, region, style
 
Fields inherited from class org.bdgp.io.AbstractDataAdapter
listeners
 
Fields inherited from interface apollo.dataadapter.ApolloDataAdapterI
OP_APPEND_DATA, OP_READ_DATA, OP_READ_RAW_ANALYSIS, OP_READ_SEQUENCE, OP_WRITE_DATA
 
Constructor Summary
ChadoXmlAdapter()
          Must have empty constructor to work with org.bdgp.io.DataAdapterRegistry instance creation from config string
 
Method Summary
 java.lang.Boolean addToCurationSet()
          Like getCurationSet--used for layering new data.
 boolean appearsToBeChadoXML(java.lang.String filename, java.io.BufferedReader in)
          Check whether the input appears to be chadoXML by looking for the line
 void commitChanges(CurationSet curation)
          Main method for writing ChadoXML file
 void commitChanges(CurationSet curation, boolean saveAnnots, boolean saveResults)
          Main method for writing ChadoXML file
 CurationSet getCurationSet()
          This is the main method for reading the data.
 CurationSet getCurationSetFromInputStream(java.io.InputStream xml_stream)
           
 java.lang.String getInput()
          Returns the input String passed to the DataAdapter, the input is of course associated with the input type Should this go into org.bdgp.io.DataAdapter?
 java.util.Properties getStateInformation()
          State info Properties carries all the info needed for the adapter to do its query This is an alternative to setDataInput.
 org.bdgp.io.IOOperation[] getSupportedOperations()
          From org.bdgp.io.DataAdapter interface
 java.lang.String getType()
          Used by GenericFileAdapterGUI
 org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
          From org.bdgp.io.VisualDataAdapter interface
 void setDataInput(DataInput dataInput)
          This should replace setInput.
 void setInput(java.lang.String inputfile)
          Input string that corresponds with the input type (eg gene name for gene input type)
 void setOriginalFilename(java.lang.String file)
          Save original file name so that if we save the data we can access the header info from the original file; and also so we can save the file name as a comment.
 void setStateInformation(java.util.Properties props)
          DataLoader calls this.
 
Methods inherited from class apollo.dataadapter.AbstractApolloAdapter
cacheUI, canWriteData, clearOldData, clearStateInformation, commitChanges, commitChanges, commitChanges, commitChanges, getAdapters, getCachedUI, getChildAdapter, getChildAdapter, getCurationState, getDatabase, getDataInput, getDefaultStyle, getFilename, getInputType, getName, getNameAdapter, getNumberOfChildAdapters, getRawAnalysisResults, getSequence, getSequence, getSequence, getSequences, getSequences, getSpecies, getStyle, hasLinkData, init, isComposite, loadNewSpeciesFromLink, operationIsSupported, rollbackAnnotations, rollbackAnnotations, setCuration, setCurationNumber, setCurationState, setDatabase, setDataLoadListener, setInputType, setLocation, setName, setPadLeft, setPadRight, setRegion, setSpecies, setStyle
 
Methods inherited from class org.bdgp.io.AbstractDataAdapter
addProgressListener, fireProgressEvent, removeProgressListener, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.bdgp.io.VisualDataAdapter
addProgressListener, fireProgressEvent, removeProgressListener
 

Field Detail

logger

protected static final org.apache.log4j.Logger logger

FIELD_LABEL

public static java.lang.String FIELD_LABEL
For labeling flat fields (which are stored as properties) so they can be written out properly. (Should this go somewhere global so that other adapters can see it?)

Constructor Detail

ChadoXmlAdapter

public ChadoXmlAdapter()
Must have empty constructor to work with org.bdgp.io.DataAdapterRegistry instance creation from config string

Method Detail

getUI

public org.bdgp.io.DataAdapterUI getUI(org.bdgp.io.IOOperation op)
From org.bdgp.io.VisualDataAdapter interface


getSupportedOperations

public org.bdgp.io.IOOperation[] getSupportedOperations()
From org.bdgp.io.DataAdapter interface


getType

public java.lang.String getType()
Used by GenericFileAdapterGUI

Specified by:
getType in interface org.bdgp.io.DataAdapter
Overrides:
getType in class AbstractApolloAdapter

setInput

public void setInput(java.lang.String inputfile)
Description copied from class: AbstractApolloAdapter
Input string that corresponds with the input type (eg gene name for gene input type)

Specified by:
setInput in interface ApolloDataAdapterI
Overrides:
setInput in class AbstractApolloAdapter

getInput

public java.lang.String getInput()
Description copied from class: AbstractApolloAdapter
Returns the input String passed to the DataAdapter, the input is of course associated with the input type Should this go into org.bdgp.io.DataAdapter?

Specified by:
getInput in interface ApolloDataAdapterI
Overrides:
getInput in class AbstractApolloAdapter

setDataInput

public void setDataInput(DataInput dataInput)
Description copied from interface: ApolloDataAdapterI
This should replace setInput. setInput is limited to just a String which is awkward for locations where you have to jam several fields into one String. DataInput deals with locations much better. DataInput can complement stateInfo (hopefully?)

Specified by:
setDataInput in interface ApolloDataAdapterI
Overrides:
setDataInput in class AbstractApolloAdapter

setOriginalFilename

public void setOriginalFilename(java.lang.String file)
Save original file name so that if we save the data we can access the header info from the original file; and also so we can save the file name as a comment.


getCurationSet

public CurationSet getCurationSet()
                           throws ApolloAdapterException
This is the main method for reading the data. The filename should already have been set.

Specified by:
getCurationSet in interface ApolloDataAdapterI
Overrides:
getCurationSet in class AbstractApolloAdapter
Throws:
ApolloAdapterException

getCurationSetFromInputStream

public CurationSet getCurationSetFromInputStream(java.io.InputStream xml_stream)
                                          throws ApolloAdapterException
Throws:
ApolloAdapterException

addToCurationSet

public java.lang.Boolean addToCurationSet()
                                   throws ApolloAdapterException
Like getCurationSet--used for layering new data.

Specified by:
addToCurationSet in interface ApolloDataAdapterI
Overrides:
addToCurationSet in class AbstractApolloAdapter
Throws:
ApolloAdapterException

commitChanges

public void commitChanges(CurationSet curation)
Main method for writing ChadoXML file

Specified by:
commitChanges in interface ApolloDataAdapterI
Overrides:
commitChanges in class AbstractApolloAdapter

commitChanges

public void commitChanges(CurationSet curation,
                          boolean saveAnnots,
                          boolean saveResults)
Main method for writing ChadoXML file

Overrides:
commitChanges in class AbstractApolloAdapter

appearsToBeChadoXML

public boolean appearsToBeChadoXML(java.lang.String filename,
                                   java.io.BufferedReader in)
                            throws ApolloAdapterException
Check whether the input appears to be chadoXML by looking for the line

Throws:
ApolloAdapterException

getStateInformation

public java.util.Properties getStateInformation()
Description copied from interface: ApolloDataAdapterI
State info Properties carries all the info needed for the adapter to do its query This is an alternative to setDataInput. For most cases setDataInput should be sufficient. This should return StateInformation

Specified by:
getStateInformation in interface ApolloDataAdapterI
Overrides:
getStateInformation in class AbstractApolloAdapter

setStateInformation

public void setStateInformation(java.util.Properties props)
DataLoader calls this. input, inputType and optionally database set here. MovementPanel(nav bar) sets db to default db (it has no db chooser)

Specified by:
setStateInformation in interface ApolloDataAdapterI
Overrides:
setStateInformation in class AbstractApolloAdapter