PortletEntry entry = (PortletEntry) Registry.createEntry(Registry.PORTLET);
entry.setParent(JSR168_PORTLET);
entry.setType(JS1_REFERENCE_TYPE);
Description desc = portletDefinition.getDescription(Jetspeed.getDefaultLocale());
if(desc != null && desc.getDescription() != null && desc.getDescription().length() > 0)
{
entry.setDescription(desc.getDescription());
}
DisplayName title = portletDefinition.getDisplayName(Jetspeed.getDefaultLocale());
if (title != null && title.getDisplayName() != null && title.getDisplayName().length() > 0)
{
entry.setTitle(title.getDisplayName());
}
else
{
Language lang = portletDefinition.getLanguageSet().get(Jetspeed.getDefaultLocale());
if (lang != null)
{
String tit = lang.getShortTitle();
if(tit != null && tit.length() > 0)
{
entry.setTitle(tit);
if (desc == null || desc.getDescription() == null || desc.getDescription().length() == 0)
{
String descTitle = lang.getTitle();
if (descTitle != null && descTitle.length() > 0)
{
entry.setDescription(descTitle);