Package nzilbb.labbcat
Class LabbcatAdmin
- java.lang.Object
-
- nzilbb.labbcat.LabbcatView
-
- nzilbb.labbcat.LabbcatEdit
-
- nzilbb.labbcat.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
LabbcatEditand adds some administration operations, including definition of layers, registration of converters, etc., i.e. those that can be performed by users withadmin
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 Summary
Constructors Constructor Description LabbcatAdmin()Default constructor.LabbcatAdmin(String labbcatUrl)Constructor from string URL.LabbcatAdmin(String labbcatUrl, String username, String password)Constructor with String attributes.LabbcatAdmin(URL labbcatUrl)Constructor from URL.LabbcatAdmin(URL labbcatUrl, String username, String password)Constructor with attributes.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description URLadminUrl(String resource)Constructs a store URL for the given resource.CategorycreateCategory(Category category)Creates a new category record.CorpuscreateCorpus(Corpus corpus)Creates a new corpus record.MediaTrackcreateMediaTrack(MediaTrack mediaTrack)Creates a new media track record.ProjectcreateProject(Project project)Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".RolecreateRole(Role role)Creates a new role record.RolePermissioncreateRolePermission(RolePermission rolePermission)Creates a new role permission record.UsercreateUser(User user)Creates a new user record.voiddeleteCategory(String classId, String name)Deletes an existing category record.voiddeleteCategory(Category category)Deletes an existing category record.voiddeleteCorpus(String name)Deletes an existing corpus record.voiddeleteCorpus(Corpus corpus)Deletes an existing corpus record.voiddeleteLayer(String id)Deletes the given layer, and all associated annotations.voiddeleteLexicon(String lexicon)Delete a previously loaded lexicon.voiddeleteMediaTrack(String suffix)Deletes an existing media track record.voiddeleteMediaTrack(MediaTrack mediaTrack)Deletes an existing media track record.voiddeleteProject(String name)Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".voiddeleteProject(Project project)Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".voiddeleteRole(String name)Deletes an existing role record.voiddeleteRole(Role role)Deletes an existing role record.voiddeleteRolePermission(String roleId, String entity)Deletes an existing role permission record.voiddeleteRolePermission(RolePermission rolePermission)Deletes an existing role permission record.voiddeleteUser(String user)Deletes an existing user record.voiddeleteUser(User user)Deletes an existing user record.voidderegisterDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer)NOT YET IMPLEMENTED - De-registers a transcript deserializer.voidderegisterSerializer(nzilbb.ag.serialize.GraphSerializer serializer)NOT YET IMPLEMENTED - De-registers a transcript serializer.StringgenerateLayer(String layerId)Generates annotations on a given layer for all transcripts in the corpus.nzilbb.ag.serialize.SerializationDescriptor[]getDeserializerDescriptors()NOT YET IMPLEMENTED - Lists the descriptors of all registered deserializers.nzilbb.ag.serialize.SerializationDescriptor[]getSerializerDescriptors()NOT YET IMPLEMENTED - Lists the descriptors of all registered serializers.voidloadLexicon(File file, String lexicon, String fieldDelimiter, String fieldNames, String quote, String comment, boolean skipFirstLine)Upload a flat lexicon file for lexical tagging.nzilbb.ag.LayernewLayer(nzilbb.ag.Layer layer)Adds a new layer.Category[]readCategories(String classId)Reads a list of category records.Category[]readCategories(String classId, Integer pageNumber, Integer pageLength)Reads a list of category records.Corpus[]readCorpora()Reads a list of corpus records.Corpus[]readCorpora(Integer pageNumber, Integer pageLength)Reads a list of corpus records.MediaTrack[]readMediaTracks()Reads a list of mediaTrack records.MediaTrack[]readMediaTracks(Integer pageNumber, Integer pageLength)Reads a list of media track records.Project[]readProjects()Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".Project[]readProjects(Integer pageNumber, Integer pageLength)Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".RolePermission[]readRolePermissions(String roleId)Reads a list of role permission records.RolePermission[]readRolePermissions(String roleId, Integer pageNumber, Integer pageLength)Reads a list of role permission records.Role[]readRoles()Reads a list of role records.Role[]readRoles(Integer pageNumber, Integer pageLength)Reads a list of role records.SystemAttribute[]readSystemAttributes()Reads a list of system_attribute records.User[]readUsers()Reads a list of user records.User[]readUsers(Integer pageNumber, Integer pageLength)Reads a list of user records.voidregisterDeserializer(nzilbb.ag.serialize.GraphDeserializer deserializer)NOT YET IMPLEMENTED - Registers a transcript deserializer.voidregisterSerializer(nzilbb.ag.serialize.GraphSerializer serializer)NOT YET IMPLEMENTED - Registers a transcript serializer.nzilbb.ag.LayersaveLayer(nzilbb.ag.Layer layer)Saves changes to a layer.voidsetPassword(String user, String password, boolean resetPassword)Sets a given user's password.CategoryupdateCategory(Category category)Updates an existing category record.CorpusupdateCorpus(Corpus corpus)Updates an existing corpus record.voidupdateInfo(String html)Saves the store's information document.MediaTrackupdateMediaTrack(MediaTrack mediaTrack)Updates an existing media track record.ProjectupdateProject(Project project)Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategorywith classId = "layer".RoleupdateRole(Role role)Updates an existing role record.RolePermissionupdateRolePermission(RolePermission rolePermission)Updates an existing role permission record.SystemAttributeupdateSystemAttribute(String attribute, String value)Updates an existing systemAttribute record.SystemAttributeupdateSystemAttribute(SystemAttribute systemAttribute)Updates an existing systemAttribute record.UserupdateUser(User user)Updates an existing user record.-
Methods inherited from class nzilbb.labbcat.LabbcatEdit
addDictionaryEntry, addLayerDictionaryEntry, annotatorExt, annotatorExt, createAnnotation, deleteMatchingAnnotations, deleteMedia, deleteParticipant, deleteTranscript, destroyAnnotation, editUrl, newTranscript, removeDictionaryEntry, removeLayerDictionaryEntry, saveEpisodeDocument, saveMedia, saveParticipant, saveSource, saveTranscript, tagMatchingAnnotations, transcriptUpload, transcriptUpload, transcriptUpload, transcriptUploadDelete, transcriptUploadDelete, transcriptUploadParameters, updateTranscript, updateTranscript
-
Methods inherited from class nzilbb.labbcat.LabbcatView
aggregateMatchingAnnotations, cancel, cancelTask, changePassword, countAnnotations, countMatchingAnnotations, countMatchingParticipantIds, countMatchingTranscriptIds, delete, deserializerForFilesSuffix, deserializerForMimeType, FileNameFromContentDisposition, get, getAnchors, getAnnotations, getAnnotatorDescriptor, getAvailableMedia, getBatchMode, getCorpusIds, getCorpusInfo, getDashboardItem, getDashboardItems, getDictionaries, getDictionaryEntries, getEpisodeDocuments, getFragment, getFragment, getFragment, getFragments, getFragments, getFragmentSeries, getId, getInfo, getLabbcatUrl, getLanguage, getLayer, getLayerIds, getLayers, getMatchAnnotations, getMatchAnnotations, getMatchAnnotations, getMatches, getMatches, getMatches, getMatches, getMatchingAnnotations, getMatchingParticipantIds, getMatchingTranscriptIds, getMedia, getMedia, getMediaFile, getMediaTracks, getMinLabbcatVersion, getParticipant, getParticipantAttributes, getParticipantIds, getPassword, getRequiredHttpAuthorization, getResponse, getSchema, getSoundFragments, getSoundFragments, getSystemAttribute, getTasks, getTranscriberDescriptors, getTranscript, getTranscript, getTranscriptAttributes, getTranscriptIds, getTranscriptIdsInCorpus, getTranscriptIdsWithParticipant, getUserInfo, getUsername, getVerbose, intervalAnnotations, intervalAnnotations, isCancelling, makeUrl, post, postMultipart, processWithPraat, processWithPraat, put, readAgreement, releaseTask, search, serializerForFilesSuffix, serializerForMimeType, setBatchMode, setLabbcatUrl, setLanguage, setPassword, setResponse, setUsername, setVerbose, taskStatus, taskStatus, url, versionInfo, waitForTask
-
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, 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, getTranscriberDescriptors, getTranscript, getTranscript, getTranscriptIds, getTranscriptIdsInCorpus, getTranscriptIdsWithParticipant, serializerForFilesSuffix, serializerForMimeType
-
-
-
-
Constructor Detail
-
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/
-
-
Method Detail
-
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.PermissionExceptionNOT YET IMPLEMENTED - Registers a transcript deserializer.- Specified by:
registerDeserializerin interfacenzilbb.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.PermissionExceptionNOT YET IMPLEMENTED - De-registers a transcript deserializer.- Specified by:
deregisterDeserializerin interfacenzilbb.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.PermissionExceptionNOT YET IMPLEMENTED - Lists the descriptors of all registered deserializers.- Specified by:
getDeserializerDescriptorsin interfacenzilbb.ag.GraphStoreQuery- Overrides:
getDeserializerDescriptorsin classLabbcatView- 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.PermissionExceptionNOT YET IMPLEMENTED - Registers a transcript serializer.- Specified by:
registerSerializerin interfacenzilbb.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.PermissionExceptionNOT YET IMPLEMENTED - De-registers a transcript serializer.- Specified by:
deregisterSerializerin interfacenzilbb.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.PermissionExceptionNOT YET IMPLEMENTED - Lists the descriptors of all registered serializers.- Specified by:
getSerializerDescriptorsin interfacenzilbb.ag.GraphStoreQuery- Overrides:
getSerializerDescriptorsin classLabbcatView- 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.PermissionExceptionAdds a new layer.- Specified by:
newLayerin interfacenzilbb.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.PermissionExceptionSaves changes to a layer.- Specified by:
saveLayerin interfacenzilbb.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:
deleteLayerin 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.
-
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(),readCorpora(Integer,Integer),updateCorpus(Corpus),deleteCorpus(Corpus),deleteCorpus(String)
-
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:
createCorpus(Corpus),readCorpora(Integer,Integer),updateCorpus(Corpus),deleteCorpus(Corpus),deleteCorpus(String)
-
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:
createCorpus(Corpus),readCorpora(),updateCorpus(Corpus),deleteCorpus(Corpus),deleteCorpus(String)
-
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:
createCorpus(Corpus),readCorpora(),readCorpora(Integer,Integer),deleteCorpus(Corpus),deleteCorpus(String)
-
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:
createCorpus(Corpus),readCorpora(),readCorpora(Integer,Integer),updateCorpus(Corpus),deleteCorpus(String)
-
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:
createCorpus(Corpus),readCorpora(),readCorpora(Integer,Integer),updateCorpus(Corpus),deleteCorpus(Corpus)
-
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 ofCategorywith classId = "layer". UsecreateCategory(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:
createCategory(Category)
-
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 ofCategorywith classId = "layer". UsereadCategories(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:
readCategories(String)
-
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 ofCategorywith classId = "layer". UsereadCategories(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:
readCategories(String,Integer,Integer)
-
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 ofCategorywith classId = "layer". UseupdateCategory(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:
updateCategory(Category)
-
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 ofCategorywith classId = "layer". UsedeleteCategory(Category)insteadDeletes 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:
deleteCategory(Category)
-
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 ofCategorywith classId = "layer". UsedeleteCategory(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:
deleteCategory(String,String)
-
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(String),readCategories(String,Integer,Integer),updateCategory(Category),deleteCategory(Category),deleteCategory(String,String)
-
readCategories
public Category[] readCategories(String classId) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Reads a list of category records.- Overrides:
readCategoriesin classLabbcatView- 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:
createCategory(Category),readCategories(String,Integer,Integer),updateCategory(Category),deleteCategory(Category),deleteCategory(String,String)
-
readCategories
public Category[] readCategories(String classId, Integer pageNumber, Integer pageLength) throws nzilbb.ag.StoreException, nzilbb.ag.PermissionException
Reads a list of category records.- Overrides:
readCategoriesin classLabbcatView- 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:
createCategory(Category),readCategories(String),updateCategory(Category),deleteCategory(Category),deleteCategory(String,String)
-
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:
createCategory(Category),readCategories(String),readCategories(String,Integer,Integer),deleteCategory(Category),deleteCategory(String,String)
-
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:
createCategory(Category),readCategories(String),readCategories(String,Integer,Integer),updateCategory(Category),deleteCategory(String,String)
-
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:
createCategory(Category),readCategories(String),readCategories(String,Integer,Integer),updateCategory(Category),deleteCategory(Category)
-
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(),readMediaTracks(Integer,Integer),updateMediaTrack(MediaTrack),deleteMediaTrack(MediaTrack),deleteMediaTrack(String)
-
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:
createMediaTrack(MediaTrack),readMediaTracks(Integer,Integer),updateMediaTrack(MediaTrack),deleteMediaTrack(MediaTrack),deleteMediaTrack(String)
-
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:
createMediaTrack(MediaTrack),readMediaTracks(),updateMediaTrack(MediaTrack),deleteMediaTrack(MediaTrack),deleteMediaTrack(String)
-
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:
createMediaTrack(MediaTrack),readMediaTracks(),readMediaTracks(Integer,Integer),deleteMediaTrack(MediaTrack),deleteMediaTrack(String)
-
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:
createMediaTrack(MediaTrack),readMediaTracks(),readMediaTracks(Integer,Integer),updateMediaTrack(MediaTrack),deleteMediaTrack(String)
-
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:
createMediaTrack(MediaTrack),readMediaTracks(),readMediaTracks(Integer,Integer),updateMediaTrack(MediaTrack),deleteMediaTrack(MediaTrack)
-
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(),readRoles(Integer,Integer),updateRole(Role),deleteRole(Role),deleteRole(String)
-
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:
createRole(Role),readRoles(Integer,Integer),updateRole(Role),deleteRole(Role),deleteRole(String)
-
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:
createRole(Role),readRoles(),updateRole(Role),deleteRole(Role),deleteRole(String)
-
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:
createRole(Role),readRoles(),readRoles(Integer,Integer),deleteRole(Role),deleteRole(String)
-
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:
createRole(Role),readRoles(),readRoles(Integer,Integer),updateRole(Role),deleteRole(String)
-
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:
createRole(Role),readRoles(),readRoles(Integer,Integer),updateRole(Role),deleteRole(Role)
-
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(String),readRolePermissions(String,Integer,Integer),updateRolePermission(RolePermission),deleteRolePermission(RolePermission),deleteRolePermission(String,String)
-
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:
createRolePermission(RolePermission),readRolePermissions(String,Integer,Integer),updateRolePermission(RolePermission),deleteRolePermission(RolePermission),deleteRolePermission(String,String)
-
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:
createRolePermission(RolePermission),readRolePermissions(String),updateRolePermission(RolePermission),deleteRolePermission(RolePermission),deleteRolePermission(String,String)
-
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:
createRolePermission(RolePermission),readRolePermissions(String),readRolePermissions(String,Integer,Integer),deleteRolePermission(RolePermission),deleteRolePermission(String,String)
-
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:
createRolePermission(RolePermission),readRolePermissions(String),readRolePermissions(String,Integer,Integer),updateRolePermission(RolePermission),deleteRolePermission(String,String)
-
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:
createRolePermission(RolePermission),readRolePermissions(String),readRolePermissions(String,Integer,Integer),updateRolePermission(RolePermission),deleteRolePermission(RolePermission)
-
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(SystemAttribute)
-
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:
readSystemAttributes(),updateSystemAttribute(SystemAttribute)
-
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:
readSystemAttributes(),updateSystemAttribute(String,String)
-
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:
LabbcatView.getInfo()
-
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(),readUsers(Integer,Integer),updateUser(User),deleteUser(User),deleteUser(String)
-
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:
createUser(User),readUsers(Integer,Integer),updateUser(User),deleteUser(User),deleteUser(String)
-
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:
createUser(User),readUsers(),updateUser(User),deleteUser(User),deleteUser(String)
-
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:
createUser(User),readUsers(),readUsers(Integer,Integer),deleteUser(User),deleteUser(String)
-
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:
createUser(User),readUsers(),readUsers(Integer,Integer),updateUser(User),deleteUser(String)
-
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:
createUser(User),readUsers(),readUsers(Integer,Integer),updateUser(User),deleteUser(User)
-
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(String)
-
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:
loadLexicon(File,String,String,String,String,String,boolean)
-
-