if ( portletKey == null ) {
// no portlet window, so use a default behaviour
XMLUtils.createElement(contenthandler, "title", copletInstanceData.getTitle());
} else {
copletInstanceData.setTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_LAYOUT, layout);
LocalizedString localizedTitle = (LocalizedString)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_TITLE);
String title;
if ( localizedTitle == null ) {
title = copletInstanceData.getTitle();
} else {
title = localizedTitle.getValue();
}
XMLUtils.createElement(contenthandler, "title", title);
final String portletInstanceKey = (String)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_PORTLET_INSTANCE_KEY);
final User user = (User)copletInstanceData.getTemporaryAttribute(WSRPAdapter.ATTRIBUTE_NAME_USER);