Class TranscriptionRest

java.lang.Object
org.exoplatform.documents.rest.TranscriptionRest

@RestController @RequestMapping("/transcriptions") public class TranscriptionRest extends Object
The transcription of an audio or video file (EXO-92097): its state, its transcript, its timed segments, and a retry. Every answer is read with the caller's own rights, so none may be stored by a shared cache: a file the caller cannot open answers 404.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.springframework.http.ResponseEntity<Void>
    dismissSpeakerProposal(jakarta.servlet.http.HttpServletRequest request, String documentId, String speaker)
    Dismisses the proposal for one speaker of a file's transcript (EXO-92126).
    org.springframework.http.ResponseEntity<String>
    getChapters(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the chapters a file's transcript is grouped into (EXO-92122), a JSON list of chapters, each with its start in seconds, the index of its first segment, its title and its summary.
    org.springframework.http.ResponseEntity<String>
    getSegments(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the timed segments of a file's transcript, a JSON list of start, end and text.
    org.springframework.http.ResponseEntity<List<TranscriptionSpeakerProposalEntity>>
    getSpeakerProposals(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the proposals of who the speakers of a file's transcript are, with the sentences that show each, to a user who can edit the file (EXO-92126).
    org.springframework.http.ResponseEntity<TranscriptionSpeakersEntity>
    getSpeakers(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the speakers of a file's transcript whom someone named, with the person each is, and whether the caller may name them (EXO-92123).
    org.springframework.http.ResponseEntity<TranscriptionStateEntity>
    getState(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the transcription state of a file.
    org.springframework.http.ResponseEntity<String>
    getText(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Answers the transcript of a file, as plain text.
    org.springframework.http.ResponseEntity<Void>
    requestChapters(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Asks for the chapters of a transcript being read (EXO-92122); a transcript that has them, or none to make, is left as it is.
    org.springframework.http.ResponseEntity<Void>
    retry(jakarta.servlet.http.HttpServletRequest request, String documentId)
    Asks to transcribe a file again.
    org.springframework.http.ResponseEntity<Void>
    setSpeaker(jakarta.servlet.http.HttpServletRequest request, String documentId, String speaker, Long identityId, String name)
    Says who a speaker of a file's transcript is (EXO-92123): a person with an account, by identity id, or a guest, by a plain name; exactly one of the two.
    org.springframework.http.ResponseEntity<Void>
    unsetSpeaker(jakarta.servlet.http.HttpServletRequest request, String documentId, String speaker)
    Says that a speaker of a file's transcript is nobody named any more (EXO-92123).

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TranscriptionRest

      public TranscriptionRest()
  • Method Details

    • getState

      @GetMapping(path="{documentId}", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<TranscriptionStateEntity> getState(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the transcription state of a file.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the state, never stored by a shared cache; only available=false when no transcription engine is installed
    • getText

      @GetMapping(path="{documentId}/text", produces="text/plain") @Secured("users") public org.springframework.http.ResponseEntity<String> getText(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the transcript of a file, as plain text.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the transcript, never stored by a shared cache
    • getSegments

      @GetMapping(path="{documentId}/segments", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<String> getSegments(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the timed segments of a file's transcript, a JSON list of start, end and text.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the segments, never stored by a shared cache
    • getChapters

      @GetMapping(path="{documentId}/chapters", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<String> getChapters(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the chapters a file's transcript is grouped into (EXO-92122), a JSON list of chapters, each with its start in seconds, the index of its first segment, its title and its summary.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the chapters, never stored by a shared cache
    • requestChapters

      @PostMapping(path="{documentId}/chapters") @Secured("users") public org.springframework.http.ResponseEntity<Void> requestChapters(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Asks for the chapters of a transcript being read (EXO-92122); a transcript that has them, or none to make, is left as it is. The answer tells the reader whether to wait for them.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      202 when the chapters are coming (queued now, or earlier and not made yet), 204 when none are to be made
    • getSpeakers

      @GetMapping(path="{documentId}/speakers", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<TranscriptionSpeakersEntity> getSpeakers(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the speakers of a file's transcript whom someone named, with the person each is, and whether the caller may name them (EXO-92123).
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the named speakers, never stored by a shared cache
    • setSpeaker

      @PutMapping(path="{documentId}/speakers/{speaker}") @Secured("users") public org.springframework.http.ResponseEntity<Void> setSpeaker(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId, @PathVariable("speaker") String speaker, @RequestParam(name="identityId",required=false) Long identityId, @RequestParam(name="name",required=false) String name)
      Says who a speaker of a file's transcript is (EXO-92123): a person with an account, by identity id, or a guest, by a plain name; exactly one of the two.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      speaker - the speaker's number in the transcript
      identityId - the person's identity id, or null for a guest
      name - the guest's name, or null for a person
      Returns:
      204 once the speaker is named
    • unsetSpeaker

      @DeleteMapping(path="{documentId}/speakers/{speaker}") @Secured("users") public org.springframework.http.ResponseEntity<Void> unsetSpeaker(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId, @PathVariable("speaker") String speaker)
      Says that a speaker of a file's transcript is nobody named any more (EXO-92123).
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      speaker - the speaker's number in the transcript
      Returns:
      204 once the speaker is unnamed
    • getSpeakerProposals

      @GetMapping(path="{documentId}/speakers/proposals", produces="application/json") @Secured("users") public org.springframework.http.ResponseEntity<List<TranscriptionSpeakerProposalEntity>> getSpeakerProposals(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Answers the proposals of who the speakers of a file's transcript are, with the sentences that show each, to a user who can edit the file (EXO-92126). A proposal naming a person deleted since is left out, and so is one still waiting for a confirmation that names a person disabled since, who can no longer be named; an applied one stays, as it explains a name the speaker still bears. A proposal made by elimination comes with the full name of the person its other voice is taken to be, and is left out once that person is deleted, since nothing is left to explain it.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      the proposals, never stored by a shared cache
    • dismissSpeakerProposal

      @DeleteMapping(path="{documentId}/speakers/proposals/{speaker}") @Secured("users") public org.springframework.http.ResponseEntity<Void> dismissSpeakerProposal(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId, @PathVariable("speaker") String speaker)
      Dismisses the proposal for one speaker of a file's transcript (EXO-92126).
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      speaker - the speaker's number in the transcript
      Returns:
      204 once dismissed, 409 when another change of the file held it up
    • retry

      @PostMapping(path="{documentId}/retry") @Secured("users") public org.springframework.http.ResponseEntity<Void> retry(jakarta.servlet.http.HttpServletRequest request, @PathVariable("documentId") String documentId)
      Asks to transcribe a file again.
      Parameters:
      request - the HTTP request, which names the caller
      documentId - the file's UUID
      Returns:
      202 once the file is handed to the transcriber, or when it is already queued or being transcribed