//TODO: do the lookup once, minor speed improvment
// validate parent entry exists
PortletEntry parentEntry = (PortletEntry)Registry.getEntry(Registry.PORTLET, JSR168_PORTLET);
//TODO: speed improvement 2, only get categories once
Iterator categoryIterator = parentEntry.listCategories();
PortletEntry entry = (PortletEntry) Registry.createEntry(Registry.PORTLET);
entry.setParent(JSR168_PORTLET);
entry.setType(JS1_REFERENCE_TYPE);