private Message getTitleMessage(BrowseInfo info)
{
if (titleMessage == null)
{
BrowseIndex bix = info.getBrowseIndex();
// For a second level browse (ie. items for author),
// get the value we are focussing on (ie. author).
// (empty string if none).
String value = "";
if (info.hasValue())
{
if (bix.isAuthorityIndex())
{
ChoiceAuthorityManager cm = ChoiceAuthorityManager.getManager();
String fk = cm.makeFieldKey(bix.getMetadata(0));
value = "\""+cm.getLabel(fk, info.getValue(), null)+"\"";
}
else
value = "\"" + info.getValue() + "\"";
}
// Get the name of any scoping element (collection / community)
String scopeName = "";
if (info.getBrowseContainer() != null)
scopeName = info.getBrowseContainer().getName();
else
scopeName = "";
if (bix.isMetadataIndex())
{
titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.metadata." + bix.getName())
.parameterize(scopeName, value);
}
else if (info.getSortOption() != null)
{
titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.item." + info.getSortOption().getName())
.parameterize(scopeName, value);
}
else
{
titleMessage = message("xmlui.ArtifactBrowser.ConfigurableBrowse.title.item." + bix.getSortOption().getName())
.parameterize(scopeName, value);
}
}
return titleMessage;