Class Graphs
- java.lang.Object
-
- nzilbb.labbcat.server.api.APIRequestHandler
-
- nzilbb.labbcat.server.api.serialize.Graphs
-
public class Graphs extends APIRequestHandler
/api/serialize/graphs : Converts transcripts to specific formats.Converts transcripts to annotation file formats.
The request method can be GET or POST
- Parameters:
mimeType
- Content-type of the format to serialize to.layerId
- A list of layer IDs to include in the serialization.id
- One or more graph IDs.query
- Graph QL expression to identify the graph IDs, if no id parameter is supplied.name
- Optional name of the collection.
Output: Each of the transcripts specified by the input parameters converted to the given format.
This may be a single file or multiple files, depending on the converter behaviour and how many graphs are specified. If there is only one, the file in returned as the response to the request. If there are more than one, the response is a zip file containing the output files.
- Author:
- Robert Fromont
-
-
Field Summary
-
Fields inherited from class nzilbb.labbcat.server.api.APIRequestHandler
SC_BAD_REQUEST, SC_CONFLICT, SC_FORBIDDEN, SC_INTERNAL_SERVER_ERROR, SC_METHOD_NOT_ALLOWED, SC_NOT_FOUND, SC_OK, SC_UNPROCESSABLE_CONTENT, SC_UNSUPPORTED_MEDIA_TYPE
-
-
Constructor Summary
Constructors Constructor Description Graphs()
Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
cancel()
Cancels the currently running exportTextGrids() method.void
get(RequestParameters parameters, OutputStream out, Consumer<String> contentType, Consumer<String> fileName, Consumer<Integer> httpStatus)
The GET method for the servlet.int
getPercentComplete()
PercentComplete accessorVector<nzilbb.ag.serialize.util.NamedStream>
serializeGraphs(String name, String[] ids, Collection<String> layers, String mimeType, SqlGraphStoreAdministration store)
Deprecated.Graphs
setPercentComplete(int iNewPercentComplete)
PercentComplete mutator-
Methods inherited from class nzilbb.labbcat.server.api.APIRequestHandler
GetSystemAttribute, init, writeResponse
-
-
-
-
Method Detail
-
getPercentComplete
public int getPercentComplete()
PercentComplete accessor- Returns:
- How far through the speakers.
-
setPercentComplete
public Graphs setPercentComplete(int iNewPercentComplete)
PercentComplete mutator- Parameters:
iNewPercentComplete
- How far through the speakers.
-
get
public void get(RequestParameters parameters, OutputStream out, Consumer<String> contentType, Consumer<String> fileName, Consumer<Integer> httpStatus)
The GET method for the servlet.This expects an array of graph ids, start times and end times, a list of layerIds in include, and a mimetype.
Input HTTP parameters:
- mimeType - content-type of the format to serialize to.
- layerId - a list of layer IDs to include in the serialization.
- id - one or more graph IDs.
- query - Graph QL expression to identify the graph IDs, if no id parameter is supplied.
- name - (optional) name of the collection.
Output: A each of the transcript fragments specified by the input parameters converted to the given format.This may be a single file or multiple files, depending on the converter behaviour and how many fragments are specified. If there is only one, the file in returned as the response to the request. If there are more than one, the response is a zipfile containing the output files.
- Parameters:
parameters
- Request parameter map.out
- Response body stream.contentType
- Receives the content type for specification in the response headers.fileName
- Receives the filename for specification in the response headers.httpStatus
- Receives the response status code, in case or error.
-
cancel
public void cancel()
Cancels the currently running exportTextGrids() method.
-
serializeGraphs
@Deprecated public Vector<nzilbb.ag.serialize.util.NamedStream> serializeGraphs(String name, String[] ids, Collection<String> layers, String mimeType, SqlGraphStoreAdministration store) throws Exception
Deprecated.Converts the given utterances to the given format.- Parameters:
ids
- IDs of graphs to convert.layers
- A list of layer names.mimeType
- The target content type.store
- The graph store for retrieving serializers and graphs from.- Returns:
- A Stream containing the fragments - could be a single stream with the fragments, of the given MIME type, or a ZIP file containing individual files.
- Throws:
Exception
-
-