Package org.omegat.core.data
Class ProjectProperties
- java.lang.Object
-
- org.omegat.core.data.ProjectProperties
-
public class ProjectProperties extends java.lang.ObjectStorage for project properties. May read and write project from/to disk.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classProjectProperties.ProjectPathClass for support project path functionality, like relative path, etc.
-
Constructor Summary
Constructors Constructor Description ProjectProperties(java.io.File projectDir)Default constructor to initialize fields (to get no NPEs).
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidautocreateDirectories()java.lang.StringcomputeDefaultWriteableGlossaryFile()static java.util.List<java.lang.String>getDefaultExcludes()ProjectProperties.ProjectPathgetDictDir()java.lang.StringgetDictRoot()Returns The Dictionaries Files Directoryjava.lang.StringgetDictRootRelative()java.util.List<java.lang.String>getExportTmLevels()java.lang.StringgetExportTMRoot()Returns The Translation Memory (TMX) Files Directoryjava.lang.StringgetExternalCommand()ProjectProperties.ProjectPathgetGlossaryDir()java.lang.StringgetGlossaryRoot()Returns The Glossary Files DirectoryFiltersgetProjectFilters()java.lang.StringgetProjectInternal()Returns The Project's Translation Memory (TMX) Filejava.io.FilegetProjectInternalDir()java.lang.StringgetProjectInternalRelative()java.lang.StringgetProjectName()Returns the name of the Projectjava.lang.StringgetProjectRoot()Returns The Project Root Directoryjava.io.FilegetProjectRootDir()SRXgetProjectSRX()java.util.List<RepositoryDefinition>getRepositories()ProjectProperties.ProjectPathgetSourceDir()LanguagegetSourceLanguage()Returns The Source Language (language of the source files) of the Projectjava.lang.StringgetSourceRoot()Returns The Source (to be translated) Files Directoryjava.util.List<java.lang.String>getSourceRootExcludes()java.lang.Class<?>getSourceTokenizer()Returns the class name of the source language tokenizer for the Project.ProjectProperties.ProjectPathgetTargetDir()LanguagegetTargetLanguage()Returns The Target Language (language of the translated files) of the Projectjava.lang.StringgetTargetRoot()Returns The Target (Compiled) Files Directoryjava.lang.Class<?>getTargetTokenizer()Returns the class name of the target language tokenizer for the Project.java.lang.StringgetTMAutoRoot()Returns The Translation Memory (TMX) Files Directory for automatically applied files.ProjectProperties.ProjectPathgetTmDir()java.lang.StringgetTMEnforceRoot()Returns The Translation Memory (TMX) Files Directory for automatically enforced files.java.lang.StringgetTMMTRoot()Returns The Translation Memory (TMX) Files Directory for machine translation files.java.lang.StringgetTMOtherLangRoot()Returns The Translation Memory (TMX) with translations to other languages Files Directoryjava.lang.StringgetTMPenaltyRoot()Returns The Translation Memory (TMX) Files Directory for files with penalties.java.lang.StringgetTMRoot()Returns The Translation Memory (TMX) Files DirectoryProjectProperties.ProjectPathgetWritableGlossaryFile()java.lang.StringgetWriteableGlossary()Returns The Glossary File Locationjava.lang.StringgetWriteableGlossaryDir()Returns The Glossary File DirectorybooleanhasRepositories()booleanisDefaultWriteableGlossaryFile()booleanisExportTm(java.lang.String level)Returns whether a given TM level will be exportedbooleanisProjectValid()booleanisRemoveTags()booleanisSentenceSegmentingEnabled()Returns whether The Sentence Segmenting is Enabled for this Project.booleanisSupportDefaultTranslations()booleanisTeamProject()voidloadProjectFilters()Loads filters.xml if found in the /omegat filter of the projectvoidloadProjectSRX()Loads segmentation.conf if found in the /omegat folder of the projectvoidsetDictRoot(java.lang.String dictRoot)Sets Dictionaries Files DirectoryvoidsetExportTmLevels(boolean omT, boolean level1, boolean level2)Sets level(s) of TMs to be exported by project.voidsetExportTmLevels(java.util.List<java.lang.String> levels)Sets level(s) of TMs to be exported by project.voidsetExportTMRoot(java.lang.String exportTMRoot)Sets The Export Translation Memory (TMX) Files DirectoryvoidsetExternalCommand(java.lang.String command)voidsetGlossaryRoot(java.lang.String glossaryRoot)Sets The Glossary Files DirectoryvoidsetProjectFilters(Filters projectFilters)voidsetProjectSRX(SRX projectSRX)voidsetRemoveTags(boolean removeTags)voidsetRepositories(java.util.List<RepositoryDefinition> repositories)voidsetSentenceSegmentingEnabled(boolean sentenceSegmentingEnabled)Sets whether The Sentence Segmenting is Enabled for this ProjectvoidsetSourceLanguage(java.lang.String sourceLanguage)Sets The Source Language (language of the source files) of the ProjectvoidsetSourceLanguage(Language sourceLanguage)Sets The Source Language (language of the source files) of the ProjectvoidsetSourceRoot(java.lang.String sourceRoot)Sets The Source (to be translated) Files DirectoryvoidsetSourceRootRelative(java.lang.String sourceRootRelative)voidsetSourceTokenizer(java.lang.Class<?> sourceTokenizer)Sets the class name of the source language tokenizer for the Project.voidsetSupportDefaultTranslations(boolean supportDefaultTranslations)voidsetTargetLanguage(java.lang.String targetLanguage)Sets The Target Language (language of the translated files) of the ProjectvoidsetTargetLanguage(Language targetLanguage)Sets The Target Language (language of the translated files) of the ProjectvoidsetTargetRoot(java.lang.String targetRoot)Sets The Target (Compiled) Files DirectoryvoidsetTargetTokenizer(java.lang.Class<?> targetTokenizer)Sets the class name of the target language tokenizer for the Project.voidsetTMRoot(java.lang.String tmRoot)Sets The Translation Memory (TMX) Files DirectoryvoidsetWriteableGlossary(java.lang.String writeableGlossaryFile)Sets The Writeable Glossary File LocationvoidverifyProject()Verify project and print any problems.
-
-
-
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
-
getTargetDir
public ProjectProperties.ProjectPath getTargetDir()
-
getGlossaryRoot
public java.lang.String getGlossaryRoot()
Returns The Glossary Files Directory
-
setGlossaryRoot
public void setGlossaryRoot(java.lang.String glossaryRoot)
Sets The Glossary Files Directory
-
getGlossaryDir
public ProjectProperties.ProjectPath getGlossaryDir()
-
getWritableGlossaryFile
public ProjectProperties.ProjectPath getWritableGlossaryFile()
-
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()
-
getTmDir
public ProjectProperties.ProjectPath getTmDir()
-
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.
-
getDictDir
public ProjectProperties.ProjectPath getDictDir()
-
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)
-
getSourceDir
public ProjectProperties.ProjectPath getSourceDir()
-
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()
-
getRepositories
public java.util.List<RepositoryDefinition> getRepositories()
-
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.IOExceptionLoads 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()
-
verifyProject
public void verifyProject() throws ProjectExceptionVerify project and print any problems.- Throws:
ProjectException
-
autocreateDirectories
public void autocreateDirectories()
-
-