Example Plug-ins
Author: Zach Bailey
Set Start Date "Today" plug-in
This plug-in sets the metadata field "start date" to the current time for newly created assets.
File Checker Plug-in
This plug-in allows administrators to place restrictions on the size and type of file created using a specific asset factory.
If a user, for example, creates or uploads a new file using an asset factory, this plug-in checks to see if the file extension is .doc and that the file size is no larger than 1MB. If either of these conditions are not satisfied, then the asset is not created and a message is displayed to the user explaining why.
Display to System Name Plug-in
This plug-in ensures that newly-created assets are given search engine friendly system names.
After the user submits edit in the original asset creation screen, the plug-in checks the new asset’s system name. If the user has not specified a system name for the new asset, it will by default be based off a substring of the original asset used by the asset factory (i.e. if original asset is named "page", then new asset is named "page1"). This plug-in then takes the value from the metadata display name, makes it search engine friendly, and turns that into the system name for the new asset. Making the name search engine friendly involves removing extraneous characters (only allowed system name characters are A-Z, a-z, 0-9, hyphen, period) and converting spaces to hyphens.
Create Resized Images Plugin
This plugin allows an administrator to specify that multiple resized images will be created when a user uploads a single image. For example, if the administrator desires that a thumbnail automatically be generated for an image that a users uploads, the administrator will attach this plugin to the asset factory that will be used to upload the image.
Note: this plugin relies on the Java Imaging API and as such is only able to work with freely licensed image formats. This means this plugin can work with JPEG, JPEG2000, BMP, and PNG images, but not GIF images.
Parameters:
- Number of additional images: This is a non-negative integer for how many additional images the plugin will create in addition to the original.
- Image widths: This is a comma-delimited list of the widths for the additional images. Note that both pixel values and percentages may be used interchangably. To use a pixel value, simply enter the number of pixels. To use a percentage, enter the percentage followed by the percent sign. Example: "450,20%" would create an additional image 450 pixels wide and another image that had a width 20% of the original image's pixel width value.
- Image heights: This is a comma-delimited list of the heights for the additional images. Note that both pixel values and percentages may be used interchangably. To use a pixel value, simply enter the number of pixels. To use a percentage, enter the percentage followed by the percent sign. Example: "450,20%" would create an additional image 450 pixels wide and another image that had a width 20% of the original image's pixel height value.
Both the width and height comma delimited lists must be specified and must contain an amount of comma-delimited values equal to the number of additional images.