Class ServerBasedFieldsTemplate
Represents a fields template stored on the server. A fields template is a named collection of field definitions which can be applied to one or more translation memories (FieldsTemplate. Changes made to the fields template will be applied to all translation memories associated with it.
Implements
Inherited Members
Namespace: SdlSdl.LanguagePlatformTranslationMemoryApi
Assembly: Sdl.LanguagePlatform.TranslationMemoryApi.dll
Syntax
public class ServerBasedFieldsTemplate : IFieldsTemplate, INotifyPropertyChanged, IEquatable<ServerBasedFieldsTemplate>, IEditableObject, IPermissionCheck
Constructors
ServerBasedFieldsTemplate(TranslationProviderServer)
Creates a new fields template. Note that you have to call Save() to persist the fields template, after setting all the required properties.
Declaration
public ServerBasedFieldsTemplate(TranslationProviderServer server)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderServer | server | The translation provider server on which the fields template should be created. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when |
Properties
Description
Gets or sets the description of the fields template.
Declaration
[StringLength(255, ErrorMessage = "Description too long!")]
public string Description { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get/set description of an entity that no longer exists. |
FieldDefinitions
Gets the fields definitions contained in this fields template.
Declaration
public FieldDefinitionCollection FieldDefinitions { get; }
Property Value
Type | Description |
---|---|
FieldDefinitionCollection |
Remarks
If the list of fields definitions has been pre-loaded, the in-memory collection of fields definitions is returned, otherwise the list of fields definitions is retrieved from the server on-demand.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
Id
Gets the unique id of the fields template. This is automatically generated by the system.
Declaration
public Guid Id { get; }
Property Value
Type | Description |
---|---|
Guid |
IsDeleted
Returns
true
if this translation memory has been deleted.
Declaration
public bool IsDeleted { get; }
Property Value
Type | Description |
---|---|
bool |
IsDirty
Returns
true
if this fields template has unsaved changes.
Declaration
public bool IsDirty { get; }
Property Value
Type | Description |
---|---|
bool |
IsNewObject
Returns
true
if this fields template has not been saved yet.
Declaration
public bool IsNewObject { get; }
Property Value
Type | Description |
---|---|
bool |
LinkedResourceGroupPaths
Gets the collection of paths for the linked resource groups.
Declaration
public string[] LinkedResourceGroupPaths { get; set; }
Property Value
Type | Description |
---|---|
string |
Name
Gets or sets the name of this fields template.
Declaration
[Required(ErrorMessage = "Required Field")]
[RegularExpression("[^\\\\/\"<>\\|\\*\\?%]+", ErrorMessage = "The following characters ^ \\ / \\\" < > | * ? % are not allowed")]
[StringLength(50, ErrorMessage = "Name too long!")]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string |
Remarks
Note that you have to call Save() to persists the change after setting this property.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when trying to get or set name of an entity that no longer exists. |
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 the parent resource group path.
Declaration
[Required(ErrorMessage = "Required Field")]
public string ParentResourceGroupPath { get; set; }
Property Value
Type | Description |
---|---|
string |
TranslationProviderServer
Gets the server.
Declaration
public TranslationProviderServer TranslationProviderServer { get; }
Property Value
Type | Description |
---|---|
TranslationProviderServer |
Methods
Delete()
Deletes this fields template from the system.
Declaration
public void Delete()
Remarks
If any translation memories are currently associated with the fields template, the fields of these translation memories will not be affected.
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |
ObjectNotSavedException | Thrown when this object has not been initially saved yet. |
Equals(ServerBasedFieldsTemplate)
Returns true if this fields template has the same Id as the specified fields template.
Declaration
public bool Equals(ServerBasedFieldsTemplate other)
Parameters
Type | Name | Description |
---|---|---|
ServerBasedFieldsTemplate | other | A fields template to compare to. |
Returns
Type | Description |
---|---|
bool | True if this fields template has the same Id as the specified fields template. |
Equals(object)
Returns true if this fields template has the same Id as the specified fields template.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
object | obj | A fields template to compare to. |
Returns
Type | Description |
---|---|
bool | True if this fields template has the same Id as the specified fields template. |
Overrides
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
HasPermission(string)
Determines whether the specified permission has permission.
Declaration
public bool HasPermission(string permission)
Parameters
Type | Name | Description |
---|---|---|
string | permission | The permission. |
Returns
Type | Description |
---|---|
bool |
|
Save()
Saves this fields template, including any changes to its field definitions.
Declaration
public void Save()
Exceptions
Type | Condition |
---|---|
ObjectDeletedException | Thrown when this object has already been deleted. |