Class LabbcatAdmin

All Implemented Interfaces:
nzilbb.ag.GraphStore, nzilbb.ag.GraphStoreAdministration, nzilbb.ag.GraphStoreQuery

public class LabbcatAdmin extends LabbcatEdit implements nzilbb.ag.GraphStoreAdministration
Client-side implementation of nzilbb.ag.GraphStoreAdminitration.

This class inherits the read-write operations of LabbcatEdit and adds some administration operations, including definition of layers, registration of converters, etc., i.e. those that can be performed by users with admin permission.

e.g.

 // create annotation store client
 LabbcatAdmin store = new LabbcatAdmin("https://labbcat.canterbury.ac.nz", "demo", "demo");
 // get some basic information
 String id = store.getId();
 String[] layers = store.getLayerIds();
 String[] corpora = store.getCorpusIds();
 String[] documents = store.getGraphIdsInCorpus(corpora[0]);
 // delete a document
 store.deleteGraph(documents[0]);
 
Author:
Robert Fromont robert@fromont.net.nz
  • Constructor Details

    • LabbcatAdmin

      public LabbcatAdmin()
      Default constructor.
    • LabbcatAdmin

      public LabbcatAdmin(String labbcatUrl) throws MalformedURLException
      Constructor from string URL.
      Parameters:
      labbcatUrl - The base URL of the LaBB-CAT server - e.g. https://labbcat.canterbury.ac.nz/demo/
      Throws:
      MalformedURLException - If the URL is invalid.
    • LabbcatAdmin

      public LabbcatAdmin(String labbcatUrl, String username, String password) throws MalformedURLException
      Constructor with String attributes.
      Parameters:
      labbcatUrl - The base URL of the LaBB-CAT server - e.g. https://labbcat.canterbury.ac.nz/demo/
      username - LaBB-CAT username.
      password - LaBB-CAT password.
      Throws:
      MalformedURLException - If the URL is invalid.
    • LabbcatAdmin

      public LabbcatAdmin(URL labbcatUrl)
      Constructor from URL.
      Parameters:
      labbcatUrl - The base URL of the LaBB-CAT server - e.g. https://labbcat.canterbury.ac.nz/demo/
    • LabbcatAdmin

      public LabbcatAdmin(URL labbcatUrl, String username, String password)
      Constructor with attributes.
      Parameters:
      labbcatUrl - The base URL of the LaBB-CAT server - e.g. https://labbcat.canterbury.ac.nz/demo/
      username - LaBB-CAT username.
      password - LaBB-CAT password.
  • Method Details

    • adminUrl

      public URL adminUrl(String resource) throws nzilbb.ag.StoreException
      Constructs a store URL for the given resource.
      Parameters:
      resource - The relative name of the resource.
      Returns:
      A URL for the given resource.
      Throws:
      nzilbb.ag.StoreException - If the URL is malformed.
    • registerDeserializer

      public void registerDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      NOT YET IMPLEMENTED - 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 operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
    • deregisterDeserializer

      public void deregisterDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      NOT YET IMPLEMENTED - 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 operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
    • getDeserializerDescriptors

      public nzilbb.ag.serialize.SerializationDescriptor[] getDeserializerDescriptors() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      NOT YET IMPLEMENTED - Lists the descriptors of all registered deserializers.
      Specified by:
      getDeserializerDescriptors in interface nzilbb.ag.GraphStoreQuery
      Overrides:
      getDeserializerDescriptors in class LabbcatView
      Returns:
      A list of the descriptors of all registered deserializers.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
    • registerSerializer

      public void registerSerializer(nzilbb.ag.serialize.GraphSerializer serializer) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      NOT YET IMPLEMENTED - 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.
      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
      NOT YET IMPLEMENTED - 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.
      nzilbb.ag.PermissionException - If the operation is not permitted.
    • getSerializerDescriptors

      public nzilbb.ag.serialize.SerializationDescriptor[] getSerializerDescriptors() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      NOT YET IMPLEMENTED - Lists the descriptors of all registered serializers.
      Specified by:
      getSerializerDescriptors in interface nzilbb.ag.GraphStoreQuery
      Overrides:
      getSerializerDescriptors in class LabbcatView
      Returns:
      A list of the descriptors of all registered serializers.
      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.
      Returns:
      The resulting layer definition.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
    • generateLayer

      public String generateLayer(String layerId) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Generates annotations on a given layer for all transcripts in the corpus.
      Parameters:
      layerId - The ID of the layer to generate annotations for.
      Returns:
      The thread ID of the the running generation task.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      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.
      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.
    • createCorpus

      public Corpus createCorpus(Corpus corpus) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new corpus record.
      Parameters:
      corpus - The corpus details to save.
      Returns:
      The corpus just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readCorpora

      public Corpus[] readCorpora() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of corpus records.
      Returns:
      A list of corpora.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readCorpora

      public Corpus[] readCorpora(Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of corpus records.
      Parameters:
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of corpora.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateCorpus

      public Corpus updateCorpus(Corpus corpus) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing corpus record.
      Parameters:
      corpus - The corpus details to save.
      Returns:
      The corpus just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteCorpus

      public void deleteCorpus(Corpus corpus) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing corpus record.
      Parameters:
      corpus - The corpus to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteCorpus

      public void deleteCorpus(String name) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing corpus record.
      Parameters:
      name - The name/ID of the corpus to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createProject

      @Deprecated(since="1.2.0", forRemoval=true) public Project createProject(Project project) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use createCategory(Category) instead.
      Creates a new project record.
      Parameters:
      project - The project details to save.
      Returns:
      The project just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readProjects

      @Deprecated(since="1.2.0", forRemoval=true) public Project[] readProjects() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use readCategories(String) instead.
      Reads a list of project records.
      Returns:
      A list of projects.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readProjects

      @Deprecated(since="1.2.0", forRemoval=true) public Project[] readProjects(Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use readCategories(String,Integer,Integer) instead.
      Reads a list of project records.
      Parameters:
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of projects.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateProject

      @Deprecated(since="1.2.0", forRemoval=true) public Project updateProject(Project project) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use updateCategory(Category) isntead.
      Updates an existing project record.
      Parameters:
      project - The project details to save.
      Returns:
      The project just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteProject

      @Deprecated(since="1.2.0", forRemoval=true) public void deleteProject(Project project) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use deleteCategory(Category) instead
      Deletes an existing project record.
      Parameters:
      project - The project to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteProject

      @Deprecated(since="1.2.0", forRemoval=true) public void deleteProject(String name) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deprecated, for removal: This API element is subject to removal in a future version.
      Projects are now layer categories - a type of Category with classId = "layer". Use deleteCategory(String,String) instead.
      Deletes an existing project record.
      Parameters:
      name - The name/ID of the project to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createCategory

      public Category createCategory(Category category) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new category record.
      Parameters:
      category - The category details to save.
      Returns:
      The category just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readCategories

      public Category[] readCategories(String classId) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of category records.
      Parameters:
      classId - What to read the categories of - "trascript" or "participant".
      Returns:
      A list of categories.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readCategories

      public Category[] readCategories(String classId, Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of category records.
      Parameters:
      classId - What to read the categories of - "trascript" or "participant".
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of categories.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateCategory

      public Category updateCategory(Category category) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing category record.
      Parameters:
      category - The category details to save.
      Returns:
      The category just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteCategory

      public void deleteCategory(Category category) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing category record.
      Parameters:
      category - The category to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteCategory

      public void deleteCategory(String classId, String name) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing category record.
      Parameters:
      classId - The scope of the category - "trascript" or "participant".
      name - The name/ID of the category to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createMediaTrack

      public MediaTrack createMediaTrack(MediaTrack mediaTrack) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new media track record.
      Parameters:
      mediaTrack - The mediaTrack details to save.
      Returns:
      The mediaTrack just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readMediaTracks

      public MediaTrack[] readMediaTracks() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of mediaTrack records.
      Returns:
      A list of mediaTracks.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readMediaTracks

      public MediaTrack[] readMediaTracks(Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of media track records.
      Parameters:
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of mediaTracks.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateMediaTrack

      public MediaTrack updateMediaTrack(MediaTrack mediaTrack) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing media track record.
      Parameters:
      mediaTrack - The mediaTrack details to save.
      Returns:
      The mediaTrack just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteMediaTrack

      public void deleteMediaTrack(MediaTrack mediaTrack) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing media track record.
      Parameters:
      mediaTrack - The mediaTrack to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteMediaTrack

      public void deleteMediaTrack(String suffix) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing media track record.
      Parameters:
      suffix - The suffix of the mediaTrack to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createRole

      public Role createRole(Role role) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new role record.
      Parameters:
      role - The role details to save.
      Returns:
      The role just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readRoles

      public Role[] readRoles() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of role records.
      Returns:
      A list of roles.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readRoles

      public Role[] readRoles(Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of role records.
      Parameters:
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of roles.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateRole

      public Role updateRole(Role role) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing role record.
      Parameters:
      role - The role details to save.
      Returns:
      The role just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteRole

      public void deleteRole(Role role) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing role record.
      Parameters:
      role - The role to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteRole

      public void deleteRole(String name) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing role record.
      Parameters:
      name - The name/ID of the role to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createRolePermission

      public RolePermission createRolePermission(RolePermission rolePermission) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new role permission record.
      Parameters:
      rolePermission - The rolePermission details to save.
      Returns:
      The rolePermission just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readRolePermissions

      public RolePermission[] readRolePermissions(String roleId) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of role permission records.
      Parameters:
      roleId - The ID of the user role to get permissions for.
      Returns:
      A list of rolePermissions.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readRolePermissions

      public RolePermission[] readRolePermissions(String roleId, Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of role permission records.
      Parameters:
      roleId - The ID of the user role to get permissions for.
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of rolePermissions.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateRolePermission

      public RolePermission updateRolePermission(RolePermission rolePermission) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing role permission record.
      Parameters:
      rolePermission - The rolePermission details to save.
      Returns:
      The rolePermission just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteRolePermission

      public void deleteRolePermission(RolePermission rolePermission) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing role permission record.
      Parameters:
      rolePermission - The rolePermission to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteRolePermission

      public void deleteRolePermission(String roleId, String entity) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing role permission record.
      Parameters:
      roleId - The name/ID of the role.
      entity - The entity of the permission.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readSystemAttributes

      public SystemAttribute[] readSystemAttributes() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of system_attribute records.
      Returns:
      A list of system attributes.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateSystemAttribute

      public SystemAttribute updateSystemAttribute(String attribute, String value) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing systemAttribute record.
      Parameters:
      attribute - The ID of the attribute to update.
      value - The new value of the attribute.
      Returns:
      The systemAttribute just updated.
      Throws:
      nzilbb.ag.StoreException - If the attribute doesn't exist or its type is "readonly".
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateSystemAttribute

      public SystemAttribute updateSystemAttribute(SystemAttribute systemAttribute) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing systemAttribute record.
      Parameters:
      systemAttribute - The systemAttribute details to save.
      Returns:
      The systemAttribute just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateInfo

      public void updateInfo(String html) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Saves the store's information document.
      Parameters:
      html - An HTML document with information about the corpus as a whole.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • createUser

      public User createUser(User user) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Creates a new user record.
      Parameters:
      user - The user details to save.
      Returns:
      The user just created.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readUsers

      public User[] readUsers() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of user records.
      Returns:
      A list of users.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • readUsers

      public User[] readUsers(Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Reads a list of user records.
      Parameters:
      pageNumber - The zero-based page of records to return (if null, all records will be returned).
      pageLength - The length of pages (if null, the default page length is 20).
      Returns:
      A list of users.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • updateUser

      public User updateUser(User user) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Updates an existing user record.
      Parameters:
      user - The user details to save.
      Returns:
      The user just updated.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteUser

      public void deleteUser(User user) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing user record.
      Parameters:
      user - The user to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • deleteUser

      public void deleteUser(String user) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Deletes an existing user record.
      Parameters:
      user - The ID of the user to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      nzilbb.ag.PermissionException - If the operation is not permitted.
      See Also:
    • setPassword

      public void setPassword(String user, String password, boolean resetPassword) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
      Sets a given user's password.
      Parameters:
      user - The ID of the user to update.
      password - The new password.
      resetPassword - Whether the user must reset their password when they next log in.
      Throws:
      nzilbb.ag.StoreException - If an error occurs, e.g. the user does not exist.
      nzilbb.ag.PermissionException - If the current user does not have the 'admin' role.
    • loadLexicon

      public void loadLexicon(File file, String lexicon, String fieldDelimiter, String fieldNames, String quote, String comment, boolean skipFirstLine) throws nzilbb.ag.StoreException
      Upload a flat lexicon file for lexical tagging.

      By default LaBB-CAT includes a layer manager called the Flat Lexicon Tagger, which can be configured to annotate words with data from a dictionary loaded from a plain text file (e.g. a CSV file). The file must have a 'flat' structure in the sense that it's a simple list of dictionary entries with a fixed number of columns/fields, rather than having a complex structure.

      Parameters:
      file - The lexicon file.
      lexicon - The name for the resulting lexicon. If the named lexicon already exists, it will be completely replaced with the contents of the file (i.e. all existing entries will be deleted befor adding new entries from the file). e.g. 'cmudict'
      fieldDelimiter - The character used to delimit fields in the file. If this is " - ", rows are split on only the *first* space, in line with common dictionary formats. e.g. ',' for Comma Separated Values (CSV) files.
      fieldNames - A list of field names, delimited by fieldDelimiter, e.g. 'Word,Pronunciation'.
      quote - The character used to quote field values (if any), e.g. '"'.
      comment - The character used to indicate a line is a comment (not an entry) (if any) e.g. '#'.
      skipFirstLine - Whether to ignore the first line of the file (because it contains field names).
      Throws:
      nzilbb.ag.StoreException - If the lexicon could not be loaded.
      See Also:
    • deleteLexicon

      public void deleteLexicon(String lexicon) throws nzilbb.ag.StoreException
      Delete a previously loaded lexicon.
      Parameters:
      lexicon - The lexicon to delete.
      Throws:
      nzilbb.ag.StoreException - If an error prevents the operation.
      See Also: