org.apache.jetspeed.om.registry.Registry registry =
Registry.get(Registry.PORTLET);
Enumeration entries = registry.getEntries();
while (entries.hasMoreElements())
{
PortletEntry regEntry = (PortletEntry) entries.nextElement();
String regType = regEntry.getType();
if (regType.equalsIgnoreCase("abstract"))
{
parentSet.add(regEntry.getName());
}
}
context.put("parents", parentSet);
context.put(
"securitys",
CustomizeSetAction.buildList(rundata, Registry.SECURITY));
}
if (mode != null && mode.equals(SecurityConstants.PARAM_MODE_UPDATE))
{
String portletName =
rundata.getParameters().getString(PORTLET_NAME);
PortletEntry portletEntry =
(PortletEntry) Registry.getEntry(Registry.PORTLET, portletName);
String tab = rundata.getParameters().getString(TAB_PARAMETER);
context.put("currentTab", tab);
context.put(
"securitys",
CustomizeSetAction.buildList(rundata, Registry.SECURITY));
context.put("entry", portletEntry);
MediaTypeRegistry mediaTypeReg = (MediaTypeRegistry)Registry.get(Registry.MEDIA_TYPE);
context.put("media_types", iteratorToCollection(mediaTypeReg.listEntryNames()));
if(portletEntry.getType() != null && portletEntry.getType().equals("ref"))
{
PortletEntry parentEntry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portletEntry.getParent());
if(parentEntry == null)
{
logger.error(this.getClass().getName() + ": Portlet " + portletName + " of type ref has no parent. This portlet will not work properly.");
}
else
{
Collection parentCategories = iteratorToCollection(parentEntry.listCategories());
context.put("parent_categories", parentCategories);
Collection parentMediaTypes = iteratorToCollection(parentEntry.listMediaTypes());
context.put("parent_mediatypes", parentMediaTypes);
}
}
}
if (mode != null && mode.equals(SecurityConstants.PARAM_MODE_DELETE))
{
String portletName =
rundata.getParameters().getString(PORTLET_NAME);
PortletEntry portletEntry =
(PortletEntry) Registry.getEntry(registry, portletName);
context.put("entry", portletEntry);
}
}