Asset files and/or their metadata can be easily exported from Asset Bank.
The first step in the process to do this is to run a search in order to define the set of assets that will be exported. If you scroll down to the bottom of the search results page, a link is shown below the results titled "Export all results..." - clicking this link will show a page on which you may specify how the export should work.
Alternatively, you can add assets to your lightbox, view the lightbox and select certain assets to export using the 'export assets' option from the 'more actions' drop down.
Exports can be run by admin users and optionally org unit admin users (if the setting org-unit-admins-can-export) or standard users if a group that they are in has been ticked as 'can export assets' (from the Admin > Groups > edit page).
This page allows you to run an export, exporting either just the asset metadata, or the metadata and the asset files themselves. The metadata can be written to one of two different file formats
- Text/tab delimited - this is the default option
- Native Excel 2007 Format - this can be optionally selected by ticking the relevant checkbox. Once selected it will offer you the opportunity to include the asset images in the first column of the spreadsheet. They will be sized according to a usage type selected from a listbox on the form (the listbox is populated by an admin user selecting certain usage types to show their formats on the export page from Admin > Download Options - see usage types help for more information).
If you choose to export the asset files they will be added to one or more zip files.
The file that is generated will contain all the chosen assets' metadata, both standard attributes such as Filename, DateAdded, etc. plus any additional flexible attributes that are currently configured. Each attribute's column is identified in a header row, with the attribute's name appearing at the top of the column. Flexible attribute names will be given a prefix of "att:" and will also include the Id of the attribute.
The options presented on the export page are described below:
Append to filename
If you are generating an export file for a particular purpose, you can append a text value to the filename to help you identify it later. If the application setting export-append-mandatory equals 'true' this field will need to be filled in to continue with the export.
Any text you enter here will be written to the exported metadata file in a header, so again you can use this to help you identify the export at a later date (for example, if you are archiving assets this could contain a summary of the archive's contents).
When Asset Bank is configured to be multi-lingual, this option allows you to control whether any translations entered for assets are also exported. If this is selected, each text-based attribute will have multiple columns in the resulting file, one for the default language, and one for each of the additional languages. Each additional language will be identified in the column header by its (typically) 2-letter code (e.g. att:lang_fr:Title).
Export asset files
If this checkbox is left unchecked, only the metadata text file will be generated. Furthermore, the resulting file will be written in such a way that if it is subsequently used in a metadata import, the data will be matched up against the source assets. This process can be used to support an offline bulk edit, where metadata is manipulated in the exported txt file and then re-imported. It is also useful for taking backups of metadata that can later be restored if required.
If the 'Export asset files' checkbox is selected, one or more zip files will be generated containing the original asset files, which can be downloaded alongside the metadata file. In this case, the metadata file is generated in a way that is suited to being later matched up with the exported asset files. For instance, any related assets are identified by their filename rather than the id in Asset Bank.
If application setting:
is true, any converted/working versions of files will also be exported. They will be named the same as the main asset files that accompany, but with a prefix (typically '_') taken from setting substitute-file-prefix. These files will be used during a re-import so that working version (for example, versions of an image before it was rotated) are preserved.
Export files to directory
By default, exported assets are packaged into zip files for download via the browser (as described above), however by de-selecting the 'Export as zip file(s)' checkbox will result in the files being written instead to a hard-drive directory. The directory will be named the same as the metadata file (without the suffix) which will be placed in the 'export' directory in the current system storage device.
Export immediate children
If your Asset Bank has types enabled then you can optionally include immediate child data in your export file by checking this option
Export attribute template
You can define attribute templates (i.e. a set of attributes) from the Admin > Attributes > Display Attributes > Export area to use when exporting. If you have any export templates defined then they will be presented as list box on the export form and when you run an export using a template only the values for the selected attributes will be exported. You still have the option of not selecting a template which will export all attribute values for the assets in question.
Exported Asset Filenames
The format of the filenames used by Asset Bank when adding asset files to the downloadable zip files is configurable using the setting exported-asset-filename-format. Its value can contain the characters 'i', 'f' and/or 't' in any order, symbolising Id, Filename and Title (name) respectively. For example, the default value ("if") specifies a format containing the Id followed by the Filename. By default these values will be separated by a dot (e.g. 1234.MyFileName.jpg) although the separator character is also customisable using setting exported-asset-filename-field-delimiter. Note that where instances of the exported-asset-filename-field-delimiter value are found in the filename elements (for example if the title is being used and contains a '.' character) they will be replaced with the value of exported-asset-filename-delimiter-replacement, which is '_' by default.
There is also a further filename format that can be used in special cases: specifying "fl" denotes that the name of the file of the asset in the repository (the FileLocation column) will be used. This may be useful when a whole Asset Bank repository is migrated from one instance to another, and the asset files are being bulk uploaded from an existing Asset Bank repository filesystem.
Exported Metadata Filename
It is also possible to customise how the filename for the asset metadata export file is generated. The setting export-file-stem can be used to specify a custom prefix for the filename (the default is 'export') and export-file-name-dt can be set to true or false to control whether the date & time are appended to the chosen prefix.
My default, the metadata file is given a ".xls" extension, so that it is automatically opened using Excel. However, as the file is not strictly in xls format it can sometimes be mis-interpreted by Excel. If this happens (or if Excel is not available to admin users) an alternative file extension can be provided in setting export-file-extension.
The format of date values written to the export file can be specified using the application setting export-date-format. By default this is set to "dd/MM/yyyy hh:mm:ss", although this can be changed to any format accepted by the Java language SimpleDateFormat class documentation (see http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html).
Note that changes to the export-date-format setting should probably be mirrored by changes to import-date-format if the exported metadata is going to be re-imported.
Exporting Related Asset Data
Note, this section is only relevant if relationships are enabled.
When setting export-relationship-data is 'true', the exported metadata will include columns identifying other assets to which each asset is related. Separate columns are provided for parents, children and related (peer) assets. If only the metadata is being exported, these columns will contain the Asset Bank id for each related asset, otherwise the filename (without extension) will be used. Multiple related assets are separated by commas.
It is possible for exported assets to include metadata from their parent assets. This is enabled by setting include-metadata-from-parents-for-export to 'true' in the configuration, and does not depend on exporting the relationships. By default, a space will be used to delimit data that is added to an asset's attribute values from its parent, but this can be customised using setting export-data-merged-field-delimiter.
If agreements are enabled, the content of each asset's agreement (and any previous agreements) can be exported by changing application setting export-agreement-data to 'true'. The agreement data will be exported in a column containing an XML document for each asset that has an agreement status of 'requires agreement' and one or more agreements.