PortalService portalService = null;
try {
portalService = (PortalService) this.manager.lookup(PortalService.ROLE);
attributes = new AttributesImpl();
CompositeLayout tabLayout = (CompositeLayout) layout;
// selected tab
Integer data = (Integer) layout.getAspectData(config.aspectName);
int selected = data.intValue();
// loop over all tabs
for (int j = 0; j < tabLayout.getSize(); j++) {
NamedItem tab = (NamedItem) tabLayout.getItem(j);
// open named-item tag
attributes.clear();
attributes.addCDATAAttribute("name", String.valueOf(tab.getName()));
if (j == selected) {