IDocumentMIMEType¶
- class IDocumentMIMEType¶
Bases:
ImpactCOMWrapperBase- Description:
Represents a document MIME type indicating the types of data that files contain.
- Remarks:
The MIME type assigned to a document is used to Identify the data that a file contains, and is useful in searching for documents of a specific type. Limit the size of files that can be stored in the document repository. Associate an IDocumentMetaExtractor for automatically extract data from the file contents. Associate an IDocumentThumbnailGenerator for generating thumbnails for files. Introduced in Impact 9.0.0.83.
Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance
- property can_delete¶
Gets can_delete.
- Description:
Determines if the MIME type can be safely deleted.
- Remarks:
A MIME type cannot be deleted if it has associated documents.
- Returns:
The value of can_delete.
- Return type:
can_delete (bool)
- property document_type¶
Gets document_type.
- Description:
The default IDocumentType for this MIME type object.
- Returns:
The value of document_type.
- Return type:
- property extensions¶
Gets Extensions.
- Description:
A list of file extensions that map to this MIME type object.
- Remarks:
A semi-colon separated list of file extensions. Extensions should not include the period character and are case-insensitive. Altering the Extensions property will not automatically associate any existing documents with this MIME type. You should ensure you have configured all appropriate MIME types and extensions before adding documents. You cannot set the Extensions for the default MIME type.
- Returns:
The value of Extensions.
- Return type:
extensions (str)
- property max_file_size_mb¶
Gets max_file_size_mb.
- Description:
The maximum file size for files
- Remarks:
Setting the max_file_size_mb to zero allows files of any size to be added - within the limits of the underlying document provider. It is recommended that you always configure an appropriate max_file_size_mb for the default document MIME type. Users with the appropriate user privilege can override this restriction.
- Returns:
The value of max_file_size_mb.
- Return type:
max_file_size_mb (int)
- property meta_extractor_key¶
Gets meta_extractor_key.
- Description:
Associates an IDocumentMetaExtractor with an IDocumentMIMEType object.
- Remarks:
Impact supports a plugin architecture for document meta-data extractors. When you associate a meta-data extractor with a MIME type any documents that are added or updated will automatically read data from the files and assign values to specific document columns. Associating a meta-extractor after documents have been created will not automatically extract any meta-data unless those documents are updated. You cannot set the meta_extractor_key for the default MIME type.
- Returns:
The value of meta_extractor_key.
- Return type:
meta_extractor_key (str)
- Examples:
- property mime¶
Gets MIME.
- Description:
The unique MIME identifier.
- Remarks:
The MIME identifier should follow the Internet standards for identifying each type. A default document MIME type can be configured with a MIME property of ‘*’.
- Returns:
The value of MIME.
- Return type:
mime (str)
- property modified_date_time¶
Gets modified_date_time.
- Description:
The date and time that this IDocumentMIMEType was last modified.
- Remarks:
Introduced in Impact 10.0.0.69
- Returns:
The value of modified_date_time.
- Return type:
modified_date_time (datetime)
- property name¶
Gets Name.
- Description:
The name of the MIME type.
- Returns:
The value of Name.
- Return type:
name (str)
- property name_translated_xml¶
Gets name_translated_xml.
- Description:
The XML used to store translations for the Name property.
- Remarks:
This property is used internally.
- Returns:
The value of name_translated_xml.
- Return type:
name_translated_xml (str)
- property thumbnail_generator_key¶
Gets thumbnail_generator_key.
- Description:
Associates an IDocumentThumbnailGenerator with an IDocumentMIMEType object.
- Remarks:
Impact supports a plugin architecture for document thumbnail image generation. When you associate a thumbnail generator with a MIME type any documents will use that thumbnail generator to create thumbnail images when required. See IDocument.get_thumbnail_file for details of how thumbnail images are generated. To associate a static thumbnail image with a MIME type use the load_thumbnail_from_file or load_thumbnail_from_stream method. You cannot set the thumbnail_generator_key for the default MIME type.
- Returns:
The value of thumbnail_generator_key.
- Return type:
thumbnail_generator_key (str)
- Examples:
- delete()¶
- Description:
Permanently deletes the document MIME type.
- Remarks:
You should check can_delete to determine if you can delete a MIME type.
- do_update()¶
- Description:
Update the modified MIME type directly in the database.
- Remarks:
When modifying one or more MIME type properties update all the values with a single call to do_update.
- load_thumbnail_from_file(size, file_name)¶
- Description:
Loads a static thumbnail image from the file specified.
- Remarks:
Any image that is assigned will automatically be resized and converted to a PNG format. It is recommended you always supply a PNG image with a transparent background for static thumbnails.
- Parameters:
size (ipMIMETypeThumbnailSize) – The size of the static thumbnail image being set.
file_name (str) – The full path to the image file.
- load_thumbnail_from_stream(size, stream)¶
- Description:
Loads a static thumbnail image from the IStream specified.
- Remarks:
Any image that is assigned will automatically be resized and converted to a PNG format. It is recommended you always supply a PNG image with a transparent background for static thumbnails.
- Parameters:
size (ipMIMETypeThumbnailSize) – The size of the static thumbnail image being set.
stream (win32com.client.Dispatch) – The IStream containing the image file data.
- name_translated(language_id, exact_language_match)¶
- Description:
Gets the translated version of the document MIME type Name, in the language specified.
- Remarks:
You should check supports_translations to determine if translations are supported. For a more detailed explanation of the parameters, please see the notes for the master_setting_name_translated method.
- Parameters:
language_id (any) – A string or enum representing the language wanted.
exact_language_match (bool) – Specifies what to do if there is no translation for the specified language.
- save_thumbnail_to_file(size, file_name, file_format, transparent_to_colour_r_g_b)¶
- Description:
Saves a thumbnail image to a file.
- Remarks:
The file_format parameter must be one of ffPNG, ffMetafile, ffBitmap, ffJPG, ffTIFF.
- Parameters:
size (ipMIMETypeThumbnailSize) – The thumbnail size you want to save.
file_name (str) – The full path to the destination file to be created.
file_format (ipFileFormat) – The required image format.
transparent_to_colour_rgb (int) – To generate a thumbnail image which has a specific background colour you can pass an RGB value. If the static thumbnail has any transparency then it will be assigned this colour. To retain any transparency for the static thumbnail image set this parameter to -1. This is only possible if the file_format specified also supports transparency.
- Examples:
- save_thumbnail_to_stream(size, file_format, transparent_to_colour_r_g_b)¶
- Description:
Saves a thumbnail image to a stream.
- Remarks:
The file_format parameter must be one of ffPNG, ffMetafile, ffBitmap, ffJPG, ffTIFF.
- Returns:
The return value is an IStream containing the image data.
- Parameters:
size (ipMIMETypeThumbnailSize) – The thumbnail size you want to save.
file_format (ipFileFormat) – The required image format.
transparent_to_colour_rgb (int) – To generate a thumbnail image which has a specific background colour you can pass an RGB value. If the static thumbnail has any transparency then it will be assigned this colour. To retain any transparency for the static thumbnail image set this parameter to -1. This is only possible if the file_format specified also supports transparency.