Class ServerBasedTranslationMemory
Represents a ITranslationMemory which is hosted on a server, as opposed to a FileBasedTranslationMemory.
Implements
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class ServerBasedTranslationMemory : RemoteTranslationMemory, ITranslationMemory2015, ITranslationMemory, ITranslationProvider, ISupportPlaceables, INotifyPropertyChanged, IEditableObject, IEquatable<ServerBasedTranslationMemory>, IPermissionCheck, IAdvancedContextTranslationMemory
Constructors
ServerBasedTranslationMemory(TranslationProviderServer)
Creates a new translation memory. Note that you have to call Save() to persist the translation memory.
Declaration
public ServerBasedTranslationMemory(TranslationProviderServer server)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderServer | server | The server with which the database server should be registered. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |
Properties
CachedTranslationUnitCount
Gets the cached total translation unit count for all language directions. This count is computed at regular intervals and when performing imports. To calculate the actual translation unit count, use GetTranslationUnitCount() but bear in mind that this is a relatively expensive operation.
Declaration
public int CachedTranslationUnitCount { get; }
Property Value
Type | Description |
---|---|
int |
Container
Gets or sets the translation memory container that contains this translation memory.
Declaration
public TranslationMemoryContainer Container { get; set; }
Property Value
Type | Description |
---|---|
TranslationMemoryContainer |
Remarks
You cannot change this property after the translation memory has been created.
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when trying to set this property after the translation memory has been created. |
ObjectDeletedException | Thrown when this object has been deleted. |
CreationUserName
Gets the creation user of this translation memory.
Declaration
public string CreationUserName { get; }
Property Value
Type | Description |
---|---|
string |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
ExpirationDate
Gets or sets the expiration date for this translation memory.
Declaration
public DateTime? ExpirationDate { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Remarks
You have to call Save() in order to perist changes to this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
FieldDefinitions
Gets the custom fields defined for this TM.
Declaration
public FieldDefinitionCollection FieldDefinitions { get; }
Property Value
Type | Description |
---|---|
FieldDefinitionCollection |
Remarks
In case this is a server-based translation memory, which is associated with a fields template (see IFieldsTemplate), this returns a read-only fields collection identical to the template's fields collection. In all other cases, the field collection returned can be modified. Note that you have to call Save() to persist any changes made to the fields.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
FieldsTemplate
Gets or sets the field group template. Can be null.
Declaration
public ServerBasedFieldsTemplate FieldsTemplate { get; set; }
Property Value
Type | Description |
---|---|
ServerBasedFieldsTemplate |
Remarks
You need to call Save() to persist the change after setting this property.
The template is potentially shared by a number of translation memories. Changes made to the template will affect all translation memories which refer to this template.
If you want to make field changes for this translation memory only, make those modifications through the FieldDefinitions property. Before you can do that, set the FieldsTemplate property to null.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
FuzzyIndexStatisticsRecomputedAt
Gets the time of the last fuzzy index statistics recomputation of this TM, if available.
Declaration
public DateTime? FuzzyIndexStatisticsRecomputedAt { get; }
Property Value
Type | Description |
---|---|
DateTime |
FuzzyIndexStatisticsSize
Gets the size of the TM at the point of the last fuzzy index statistics recomputation, if available.
Declaration
public int? FuzzyIndexStatisticsSize { get; }
Property Value
Type | Description |
---|---|
int |
FuzzyIndexTuningSettings
Gets or sets the fuzzy index tuning settings for the TM. Note that you have to call Save() to persists changes to this property.
Declaration
public FuzzyIndexTuningSettings FuzzyIndexTuningSettings { get; set; }
Property Value
Type | Description |
---|---|
FuzzyIndexTuningSettings |
IsDirty
Returns
true
if this translation memory has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
IsProjectTranslationMemory
Gets or sets an indication whether this translation memory is a project translation memory.
Declaration
public bool IsProjectTranslationMemory { get; set; }
Property Value
Type | Description |
---|---|
bool |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
Type | Description |
---|---|
bool |
LanguageDirections
Gets this list of language directions for this translation memory.
Declaration
public ServerBasedTranslationMemoryLanguageDirectionCollection LanguageDirections { get; }
Property Value
Type | Description |
---|---|
ServerBasedTranslationMemoryLanguageDirectionCollection |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
LanguageResourceBundles
Gets the language resources which are associated with this TM.
Declaration
public LanguageResourceBundleCollection LanguageResourceBundles { get; }
Property Value
Type | Description |
---|---|
LanguageResourceBundleCollection |
Remarks
In case this is a server-based translation memory, which is associated with a language resources template (see ILanguageResourcesTemplate), this returns a read-only language resources collection identical to the template's language resources collection. In all other cases, the language resources collection returned can be modified. Note that you have to call Save() to persist any changes made to language resources.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
LanguageResourcesTemplate
Gets or sets the ServerBasedLanguageResourcesTemplate object associated with this TM.
Declaration
public ServerBasedLanguageResourcesTemplate LanguageResourcesTemplate { get; set; }
Property Value
Type | Description |
---|---|
ServerBasedLanguageResourcesTemplate |
Remarks
The template is a shared entity that defines the language resources that are associated with one or more TMs. Modifying the template will therefore cause modifications to the shared data and alter the language resources for all associated TMs.
If you want to make language resource changes for this translation memory only, make those modifications through the ITranslationMemory.LanguageResourceBundles property. Before you can do that, set the LanguageResourcesTemplate property to null.
///Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
LinkedResourceGroupPaths
Gets the collection of paths for the linked resource groups.
Declaration
public string[] LinkedResourceGroupPaths { get; set; }
Property Value
Type | Description |
---|---|
string |
OwnerId
Declaration
public Guid? OwnerId { get; }
Property Value
Type | Description |
---|---|
Guid |
ParentResourceGroupDescription
Gets the parent resource group description.
Declaration
public string ParentResourceGroupDescription { get; set; }
Property Value
Type | Description |
---|---|
string |
ParentResourceGroupName
Gets the parent resource group name.
Declaration
public string ParentResourceGroupName { get; set; }
Property Value
Type | Description |
---|---|
string |
ParentResourceGroupPath
Gets or sets the parent resource group path.
Declaration
[Required(ErrorMessage = "Required Field")]
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
string | The parent resource group path. |
StatusInfo
Gets the status info for the provider.
Declaration
public ProviderStatusInfo StatusInfo { get; }
Property Value
Type | Description |
---|---|
ProviderStatusInfo |
SupportedLanguageDirections
Gets the list of language directions which are supported by this translation memory.
Declaration
public ReadOnlyCollection<LanguagePair> SupportedLanguageDirections { get; }
Property Value
Type | Description |
---|---|
ReadOnlyCollectionLanguagePair |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
SupportsConcordanceSearch
SupportsConcordanceSearch. Always true for TMs.
Declaration
public bool SupportsConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsDocumentSearches
SupportsDocumentSearches. Always true for TMs.
Declaration
public bool SupportsDocumentSearches { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsFilters
SupportsFilters. Always true for TMs.
Declaration
public bool SupportsFilters { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsFuzzySearch
SupportsFuzzySearch. Always true for TMs.
Declaration
public bool SupportsFuzzySearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsMultipleResults
SupportsMultipleResults. Always true for TMs.
Declaration
public bool SupportsMultipleResults { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsPenalties
SupportsPenalties. Always true for TMs.
Declaration
public bool SupportsPenalties { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsPlaceables
SupportsPlaceables. Always true for TMs.
Declaration
public bool SupportsPlaceables { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsScoring
SupportsScoring. Always true for TMs.
Declaration
public bool SupportsScoring { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsSearchForTranslationUnitUsingContainsOperator
States whether the TM supports 'contains' TU searches (better performance than 'matches' searches)
Declaration
public bool SupportsSearchForTranslationUnitUsingContainsOperator { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsSearchForTranslationUnits
SupportsSearchForTranslationUnits. Always true for TMs.
Declaration
public bool SupportsSearchForTranslationUnits { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsSourceConcordanceSearch
SupportsSourceConcordanceSearch. Always true for TMs.
Declaration
public bool SupportsSourceConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsStructureContext
SupportsStructureContext. Always true for TMs.
Declaration
public bool SupportsStructureContext { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTaggedInput
SupportsTaggedInput. Always true for TMs.
Declaration
public bool SupportsTaggedInput { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTargetConcordanceSearch
SupportsTargetConcordanceSearch. Returns
true
if this translation memory has a word-based fuzzy index for the target language (see FuzzyIndexes).
Declaration
public bool SupportsTargetConcordanceSearch { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsTranslation
SupportsTranslation. Always true for TMs.
Declaration
public bool SupportsTranslation { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsUpdate
SupportsUpdate. Always true for TMs.
Declaration
public bool SupportsUpdate { get; }
Property Value
Type | Description |
---|---|
bool |
SupportsWordCounts
SupportsWordCounts. Always true for TMs.
Declaration
public bool SupportsWordCounts { get; }
Property Value
Type | Description |
---|---|
bool |
TextContextMatchType
Gets or sets the context matching type flag
Declaration
public TextContextMatchType TextContextMatchType { get; set; }
Property Value
Type | Description |
---|---|
TextContextMatchType |
TokenizerFlags
Gets or sets the flags affecting tokenizer behaviour for this TM.
Declaration
public TokenizerFlags TokenizerFlags { get; set; }
Property Value
Type | Description |
---|---|
TokenizerFlags |
TranslationMethod
Declaration
public TranslationMethod TranslationMethod { get; }
Property Value
Type | Description |
---|---|
TranslationMethod |
TranslationProviderServer
Gets the server.
Declaration
public TranslationProviderServer TranslationProviderServer { get; }
Property Value
Type | Description |
---|---|
TranslationProviderServer |
Uri
Gets a URI which uniquely identifies this translation provider.
Declaration
public Uri Uri { get; }
Property Value
Type | Description |
---|---|
Uri |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
UsesIdContextMatching
Gets or sets the flag determining whether id context matching is used
Declaration
public bool UsesIdContextMatching { get; set; }
Property Value
Type | Description |
---|---|
bool |
UsesLegacyHashes
Gets or sets flag determining whether legacy hashes are used
Declaration
public bool UsesLegacyHashes { get; set; }
Property Value
Type | Description |
---|---|
bool |
WordCountFlags
Gets or sets the flags affecting word count behaviour for this TM.
Declaration
public WordCountFlags WordCountFlags { get; set; }
Property Value
Type | Description |
---|---|
WordCountFlags |
Methods
Delete()
Deletes this translation memory.
Declaration
public void Delete()
Remarks
The translation memory will be deleted from the server, including all its content.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
ObjectNotSavedException | Thrown when this object has not been initially saved yet. |
Equals(ServerBasedTranslationMemory)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(ServerBasedTranslationMemory other)
Parameters
Type | Name | Description |
---|---|---|
ServerBasedTranslationMemory | other | An object to compare with this object. |
Returns
Type | Description |
---|---|
bool | true if the current object is equal to the |
Equals(object)
Determines whether the specified object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | The object to compare with this instance. |
Returns
Type | Description |
---|---|
bool |
|
Overrides
Exceptions
Type | Condition |
---|---|
NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. |
Overrides
GetLanguageDirection(LanguagePair)
Gets the language direction with specified source and target language.
Declaration
public ServerBasedTranslationMemoryLanguageDirection GetLanguageDirection(LanguagePair languageDirection)
Parameters
Type | Name | Description |
---|---|---|
LanguagePair | languageDirection | The language direction. |
Returns
Type | Description |
---|---|
ServerBasedTranslationMemoryLanguageDirection | The language direction; or null if no such language direction exists. |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
GetServerBasedTranslationMemoryPath(Uri)
Gets the server-based translation memory name from the given URI.
Declaration
public static string GetServerBasedTranslationMemoryPath(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | URI |
Returns
Type | Description |
---|---|
string | server-based translation memory name |
GetTranslationUnitCount()
Gets the total translation unit count for all language directions in this translation memory.
Declaration
public int GetTranslationUnitCount()
Returns
Type | Description |
---|---|
int | The total translation unit count for this TM. |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
HasPermission(string)
Checks whether the current user has the specified permission on this translation memory.
Declaration
public bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
string | permission | A permission ID. See TranslationMemoryPermissions. |
Returns
Type | Description |
---|---|
bool | True if the user has the specified permission for this TM. |
IsServerBasedTranslationMemory(Uri)
Determines whether the given URI represents a server-based translation memory.
Declaration
public static bool IsServerBasedTranslationMemory(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | The URI to check. |
Returns
Type | Description |
---|---|
bool | Whether |
LoadState(string)
Loads previously serialized state information into this translation provider instance.
Declaration
public void LoadState(string translationProviderState)
Parameters
Type | Name | Description |
---|---|---|
string | translationProviderState | A string representing the state of translation provider that was previously saved using SerializeState(). |
Remarks
The format of this string can be decided upon by the translation provider implementation.
RecomputeFuzzyIndexStatistics()
Synchronously recomputes the fuzzy index statistics of the TM.
Declaration
public void RecomputeFuzzyIndexStatistics()
Remarks
This can be a long running operation, especially for larger TMs. It is recommended to use ScheduledRecomputeStatisticsOperation to perform this operation on the Execution Server.
RefreshStatusInfo()
Ensures that the provider's status information (StatusInfo) is refreshed, in case it is cached.
Declaration
public void RefreshStatusInfo()
Save()
Saves the changes to this translation memory. This includes changes to language directions, fields and language resources.
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |
SerializeState()
Serializes any meaningful state information for this translation provider that can be stored in projects and sent around the supply chain.
Declaration
public string SerializeState()
Returns
Type | Description |
---|---|
string | A string representing the state of this translation provider that can later be passed into the LoadState(string) method to restore the state after creating a new translation provider. |
Remarks
The format of this string can be decided upon by the translation provider implementation.
ServerSupportsTranslationAndAnalysisService(Uri)
Check if the server supports Translation and Analysis Service
Declaration
public static bool ServerSupportsTranslationAndAnalysisService(Uri uri)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri |
Returns
Type | Description |
---|---|
bool |
ShouldRecomputeFuzzyIndexStatistics()
Gets a flag which indicates whether it is recommended to recompute the fuzzy index statistics (see RecomputeFuzzyIndexStatistics()).
Declaration
public bool ShouldRecomputeFuzzyIndexStatistics()
Returns
Type | Description |
---|---|
bool |
|
SupportsLanguageDirection(LanguagePair)
Checks whether this translation provider supports the specified language direction.
Declaration
public bool SupportsLanguageDirection(LanguagePair languageDirection)
Parameters
Type | Name | Description |
---|---|---|
LanguagePair | languageDirection | The language direction. |
Returns
Type | Description |
---|---|
bool | True if the specified language direction is supported. |
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has been deleted. |