Class 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 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 interface nzilbb.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 interface nzilbb.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 interface nzilbb.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 interface nzilbb.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 interface nzilbb.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 interface nzilbb.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 interface nzilbb.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.