{
FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
try
{
SearchEngine searchEngine = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getSearchEngine();
PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
List<PortletDefinition> portletDefList = app.getPortlets();
List<Object> list = new ArrayList<Object>();
list.addAll(portletDefList);
list.add(app);
searchEngine.remove(list);
list.clear();
list.add(app);
list.addAll(portletDefList);
searchEngine.add(list);
}
catch (Exception e)
{
logger.error("Failed to refresh the search index of application.", e);
StringResourceModel resModel = new StringResourceModel("pam.details.action.status.search.index.refreshFailure", this, null, new Object [] { paNodeBean.getApplicationName(), e.getMessage() } );