final String title = form.getTitle();
final String applicationId = form.getApplicationId();
final String portletName = form.getPortletName();
final boolean isFramework = form.isFramework();
final IPortletType type = portletTypeRegistry.getPortletType(form.getTypeId());
portletDef = portletDefinitionRegistry.createPortletDefinition(type, fname, name, title, applicationId, portletName, isFramework);
} else {
portletDef = portletDefinitionRegistry.getPortletDefinition(form.getId());
}
portletDef.setDescription(form.getDescription());
portletDef.setFName(form.getFname());
portletDef.setName(form.getName());
portletDef.setTimeout(form.getTimeout());
portletDef.setTitle(form.getTitle());
portletDef.getPortletDescriptorKey().setWebAppName(form.getApplicationId());
portletDef.getPortletDescriptorKey().setPortletName(form.getPortletName());
portletDef.getPortletDescriptorKey().setFrameworkPortlet(form.isFramework());
final IPortletType portletType = portletTypeRegistry.getPortletType(form.getTypeId());
if (portletType == null) {
throw new IllegalArgumentException("No IPortletType exists for ID " + form.getTypeId());
}
portletDef.setType(portletType);