Package org.omegat.core.data
Class ProjectProperties
- java.lang.Object
-
- org.omegat.core.data.ProjectProperties
-
public class ProjectProperties extends java.lang.Object
Storage for project properties. May read and write project from/to disk.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
ProjectProperties.ProjectPath
Class 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 void
autocreateDirectories()
java.lang.String
computeDefaultWriteableGlossaryFile()
static java.util.List<java.lang.String>
getDefaultExcludes()
ProjectProperties.ProjectPath
getDictDir()
java.lang.String
getDictRoot()
Returns The Dictionaries Files Directoryjava.lang.String
getDictRootRelative()
java.util.List<java.lang.String>
getExportTmLevels()
java.lang.String
getExportTMRoot()
Returns The Translation Memory (TMX) Files Directoryjava.lang.String
getExternalCommand()
ProjectProperties.ProjectPath
getGlossaryDir()
java.lang.String
getGlossaryRoot()
Returns The Glossary Files DirectoryFilters
getProjectFilters()
java.lang.String
getProjectInternal()
Returns The Project's Translation Memory (TMX) Filejava.io.File
getProjectInternalDir()
java.lang.String
getProjectInternalRelative()
java.lang.String
getProjectName()
Returns the name of the Projectjava.lang.String
getProjectRoot()
Returns The Project Root Directoryjava.io.File
getProjectRootDir()
SRX
getProjectSRX()
java.util.List<RepositoryDefinition>
getRepositories()
ProjectProperties.ProjectPath
getSourceDir()
Language
getSourceLanguage()
Returns The Source Language (language of the source files) of the Projectjava.lang.String
getSourceRoot()
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.ProjectPath
getTargetDir()
Language
getTargetLanguage()
Returns The Target Language (language of the translated files) of the Projectjava.lang.String
getTargetRoot()
Returns The Target (Compiled) Files Directoryjava.lang.Class<?>
getTargetTokenizer()
Returns the class name of the target language tokenizer for the Project.java.lang.String
getTMAutoRoot()
Returns The Translation Memory (TMX) Files Directory for automatically applied files.ProjectProperties.ProjectPath
getTmDir()
java.lang.String
getTMEnforceRoot()
Returns The Translation Memory (TMX) Files Directory for automatically enforced files.java.lang.String
getTMMTRoot()
Returns The Translation Memory (TMX) Files Directory for machine translation files.java.lang.String
getTMOtherLangRoot()
Returns The Translation Memory (TMX) with translations to other languages Files Directoryjava.lang.String
getTMPenaltyRoot()
Returns The Translation Memory (TMX) Files Directory for files with penalties.java.lang.String
getTMRoot()
Returns The Translation Memory (TMX) Files DirectoryProjectProperties.ProjectPath
getWritableGlossaryFile()
java.lang.String
getWriteableGlossary()
Returns The Glossary File Locationjava.lang.String
getWriteableGlossaryDir()
Returns The Glossary File Directoryboolean
hasRepositories()
boolean
isDefaultWriteableGlossaryFile()
boolean
isExportTm(java.lang.String level)
Returns whether a given TM level will be exportedboolean
isProjectValid()
boolean
isRemoveTags()
boolean
isSentenceSegmentingEnabled()
Returns whether The Sentence Segmenting is Enabled for this Project.boolean
isSupportDefaultTranslations()
boolean
isTeamProject()
void
loadProjectFilters()
Loads filters.xml if found in the /omegat filter of the projectvoid
loadProjectSRX()
Loads segmentation.conf if found in the /omegat folder of the projectvoid
setDictRoot(java.lang.String dictRoot)
Sets Dictionaries Files Directoryvoid
setExportTmLevels(boolean omT, boolean level1, boolean level2)
Sets level(s) of TMs to be exported by project.void
setExportTmLevels(java.util.List<java.lang.String> levels)
Sets level(s) of TMs to be exported by project.void
setExportTMRoot(java.lang.String exportTMRoot)
Sets The Export Translation Memory (TMX) Files Directoryvoid
setExternalCommand(java.lang.String command)
void
setGlossaryRoot(java.lang.String glossaryRoot)
Sets The Glossary Files Directoryvoid
setProjectFilters(Filters projectFilters)
void
setProjectSRX(SRX projectSRX)
void
setRemoveTags(boolean removeTags)
void
setRepositories(java.util.List<RepositoryDefinition> repositories)
void
setSentenceSegmentingEnabled(boolean sentenceSegmentingEnabled)
Sets whether The Sentence Segmenting is Enabled for this Projectvoid
setSourceLanguage(java.lang.String sourceLanguage)
Sets The Source Language (language of the source files) of the Projectvoid
setSourceLanguage(Language sourceLanguage)
Sets The Source Language (language of the source files) of the Projectvoid
setSourceRoot(java.lang.String sourceRoot)
Sets The Source (to be translated) Files Directoryvoid
setSourceRootRelative(java.lang.String sourceRootRelative)
void
setSourceTokenizer(java.lang.Class<?> sourceTokenizer)
Sets the class name of the source language tokenizer for the Project.void
setSupportDefaultTranslations(boolean supportDefaultTranslations)
void
setTargetLanguage(java.lang.String targetLanguage)
Sets The Target Language (language of the translated files) of the Projectvoid
setTargetLanguage(Language targetLanguage)
Sets The Target Language (language of the translated files) of the Projectvoid
setTargetRoot(java.lang.String targetRoot)
Sets The Target (Compiled) Files Directoryvoid
setTargetTokenizer(java.lang.Class<?> targetTokenizer)
Sets the class name of the target language tokenizer for the Project.void
setTMRoot(java.lang.String tmRoot)
Sets The Translation Memory (TMX) Files Directoryvoid
setWriteableGlossary(java.lang.String writeableGlossaryFile)
Sets The Writeable Glossary File Locationvoid
verifyProject()
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.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()
-
verifyProject
public void verifyProject() throws ProjectException
Verify project and print any problems.- Throws:
ProjectException
-
autocreateDirectories
public void autocreateDirectories()
-
-