Part VIII Appendixes
mm-img, mm:img
Description
Used to deliver the correct image based on the capabilities of the target device. Typically,
multiple images will be placed inside a media-group element so that different image formats are
available to be delivered depending on the requesting device type. The first image matching the
criteria of this tag's where attribute is delivered; all others are ignored. Attribute of the XHTML
<img> tag can also be used with this tag. This is an empty tag, so it requires a slash (/) before the
final angle bracket (>).
Attributes
•
where="..."
The where attribute enables the author to specify content selection conditions for devices.
Conditions are constructed by specifying device attribute names and allowable values, using
comparison operators from the Python programming language. Multiple conditions can be
combined to make complex expressions by using the logical "and", "or" and "not" operators
from Python.
Note: The "where" clause quoted string must not contain line breaks.
WebLogic Mobility Server also supports use of the Python .endswith( ), .startswith( ) and
.find( ) methods for partial matching.
Restrictions:
•
At least one condition must be specified
•
Attribute names must be valid as taken from the Device Repository
•
All String attribute values must be wrapped in single quotes
•
fittoscreen="true | false"
If this attribute is set to "true", the image width is resized to the UsableWidthPixels value of
the device, as defined in the Device Repository. The image height is resized by the same
factor so that the image maintains the same aspect ratio. This has an effect only if the original
image is wider than the targeted screen width.
Example
<!—The WebLogic Mobility Server will select an image depending on the graphic
support of the requesting device. If the device matches more than one where
clause, it will receive the image from the first one that it matches. If no
match occurs, the text from the media-group's alt attribute will be sent to the
device.-->
<mm-media-group alt="No image provided">
<mm-img where="ImgJpgProgressiveSupported" height="80" width="60" alt="Gold"
src="img/gold.jpg" />
<mm-img where="ImgGIFSupported" height="40" width="30" alt="Gold"
src="img/gold.jpg" />
<mm-img where="ImgWBMPSupported" height="16" width="12" alt="Gold" src="
img/gold.wbmp" />
</mm-media-group>
174 - BEA WebLogic Mobility Server User Guide
Need help?
Do you have a question about the WebLogic and is the answer not in the manual?