newLocale = null;
newDescription = null;
}
FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
try
{
registry.savePortletDefinition(def);
StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
feed.info(resModel.getString());
}
catch (RegistryException e)
{
logger.error("Failed to save portlet definition.", e);
StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
feed.info(resModel.getString());
}
}
};
}
@Override
public void delete(IModel<DescriptionBean>[] fields)
{
FeedbackPanel feed = (FeedbackPanel) getPage().get("feedback");
try
{
PortletRegistry registry = ((AbstractAdminWebApplication) getApplication()).getServiceLocator().getPortletRegistry();
PortletApplication app = registry.getPortletApplication(paNodeBean.getApplicationName());
PortletDefinition def = app.getPortlet(paNodeBean.getName());
InitParam initParam = def.getInitParam(name);
if (initParam != null)
{
for (Iterator<Description> it = initParam.getDescriptions().iterator(); it.hasNext(); )
{
Description description = it.next();
for (IModel<DescriptionBean> descriptionBeanModel : fields)
{
if (descriptionBeanModel.getObject().getLocale().equals(description.getLocale()))
{
it.remove();
break;
}
}
}
registry.savePortletDefinition(def);
StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveOK", this, null, new Object [] { paNodeBean.getName() } );
feed.info(resModel.getString());
}
}
catch (FailedToStorePortletDefinitionException e)
{
logger.error("Failed to save portlet definition.", e);
StringResourceModel resModel = new StringResourceModel("pam.details.action.status.portlet.saveFailure", this, null, new Object [] { paNodeBean.getName(), e.getMessage() } );
feed.info(resModel.getString());
}
}
});
}