{
paWar = new PortletApplicationWar(fileSystem,
portletApplicationName, "/" + portletApplicationName);
} catch (IOException e)
{
throw new RegistryException("Failed to create PA WAR", e);
}
MutablePortletApplication app;
String paName = paWar.getPortletApplicationName();
try
{
app = paWar.createPortletApp();
if (app == null)
{
String msg = "Error loading portlet.xml: ";
log.error(msg);
throw new RegistryException(msg);
}
app.setApplicationType(MutablePortletApplication.WEBAPP);
app.setChecksum(checksum);
// load the web.xml
log.info("Loading web.xml into memory...."
+ portletApplicationName);
MutableWebApplication webapp = paWar.createWebApp();
paWar.validate();
app.setWebApplicationDefinition(webapp);
// save it to the registry
log.info("Saving the portlet.xml in the registry..."
+ portletApplicationName);
registry.registerPortletApplication(app);
log.info("Committing registry changes..." + portletApplicationName);
} catch (Exception e)
{
String msg = "Unable to register portlet application, " + paName
+ ", through the portlet registry: " + e.toString();
log.error(msg, e);
throw new RegistryException(msg, e);
}
return true;
}