Class SqlGraphStoreAdministration
- java.lang.Object
-
- nzilbb.labbcat.server.db.SqlGraphStore
-
- nzilbb.labbcat.server.db.SqlGraphStoreAdministration
-
- All Implemented Interfaces:
nzilbb.ag.GraphStore
,nzilbb.ag.GraphStoreAdministration
,nzilbb.ag.GraphStoreQuery
public class SqlGraphStoreAdministration extends SqlGraphStore implements nzilbb.ag.GraphStoreAdministration
Graph store administration that uses a relational database as its back end.- Author:
- Robert Fromont robert@fromont.net.nz
-
-
Constructor Summary
Constructors Constructor Description SqlGraphStoreAdministration(String baseUrl, File files, String connectString, String databaseUser, String password, String storeUser)
Constructor with connection parameters.SqlGraphStoreAdministration(String baseUrl, File files, Connection connection, String user)
Deprecated.SqlGraphStoreAdministration(String baseUrl, File files, nzilbb.sql.ConnectionFactory db, String user)
Constructor with connection.SqlGraphStoreAdministration(String baseUrl, Connection connection, String user)
Deprecated.SqlGraphStoreAdministration(String baseUrl, nzilbb.sql.ConnectionFactory db, String user)
Constructor with connection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deleteAnnotatorTask(String taskId)
Delete the identified automation task.void
deleteLayer(String id)
Deletes the given layer, and all associated annotations.void
deregisterDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer)
De-registers a transcript deserializer.void
deregisterSerializer(nzilbb.ag.serialize.GraphSerializer serializer)
De-registers a transcript serializer.void
newAnnotatorTask(String annotatorId, String taskId, String description)
Create a new annotator task with the given ID and description.nzilbb.ag.Layer
newLayer(nzilbb.ag.Layer layer)
Adds a new layer.void
registerDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer)
Registers a transcript deserializer.void
registerSerializer(nzilbb.ag.serialize.GraphSerializer serializer)
Registers a transcript serializer.void
saveAnnotatorTaskDescription(String taskId, String description)
Update the annotator task description.void
saveAnnotatorTaskParameters(String taskId, String parameters)
Update the annotator task parameters.nzilbb.ag.Layer
saveLayer(nzilbb.ag.Layer layer)
Saves changes to a layer.-
Methods inherited from class nzilbb.labbcat.server.db.SqlGraphStore
aggregateMatchingAnnotations, annotationDataFile, countAnnotations, countMatchingAnnotations, countMatchingParticipantIds, countMatchingTranscriptIds, createAnnotation, deleteMatchingAnnotations, deleteMedia, deleteParticipant, deleteTranscript, deserializerForFilesSuffix, deserializerForMimeType, destroyAnnotation, finalize, generateMissingMedia, getAnchors, getAnnotations, getAnnotator, getAnnotatorDescriptor, getAnnotatorDescriptors, getAnnotatorDir, getAnnotatorTaskParameters, getAnnotatorTasks, getAvailableMedia, getBaseUrl, getConnection, getCorpusIds, getDb, getDeserializerDescriptors, getDeserializersByMimeType, getDeserializersBySuffix, getDisconnectWhenFinished, getEpisodeDocuments, getFiles, getFragment, getFragment, getFragment, getFragmentSeries, getId, getLayer, getLayerIds, getLayers, getMatchAnnotations, getMatchAnnotations, getMatchingAnnotations, getMatchingAnnotations, getMatchingParticipantIds, getMatchingParticipantIds, getMatchingTranscriptIds, getMedia, getMedia, getMediaTracks, getParticipant, getParticipantIds, getPermissionsSpecified, getSchema, getSerializerDescriptors, getSerializersByMimeType, getSerializersBySuffix, getSerializersDirectory, getSource, getSystemAttribute, getTranscriber, getTranscriberDescriptor, getTranscriberDescriptors, getTranscript, getTranscript, getTranscriptIds, getTranscriptIdsInCorpus, getTranscriptIdsWithParticipant, getUser, getUserRoles, saveEpisodeDocument, saveMedia, saveParticipant, saveSource, saveTranscript, serializerForFilesSuffix, serializerForMimeType, setBaseUrl, setConnection, setDb, setDeserializersByMimeType, setDeserializersBySuffix, setDisconnectWhenFinished, setFiles, setId, setSerializersByMimeType, setSerializersBySuffix, setSerializersDirectory, setUser, tagMatchingAnnotations, urlForAnnotationFile
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface nzilbb.ag.GraphStore
createAnnotation, deleteGraph, deleteMatchingAnnotations, deleteMedia, deleteParticipant, deleteTranscript, destroyAnnotation, saveEpisodeDocument, saveGraph, saveMedia, saveParticipant, saveSource, saveTranscript, tagMatchingAnnotations
-
Methods inherited from interface nzilbb.ag.GraphStoreQuery
aggregateMatchingAnnotations, countAnnotations, countAnnotations, countMatchingAnnotations, countMatchingGraphIds, countMatchingParticipantIds, countMatchingTranscriptIds, deserializerForFilesSuffix, deserializerForMimeType, getAnchors, getAnnotations, getAnnotations, getAnnotations, getAnnotations, getAvailableMedia, getCorpusIds, getDeserializerDescriptors, getEpisodeDocuments, getFragment, getFragment, getFragment, getFragmentSeries, getGraph, getGraph, getGraphIds, getGraphIdsInCorpus, getGraphIdsWithParticipant, getId, getLayer, getLayerIds, getLayers, getMatchAnnotations, getMatchingAnnotations, getMatchingAnnotations, getMatchingGraphIds, getMatchingGraphIds, getMatchingGraphIds, getMatchingParticipantIds, getMatchingParticipantIds, getMatchingTranscriptIds, getMatchingTranscriptIds, getMatchingTranscriptIds, getMedia, getMedia, getMediaTracks, getParticipant, getParticipant, getParticipantIds, getSchema, getSerializerDescriptors, getTranscriberDescriptors, getTranscript, getTranscript, getTranscriptIds, getTranscriptIdsInCorpus, getTranscriptIdsWithParticipant, serializerForFilesSuffix, serializerForMimeType
-
-
-
-
Constructor Detail
-
SqlGraphStoreAdministration
@Deprecated public SqlGraphStoreAdministration(String baseUrl, Connection connection, String user) throws SQLException, nzilbb.ag.PermissionException
Deprecated.Constructor with connection.- Parameters:
baseUrl
- URL prefix for file access.connection
- An opened database connection.user
- ID of the user- Throws:
SQLException
- If an error occurs during connection or loading of configuraion.nzilbb.ag.PermissionException
- If the store user doesn't have administrator privileges
-
SqlGraphStoreAdministration
@Deprecated public SqlGraphStoreAdministration(String baseUrl, File files, Connection connection, String user) throws SQLException, nzilbb.ag.PermissionException
Deprecated.Constructor with connection.- Parameters:
baseUrl
- URL prefix for file access.files
- Root directory for file structure.connection
- An opened database connection.user
- ID of the user- Throws:
SQLException
- If an error occurs during connection or loading of configuraion.nzilbb.ag.PermissionException
- If the store user doesn't have administrator privileges
-
SqlGraphStoreAdministration
public SqlGraphStoreAdministration(String baseUrl, nzilbb.sql.ConnectionFactory db, String user) throws SQLException, nzilbb.ag.PermissionException
Constructor with connection.- Parameters:
baseUrl
- URL prefix for file access.db
- A database connection factory.user
- ID of the user- Throws:
SQLException
- If an error occurs during connection or loading of configuraion.nzilbb.ag.PermissionException
- If the store user doesn't have administrator privileges
-
SqlGraphStoreAdministration
public SqlGraphStoreAdministration(String baseUrl, File files, nzilbb.sql.ConnectionFactory db, String user) throws SQLException, nzilbb.ag.PermissionException
Constructor with connection.- Parameters:
baseUrl
- URL prefix for file access.files
- Root directory for file structure.db
- A database connection factory.user
- ID of the user- Throws:
SQLException
- If an error occurs during connection or loading of configuraion.nzilbb.ag.PermissionException
- If the store user doesn't have administrator privileges
-
SqlGraphStoreAdministration
public SqlGraphStoreAdministration(String baseUrl, File files, String connectString, String databaseUser, String password, String storeUser) throws SQLException, nzilbb.ag.PermissionException
Constructor with connection parameters.- Parameters:
baseUrl
- URL prefix for file access.files
- Root directory for file structure.connectString
- The database connection string.databaseUser
- The database username.password
- The databa password.storeUser
- ID of the user- Throws:
SQLException
- If an error occurs during connection or loading of configuraion.nzilbb.ag.PermissionException
- If the store user doesn't have administrator privileges
-
-
Method Detail
-
registerDeserializer
public void registerDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Registers a transcript deserializer.- Specified by:
registerDeserializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
deserializer
- The deserializer to register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the deserializer from being registered.nzilbb.ag.PermissionException
- If registering the deserializer is not permitted.
-
deregisterDeserializer
public void deregisterDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
De-registers a transcript deserializer.- Specified by:
deregisterDeserializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
deserializer
- The deserializer to de-register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the deserializer from being deregistered.nzilbb.ag.PermissionException
- If deregistering the deserializer is not permitted.
-
registerSerializer
public void registerSerializer(nzilbb.ag.serialize.GraphSerializer serializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Registers a transcript serializer.- Specified by:
registerSerializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
serializer
- The serializer to register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation from completing.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
deregisterSerializer
public void deregisterSerializer(nzilbb.ag.serialize.GraphSerializer serializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
De-registers a transcript serializer.- Specified by:
deregisterSerializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
serializer
- The serializer to de-register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation from completing.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
saveLayer
public nzilbb.ag.Layer saveLayer(nzilbb.ag.Layer layer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Saves changes to a layer.- Specified by:
saveLayer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
layer
- A modified layer definition.LaBB-CAT extends the
Layer.validLabels
funcionality by supporting an alternative layer attribute: validLabelsDefinition, which is an array of label definitions, each definition being a map of string to string or integer. Each label definition is expected to have the following attributes:- label
- what the underlying label is in LaBB-CAT (i.e. the DISC label, for a DISC layer)
- display
- the symbol in the transcript, for the label (e.g. the IPA version of the label)
- selector
- the symbol on the label helper, for the label (e.g. the IPA version of the label) - if there's no selector specified, then the value for display is used, and if there's no value for display specified, then there's no option on the label helper (so that type-able consonants like p, b, t, d etc. don't take up space on the label helper)
- description
- tool-tip text that appears if you hover the mouse over the IPA symbol in the helper
- category
- the broad category of the symbol, for organizing the layout of the helper
- subcategory
- the narrower category of the symbol, for listing subgroups of symbols together
- display_order
- the order to process/list the labels in
validLabelsDefinition takes precedence over validLabels - i.e. if validLabelsDefinition is present, it's label options are saved. Otherwise, the validLabels options are saved.
- Returns:
- The resulting layer definition.
- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
newLayer
public nzilbb.ag.Layer newLayer(nzilbb.ag.Layer layer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Adds a new layer.- Specified by:
newLayer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
layer
- A new layer definition.LaBB-CAT extends the
Layer.validLabels
funcionality by supporting an alternative layer attribute: validLabelsDefinition, which is an array of label definitions, each definition being a map of string to string or integer. Each label definition is expected to have the following attributes:- label
- what the underlying label is in LaBB-CAT (i.e. the DISC label, for a DISC layer)
- display
- the symbol in the transcript, for the label (e.g. the IPA version of the label)
- selector
- the symbol on the label helper, for the label (e.g. the IPA version of the label) - if there's no selector specified, then the value for display is used, and if there's no value for display specified, then there's no option on the label helper (so that type-able consonants like p, b, t, d etc. don't take up space on the label helper)
- description
- tool-tip text that appears if you hover the mouse over the IPA symbol in the helper
- category
- the broad category of the symbol, for organizing the layout of the helper
- subcategory
- the narrower category of the symbol, for listing subgroups of symbols together
- display_order
- the order to process/list the labels in
validLabelsDefinition takes precedence over validLabels - i.e. if validLabelsDefinition is present, it's label options are saved. Otherwise, the validLabels options are saved.
- Returns:
- The resulting layer definition.
- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
deleteLayer
public void deleteLayer(String id) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Deletes the given layer, and all associated annotations.- Specified by:
deleteLayer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
id
- The ID layer to delete.- Throws:
nzilbb.ag.StoreException
- If an error prevents the transcript from being saved.nzilbb.ag.PermissionException
- If saving the transcript is not permitted.
-
newAnnotatorTask
public void newAnnotatorTask(String annotatorId, String taskId, String description) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Create a new annotator task with the given ID and description.- Parameters:
annotatorId
- The ID of the annotator that will perform the task.taskId
- The ID of the task, which must not already exist.description
- The description of the task.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
saveAnnotatorTaskDescription
public void saveAnnotatorTaskDescription(String taskId, String description) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Update the annotator task description.- Parameters:
taskId
- The ID of the task, which must not already exist.description
- The description of the task.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
saveAnnotatorTaskParameters
public void saveAnnotatorTaskParameters(String taskId, String parameters) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Update the annotator task parameters.- Parameters:
taskId
- The ID of the automation task.parameters
- The task parameters, serialized as a string.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
deleteAnnotatorTask
public void deleteAnnotatorTask(String taskId) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Delete the identified automation task.- Parameters:
taskId
- The ID of the automation task.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.nzilbb.ag.PermissionException
- If the operation is not permitted.
-
-