Module: alfresco/renderers/FileType

alfresco/renderers/FileType

This renders an image that represents the type of file that the assigned node represents.
Author:
  • Dave Draper
License:
Source:

Mixes In

  • module:alfresco/renderers/_JsNodeMixin

Members

altText :string

The alt text for the file type image.
Type:
  • string
Source:

customExtnMappings :object

Type:
  • object
Default Value:
  • null
Source:

customTypeMappings :object

Type:
  • object
Default Value:
  • null
Source:

defaultExtnMappings :object

The default mappings.
Type:
  • object
Default Value:
  • {"aep": "aep", "ai": "ai", "aiff": "aiff", "asf": "video", "asnd": "asnd", "asx": "video", "au": "audio", "avi": "video", "avx": "video", "bmp": "img", "css": "text", "divx": "video", "doc": "doc", "docx": "doc", "docm": "doc", "dotx": "doc", "dotm": "doc", "eml": "eml", "eps": "eps", "fla": "fla", "flv": "video", "fxp": "fxp", "gif": "img", "htm": "html", "html": "html", "indd": "indd", "jpeg": "img", "jpg": "img", "key": "key", "mkv": "video", "mov": "video", "movie": "video", "mp3": "mp3", "mp4": "video", "mpeg": "video", "mpeg2": "video", "mpv2": "video", "msg": "eml", "numbers": "numbers", "odg": "odg", "odp": "odp", "ods": "ods", "odt": "odt", "ogg": "video", "ogv": "video", "pages": "pages", "pdf": "pdf", "png": "img", "ppj": "ppj", "ppt": "ppt", "pptx": "ppt", "pptm": "ppt", "pps": "ppt", "ppsx": "ppt", "ppsm": "ppt", "pot": "ppt", "potx": "ppt", "potm": "ppt", "ppam": "ppt", "sldx": "ppt", "sldm": "ppt", "psd": "psd", "qt": "video", "rtf": "rtf", "snd": "audio", "spx": "audio", "svg": "img", "swf": "swf", "tif": "img", "tiff": "img", "txt": "text", "wav": "audio", "webm": "video", "wmv": "video", "xls": "xls", "xlsx": "xls", "xltx": "xls", "xlsm": "xls", "xltm": "xls", "xlam": "xls", "xlsb": "xls", "xml": "xml", "xvid": "video", "zip": "zip"}
Source:

defaultTypeMappings :object

Default mappings from objects to types.
Type:
  • object
Source:

imageUrl :string

The URL to the image. Available parameters to replace are {prefix} {type} and {size}
Type:
  • string
Default Value:
  • require.toUrl("alfresco/renderers/css/images/filetypes/{prefix}-{type}-{size}.png")
Source:

size :string

The size of the image. By default this will be "large" but can be set to "small" or "medium". The default widget has 3 image sizes: 16px, 32px and 48px and changing the size will change the size of image that is used.
Type:
  • string
Default Value:
  • "large"
Source:

Methods

createWidgetDom()

Overrides the inherited function to construct the DOM for the widget using native browser capabilities.
Since:
  • 1.0.101
Source:

getExtension() → {string}

Gets the extension for the current item. It does this by looking for the last "." in the fileName.
Source:
Returns:
The extension for the current item
Type
string

getImagePrefix() → {string}

This returns a String that represents the prefix for the element src based on the file name of the current item. For example if a filename ends in ".jpg " then this is likely to return a prefix of "image".
Source:
Returns:
A string representation of the image prefix.
Type
string

getImageSize() → {string}

Returns a String that represents the size of the image. This string will be including in the "src" attribute of the element used to display the file type. By default "large" maps to "48", "medium" to "32" and "small" to "16".
Source:
Returns:
The string that represents the correct image size to use in the "src" attribute for the image.
Type
string

getImageType() → {string}

This returns a String that represents the type of file that an image should be generated for.
Source:
Returns:
The string representing the type.
Type
string

postCreate()

Source:

postMixInProperties()

Set up the attributes to be used when rendering the template.
Source: