| IFileTypeManager Interface |
This is the main access point for file conversion operations.
The file type manager holds a prioritized list of file type definitions. The order of file type definitions is important, as it determines which file types take precedence over others in case multiple file type definitions could be used to process the same file. The most significant file type definition appears first in the list.
In implementations, the file type manager is often pre-configured with a set of file type definitions in the host application. However, the list can also be explicitly manipulated by calling AddFileTypeDefinition(IFileTypeDefinition), InsertFileTypeDefinition(Int32, IFileTypeDefinition) or RemoveFileTypeDefinition(IFileTypeDefinition). File type definitions can be instantiated from existing files or resources using the FileTypeDefinitionFactory.
Call one of the overloaded GetConverter...() methods to use the file type definitions to automatically detect file types and initialize a IMultiFileConverter to process the content.
Namespace: Sdl.FileTypeSupport.Framework.IntegrationApi
The IFileTypeManager type exposes the following members.
| Name | Description | |
|---|---|---|
| AddFileTypeDefinition |
Appends a file type definition to the collection.
| |
| BuildAdditionalGeneratorsInfo |
Helper method to create additional generator information so that it can be used by filter component builders.
| |
| BuildBilingualGenerator(IBilingualDocumentWriter) |
Helper function to create a bilingual generator for a bilingual document writer, so that
it can be used with relevant overloads to GetConverter.
| |
| BuildBilingualGenerator(IFileTypeDefinition) |
Helper function used by the file type manager implementation and other components that need to
instantiate a bilingual generator for a specific file type.
| |
| BuildDefaultBilingualGenerator |
Helper function that constructs an instance of a generator for the default bilingual file format,
if set.
| |
| BuildExtractor |
Helper function used by the file type manager implementation and other components that need to
create components that are normally used through the file converters objects.
Determines the best matching file type for the specified file according to the rules described in the documentation of GetConverter(String, CultureInfo, Codepage, EventHandlerMessageEventArgs) and returns an initialized file extractor that can be used to process the file. | |
| BuildFileExtractor(IBilingualParser, IFileTypeComponentBuilder) |
Helper method to create a file extractor so that it can be used by filter component builders.
| |
| BuildFileExtractor(INativeExtractor, IFileTypeComponentBuilder) |
Helper method to create a file extractor so that it can be used by filter component builders.
| |
| BuildFileGenerator(IBilingualWriter) |
Helper method to create a file generator so that it can be used by filter component builders.
| |
| BuildFileGenerator(INativeGenerator) |
Helper method to create a file generator so that it can be used by filter component builders.
| |
| BuildFileTypeInformation |
Helper method to create file type information so that it can be used by filter component builders.
| |
| BuildGeneratorInfo |
Helper method to create generator information so that it can be used by filter component builders.
| |
| BuildNativeExtractor |
Helper method to create a native extractor so that it can be used by filter component builders.
| |
| BuildNativeGenerator(INativeFileWriter) |
Helper method to create a native generator so that it can be used by filter component builders.
| |
| BuildNativeGenerator(IPersistentFileConversionProperties) |
Helper function used by the file type manager implementation and other components that need to
create a file generator component from a specific file type definition.
Creates and initializes a file generator that can be used to write native output files. | |
| BuildNativeGeneratorWithVerifiers |
This is an alternative implementation of the BuildNativeGenerator(IPersistentFileConversionProperties) method, which creates a generator with
objects that will perform native verification of the generated file.
| |
| BuildNativeSubContentExtractor |
Helper method to create a native sub-content extractor so that it can be used by filter component builders.
| |
| BuildNativeSubContentGenerator |
Helper method to create a native sub content generator so that it can be used by filter component builders.
| |
| BuildPreviewSetsFactory |
Helper method to create a preview sets factory so that it can be used by filter compnent builders.
| |
| BuildQuickTagsFactory |
Helper method to create a QuickTags factory so that it can be used by filter component builders.
| |
| BuildSubContentExtractor(IBilingualParser, IFileTypeComponentBuilder) |
Helper method to create a sub-content extractor so that it can be used by filter component builders.
| |
| BuildSubContentExtractor(INativeSubContentExtractor, IFileTypeComponentBuilder) |
Helper method to create a sub-content file extractor so that it can be used by filter component builders.
| |
| BuildSubContentGenerator(IBilingualWriter) |
Helper method to create a sub content generator so that it can be used by filter component builders.
| |
| BuildSubContentGenerator(INativeSubContentGenerator) |
Helper method to create a sub content generator so that it can be used by filter component builders.
| |
| BuildVerifierCollection |
Helper method to create a verifier collection so that it can be used by filter component builders.
| |
| ClearFileTypeDefinitions |
Removes all file type definitions from the collection.
| |
| CreateFileTypeDefinition(String) |
Creates a file type definition based on the filter definition ID of component builder which should be used
to create this filter.
| |
| CreateFileTypeDefinition(String, FileTypeProfile) |
Creates a file type definition based on the Id and a profile override.
The FilterManager must discover the actual component builder associated with this definition and create a new definition based on it.
If a profileOverride has been supplied, then this should override the FileTypeInformation for that definition.
| |
| CreateFileTypeDefinition(IFileTypeComponentBuilder, FileTypeProfile) |
Creates a file type definition based on component builder and overrides the FileTypeInformation with the supplied profile override.
| |
| FindFileTypeDefinition |
Locates a file type definition from the collection using ids.
| |
| GetAllMatchingFileTypeDefinitions | Returns the file type definitions that can operate on the specified file. Each file type definition is evaluated in order to determine if it can process the file, which may involve invoking the corresponding file sniffer. Only file type definitions that are enabled and not hidden are evaluated. | |
| GetConverter(IBilingualParser) |
Creates and initializes a file converter to use a specific bilingual parser, and not output to anything in particular.
| |
| GetConverter(String, EventHandlerMessageEventArgs) |
Creates and initializes a file converter that can be used to read a single bilingual file, without
outputting content to anything in particular.
| |
| GetConverter(String, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter for reading native files, without passing the output to anything.
| |
| GetConverterToBilingual(IBilingualParser, IBilingualDocumentGenerator, BilingualDocumentOutputPropertiesProvider) |
Creates and initializes a file converter for an existing bilingual parser and writer.
| |
| GetConverterToBilingual(String, IBilingualDocumentGenerator, BilingualDocumentOutputPropertiesProvider, EventHandlerMessageEventArgs) |
Creates and initializes a file converter for a single file, typically of the default bilingual file type.
The specified bilingual document generator will be used for output.
The file type definitions are tested in order, and the first file type definition that
matches the input file is used. The following steps are used to determine if
a file type definition matches the file:
| |
| GetConverterToBilingual(String, IBilingualDocumentGenerator, BilingualDocumentOutputPropertiesProvider, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter using the filters that best match a set of native files.
The file converter can then be used to process all of the files as one document. The specified
bilingual writer will be used for output.
The file type definitions are tested in sequence, and the first file type definition that
matches a file is used for each file. The following steps are used to determine if
a file type definition matches a file:
| |
| GetConverterToDefaultBilingual(IBilingualParser, String) |
Creates and initializes a file converter to write a bilingual output file in the default format, reading
input from a specified bilingual parser.
| |
| GetConverterToDefaultBilingual(String, String, EventHandlerMessageEventArgs) |
Creates and initializes a file converter in order to read a single (typically bilingual) input file and
write a bilingual output file in the default format.
The converter will automatically use the file type that best matches the file to be converted. The file type definitions are each tested in sequence, and the first file type definition that matches the input file is used. The following steps are used to determine if a file type definition matches:
| |
| GetConverterToDefaultBilingual(String, String, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter in order to create a bilingual file in the default format.
The converter will automatically use the filters that best match the native files to be converted. These converters are selected as described below. The file type definitions are each tested in sequence, and the first file type definition that matches a file is used for each file. The following steps are used to determine if a file type definition matches a file:
| |
| GetConverterToNative(IBilingualParser, OutputPropertiesProvider) |
Creates a converter for writing native output files for content read by a specified bilingual parser.
| |
| GetConverterToNative(String, OutputPropertiesProvider, EventHandlerMessageEventArgs) |
Creates a converter for parsing a single file and writing native output files.
This is intended for bilingual file types, in which the languages and codepage can be deducted automatically from the file content. This version is typically used for parsing SDL XLIFF documents (where support for these have been installed as another bilingual file type). However, it could also be used for processing individual native files in which source language (and codepage) can be deducted from the file content. | |
| GetConverterToNative(String, OutputPropertiesProvider, CultureInfo, Codepage, EventHandlerMessageEventArgs) |
Creates and initializes a file converter for reading native files, doing processing on them and
creating native files as output in one single pass.
The file type definitions are tested in sequence, and the first file type definition that matches a file is used for each file. The following steps are used to determine if a file type definition matches a file:
| |
| InsertFileTypeDefinition |
Inserts a file type definition into the collection at a specific priority position.
| |
| RemoveFileTypeDefinition |
Removes a file type definition from the collection.
If no such file type definition exists in the collection, nothing happens.
|
| Name | Description | |
|---|---|---|
| ConfigurationVersionInformation | Provides information on the version of the configuration information that is used to instantiate the current instance of the IFileTypeManager. This can be used to determine whether the instance is working with the latest version of configuration information that the host application requires. For instance, applications may transfer their file type manager configuration information from one system to another. By checking this property the application can determine the state of the configuration, and perform additional tasks to ensure the configuration is in the format that the application requires (e.g. deploy additional filters that have only been released in the latest version of the application). | |
| DefaultBilingualFileTypeDefinition |
The file type definitions that should be used as the default bilingual file type, or null if none.
| |
| FileTypeDefinitionFactory |
Provides access to the implementation used to instantiate file type
definitions. Can be used to explicitly create a file type definition
that can be added to the manager by calling AddFileTypeDefinition(IFileTypeDefinition)
or InsertFileTypeDefinition(Int32, IFileTypeDefinition).
| |
| FileTypeDefinitions | The file type definitions that are currently known to this instance of the file type manager. The order of the file type definitions defines their relative priority, with the most significant file type definition appearing first. | |
| SettingsBundle |
The settings bundle containing the settings used by components of the
FileTypeManager. This property should be set before any operations
requiring the use of settings are invoked (for example, GetConverterToBilingual
implementations) or the operation may not work as expected.
This property can return null if no settings bundle has been set.
|
Actual file type manager instances are often provided by the application that hosts the framework, in which case they are often pre-configured from some configuration (e.g. through the spring framework).