String accessKey = attributes.getAccessKey();
String shortcut = attributes.getShortcut();
if (shortcut != null) {
if (accessKey != null) {
throw new PAPIException(exceptionLocalizer.
format(
"menu-building-shortcut-and-accesskey-error"));
}
} else {
shortcut = accessKey;
}
PolicyReferenceResolver resolver =
pageContext.getPolicyReferenceResolver();
// Process the shortcut
TextAssetReference shortcutObj =
resolver.resolveQuotedTextExpression(shortcut);
builder.setShortcut(shortcutObj);
//Process the href as a mariner expression
LinkAssetReference href = resolver.resolveQuotedLinkExpression(
attributes.getHref(), PageURLType.MENU_ITEM);
builder.setHref(href);
// Process the prompt as a mariner expression
TextAssetReference prompt = resolver.resolveQuotedTextExpression(
attributes.getPrompt());
builder.setPrompt(prompt);
// Set the title.
builder.setTitle(attributes.getTitle());
} catch (BuilderException be) {
logger.error("menu-building-error", be);
throw new PAPIException(
exceptionLocalizer.format("menu-building-error"), be);
}
return PROCESS_ELEMENT_BODY;
}