throw new ViewNavigationException(null, "Failed to navigate to state: [" + navigationState + "]", e);
view = getView(navigationState); } catch (Exception e) { throw new ViewNavigationException(viewName, e); throw new ViewNavigationException(navigationState, "Failed to obtain a View using view name " + viewName + " from registered ViewProviders"); navigateTo(navigationState); } catch (Exception e) { throw new ViewNavigationException(viewName, e);
final AuthContext authContext = AuthContext.getCurrent().orElseThrow(() -> new ViewNavigationException( navigationState, "No AuthContext available as Context resource: failed to process Authenticate annotation on View or UI"));
navigateToState(viewConfiguration, parentViewName); } catch (Exception e) { throw new ViewNavigationException(parentViewName, e); throw new ViewNavigationException(buildNavigationState(viewName, parameters), "Declared parent view name " + parentViewName + " of sub view " + viewName + " is not a SubViewContainer"); ViewNavigationUtils.setViewParameters(view, viewConfiguration, parsedParameters); } catch (Exception e) { throw new ViewNavigationException(viewName, e);
navigateToState(null, sanitizeNavigationState(navigationState)); } catch (Exception e) { throw new ViewNavigationException(null, "Failed to navigate to state: [" + navigationState + "]", e);
/** * Invoked when authentication is missing or failed using {@link AuthContext} during {@link Authenticate} annotation * processing. * @param authc Authenticate annotation * @param navigationState Navigation state * @throws ViewNavigationException If cannot be performed any redirection using {@link Authenticate#redirectURI()} */ protected void onAuthenticationFailed(final Authenticate authc, final String navigationState) throws ViewNavigationException { // redirect String redirectURI = AnnotationUtils.getStringValue(authc.redirectURI()); if (redirectURI != null) { // check view scheme String viewNavigationState = getViewNavigationState(redirectURI); if (viewNavigationState != null) { try { suspendAuthenticationCheck = true; navigator.navigateTo(viewNavigationState); } finally { suspendAuthenticationCheck = false; } } else { // try to open the URI as an URL Page.getCurrent().open(redirectURI, null); } } else { throw new ViewNavigationException(navigationState, "Authentication required"); } }
@Override public void showView(View view) { // check display in window try { if (showInWindow != null) { // set window contents showInWindow.setContent(ViewDisplayUtils.getViewContent(view)); // open window UI ui = navigator.getUI(); if (ui == null) { throw new ViewNavigationException(null, "Failed display View " + view.getClass().getName() + " in Window: no UI available"); } openWindow(ui, showInWindow); // clear reference showInWindow = null; } else { // default if (getDefaultViewDisplay() != null) { getDefaultViewDisplay().showView(view); } } } finally { showInWindow = null; } }
/** * Navigate to default View, if available * @throws ViewNavigationException Navigation error */ public void navigateToDefault() throws ViewNavigationException { // close any Window displayed View closeAllViewWindows(); // default view String viewName = getDefaultViewName(); if (viewName == null) { throw new ViewNavigationException(null, "No default view name defined"); } try { navigateToState(null, getDefaultViewName()); } catch (Exception e) { throw new ViewNavigationException(viewName, e); } }
@Override public void navigateTo(String viewName, Map<String, Object> parameters) throws ViewNavigationException { try { navigateTo(actuator.buildNavigationState(viewName, parameters)); } catch (Exception e) { throw new ViewNavigationException(viewName, e); } }
@Override public void navigateTo(String viewName, Map<String, Object> parameters) throws ViewNavigationException { try { navigateTo(actuator.buildNavigationState(viewName, parameters)); } catch (Exception e) { throw new ViewNavigationException(viewName, e); } }