Posts Tagged ‘thumbnail creator in fatwire’

Out of the 4 flex filters provided by Oracle WebCenter Sites, one of the most important and useful filter is THUMBNAIL CREATOR.

The Purpose of this filter is to create THUMBNAILS from the images which we upload.

We will now see how to create thumbnails using this filter.


The Flex filter is a part of the Flex Family. So, in order to create any filter, we need to create the Flex Family.










After creation of the Flex family, enable the flex family members for your site.


1.  ImageFile  – (BLOB)
2. ThumbnailFile – (BLOB)
3. ImageHeight – (STRING)
4. ImageWidth – (STRING)
5. ThumbnailWidth – (STRING)
6. ThumbnailHeight – (STRING)


1. Click on New Sample Filter. The following screen appears.









2. Enter the Name, Description. Select THUMBNAILCREATOR option in the FILTER dropdown. Then Click on Get Arguments button. The following screen appears.









3. In the ARGUMENTS Section, make sure that you specify values for all the options in the NAME drop down list. After adding all the values, the list should consist the following key – value pairs.

Output attribute for Thumb Height = ThumbnailHeight
Output attribute for Thumb Width = ThumbnailWidth
Output attribute name = ThumbnailFile
Input attribute name = ImageFile
Output attribute for Main Width = ImageWidth
Output attribute for Main Height = ImageHeight
Enter maximum pixel size = 100

NOTE: The Maximum pixel size is the size of the Thumbnail.

It should finally look like the following screen.









4. Click on Save.

















1. Add the filter to either new content definitions or existing content definitions.

2. Add the Flex Attribute IMAGEFILE, which was created by us above.

3. After adding the above two, the content definition looks as follows.














Now, its time to test the filter which we have created. Create a new asset of type SAMPLE_C, and select the above content definition. The below screen appears:





1. Give a name to the asset, and upload an image.

2. Save it.

3. Click on the INSPECT button. You can see the result screen which has the image file, thumbnail file, image height, image width, thumbnail height, thumbnail width.
















We haven’t added the the attributes ThumbnailFile, ImageHeight, ImageWidth, ThumbnailWidth, ThumbnailHeight in our content definition. But still, they appeared in the element inspection screen.

So, the point to note here is that these 5 attributes are used internally by the filter class to store the dimensions (width and height) of the image and thumbnails, and to display them.

That’s it. We have successfully created the Thumbnail Creator filter.

What is a Flex Filter?

A FLEX FILTER is a utility, that performs operations on the flex assets, for which that filter is assigned. The filter will be called only after the particular asset (for which this filter is assigned)  is saved. Flex filter classes implement the functionality of flex filter assets.

How many types of filters are there in total?

Oracle WebCenter Sites / Fatwire Content Server ships with FOUR Flex Filters by default. We also have the provision to create our custom filters. This can be done by creating new jar files, and registering them in the database. Following are the different types of Flex Filters available.

1.   Doc-Type Filter – Used to get the MIME Type / File Types.

2.   Thumbnail Creator – Used to convert an image into a thumbnail.

3.   Field Copier – Used to copy the contents of a system-defined attributes like name, template, etc (Totally 18 system attributes are there) into a user-defined attribute, to be used within the code.

4.   Document Transformation – Converts a document from one file type into another.

We will discuss about these Filters in detail, in the upcoming posts.