Interface IPackage
Namespace: SdlSdl.ProjectAutomationCore
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 |
---|---|
DateTime |
LocalProjectFolder
The local folder used to store project files.
Declaration
string LocalProjectFolder { get; }
Property Value
Type | Description |
---|---|
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 |
---|---|
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 |
---|---|
IEnumerableLanguage |
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 |
---|---|
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 |
---|---|---|
IEnumerablestring | filePaths |
Returns
Type | Description |
---|---|
IEnumerableProjectFile | 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 |
---|---|---|
string | fileToAdd | |
string | folderInProject | |
Language | language | |
Guid | id | |
string | filterDefinitionId | |
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 |
---|---|---|
string | manualTaskName | The name of the manual task. Typically "Translate" or "Review", but other task names can be |
string | assignToUser | The user to assign the task to. |
DateTime | dueDate | The date by which the task should be completed. |
IEnumerableTaskFileInfo | 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 |
---|---|
IEnumerableProjectFile |
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 |
---|---|
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 |
---|---|
IEnumerableProjectFile | An array of ProjectFile objects, representing all the files in this project with the specified target language. |
GetTermbaseConfiguration(bool)
Retrieves all termbase-related settings that are associated with this project.
Declaration
TermbaseConfiguration GetTermbaseConfiguration(bool obtainCopy)
Parameters
Type | Name | Description |
---|---|---|
bool | 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 |
---|---|
IEnumerableProjectFile | An array of ProjectFile objects, representing all the translatable files in this project. |
GetTranslationMemoryInstances(bool)
Returns a instance of each translation memory associated to the package
Declaration
IEnumerable<ITranslationMemory> GetTranslationMemoryInstances(bool performUpdateOnly)
Parameters
Type | Name | Description |
---|---|---|
bool | performUpdateOnly |
Returns
Type | Description |
---|---|
IEnumerableITranslationMemory |
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 |
---|---|---|
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 |
---|---|---|
IEnumerableGuid | projectFileIds | The files to run the task on. |
string | taskTemplateId | The ID of the task template (i.e. the type of task) to run. |
EventHandlerTaskStatusEventArgs | statusEventHandler | Event handler for task status events. |
EventHandlerTaskMessageEventArgs | 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 |
---|---|---|
IEnumerableGuid | projectFileIds | The files to run the task on. |
IEnumerablestring | taskTemplateIds | The IDs of the task templates (i.e. the types of task) to run. |
string | complexTaskName | The name of the set of tasks to be run together |
EventHandlerTaskStatusEventArgs | statusEventHandler | Event handler for task status events. |
EventHandlerTaskMessageEventArgs | messageEventHandler | Event handler for message events. |
Returns
Type | Description |
---|---|
TaskSequence | Information about the sequence of tasks that has been run. |
SetAnalysisBands(int[])
Sets the analysis bands minimum values for the package project
Declaration
void SetAnalysisBands(int[] minimumMatchValues)
Parameters
Type | Name | Description |
---|---|---|
int | 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 |
---|---|
ArgumentException | Thrown when |
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
<p>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 |
---|---|
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(bool). |
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 |
---|---|
ArgumentNullException | Thrown when |
ArgumentException | Thrown when |