PATH  WebObjects 4.0 Documentation > What's New in WebObjects 4.0

Table of Contents Previous Section

Improved Image Loading

To make it easier to display images from a database, the following attributes have been added to WOActiveImage, WOImage, WOImageButton, WOFrame, WOBody, and WOEmbeddedObject.
Attribute Description
data An NSData object containing the image or embedded object.
mimeType The MIME type of the image to be put in the content-type header field.
key The key under which the data is stored in an application-wide cache. If the key is already in the image cache table, then the value isn't computed again. This attribute is optional; the default is a random key, which means the data will be removed from the cache after access.

Images are cached by the WOResourceManager object. The following are new methods on WOResourceManager that access the image cache:
WOResourceManager
Method Description
flushDataCache Removes all data from the image data cache.
setData:forKey:mimeType:session: (Objective-C) setData (Java) Adds image data of the specified type to the data cache with the specified key.
removeDataForKey:session: (Objective-C) removeDataForKey (Java) Removes the data for the specified key from the image data cache. The session argument is ignored.

Table of Contents Next Section