Package org.omegat.core.data
Class NotLoadedProject
- java.lang.Object
-
- org.omegat.core.data.NotLoadedProject
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.omegat.core.data.IProject
IProject.AllTranslations, IProject.DefaultTranslationsIterator, IProject.FileInfo, IProject.MultipleTranslationsIterator, IProject.OptimisticLockingFail
-
-
Constructor Summary
Constructors Constructor Description NotLoadedProject()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
closeProject()
Close project.void
commitSourceFiles()
Commit source files in a team project.void
compileProject(java.lang.String sourcePattern)
Create translated documents.void
compileProjectAndCommit(java.lang.String sourcePattern, boolean doPostProcessing, boolean commitTargetFiles)
Builds translated files corresponding to sourcePattern and creates fresh TM files.void
decreaseTranslated()
void
findNonUniqueSegments()
java.util.List<SourceTextEntry>
getAllEntries()
Get all source segments.IProject.AllTranslations
getAllTranslations(SourceTextEntry ste)
Get default and alternative translations for optimistic locking.java.util.Map<Language,ProjectTMX>
getOtherTargetLanguageTMs()
Get all translation memories from /other_lang/ folder.java.util.List<IProject.FileInfo>
getProjectFiles()
Get info about each source file in project.ProjectProperties
getProjectProperties()
Get project properties.java.util.List<java.lang.String>
getSourceFilesOrder()
Get ordered list of source file names.ITokenizer
getSourceTokenizer()
Returns tokenizer for source language.StatisticsInfo
getStatistics()
Get statistics for project.java.lang.String
getTargetPathForSourceFile(java.lang.String sourceFile)
For a given source file, calculate the path of the target file that would be created by running Create Translated Documents (the file may not exist yet).ITokenizer
getTargetTokenizer()
Returns tokenizer for target language.TMXEntry
getTranslationInfo(SourceTextEntry ste)
Get translation info for specified entry.java.util.Map<java.lang.String,ExternalTMX>
getTransMemories()
Get all translation memories from /tm/ folder.java.util.List<StringEntry>
getUniqueEntries()
void
increaseTranslated()
boolean
isOrphaned(java.lang.String source)
Check if orphaned.boolean
isOrphaned(EntryKey entry)
Check if orphaned.boolean
isProjectLoaded()
Get project loaded status.boolean
isProjectModified()
Is project modified ?boolean
isRemoteProject()
Tells whether a project is a team projectboolean
isTeamSyncPrepared()
Check if team synchronization prepared.void
iterateByDefaultTranslations(IProject.DefaultTranslationsIterator it)
Iterate by all default translations in project.void
iterateByMultipleTranslations(IProject.MultipleTranslationsIterator it)
Iterate by all multiple translations in project.void
saveProject(boolean doTeamSync)
Save project.void
saveProjectProperties()
Save project properties only.void
setNote(SourceTextEntry entry, TMXEntry oldTrans, java.lang.String note)
Change note only for translation.void
setSourceFilesOrder(java.util.List<java.lang.String> filesList)
Set ordered list of source file names.void
setTranslation(SourceTextEntry entry, PrepareTMXEntry trans, boolean defaultTranslation, TMXEntry.ExternalLinked externalLinked)
Set translation for entry.void
setTranslation(SourceTextEntry entry, PrepareTMXEntry trans, boolean defaultTranslation, TMXEntry.ExternalLinked externalLinked, IProject.AllTranslations previousTranslations)
Set translation for entry with optimistic lock checking: if previous translation is not the same like in storage, OptimisticLockingFail exception will be generated.void
teamSync()
Execute synchronization.void
teamSyncPrepare()
Prepare for team synchronization from save thread.
-
-
-
Method Detail
-
compileProject
public void compileProject(java.lang.String sourcePattern) throws java.io.IOException, TranslationException
Description copied from interface:IProject
Create translated documents.- Specified by:
compileProject
in interfaceIProject
- Throws:
java.io.IOException
TranslationException
-
isRemoteProject
public boolean isRemoteProject()
Description copied from interface:IProject
Tells whether a project is a team project- Specified by:
isRemoteProject
in interfaceIProject
- Returns:
- whether the project is a team project
-
compileProjectAndCommit
public void compileProjectAndCommit(java.lang.String sourcePattern, boolean doPostProcessing, boolean commitTargetFiles) throws java.lang.Exception
Description copied from interface:IProject
Builds translated files corresponding to sourcePattern and creates fresh TM files.- Specified by:
compileProjectAndCommit
in interfaceIProject
- Parameters:
sourcePattern
- The regexp of files to createdoPostProcessing
- Whether or not we should perform external post-processing.commitTargetFiles
- Whether or not we should commit target files- Throws:
java.lang.Exception
-
commitSourceFiles
public void commitSourceFiles() throws java.lang.Exception
Description copied from interface:IProject
Commit source files in a team project.- Specified by:
commitSourceFiles
in interfaceIProject
- Throws:
java.lang.Exception
-
closeProject
public void closeProject()
Description copied from interface:IProject
Close project.- Specified by:
closeProject
in interfaceIProject
-
decreaseTranslated
public void decreaseTranslated()
-
getAllEntries
public java.util.List<SourceTextEntry> getAllEntries()
Description copied from interface:IProject
Get all source segments. It's unmodifiable list, so, there is no need synchronization to read it.- Specified by:
getAllEntries
in interfaceIProject
-
getUniqueEntries
public java.util.List<StringEntry> getUniqueEntries()
-
getTranslationInfo
public TMXEntry getTranslationInfo(SourceTextEntry ste)
Description copied from interface:IProject
Get translation info for specified entry. It looks first for multiple, then for default. This method ALWAYS returns TMXEntry, because note can exist even for non-translated segment. Use TMXEntry.isTranslated() for check if translation text really exist. Translation can be checked for default/alternative by the TMXEntry.defaultTranslation.- Specified by:
getTranslationInfo
in interfaceIProject
- Parameters:
ste
- source entry- Returns:
- translation
-
getAllTranslations
public IProject.AllTranslations getAllTranslations(SourceTextEntry ste)
Description copied from interface:IProject
Get default and alternative translations for optimistic locking.- Specified by:
getAllTranslations
in interfaceIProject
-
iterateByDefaultTranslations
public void iterateByDefaultTranslations(IProject.DefaultTranslationsIterator it)
Description copied from interface:IProject
Iterate by all default translations in project.- Specified by:
iterateByDefaultTranslations
in interfaceIProject
-
iterateByMultipleTranslations
public void iterateByMultipleTranslations(IProject.MultipleTranslationsIterator it)
Description copied from interface:IProject
Iterate by all multiple translations in project.- Specified by:
iterateByMultipleTranslations
in interfaceIProject
-
setNote
public void setNote(SourceTextEntry entry, TMXEntry oldTrans, java.lang.String note)
Description copied from interface:IProject
Change note only for translation.
-
isOrphaned
public boolean isOrphaned(java.lang.String source)
Description copied from interface:IProject
Check if orphaned.- Specified by:
isOrphaned
in interfaceIProject
-
isOrphaned
public boolean isOrphaned(EntryKey entry)
Description copied from interface:IProject
Check if orphaned.- Specified by:
isOrphaned
in interfaceIProject
-
getTransMemories
public java.util.Map<java.lang.String,ExternalTMX> getTransMemories()
Description copied from interface:IProject
Get all translation memories from /tm/ folder.- Specified by:
getTransMemories
in interfaceIProject
- Returns:
- translation memories
-
getOtherTargetLanguageTMs
public java.util.Map<Language,ProjectTMX> getOtherTargetLanguageTMs()
Description copied from interface:IProject
Get all translation memories from /other_lang/ folder.- Specified by:
getOtherTargetLanguageTMs
in interfaceIProject
- Returns:
- translation memories
-
getProjectFiles
public java.util.List<IProject.FileInfo> getProjectFiles()
Description copied from interface:IProject
Get info about each source file in project. It's unmodifiable list, so, there is no need synchronization to read it.- Specified by:
getProjectFiles
in interfaceIProject
-
getProjectProperties
public ProjectProperties getProjectProperties()
Description copied from interface:IProject
Get project properties.- Specified by:
getProjectProperties
in interfaceIProject
- Returns:
- project properties
-
getStatistics
public StatisticsInfo getStatistics()
Description copied from interface:IProject
Get statistics for project.- Specified by:
getStatistics
in interfaceIProject
- Returns:
-
increaseTranslated
public void increaseTranslated()
-
isProjectLoaded
public boolean isProjectLoaded()
Description copied from interface:IProject
Get project loaded status.- Specified by:
isProjectLoaded
in interfaceIProject
- Returns:
- true if project loaded
-
isProjectModified
public boolean isProjectModified()
Description copied from interface:IProject
Is project modified ?- Specified by:
isProjectModified
in interfaceIProject
-
saveProject
public void saveProject(boolean doTeamSync)
Description copied from interface:IProject
Save project.- Specified by:
saveProject
in interfaceIProject
-
saveProjectProperties
public void saveProjectProperties() throws java.io.IOException
Description copied from interface:IProject
Save project properties only.- Specified by:
saveProjectProperties
in interfaceIProject
- Throws:
java.io.IOException
-
setTranslation
public void setTranslation(SourceTextEntry entry, PrepareTMXEntry trans, boolean defaultTranslation, TMXEntry.ExternalLinked externalLinked)
Description copied from interface:IProject
Set translation for entry. Optimistic locking will not be checked.- Specified by:
setTranslation
in interfaceIProject
- Parameters:
entry
- entrytrans
- translation. It can't be null
-
setTranslation
public void setTranslation(SourceTextEntry entry, PrepareTMXEntry trans, boolean defaultTranslation, TMXEntry.ExternalLinked externalLinked, IProject.AllTranslations previousTranslations) throws IProject.OptimisticLockingFail
Description copied from interface:IProject
Set translation for entry with optimistic lock checking: if previous translation is not the same like in storage, OptimisticLockingFail exception will be generated. Use when user has typed a new translation.- Specified by:
setTranslation
in interfaceIProject
- Parameters:
entry
- entrytrans
- translation. It can't be null- Throws:
IProject.OptimisticLockingFail
-
getSourceTokenizer
public ITokenizer getSourceTokenizer()
Description copied from interface:IProject
Returns tokenizer for source language.- Specified by:
getSourceTokenizer
in interfaceIProject
-
getTargetTokenizer
public ITokenizer getTargetTokenizer()
Description copied from interface:IProject
Returns tokenizer for target language.- Specified by:
getTargetTokenizer
in interfaceIProject
-
findNonUniqueSegments
public void findNonUniqueSegments()
-
getSourceFilesOrder
public java.util.List<java.lang.String> getSourceFilesOrder()
Description copied from interface:IProject
Get ordered list of source file names.- Specified by:
getSourceFilesOrder
in interfaceIProject
-
setSourceFilesOrder
public void setSourceFilesOrder(java.util.List<java.lang.String> filesList)
Description copied from interface:IProject
Set ordered list of source file names.- Specified by:
setSourceFilesOrder
in interfaceIProject
-
getTargetPathForSourceFile
public java.lang.String getTargetPathForSourceFile(java.lang.String sourceFile)
Description copied from interface:IProject
For a given source file, calculate the path of the target file that would be created by running Create Translated Documents (the file may not exist yet).The target path must be calculated because it can depend on project properties such as the target language, etc.
- Specified by:
getTargetPathForSourceFile
in interfaceIProject
- Parameters:
sourceFile
- The relative path (under thesource
directory) of the source file, e.g.Bundle.properties
- Returns:
- The relative path (under the
target
directory) of the corresponding target file, e.g.Bundle_fr_FR.properties
-
isTeamSyncPrepared
public boolean isTeamSyncPrepared()
Description copied from interface:IProject
Check if team synchronization prepared.- Specified by:
isTeamSyncPrepared
in interfaceIProject
-
teamSync
public void teamSync()
Description copied from interface:IProject
Execute synchronization.
-
teamSyncPrepare
public void teamSyncPrepare() throws java.lang.Exception
Description copied from interface:IProject
Prepare for team synchronization from save thread.- Specified by:
teamSyncPrepare
in interfaceIProject
- Throws:
java.lang.Exception
-
-