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
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 Summary
ConstructorsConstructorDescriptionDefault 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
Modifier and TypeMethodDescriptionConstructs a store URL for the given resource.createCategory
(Category category) Creates a new category record.createCorpus
(Corpus corpus) Creates a new corpus record.createMediaTrack
(MediaTrack mediaTrack) Creates a new media track record.createProject
(Project project) Deprecated, for removal: This API element is subject to removal in a future version.createRole
(Role role) Creates a new role record.createRolePermission
(RolePermission rolePermission) Creates a new role permission record.createUser
(User user) Creates a new user record.void
deleteCategory
(String classId, String name) Deletes an existing category record.void
deleteCategory
(Category category) Deletes an existing category record.void
deleteCorpus
(String name) Deletes an existing corpus record.void
deleteCorpus
(Corpus corpus) Deletes an existing corpus record.void
deleteLayer
(String id) Deletes the given layer, and all associated annotations.void
deleteLexicon
(String lexicon) Delete a previously loaded lexicon.void
deleteMediaTrack
(String suffix) Deletes an existing media track record.void
deleteMediaTrack
(MediaTrack mediaTrack) Deletes an existing media track record.void
deleteProject
(String name) Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategory
with classId = "layer".void
deleteProject
(Project project) Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategory
with classId = "layer".void
deleteRole
(String name) Deletes an existing role record.void
deleteRole
(Role role) Deletes an existing role record.void
deleteRolePermission
(String roleId, String entity) Deletes an existing role permission record.void
deleteRolePermission
(RolePermission rolePermission) Deletes an existing role permission record.void
deleteUser
(String user) Deletes an existing user record.void
deleteUser
(User user) Deletes an existing user record.void
deregisterDeserializer
(nzilbb.ag.serialize.GraphDeserializer deserializer) NOT YET IMPLEMENTED - De-registers a transcript deserializer.void
deregisterSerializer
(nzilbb.ag.serialize.GraphSerializer serializer) NOT YET IMPLEMENTED - De-registers a transcript serializer.generateLayer
(String layerId) Generates annotations on a given layer for all transcripts in the corpus.nzilbb.ag.serialize.SerializationDescriptor[]
NOT YET IMPLEMENTED - Lists the descriptors of all registered deserializers.nzilbb.ag.serialize.SerializationDescriptor[]
NOT YET IMPLEMENTED - Lists the descriptors of all registered serializers.void
loadLexicon
(File file, String lexicon, String fieldDelimiter, String fieldNames, String quote, String comment, boolean skipFirstLine) Upload a flat lexicon file for lexical tagging.nzilbb.ag.Layer
newLayer
(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[]
Reads a list of corpus records.Corpus[]
readCorpora
(Integer pageNumber, Integer pageLength) Reads a list of corpus records.Reads a list of mediaTrack records.readMediaTracks
(Integer pageNumber, Integer pageLength) Reads a list of media track records.Project[]
Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategory
with 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 ofCategory
with classId = "layer".readRolePermissions
(String roleId) Reads a list of role permission records.readRolePermissions
(String roleId, Integer pageNumber, Integer pageLength) Reads a list of role permission records.Role[]
Reads a list of role records.Role[]
Reads a list of role records.Reads a list of system_attribute records.User[]
Reads a list of user records.User[]
Reads a list of user records.void
registerDeserializer
(nzilbb.ag.serialize.GraphDeserializer deserializer) NOT YET IMPLEMENTED - Registers a transcript deserializer.void
registerSerializer
(nzilbb.ag.serialize.GraphSerializer serializer) NOT YET IMPLEMENTED - Registers a transcript serializer.nzilbb.ag.Layer
saveLayer
(nzilbb.ag.Layer layer) Saves changes to a layer.void
setPassword
(String user, String password, boolean resetPassword) Sets a given user's password.updateCategory
(Category category) Updates an existing category record.updateCorpus
(Corpus corpus) Updates an existing corpus record.void
updateInfo
(String html) Saves the store's information document.updateMediaTrack
(MediaTrack mediaTrack) Updates an existing media track record.updateProject
(Project project) Deprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategory
with classId = "layer".updateRole
(Role role) Updates an existing role record.updateRolePermission
(RolePermission rolePermission) Updates an existing role permission record.updateSystemAttribute
(String attribute, String value) Updates an existing systemAttribute record.updateSystemAttribute
(SystemAttribute systemAttribute) Updates an existing systemAttribute record.updateUser
(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, countAnnotations, countMatchingAnnotations, countMatchingParticipantIds, countMatchingTranscriptIds, delete, deserializerForFilesSuffix, deserializerForMimeType, FileNameFromContentDisposition, get, getAnchors, getAnnotations, getAnnotatorDescriptor, getAvailableMedia, getBatchMode, getCorpusIds, 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, isCancelling, makeUrl, post, postMultipart, processWithPraat, processWithPraat, put, releaseTask, search, serializerForFilesSuffix, serializerForMimeType, setBatchMode, setLabbcatUrl, setLanguage, setPassword, setResponse, setUsername, setVerbose, taskStatus, url, 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 Details
-
LabbcatAdmin
public LabbcatAdmin()Default constructor. -
LabbcatAdmin
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
Constructor from URL.- Parameters:
labbcatUrl
- The base URL of the LaBB-CAT server - e.g. https://labbcat.canterbury.ac.nz/demo/
-
LabbcatAdmin
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
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 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.PermissionException NOT YET IMPLEMENTED - De-registers a transcript deserializer.- Specified by:
deregisterDeserializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
deserializer
- The deserializer to de-register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the 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:
getDeserializerDescriptors
in interfacenzilbb.ag.GraphStoreQuery
- Overrides:
getDeserializerDescriptors
in 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.PermissionException NOT YET IMPLEMENTED - Registers a transcript serializer.- Specified by:
registerSerializer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
serializer
- The serializer to register.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.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 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:
getSerializerDescriptors
in interfacenzilbb.ag.GraphStoreQuery
- Overrides:
getSerializerDescriptors
in 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.PermissionException Adds a new layer.- Specified by:
newLayer
in 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.PermissionException Saves changes to a layer.- Specified by:
saveLayer
in 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
Deletes the given layer, and all associated annotations.- Specified by:
deleteLayer
in interfacenzilbb.ag.GraphStoreAdministration
- Parameters:
id
- The ID layer to delete.- Throws:
nzilbb.ag.StoreException
- If an error prevents the transcript from being saved.nzilbb.ag.PermissionException
- If saving the transcript is not permitted.
-
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
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 ofCategory
with 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:
-
readProjects
@Deprecated(since="1.2.0", forRemoval=true) public Project[] readProjects() throws nzilbb.ag.StoreException, nzilbb.ag.PermissionExceptionDeprecated, for removal: This API element is subject to removal in a future version.Projects are now layer categories - a type ofCategory
with 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:
-
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 ofCategory
with 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:
-
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 ofCategory
with 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:
-
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 ofCategory
with 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:
-
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 ofCategory
with 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:
-
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.PermissionExceptionReads 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
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
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
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
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
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.PermissionExceptionReads 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
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
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
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
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
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
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
Delete a previously loaded lexicon.- Parameters:
lexicon
- The lexicon to delete.- Throws:
nzilbb.ag.StoreException
- If an error prevents the operation.- See Also:
-
Category
with classId = "layer".