MarinerRequestContext requestContext,
Asset asset,
AssetGroup assetGroup,
MarinerURL marinerURL) throws RepositoryException {
MarinerURL urlResult = computeURL(requestContext,
asset, assetGroup, marinerURL);
if (asset instanceof ConvertibleImageAsset) {
String url = urlResult.getExternalForm();
// Construct the url for the convertible image asset.
ConvertibleImageAsset convertible = (ConvertibleImageAsset)asset;
PreservedArea area = PreservedArea.get(
convertible.getPreserveLeft(),
convertible.getPreserveRight(),
true);
String value = ContextInternals.constructImageURL(
requestContext, url, area);
urlResult = new MarinerURL(value);
}
// Complete the URL
urlResult = completeURL(requestContext, asset,
assetGroup,
urlResult);
// Make sure that the url cannot be modified (even if it is a
// convertible image asset).
urlResult.makeReadOnly();
return urlResult;
}