Class AbstractFileContentProcessingAutomaticTask
Base class for file content processing automatic task.
Inheritance
Inherited Members
Namespace: Sdl.ProjectAutomation.AutomaticTasks
Assembly: Sdl.ProjectAutomation.AutomaticTasks.dll
Syntax
public abstract class AbstractFileContentProcessingAutomaticTask
Constructors
AbstractFileContentProcessingAutomaticTask()
Declaration
protected AbstractFileContentProcessingAutomaticTask()
Properties
Project
Gets the project associated with this task.
Declaration
public IProject Project { get; }
Property Value
| Type | Description |
|---|---|
| IProject |
TaskFiles
Gets the task files associated with this task.
Declaration
public ProjectFile[] TaskFiles { get; }
Property Value
| Type | Description |
|---|---|
| ProjectFile[] |
TaskId
Gets the id of the task.
Declaration
public string TaskId { get; }
Property Value
| Type | Description |
|---|---|
| String |
Methods
Cancel(Boolean)
Called when user request cancel manually.
Declaration
public virtual void Cancel(bool doRollback)
Parameters
| Type | Name | Description |
|---|---|---|
| Boolean | doRollback |
ConfigureConverter(ProjectFile, IMultiFileConverter)
Configures the converter to add your content handler.
Declaration
protected abstract void ConfigureConverter(ProjectFile projectFile, IMultiFileConverter multiFileConverter)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectFile | projectFile | The file to processed in this task. |
| IMultiFileConverter | multiFileConverter | The converter. |
CreateReport(String, String, String)
Creates a report for this task. Generally the report data is created in xml format. The xml data will be provided to function as the data parameter. When a report is created the xml data will be stored as a xml file residing normally under the project/Reports folder. To render the report properly in the report view, a xslt file should be present in the task implementation project as embeded resource. The xlst file must have extension .xsl.
Declaration
public void CreateReport(string name, string description, string data)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name of the report. |
| String | description | The description of this Report. |
| String | data | The xml data of this report. |
CreateReport(String, String, String, LanguageDirection)
Creates a report with a specified language for this task. Generally the report data is created in xml format. The xml data will be provided to function as the data parameter. When a report is created the xml data will be stored as a xml file residing normally under the project/Reports folder. To render the report properly in the report view, a xslt file should be present in the task implementation project as embeded resource. The xlst file must have extension .xsl.
Declaration
public void CreateReport(string name, string description, string data, LanguageDirection languageDirection)
Parameters
| Type | Name | Description |
|---|---|---|
| String | name | The name of the report. |
| String | description | The description of this Report. |
| String | data | The xml data of this report. |
| LanguageDirection | languageDirection | The language direction of this report. |
GetSetting<TSettings>()
Gets the task settings of the project.
Declaration
protected TSettings GetSetting<TSettings>()
where TSettings : ISettingsGroup, new()
Returns
| Type | Description |
|---|---|
| TSettings |
Type Parameters
| Name | Description |
|---|---|
| TSettings |
GetWordCounter(ProjectFile)
Gets the WordCounter for a file.
Declaration
public WordCounter GetWordCounter(ProjectFile projectFile)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectFile | projectFile | The input file. |
Returns
| Type | Description |
|---|---|
| WordCounter | The WordCounter object |
OnFileComplete(ProjectFile, IMultiFileConverter)
Called when a file processing is finished. Derived class should implement this method to return information to indicate if the resulted file content should be uploaded.
Declaration
public virtual bool OnFileComplete(ProjectFile projectFile, IMultiFileConverter multiFileConverter)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectFile | projectFile | |
| IMultiFileConverter | multiFileConverter |
Returns
| Type | Description |
|---|---|
| Boolean | Returns true to indicate the file is updated. By default it returns false. |
OnInitializeTask()
Called when the task is initialized. At this moment the Project and TaskFiles are available.
Declaration
protected virtual void OnInitializeTask()
ShouldProcessFile(ProjectFile)
Check if the task should process the file.
Declaration
public virtual bool ShouldProcessFile(ProjectFile projectFile)
Parameters
| Type | Name | Description |
|---|---|---|
| ProjectFile | projectFile | The project file. |
Returns
| Type | Description |
|---|---|
| Boolean |
TaskComplete()
Called when the task is complete.
Declaration
public virtual void TaskComplete()