Interface IPackage
Namespace: Sdl.ProjectAutomation.Core
Assembly: Sdl.ProjectAutomation.Core.dll
Syntax
public interface IPackage
Properties
DueDate
Gets or sets the due date for this project.
If the project does not have a due date, this value is DateTime.MaxValue
.
Declaration
DateTime DueDate { get; set; }
Property Value
Type | Description |
---|---|
System.DateTime |
LocalProjectFolder
The local folder used to store project files.
Declaration
string LocalProjectFolder { get; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
This property can only be set for use during project creation. It is not valid to set for project updating.
PackageConvertor
Sets or returns the extension ID of the package convertor used, if any, to import this project (Returns empty string if no package convertor used).
Declaration
string PackageConvertor { get; set; }
Property Value
Type | Description |
---|---|
System.String |
SourceLanguage
The source language of the project
Declaration
Language SourceLanguage { get; }
Property Value
Type | Description |
---|---|
Language |
Remarks
It is optional to set this property during project creation. If it is not set, the source language of the reference project or template is used. If a template has more than one source language, the first one is used.
This property can only be set for use during project creation. It is not valid to set for project updating.
TargetLanguages
The target languages of the project.
Declaration
IEnumerable<Language> TargetLanguages { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<Language> |
Remarks
It is optional to set this property during project creation. If it is not set, the target languages of the reference project or template are used.
This property can only be set for use during project creation. It is not valid to set for project updating.
Methods
AddLanguageDirection(Language, Language)
Adds a new language direction.
Declaration
void AddLanguageDirection(Language sourceLanguage, Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | sourceLanguage | The source language for the language direction. |
Language | targetLanguage | The source language for the language direction. |
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when the specified language direction already exists. |
AddReferenceFiles(IEnumerable<String>)
Adds a list containing file paths as reference files to the package project
Declaration
IEnumerable<ProjectFile> AddReferenceFiles(IEnumerable<string> filePaths)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.String> | filePaths |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProjectFile> | The corresponding list of ProjectFiles |
AddTranslatableFile(String, String, Language, Guid, String, Guid)
Adds a file to the package project
Declaration
ProjectFile AddTranslatableFile(string fileToAdd, string folderInProject, Language language, Guid id, string filterDefinitionId, Guid referenceFileId)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileToAdd | |
System.String | folderInProject | |
Language | language | |
System.Guid | id | |
System.String | filterDefinitionId | |
System.Guid | referenceFileId | GUID of the parent source file |
Returns
Type | Description |
---|---|
ProjectFile |
CreateManualTask(String, String, DateTime, IEnumerable<TaskFileInfo>)
Creates a manual task. A manual task includes a set of files that is assigned to a user.
Declaration
ManualTask CreateManualTask(string manualTaskName, string assignToUser, DateTime dueDate, IEnumerable<TaskFileInfo> inputFiles)
Parameters
Type | Name | Description |
---|---|---|
System.String | manualTaskName | The name of the manual task. Typically "Translate" or "Review", but other task names can be |
System.String | assignToUser | The user to assign the task to. |
System.DateTime | dueDate | The date by which the task should be completed. |
System.Collections.Generic.IEnumerable<TaskFileInfo> | inputFiles | The files to include in the task. |
Returns
Type | Description |
---|---|
ManualTask | The newly created manual task. |
GetFileTypeConfiguration()
Returns the configuration for the file types asssociated to this package project
Declaration
ProjectFileTypeConfiguration GetFileTypeConfiguration()
Returns
Type | Description |
---|---|
ProjectFileTypeConfiguration |
GetManualTasksTranslatableFiles()
Returns all the translatable files associated to the package's manual tasks. Please note that only files with whose latest revision is bilingual are returned
Declaration
IEnumerable<ProjectFile> GetManualTasksTranslatableFiles()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProjectFile> |
GetSettings()
Gets the project-level settings.
Declaration
ISettingsBundle GetSettings()
Returns
Type | Description |
---|---|
ISettingsBundle | A settings bundle containing the project settings. Never returns |
GetSettings(Language)
Gets the settings for a specific target language.
Declaration
ISettingsBundle GetSettings(Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The project target language for which to retrieve the settings. |
Returns
Type | Description |
---|---|
ISettingsBundle | A settings bundle containing the target language specific settings. The settings bundle returned will have a parent
settings bundle which represent the current project settings. Never returns |
Remarks
Target language settings override settings specified on the project level (see GetSettings(). The override mechanism works on an individual setting level, not on a settings bundle or group level. This means that any setting that is not specifically defined/overridden on the target language level will be inherited from the project-level settings.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
GetTargetLanguageFiles(Language)
Retrieves all files for the specified target language.
Declaration
IEnumerable<ProjectFile> GetTargetLanguageFiles(Language targetLanguage)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The target language to retrieve files for. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProjectFile> | An array of ProjectFile objects, representing all the files in this project with the specified target language. |
GetTermbaseConfiguration(Boolean)
Retrieves all termbase-related settings that are associated with this project.
Declaration
TermbaseConfiguration GetTermbaseConfiguration(bool obtainCopy)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | obtainCopy |
Returns
Type | Description |
---|---|
TermbaseConfiguration | A TermbaseConfiguration object containing all termbase-related configuration for this project. |
GetTranslatableFiles()
Retrieves all translatable files that belong to the project.
Declaration
IEnumerable<ProjectFile> GetTranslatableFiles()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ProjectFile> | An array of ProjectFile objects, representing all the translatable files in this project. |
GetTranslationMemoryInstances(Boolean)
Returns a instance of each translation memory associated to the package
Declaration
IEnumerable<ITranslationMemory> GetTranslationMemoryInstances(bool performUpdateOnly)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | performUpdateOnly |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<ITranslationMemory> |
GetTranslationProviderConfiguration()
Gets the translation provider configuration for this project.
Declaration
TranslationProviderConfiguration GetTranslationProviderConfiguration()
Returns
Type | Description |
---|---|
TranslationProviderConfiguration | The translation provider configuration. This never returns |
Pack(String)
Creates the physical package archive at the given path
Declaration
void Pack(string packageFilePath)
Parameters
Type | Name | Description |
---|---|---|
System.String | packageFilePath |
RunAutomaticTask(IEnumerable<Guid>, String, EventHandler<TaskStatusEventArgs>, EventHandler<TaskMessageEventArgs>)
Runs an automatic task on a set of files. Automatic task template IDs are defined in AutomaticTaskTemplateIds. This overload allows event handlers to be specified for task status and message events. These events support cancellation of the task.
Declaration
AutomaticTask RunAutomaticTask(IEnumerable<Guid> projectFileIds, string taskTemplateId, EventHandler<TaskStatusEventArgs> statusEventHandler, EventHandler<TaskMessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Guid> | projectFileIds | The files to run the task on. |
System.String | taskTemplateId | The ID of the task template (i.e. the type of task) to run. |
System.EventHandler<TaskStatusEventArgs> | statusEventHandler | Event handler for task status events. |
System.EventHandler<TaskMessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
AutomaticTask | Information about the automatic task that has been run. |
RunAutomaticTasks(IEnumerable<Guid>, IEnumerable<String>, String, EventHandler<TaskStatusEventArgs>, EventHandler<TaskMessageEventArgs>)
Runs a sequence of automatic tasks on a set of project files.
Declaration
TaskSequence RunAutomaticTasks(IEnumerable<Guid> projectFileIds, IEnumerable<string> taskTemplateIds, string complexTaskName, EventHandler<TaskStatusEventArgs> statusEventHandler, EventHandler<TaskMessageEventArgs> messageEventHandler)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<System.Guid> | projectFileIds | The files to run the task on. |
System.Collections.Generic.IEnumerable<System.String> | taskTemplateIds | The IDs of the task templates (i.e. the types of task) to run. |
System.String | complexTaskName | The name of the set of tasks to be run together |
System.EventHandler<TaskStatusEventArgs> | statusEventHandler | Event handler for task status events. |
System.EventHandler<TaskMessageEventArgs> | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
SetAnalysisBands(Int32[])
Sets the analysis bands minimum values for the package project
Declaration
void SetAnalysisBands(int[] minimumMatchValues)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | minimumMatchValues |
UpdateSettings(Language, ISettingsBundle)
Updates the settings for a specific target language.
Declaration
void UpdateSettings(Language targetLanguage, ISettingsBundle settings)
Parameters
Type | Name | Description |
---|---|---|
Language | targetLanguage | The target language for which to update the settings. |
ISettingsBundle | settings | A settings bundle representing the new target language settings. |
Remarks
Note that this method will only update the target-language settings. If you have changed the parent project-level settings too, thee need to be updated with a separate call to UpdateSettings(ISettingsBundle).
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when |
System.ArgumentNullException | Thrown if |
UpdateSettings(ISettingsBundle)
Updates the project package-level settings.
Declaration
void UpdateSettings(ISettingsBundle settings)
Parameters
Type | Name | Description |
---|---|---|
ISettingsBundle | settings | A settings bundle object containing the new project package settings. |
Remarks
The project package settings will be completely replaced with the specified settings, so any settings not present in the updated settings bundle will revert to their defaults.
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if |
UpdateTermbaseConfiguration(TermbaseConfiguration)
Updates the termbase-related settings for this project.
Declaration
void UpdateTermbaseConfiguration(TermbaseConfiguration termbaseConfiguration)
Parameters
Type | Name | Description |
---|---|---|
TermbaseConfiguration | termbaseConfiguration | A TermbaseConfiguration object containing all termbase-related configuration for this project. This can either be newly created termbase configuration object or one that was retrieved via GetTermbaseConfiguration(Boolean). |
UpdateTranslationProviderConfiguration(TranslationProviderConfiguration)
Updates the project-wide translation provider configuration.
Declaration
void UpdateTranslationProviderConfiguration(TranslationProviderConfiguration translationProviderConfiguration)
Parameters
Type | Name | Description |
---|---|---|
TranslationProviderConfiguration | translationProviderConfiguration | The translation provider configuration. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when |
System.ArgumentException | Thrown when |