Class AmberscriptTranscriptionService

java.lang.Object
org.opencastproject.job.api.AbstractJobProducer
org.opencastproject.transcription.amberscript.AmberscriptTranscriptionService
All Implemented Interfaces:
org.opencastproject.job.api.JobProducer, org.opencastproject.transcription.api.TranscriptionService

public class AmberscriptTranscriptionService extends org.opencastproject.job.api.AbstractJobProducer implements org.opencastproject.transcription.api.TranscriptionService
  • Field Details

  • Constructor Details

    • AmberscriptTranscriptionService

      public AmberscriptTranscriptionService()
  • Method Details

    • activate

      public void activate(org.osgi.service.component.ComponentContext cc)
      Overrides:
      activate in class org.opencastproject.job.api.AbstractJobProducer
    • deactivate

      public void deactivate()
    • startTranscription

      public org.opencastproject.job.api.Job startTranscription(String mpId, org.opencastproject.mediapackage.Track track) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Specified by:
      startTranscription in interface org.opencastproject.transcription.api.TranscriptionService
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • startTranscription

      public org.opencastproject.job.api.Job startTranscription(String mpId, org.opencastproject.mediapackage.Track track, String... args) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Specified by:
      startTranscription in interface org.opencastproject.transcription.api.TranscriptionService
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • transcriptionDone

      public void transcriptionDone(String mpId, Object results)
      Specified by:
      transcriptionDone in interface org.opencastproject.transcription.api.TranscriptionService
    • transcriptionError

      public void transcriptionError(String mpId, Object obj) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Specified by:
      transcriptionError in interface org.opencastproject.transcription.api.TranscriptionService
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • getReturnValues

      public Map<String,Object> getReturnValues(String mpId, String jobId) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Specified by:
      getReturnValues in interface org.opencastproject.transcription.api.TranscriptionService
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • getLanguage

      public String getLanguage()
      Specified by:
      getLanguage in interface org.opencastproject.transcription.api.TranscriptionService
    • getAmberscriptJobType

      public String getAmberscriptJobType()
    • getNumberOfSpeakers

      public int getNumberOfSpeakers()
    • getTranscriptionType

      public String getTranscriptionType()
    • getGlossary

      public String getGlossary()
    • getTranscriptionStyle

      public String getTranscriptionStyle()
    • getTargetLanguage

      public String getTargetLanguage()
    • process

      protected String process(org.opencastproject.job.api.Job job) throws Exception
      Specified by:
      process in class org.opencastproject.job.api.AbstractJobProducer
      Throws:
      Exception
    • getGeneratedTranscription

      public org.opencastproject.mediapackage.MediaPackageElement getGeneratedTranscription(String mpId, String jobId, org.opencastproject.mediapackage.MediaPackageElement.Type type) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Specified by:
      getGeneratedTranscription in interface org.opencastproject.transcription.api.TranscriptionService
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • getTranscriptionStatus

      public String getTranscriptionStatus(String mpId) throws org.opencastproject.transcription.api.TranscriptionServiceException
      Get mediapackage transcription status
      Parameters:
      mpId - , mediapackage id
      Returns:
      transcription status
      Throws:
      org.opencastproject.transcription.api.TranscriptionServiceException
    • makeHttpClient

      protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient()
      Creates a closable http client with default configuration.
      Returns:
      closable http client
    • makeHttpClient

      protected org.apache.http.impl.client.CloseableHttpClient makeHttpClient(int socketTimeout)
      Creates a closable http client.
      Parameters:
      socketTimeout - http socket timeout value in milliseconds
    • deleteStorageFile

      protected void deleteStorageFile(String filename)
    • setServiceRegistry

      public void setServiceRegistry(org.opencastproject.serviceregistry.api.ServiceRegistry serviceRegistry)
    • setSecurityService

      public void setSecurityService(org.opencastproject.security.api.SecurityService securityService)
    • setUserDirectoryService

      public void setUserDirectoryService(org.opencastproject.security.api.UserDirectoryService userDirectoryService)
    • setOrganizationDirectoryService

      public void setOrganizationDirectoryService(org.opencastproject.security.api.OrganizationDirectoryService organizationDirectoryService)
    • setWorkspace

      public void setWorkspace(org.opencastproject.workspace.api.Workspace ws)
    • setWorkingFileRepository

      public void setWorkingFileRepository(org.opencastproject.workingfilerepository.api.WorkingFileRepository wfr)
    • setDatabase

      public void setDatabase(org.opencastproject.transcription.persistence.TranscriptionDatabase service)
    • setAssetManager

      public void setAssetManager(org.opencastproject.assetmanager.api.AssetManager service)
    • setWorkflowService

      public void setWorkflowService(org.opencastproject.workflow.api.WorkflowService service)
    • getServiceRegistry

      protected org.opencastproject.serviceregistry.api.ServiceRegistry getServiceRegistry()
      Specified by:
      getServiceRegistry in class org.opencastproject.job.api.AbstractJobProducer
    • getSecurityService

      protected org.opencastproject.security.api.SecurityService getSecurityService()
      Specified by:
      getSecurityService in class org.opencastproject.job.api.AbstractJobProducer
    • getUserDirectoryService

      protected org.opencastproject.security.api.UserDirectoryService getUserDirectoryService()
      Specified by:
      getUserDirectoryService in class org.opencastproject.job.api.AbstractJobProducer
    • getOrganizationDirectoryService

      protected org.opencastproject.security.api.OrganizationDirectoryService getOrganizationDirectoryService()
      Specified by:
      getOrganizationDirectoryService in class org.opencastproject.job.api.AbstractJobProducer