public class DLESEMetadataVocabTracker extends java.lang.Object implements MetadataVocabTracker
Constructor and Description |
---|
DLESEMetadataVocabTracker(MetadataVocab vocab,
java.lang.String sqlDriver,
java.lang.String sqlURL,
java.lang.String sqlUser,
java.lang.String sqlPassword,
java.lang.String vocabTextFile)
Constructor for the DLESEMetadataVocabTracker object
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
assignNewSystemId(java.lang.String metadataFieldId,
java.lang.String metadataValue)
Assign a unique system Id for a new vocabulary value.
|
void |
closeConnection()
Close the connection to SQL database
|
java.lang.String |
getId(java.lang.String metadataFieldId,
java.lang.String metadataValue)
Does the current fieldId/value pair already exist in the database? If so,
return the Id, if not, return "" (empty string).
|
boolean |
isUsingDatabase()
Is the system using this tracker connected to a database that handles
ensuring Id consistency and UI label changes?
|
void |
registerUiLabels(java.util.HashMap uiSystems,
java.util.HashMap uiLabelOfSystemIds)
Step through all of the current (non-retired) values in the vocab_values
table and examine the UI labels, comparing what is in the DB with what was
just loaded from the XML
|
void |
writeDataAsTextFile()
This method writes a text-based version of the entire vocabulary (even
retired values!) that simply lists each field/value system ID, along with
the metadataValue.
|
public DLESEMetadataVocabTracker(MetadataVocab vocab, java.lang.String sqlDriver, java.lang.String sqlURL, java.lang.String sqlUser, java.lang.String sqlPassword, java.lang.String vocabTextFile)
vocab
- MetadataVocab instance using this trackersqlDriver
- driver class for SQL DBsqlURL
- URL of SQL DBsqlUser
- SQL usersqlPassword
- SQL user passwordvocabTextFile
- public boolean isUsingDatabase()
isUsingDatabase
in interface MetadataVocabTracker
public void closeConnection()
closeConnection
in interface MetadataVocabTracker
public java.lang.String assignNewSystemId(java.lang.String metadataFieldId, java.lang.String metadataValue)
assignNewSystemId
in interface MetadataVocabTracker
metadataFieldId
- field encoded IdmetadataValue
- metadata value namepublic java.lang.String getId(java.lang.String metadataFieldId, java.lang.String metadataValue)
getId
in interface MetadataVocabTracker
metadataFieldId
- encoded field IdmetadataValue
- metadata value namepublic void registerUiLabels(java.util.HashMap uiSystems, java.util.HashMap uiLabelOfSystemIds)
registerUiLabels
in interface MetadataVocabTracker
uiSystems
- uiLabelOfSystemIds
- public void writeDataAsTextFile()