Class TranslatableFile

java.lang.Object
com.idmedia.translationstudio.api.connector.TranslatableFile
All Implemented Interfaces:
ITranslatableFile, ITranslatableFileIdProvider, ITranslatableFileXliff, ITranslatableXmlFile

public class TranslatableFile extends Object implements ITranslatableFile
Author:
Phillip Austerfield
  • Constructor Details

    • TranslatableFile

      public TranslatableFile(String sFile)
  • Method Details

    • addPreviewFile

      public void addPreviewFile(@Nullable @Nullable List<String> vsList)
      Add preview files

      Parameters:
      vsList - List of files
    • addAdditionalFile

      public void addAdditionalFile(String sFile)
      Add a preview file

      Specified by:
      addAdditionalFile in interface ITranslatableFile
      Parameters:
      sFile - File
    • getFullQualifiedFilePath

      @NotNull public @NotNull String getFullQualifiedFilePath()
      Get the full qualified Path (Path + Name + postfix) of the local file.
      Specified by:
      getFullQualifiedFilePath in interface ITranslatableXmlFile
      Returns:
      File Uri
    • getPreviewFiles

      @NotNull public @NotNull List<String> getPreviewFiles()
      Get List of preview files associated to the data in the translatable file
      Specified by:
      getPreviewFiles in interface ITranslatableXmlFile
      Returns:
      preview file list, never null
    • getInitialLanguage

      @NotNull public @NotNull String getInitialLanguage()
      Returns the target language (initialized in constructor) e.g de_de, fr_fr ...
      Specified by:
      getInitialLanguage in interface ITranslatableFile
      Returns:
      Language Code
    • getTargetLanguage

      @NotNull public @NotNull String getTargetLanguage()
      Returns the initial language (initialized in constructor) e.g de_de, fr_fr ...
      Specified by:
      getTargetLanguage in interface ITranslatableXmlFile
      Returns:
      Language Code
    • getProjectId

      @NotNull public @NotNull String getProjectId()
      Get the TMS Project ID where the file should be associated with
      Specified by:
      getProjectId in interface ITranslatableXmlFile
      Returns:
      Id or null
    • setProjectId

      public void setProjectId(String sProjectId)
    • setTargetLanguage

      public void setTargetLanguage(String sLang)
    • setSourceLanguage

      public void setSourceLanguage(String sLang)
    • setJobId

      public void setJobId(long lJobId)
    • setDeadline

      public void setDeadline(Date deadline)
    • getJobId

      public long getJobId()
      Get associated job id
      Specified by:
      getJobId in interface ITranslatableFile
      Returns:
    • getDeadline

      @Nullable public @Nullable Date getDeadline()
      Get Deadline
      Specified by:
      getDeadline in interface ITranslatableXmlFile
      Returns:
      deadline, may be null
    • getCustomFieldValues

      @NotNull public @NotNull List<org.json.simple.JSONObject> getCustomFieldValues()
      Get the values of the custom fields associated with the files in this translatable file
      Specified by:
      getCustomFieldValues in interface ITranslatableFile
      Returns:
      List, never null
    • getAdditionalFiles

      @NotNull public @NotNull List<String> getAdditionalFiles()
      Get list of additional files
      Specified by:
      getAdditionalFiles in interface ITranslatableXmlFile
      Returns:
      List, never null
    • getSourceLanguage

      @NotNull public @NotNull String getSourceLanguage()
      Returns the initial language (initialized in constructor) e.g de_de, fr_fr ...
      Specified by:
      getSourceLanguage in interface ITranslatableXmlFile
      Returns:
      Language Code
    • toJson

      @NotNull public @NotNull org.json.simple.JSONObject toJson()
      Store itself as JSON
      Specified by:
      toJson in interface ITranslatableFile
    • fromJson

      @Nullable public static @Nullable ITranslatableFile fromJson(@NotNull @NotNull org.json.simple.JSONObject pJson)
      Create from XML
      Parameters:
      pJson -
      Returns:
      Element or null on error
    • fromJson

      @Nullable public static @Nullable ITranslatableFile fromJson(@NotNull @NotNull org.json.simple.JSONObject pJson, @NotNull @NotNull String sXmlFile)
      Create from XML
      Parameters:
      pJson -
      sXmlFile -
      Returns:
      Element or null on error
    • hasPreviewFiles

      public boolean hasPreviewFiles()
      Are preview files available in this package.
      Specified by:
      hasPreviewFiles in interface ITranslatableFile
      Returns:
    • getCustomFields

      @NotNull public @NotNull List<Map<String,String>> getCustomFields()
      Get a list of custom field maps. Each FirstSpirit FORM field represents a single entry in the map
      Specified by:
      getCustomFields in interface ITranslatableFile
      Returns:
    • getCmsProjectId

      public long getCmsProjectId()
      Specified by:
      getCmsProjectId in interface ITranslatableFile
    • setCmsProjectId

      public void setCmsProjectId(long lCmsProjectId)
    • setCmsProjecctName

      public void setCmsProjecctName(@Nullable @Nullable String sVal)
    • getDisplayNames

      @NotNull public @NotNull List<String> getDisplayNames()
      Get the display names of the CMS file(s) included in this XML file
      Specified by:
      getDisplayNames in interface ITranslatableFile
      Returns:
    • addDisplayName

      public void addDisplayName(@Nullable @Nullable String sDisplayName)
    • addPageId

      public void addPageId(long lId)
    • concatinageDisplayNames

      @NotNull public @NotNull String concatinageDisplayNames(int nMaxLength)
      Get the display names of the CMS file(s) included in this XML file
      Specified by:
      concatinageDisplayNames in interface ITranslatableFile
      Parameters:
      nMaxLength -
      Returns:
    • getTickets

      @NotNull @Deprecated public @NotNull List<String> getTickets()
      Deprecated.
      Specified by:
      getTickets in interface ITranslatableFile
    • setIsUrgend

      public void setIsUrgend(boolean bIsUrgent)
    • isUrgendTranslation

      public boolean isUrgendTranslation()
      Indicates that this is an urgent translation
      Specified by:
      isUrgendTranslation in interface ITranslatableFile
      Returns:
    • getRequestUids

      @NotNull public @NotNull List<String> getRequestUids()
      Specified by:
      getRequestUids in interface ITranslatableFile
    • addRequestUid

      public void addRequestUid(@NotNull @NotNull String sUid)
    • getRequesterUsers

      @NotNull public @NotNull List<String> getRequesterUsers()
      Get the requester's id
      Specified by:
      getRequesterUsers in interface ITranslatableFile
      Returns:
      List
    • addCustomMessage

      public void addCustomMessage(@NotNull @NotNull org.json.simple.JSONObject pJson)
    • getCmsProjectName

      @NotNull public @NotNull String getCmsProjectName()
      Description copied from interface: ITranslatableFile
      Get the CMS project name (if available)
      Specified by:
      getCmsProjectName in interface ITranslatableFile
      Returns:
    • getCmsPageIds

      @NotNull public @NotNull List<Long> getCmsPageIds()
      Specified by:
      getCmsPageIds in interface ITranslatableFileIdProvider
    • hasXliff

      public boolean hasXliff()
      Specified by:
      hasXliff in interface ITranslatableFileXliff
    • setXliffFile

      public void setXliffFile(@Nullable @Nullable File pFile)
      Specified by:
      setXliffFile in interface ITranslatableFileXliff
    • getXliffFile

      public File getXliffFile()
      Specified by:
      getXliffFile in interface ITranslatableFileXliff