final CopletInstanceData copletInstanceData = ((CopletLayout)layout).getCopletInstanceData();
if ( config.rootTag ) {
XMLUtils.startElement(contenthandler, config.tagName);
}
final PortletWindow window = (PortletWindow)copletInstanceData.getTemporaryAttribute("window");
if ( window == null ) {
// no portlet window, so use a default behaviour
XMLUtils.createElement(contenthandler, "title", copletInstanceData.getTitle());
} else {
if ( ((PortletWindowImpl)window).getLayout() == null ) {
((PortletWindowImpl)window).setLayout((CopletLayout)layout);
}
String title = (String) copletInstanceData.getTemporaryAttribute("dynamic-title");
if ( title == null ) {
final PortletDefinition def = window.getPortletEntity().getPortletDefinition();
try {
title = def.getDisplayName(def.getLanguageSet().getDefaultLocale()).getDisplayName();
} catch (Exception ignore) {
title = copletInstanceData.getTitle();
}