Class ProjectProperties


  • public class ProjectProperties
    extends java.lang.Object
    Storage for project properties. May read and write project from/to disk.
    • Constructor Detail

      • ProjectProperties

        public ProjectProperties​(java.io.File projectDir)
                          throws java.lang.Exception
        Default constructor to initialize fields (to get no NPEs). Real values should be applied after creation.
        Throws:
        java.lang.Exception
    • Method Detail

      • getDefaultExcludes

        public static java.util.List<java.lang.String> getDefaultExcludes()
      • getTargetRoot

        public java.lang.String getTargetRoot()
        Returns The Target (Compiled) Files Directory
      • setTargetRoot

        public void setTargetRoot​(java.lang.String targetRoot)
        Sets The Target (Compiled) Files Directory
      • getGlossaryRoot

        public java.lang.String getGlossaryRoot()
        Returns The Glossary Files Directory
      • setGlossaryRoot

        public void setGlossaryRoot​(java.lang.String glossaryRoot)
        Sets The Glossary Files Directory
      • getWriteableGlossary

        public java.lang.String getWriteableGlossary()
        Returns The Glossary File Location
      • getWriteableGlossaryDir

        public java.lang.String getWriteableGlossaryDir()
        Returns The Glossary File Directory
      • setWriteableGlossary

        public void setWriteableGlossary​(java.lang.String writeableGlossaryFile)
        Sets The Writeable Glossary File Location
      • isDefaultWriteableGlossaryFile

        public boolean isDefaultWriteableGlossaryFile()
      • computeDefaultWriteableGlossaryFile

        public java.lang.String computeDefaultWriteableGlossaryFile()
      • getTMRoot

        public java.lang.String getTMRoot()
        Returns The Translation Memory (TMX) Files Directory
      • getExportTMRoot

        public java.lang.String getExportTMRoot()
        Returns The Translation Memory (TMX) Files Directory
      • setTMRoot

        public void setTMRoot​(java.lang.String tmRoot)
        Sets The Translation Memory (TMX) Files Directory
      • setExportTMRoot

        public void setExportTMRoot​(java.lang.String exportTMRoot)
        Sets The Export Translation Memory (TMX) Files Directory
      • getTMOtherLangRoot

        public java.lang.String getTMOtherLangRoot()
        Returns The Translation Memory (TMX) with translations to other languages Files Directory
      • getTMAutoRoot

        public java.lang.String getTMAutoRoot()
        Returns The Translation Memory (TMX) Files Directory for automatically applied files.
      • getTMEnforceRoot

        public java.lang.String getTMEnforceRoot()
        Returns The Translation Memory (TMX) Files Directory for automatically enforced files.
      • getTMMTRoot

        public java.lang.String getTMMTRoot()
        Returns The Translation Memory (TMX) Files Directory for machine translation files.
      • getTMPenaltyRoot

        public java.lang.String getTMPenaltyRoot()
        Returns The Translation Memory (TMX) Files Directory for files with penalties.
      • getDictRoot

        public java.lang.String getDictRoot()
        Returns The Dictionaries Files Directory
      • setDictRoot

        public void setDictRoot​(java.lang.String dictRoot)
        Sets Dictionaries Files Directory
      • getDictRootRelative

        public java.lang.String getDictRootRelative()
      • getProjectName

        public java.lang.String getProjectName()
        Returns the name of the Project
      • getProjectRoot

        public java.lang.String getProjectRoot()
        Returns The Project Root Directory
      • getProjectRootDir

        public java.io.File getProjectRootDir()
      • getProjectInternal

        public java.lang.String getProjectInternal()
        Returns The Project's Translation Memory (TMX) File
      • getProjectInternalDir

        public java.io.File getProjectInternalDir()
      • getProjectInternalRelative

        public java.lang.String getProjectInternalRelative()
      • getSourceRoot

        public java.lang.String getSourceRoot()
        Returns The Source (to be translated) Files Directory
      • setSourceRoot

        public void setSourceRoot​(java.lang.String sourceRoot)
        Sets The Source (to be translated) Files Directory
      • setSourceRootRelative

        public void setSourceRootRelative​(java.lang.String sourceRootRelative)
      • getSourceRootExcludes

        public java.util.List<java.lang.String> getSourceRootExcludes()
      • getSourceLanguage

        public Language getSourceLanguage()
        Returns The Source Language (language of the source files) of the Project
      • setSourceLanguage

        public void setSourceLanguage​(Language sourceLanguage)
        Sets The Source Language (language of the source files) of the Project
      • setSourceLanguage

        public void setSourceLanguage​(java.lang.String sourceLanguage)
        Sets The Source Language (language of the source files) of the Project
      • getTargetLanguage

        public Language getTargetLanguage()
        Returns The Target Language (language of the translated files) of the Project
      • setTargetLanguage

        public void setTargetLanguage​(Language targetLanguage)
        Sets The Target Language (language of the translated files) of the Project
      • setTargetLanguage

        public void setTargetLanguage​(java.lang.String targetLanguage)
        Sets The Target Language (language of the translated files) of the Project
      • getSourceTokenizer

        public java.lang.Class<?> getSourceTokenizer()
        Returns the class name of the source language tokenizer for the Project.
      • setSourceTokenizer

        public void setSourceTokenizer​(java.lang.Class<?> sourceTokenizer)
        Sets the class name of the source language tokenizer for the Project.
      • getTargetTokenizer

        public java.lang.Class<?> getTargetTokenizer()
        Returns the class name of the target language tokenizer for the Project.
      • setTargetTokenizer

        public void setTargetTokenizer​(java.lang.Class<?> targetTokenizer)
        Sets the class name of the target language tokenizer for the Project.
      • isSentenceSegmentingEnabled

        public boolean isSentenceSegmentingEnabled()
        Returns whether The Sentence Segmenting is Enabled for this Project. Default, Yes.
      • setSentenceSegmentingEnabled

        public void setSentenceSegmentingEnabled​(boolean sentenceSegmentingEnabled)
        Sets whether The Sentence Segmenting is Enabled for this Project
      • setExportTmLevels

        public void setExportTmLevels​(boolean omT,
                                      boolean level1,
                                      boolean level2)
        Sets level(s) of TMs to be exported by project. Accepts three booleans as arguments, corresponding to OmegaT, Level 1 and Level 2
      • setExportTmLevels

        public void setExportTmLevels​(java.util.List<java.lang.String> levels)
        Sets level(s) of TMs to be exported by project. Accepts list of levels
      • getExportTmLevels

        public java.util.List<java.lang.String> getExportTmLevels()
      • isExportTm

        public boolean isExportTm​(java.lang.String level)
        Returns whether a given TM level will be exported
      • isSupportDefaultTranslations

        public boolean isSupportDefaultTranslations()
      • setSupportDefaultTranslations

        public void setSupportDefaultTranslations​(boolean supportDefaultTranslations)
      • isRemoveTags

        public boolean isRemoveTags()
      • setRemoveTags

        public void setRemoveTags​(boolean removeTags)
      • hasRepositories

        public boolean hasRepositories()
      • isTeamProject

        public boolean isTeamProject()
      • setRepositories

        public void setRepositories​(java.util.List<RepositoryDefinition> repositories)
      • getProjectSRX

        public SRX getProjectSRX()
      • setProjectSRX

        public void setProjectSRX​(SRX projectSRX)
      • loadProjectSRX

        public void loadProjectSRX()
        Loads segmentation.conf if found in the /omegat folder of the project
      • getProjectFilters

        public Filters getProjectFilters()
      • setProjectFilters

        public void setProjectFilters​(Filters projectFilters)
      • loadProjectFilters

        public void loadProjectFilters()
                                throws java.io.IOException
        Loads filters.xml if found in the /omegat filter of the project
        Throws:
        java.io.IOException
      • getExternalCommand

        public java.lang.String getExternalCommand()
      • setExternalCommand

        public void setExternalCommand​(java.lang.String command)
      • isProjectValid

        public boolean isProjectValid()
      • autocreateDirectories

        public void autocreateDirectories()