Home » Documentation » Media module
Media for products and other things are handled by the media module. This consists of:
- A database schema with a couple of tables containing information about the media files
- A file system storage of the actual files
- Settings for configuring the paths to the file storages
- The Litium.Scensum.Media/Media.Contract assemblies containing the functionality
- A startup web application called Litium.Scensum.Media.Web
- A GUI in BackOffice under its own tab
The database
tMedia
The media items.
tMediaFolder
Folders to place media items in.
tMediaFormat
Media formats which media is connected to. E.g. Gif, Jpeg, Flash, Doc, Pdf. To add support for a new format, simply add a new row to this table.
tMediaFormatGroup
The image formats are placed in a group to allow certain extra functionality for them. E.g. on-demand scaling. This could be done for other formats like video-files.
tImage
Media items that are images also have a record in this table that adds extra information like width, height and alternative text.
tImageSize
Here you can set up the sizes that are available on the public site when using on-demand scaling. You can also set the quality for each size.
tImageTranslation
This table contains translation of alternative text for each language.
File storage
Scensum is delivered with this structure by default. This can be changed in the Media.xml setting file.
\Files\MediaArchive
Here all media files are stored. The sub path to an item looks like this: \Files\MediaArchive\0012\3456\data.jpg
\0012\3456\ is the id of the media item. Splitted into separate folders to keep the folder from getting too large
\Files\MediaArchive\Temp
This is a temporary directory used when uploading files.
\Files\ImageCache
When scaling images on-demand, the scaled image is cached in this directory. Because of this, it's important that the IIS-user has write privileges for this directory. The path to a cache image looks like this: \Files\ImageCache\0012\3456\150x150-90\data.jpg
\0012\3456\ is the id of the media item
150x150 is the width and height constraint of the scaled image
-90 is the quality of the scaled image
\Files\MediaFormatIcon
This folder contains the icons displayed in backoffice for each file type. When adding a new media format you can add an icon here just by naming it "EXTENSION.png".
Media urls
The media files are delivered by the Litium.Scensum.Media.Web application. This should be mapped in IIS as a virtual directory named "mediaarchive" beneath the channels application. So the path to this is www.mycompany.com/mediaarchive or www.mycompany.com/shop/mediaarchive.
The url to a media item looks like this:
/mediaarchive/00123456/sony-playstation-3.jpg
00123456 is the id of the media item
"sony-playstation-3" can be any text, it's good to use something relevant like a product title (cleaned from åäö, spaces etc.)
The path above will point to the original image. The url to a scaled image looks like this:
/mediaarchive/00123456/thumbnail/sony-playstation-3.jpg
00123456 is the id of the media item
"thumbnail" the common name of the size in tImageSize
"sony-playstation-3" can be any text, it's good to use something relevant like a product title (cleaned from åäö, spaces etc.)