Class ServerBasedTranslationMemory
Represents a ITranslationMemory which is hosted on a server, as opposed to a FileBasedTranslationMemory.
Implements
Inherited Members
Namespace: Sdl.LanguagePlatform.TranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class ServerBasedTranslationMemory : RemoteTranslationMemory, ITranslationMemory2015, ITranslationMemory, ITranslationProvider, 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 |
|---|---|
| System.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 |
|---|---|
| System.Int32 |
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 |
|---|---|
| System.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 |
|---|---|
| System.String |
Exceptions
| Type | Condition |
|---|---|
| ObjectDeletedException | Thrown when this object has been deleted. |
CurrentExportTasks
Gets a list of export tasks currently associated with the language directions encapsulated by this translation memory.
Declaration
public ReadOnlyCollection<ScheduledServerTranslationMemoryExport> CurrentExportTasks { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ReadOnlyCollection<ScheduledServerTranslationMemoryExport> |
CurrentImportTasks
Gets a list of import tasks currently associated with the language directions encapsulated by this translation memory.
Declaration
public ReadOnlyCollection<ScheduledServerTranslationMemoryImport> CurrentImportTasks { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.ObjectModel.ReadOnlyCollection<ScheduledServerTranslationMemoryImport> |
CurrentRecomputeStatisticsOperation
Gets the most recent scheduled recomputation of fuzzy index statistics; if any.
Declaration
public ScheduledRecomputeStatisticsOperation CurrentRecomputeStatisticsOperation { get; }
Property Value
| Type | Description |
|---|---|
| ScheduledRecomputeStatisticsOperation |
CurrentReindexOperation
Gets the most recent scheduled operation.
Declaration
public ScheduledReindexOperation CurrentReindexOperation { get; }
Property Value
| Type | Description |
|---|---|
| ScheduledReindexOperation |
ExpirationDate
Gets or sets the expiration date for this translation memory.
Declaration
public DateTime? ExpirationDate { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.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 |
|---|---|
| System.Nullable<System.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 |
|---|---|
| System.Nullable<System.Int32> |
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 |
|---|---|
| System.Boolean |
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 |
|---|---|
| System.Boolean |
Exceptions
| Type | Condition |
|---|---|
| ObjectDeletedException | Thrown when this object has been deleted. |
IsReadOnly
Declaration
public bool IsReadOnly { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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 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 |
|---|---|
| System.String[] |
ParentResourceGroupDescription
Gets the parent resource group description.
Declaration
public string ParentResourceGroupDescription { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ParentResourceGroupName
Gets the parent resource group name.
Declaration
public string ParentResourceGroupName { get; set; }
Property Value
| Type | Description |
|---|---|
| System.String |
ParentResourceGroupPath
Gets or sets the parent resource group path.
Declaration
public string ParentResourceGroupPath { get; set; }
Property Value
| Type | Description |
|---|---|
| System.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 |
|---|---|
| System.Collections.ObjectModel.ReadOnlyCollection<LanguagePair> |
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 |
|---|---|
| System.Boolean |
SupportsDocumentSearches
SupportsDocumentSearches. Always true for TMs.
Declaration
public bool SupportsDocumentSearches { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsFilters
SupportsFilters. Always true for TMs.
Declaration
public bool SupportsFilters { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsFuzzySearch
SupportsFuzzySearch. Always true for TMs.
Declaration
public bool SupportsFuzzySearch { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsMultipleResults
SupportsMultipleResults. Always true for TMs.
Declaration
public bool SupportsMultipleResults { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsPenalties
SupportsPenalties. Always true for TMs.
Declaration
public bool SupportsPenalties { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsPlaceables
SupportsPlaceables. Always true for TMs.
Declaration
public bool SupportsPlaceables { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsScoring
SupportsScoring. Always true for TMs.
Declaration
public bool SupportsScoring { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsSearchForTranslationUnits
SupportsSearchForTranslationUnits. Always true for TMs.
Declaration
public bool SupportsSearchForTranslationUnits { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsSearchForTranslationUnitUsingContainsOperator
States whether the TM supports 'contains' TU searches (better performance than 'matches' searches)
Declaration
public bool SupportsSearchForTranslationUnitUsingContainsOperator { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsSourceConcordanceSearch
SupportsSourceConcordanceSearch. Always true for TMs.
Declaration
public bool SupportsSourceConcordanceSearch { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsStructureContext
SupportsStructureContext. Always true for TMs.
Declaration
public bool SupportsStructureContext { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsTaggedInput
SupportsTaggedInput. Always true for TMs.
Declaration
public bool SupportsTaggedInput { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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 |
|---|---|
| System.Boolean |
SupportsTranslation
SupportsTranslation. Always true for TMs.
Declaration
public bool SupportsTranslation { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsUpdate
SupportsUpdate. Always true for TMs.
Declaration
public bool SupportsUpdate { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
SupportsWordCounts
SupportsWordCounts. Always true for TMs.
Declaration
public bool SupportsWordCounts { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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 |
|---|---|
| System.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 |
|---|---|
| System.Boolean |
UsesLegacyHashes
Gets or sets flag determining whether legacy hashes are used
Declaration
public bool UsesLegacyHashes { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
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 |
|---|---|
| System.Boolean | true if the current object is equal to the |
Equals(Object)
Determines whether the specified System.Object is equal to this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | The System.Object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| System.Boolean |
|
Overrides
Exceptions
| Type | Condition |
|---|---|
| System.NullReferenceException | The |
GetHashCode()
Returns a hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | 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 |
|---|---|---|
| System.Uri | uri | URI |
Returns
| Type | Description |
|---|---|
| System.String | server-based translation memory name |
GetServerVersion(Uri)
Determines the TM Server version
Declaration
public static ServerBasedTranslationMemoryVersion GetServerVersion(Uri uri)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Uri | uri |
Returns
| Type | Description |
|---|---|
| ServerBasedTranslationMemoryVersion |
GetTranslationUnitCount()
Gets the total translation unit count for all language directions in this translation memory.
Declaration
public int GetTranslationUnitCount()
Returns
| Type | Description |
|---|---|
| System.Int32 | 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 |
|---|---|---|
| System.String | permission | A permission ID. See TranslationMemoryPermissions. |
Returns
| Type | Description |
|---|---|
| System.Boolean | 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 |
|---|---|---|
| System.Uri | uri | The URI to check. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Whether |
LoadState(String)
Loads previously serialized state information into this translation provider instance.
Declaration
public void LoadState(string translationProviderState)
Parameters
| Type | Name | Description |
|---|---|---|
| System.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()
Reindex()
Reindexes this translation memory.
Declaration
public void Reindex()
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 |
|---|---|
| System.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 |
|---|---|---|
| System.Uri | uri |
Returns
| Type | Description |
|---|---|
| System.Boolean |
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 |
|---|---|
| System.Boolean |
|
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 |
|---|---|
| System.Boolean | True if the specified language direction is supported. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDeletedException | Thrown when this object has been deleted. |
Explicit Interface Implementations
ITranslationMemory.GetLanguageDirection(LanguagePair)
Declaration
ITranslationMemoryLanguageDirection ITranslationMemory.GetLanguageDirection(LanguagePair languageDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| LanguagePair | languageDirection |
Returns
| Type | Description |
|---|---|
| ITranslationMemoryLanguageDirection |
ITranslationProvider.GetLanguageDirection(LanguagePair)
Gets a translation provider for the specified language direction.
Declaration
ITranslationProviderLanguageDirection ITranslationProvider.GetLanguageDirection(LanguagePair languageDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| LanguagePair | languageDirection | The language direction. |
Returns
| Type | Description |
|---|---|
| ITranslationProviderLanguageDirection | The language direction matching the given source and target language. |
Exceptions
| Type | Condition |
|---|---|
| ObjectDeletedException | Thrown when this object has been deleted. |