{
// (1) Determine the current view
String view = determineLogicalView(request);
Object bean = null;
ModelBean mb = model.getModelBean(view);
if (mb.getBeanType() == ModelBean.PREFS_MAP)
{
// (2) restore state from Form to Prefs
bean = formToPrefs(request, view, mb);
}
else
{
// (2) restore state from Form to Bean
bean = formToBean(request, view, mb);
}
String forward = null;
// (3) validate the bean
ResourceBundle bundle = this.getPortletConfig().getResourceBundle(request.getLocale());
Map errors = model.validate(bean, view, bundle);
if (errors.isEmpty())
{
request.getPortletSession().removeAttribute(SESSION_ERROR_MESSAGES, PortletSession.PORTLET_SCOPE);
// (4) execute the velocity action
String action = request.getParameter(FrameworkConstants.BRIDGES_ACTION);
if (null == action)
{
if (mb.getBeanType() == ModelBean.PREFS_MAP)
{
// store prefs
storePreferences(request, (Map) bean);
}